Joseph Mongiat, Binh Lai, Matthew
Martin, Travis Ratcliff, Hong Suk Jung
Anti-Lock Braking System
ABS 4
December 7, 2001
Increasing safety is of primary importance when designing modern vehicles. This interest is the driving force behind control features such as adaptive cruise control, night vision technology, air bag technology, and anti-lock braking systems. All of these systems exploit embedded software to reduce cost, and allow complex control with respect to a given system. The following requirements document is for an anti-lock braking system. This document is divided into introduction, overview, requirements, uml-analysis, and promela specifications sections.
This document will address the overall problem to be solved as stated in the problem description. This section will cover a software controlled anti-lock braking system that will sense the deceleration rate per wheel, and allow the driver of the vehicle to maintain steering control at maximum brake force. Controlling the fluid pressure on each wheel's fluid pump will perform this action. The system will control a valve that allows pressure to be added to the wheel's calipers, or pressure to be decreased off the wheel's calipers.
This document will also address anti-lock braking systems functionality in the overview section. Upon a non-skidding braking situation, the anti-lock braking system will not be engaged, and conventional braking shall be performed. Once the controller detects that skidding is imminent, or the wheelspeed is approaching zero rapidly, the ABS will start to remove brake fluid to alleviate braking pressure just enough to prevent skidding, and then provide braking pressure by replacing the fluid once the 'skidding' is removed. This pulsing on reducing and adding pressure will continue as long as the system detects the skidding scenario. The driver will not be responsible for any action other then steering, and applying the brakes; no manual pumping is necessary.
This document will address an outline of the necessities for completion of the problem's solution in the requirements section. This is a detailed list of constraints that the system will perform under. This will address the speed sensing rate for formulation of the deceleration rate, maximum pumping rate for the ABS system, and failure response. The details of each requirement will be examined in the requirements analysis.
The pictorial explanation of the problem's solution will be examined in the UML Analysis section. The Unified Modeling Language(UML), will be used to model the solution to the problem. The diagrams that will be examined are as follows: use cases diagram, class diagram, state diagram, and sequences diagrams. The use case diagram is used to show how the driver, speed sensor, and brake fluid reservoirs interact with the system to accomplish the desired goal of preventing skidding in the braking action. The class diagram will be used to show the static view of the objects that will be used to solve the separate software tasks, and how they are associated with one another. The state diagram and sequence diagrams will look at the dynamic aspect of the classes' relationships. The sequence diagram will show the message passing and timing information between these classes that the system will rely on to accomplish the desired goals.
A common safety feature of today's automobile is the implementation of an anti-lock braking system. The system is designed to prevent the wheel lock-up associated with hard braking situations, which can lead to loss of steering control and dangerous skidding. The ABS system works by alleviating brake fluid pressure for a given wheel's caliper and diverting it temporarily toward a secondary reservoir. This action happens when the deceleration rate, for a given wheel, passes a threshold point. Once this correction is made, the appropriate fluid pressure is re-established on that wheel. This oscillation of backing off pressure during hard braking (when skid is imminent) allows the driver to use full braking force, and still achieve maximum steering control.
The primary motivation of ABS is to increase the driver's ability to control the direction of the vehicle under hard braking conditions. This translates into a decrease in serious accidents that are related to loss of vehicle during hard braking situations. This also translates into an attractive selling point for auto-makers. The secondary motivation falls under manufacturing and repair costs. Using embedded micro-controller software allows for software upgrades in the future if needed. This is extremely beneficial in controlling upgrade and re-design costs. Implementing the control system into software reduces moving parts, which reduces repair and assembly costs.
ABS functions independently at each wheel. The control unit gets the speed
via wheelspeed sensors at each wheel in order to calculate the deceleration. If
there exists a case of rapid deceleration, ABS will be activate prior to wheel
lock-up. Pressure on caliper is released by opening a valve, which interfaces
with the wheel cylinder, letting oil flow into a small reservoir.
Anti-lock
brakes function well on wet paved surfaces and icy or packed snow-covered roads.
Stopping times will be longer on gravel or fresh snow, although operators will
not experience the dangerous lockup of wheels and loss of steering control
usually associated with conventional braking.
The State Diagram is used to model the behavior of the system. It serves as a aid in visualizing how the system acts for different scenarios. The following figure is the state diagram for the ABS. It contains five concurrent state machines, and a description of each state machine is contained in the following subsections.
From the Waiting for Test Result state, two transitions are possible. One transition is taken to the ABS Failed state if the Waiting for Test Result state finishes its execution and the variable testPass evaluates to false. This transition also results in a Turn_On message being sent to the ABS Fail Light machine. The second transition from the Waiting for Test Result state occurs if the state is done with its execution and the testPass variable evaluates to true. This transition is to the Wait state.
The Wait state can take two transitions. One of these transitions is taken to the Braking state if a Brake_On event takes place. This event also results in a Run_Braking_Test message to be sent to the Test Sequence machine. The other transition is taken to the Idle state if a Power_Off event occurs.
The ABS Failed state has one transition that is taken to the Idle state if a Reset event occurs.
The Braking state will take a transition to the Wait state if a Brake_Off event occurs. Another transition, which is to the Idle state, can be taken from the Braking state if a Power_Off event occurs.
While in the Normal Braking state, a transition to the Pumping state will be taken if the Deceleration_Rate is less than the Threshold. This transition also results in a Decrease_Pressure message being sent to the Brake Pressure Valve state machine.
The Pumping state takes a transition to the Normal Braking state when it is finished with its execution. This transition results in a Increase_Pressure message being sent to the Brake Pressure Valve machine.
/* ABS Controller States */
mtype {Idle, Waiting, ABSfailed, Wait, Braking, ABSpumping};
/* Brake Pressure Valve States */
mtype {vIdle, IncreaseValve, DecreaseValve};
/* ABS Fail Light States */
mtype {Off, On};
/* ABS Controller Events */
mtype {Power_On, Power_Off, Brake_On, Brake_Off, Engage_ABS, Disengage_ABS};
/* Fail Light Events */
mtype {Turn_On, Reset};
/* Wheelspeed Sensor Events */
mtype {Get_Wheelspeed};
/* Test Sequence Events */
mtype {Run_Test, OK, Fail};
/* Brake Pressure Valve Events */
mtype {Increase_Pressure, Decrease_Pressure};
/* Technician Events */
mtype {tReset};
mtype controllerState;
mtype valveState;
mtype lightState;
chan controllerEvent = [0] of {mtype};
chan valveEvent = [0] of {mtype};
chan lightEvent = [0] of {mtype};
chan wheelspeedEvent = [0] of {mtype};
chan testEvent = [0] of {mtype};
chan technicianEvent = [0] of {mtype};
/*************************************************************
Purpose: Simulation of the ABS environment
Generates random signals that the system would experience.
This is designed to run continuously
*************************************************************/
init
{
do
:: timeout ->
if
:: controllerEvent!Power_On -> printf("turned on power\n");
:: controllerEvent!Power_Off -> printf("power turned off\n");
:: controllerEvent!Brake_On -> printf("brake pressed\n");
:: controllerEvent!Brake_Off -> printf("brake released\n");
:: controllerEvent!Engage_ABS -> printf("engaging ABS\n");
:: controllerEvent!Disengage_ABS -> printf("disengaging ABS\n");
:: technicianEvent!tReset -> printf("technician reset\n");
fi;
od;
}
/**************************************************************
Purpose: Simulates the ABS Controller Class (4.2.1 Class Diagram)
Class Diagram.
All sub states can be cross-referenced by the 4.3.1
State Diagram.
*************************************************************/
active proctype ABScontroller()
{
controllerState = Idle;
do
:: (controllerState == Idle) -> printf("in Idle\n");
controllerEvent?Power_On -> testEvent!Run_Test;
printf("Power_On event\n");
controllerState = Waiting;
:: (controllerState == Waiting) -> printf("in Waiting\n");
if
:: testEvent?OK -> printf("Test Pass\n");
controllerState = Wait;
:: testEvent?Fail -> printf("Test Fail\n");
lightEvent!Turn_On;
controllerState = ABSfailed;
:: controllerEvent?Power_Off -> printf("Power Off\n");
controllerState = Idle;
fi;
:: (controllerState == Wait) -> printf("in Wait\n");
controllerEvent?Brake_On -> testEvent!Run_Test;
if
:: testEvent?OK -> controllerState = Braking;
:: testEvent?Fail -> lightEvent!Turn_On;
controllerState = ABSfailed;
:: controllerEvent?Power_Off -> printf("Power Off\n");
controllerState = Idle;
fi;
:: (controllerState == Braking) -> printf("in Braking\n");
if
:: controllerEvent?Brake_Off -> controllerState = Wait;
:: controllerEvent?Engage_ABS;
valveEvent!Decrease_Pressure;
controllerState = ABSpumping;
:: controllerEvent?Power_Off -> printf("Power Off\n");
controllerState = Idle;
fi;
:: (controllerState == ABSpumping) -> printf("in ABS Pumping\n");
if
:: controllerEvent?Disengage_ABS;
valveEvent!Increase_Pressure;
controllerState = Braking;
:: controllerEvent?Brake_Off -> controllerState = Wait;
:: controllerEvent?Power_Off -> printf("Power Off\n");
controllerState = Idle;
fi;
:: (controllerState == ABSfailed) -> printf("in ABS Failed\n");
technicianEvent?tReset -> lightEvent!Reset;
controllerState = Idle;
od;
}
/*******************************************************************
Purpose: Simulates the ABS Fail Light Class (4.2.1 Class Diagram)
Waits on a Turn_On signal, and then waits until Reset.
********************************************************************/
active proctype ABSfailLight()
{
lightState = Off;
do
:: (lightState == Off) -> printf("in Off\n");
lightEvent?Turn_On -> lightState = On;
:: (lightState == On) -> printf("in On\n");
lightEvent?Reset -> lightState = Off;
od;
}
/*******************************************************************
Purpose: Simulates the Test Sequence Class (4.2.1 Class Diagram)
This 'class' simulates two testing methods with runnning
the same method 'Run_Test' for each. Real system will have two.
*******************************************************************/
active proctype TestSequence()
{
do
:: testEvent?Run_Test -> printf("Running test\n");
if
:: testEvent!OK;
:: testEvent!Fail;
fi;
od;
}
/****************************************************************
Purpose: Simulates the Brake Pressure Valve (4.2.1 Class Diagram)
Waits for one of two signals: DecreaseValve, IncreaseValve
**************************************************************/
active proctype BrakePressureValve()
{
valveState = vIdle;
do
:: (valveState == vIdle);
if
:: valveEvent?Decrease_Pressure;
valveState = DecreaseValve;
:: valveEvent?Increase_Pressure;
valveState = IncreaseValve;
fi;
:: (valveState == DecreaseValve);
printf("Decreasing Pressure") -> valveState = vIdle;
:: (valveState == IncreaseValve);
printf("Increasing Pressure") -> valveState = vIdle;
od;
}
Assertion checks are used as a spot check for a particular point of time in a
system. They provide a means for us to check that certain conditions are met at
a point in execution of our system. They are an excellent tool provided for
checking properties of our system, but they are limited, since they can only
check the system at the point where they are inserted into the promela model.
Assert that when the ABS is engaged, the ABS fail light is not on.
assert(lightState == Off)
:: (controllerState == ABSpumping) -> printf("in ABS Pumping");
assert(lightState == Off);
if
:: controllerEvent?Disengage_ABS;
valveEvent!Increase_Pressure;
controllerState = Braking;
:: controllerEvent?Brake_Off -> controllerState = Wait;
:: controllerEvent?Power_Off -> printf("Power Off");
controllerState = Idle;
fi;
The following figure shows the output that XSpin produced after running the assertion check. As you can see, the check produced no errors, therefore our assertion is valid, and the property holds true for our system design.
The XSpin text output also showed no errors, and no assertion violations for
this assertion check.
(Spin Version 3.4.10 -- 30 October 2001)
+ Partial Order Reduction
Full statespace search for:
never-claim - (not selected)
assertion violations +
cycle checks - (disabled by -DSAFETY)
invalid endstates +
State-vector 64 byte, depth reached 65, errors: 0
178 states, stored
75 states, matched
253 transitions (= stored+matched)
0 atomic steps
hash conflicts: 0 (resolved)
(max size 2^19 states)
2.542 memory usage (Mbyte)
real 0.0
user 0.0
sys 0.0
Reachability Analysis is used to verify that all states in our model of the system can be reached through some pattern of execution. If a there is a state that cannot be reached, that means that our model is incorrect. In that case, the state may be of no use to our system, and might be discarded. Another reason may be that the state is missing transitions or events that would cause our system to enter it. In that case we would need to modify our model to correct this. This process is then iterated until we reach the final result that all of our states are reachable in our system.
In the previous figure, the labels correspond to the states in our promela model. If you compare these state names with the states in our state machine, you will see that all states are reachable, and therefore reachability for our model is verified.
Model checking is used to study the behavior of a system. In this section we
verify safety critical properties of the ABS by using XSpin. Verification of
safety critical properties is very important for systems in which people's lives
are at stake, and testing and validation are not enough.
If the ABS
fails, then the ABS failure light will eventually be turned on.
[](p -> <>q)
#define p (controllerState == ABSfailed)
#define q (counter > 0)
active proctype ABScontroller()
{
controllerState = Idle;
do
:: (controllerState == Idle) -> printf("in Idle");
if
:: controllerEvent?Power_On -> testEvent!Run_Test;
printf("Power_On event");
controllerState = Waiting;
:: controllerEvent?Power_Off;
controllerState = Idle;
fi;
:: (controllerState == Waiting) -> printf("in Waiting");
if
:: testEvent?OK -> printf("Test Pass");
controllerState = Wait;
:: testEvent?Fail -> printf("Test Fail");
lightEvent!Turn_On;
controllerState = ABSfailed;
:: controllerEvent?Power_Off -> printf("Power Off");
controllerState = Idle;
fi;
:: (controllerState == Wait) -> printf("in Wait ");
controllerEvent?Brake_On -> testEvent!Run_Test;
if
:: testEvent?OK -> controllerState = Braking;
:: testEvent?Fail -> lightEvent!Turn_On;
controllerState = ABSfailed;
:: controllerEvent?Power_Off -> printf("Power Off ");
controllerState = Idle;
fi;
:: (controllerState == Braking) -> printf("in Braking ");
if
:: controllerEvent?Brake_Off -> controllerState = Wait;
:: controllerEvent?Engage_ABS;
valveEvent!Decrease_Pressure;
controllerState = ABSpumping;
:: controllerEvent?Power_Off -> printf("Power Off ");
controllerState = Idle;
fi;
:: (controllerState == ABSpumping) -> printf("in ABS Pumping ");
if
:: controllerEvent?Disengage_ABS;
valveEvent!Increase_Pressure;
controllerState = Braking;
:: controllerEvent?Brake_Off -> controllerState = Wait;
:: controllerEvent?Power_Off -> printf("Power Off ");
controllerState = Idle;
fi;
:: (controllerState == ABSfailed) -> printf("in ABS Failed ");
technicianEvent?tReset -> lightEvent!Reset;
controllerState = Idle;
od;
}
active proctype ABSfailLight()
{
lightState = Off;
do
:: (lightState == Off) -> printf("in Off ");
lightEvent?Turn_On -> lightState = On;
counter = 0;
:: (lightState == On) -> printf("in On");
counter++;
lightEvent?Reset -> lightState = Off;
od;
}
This figure shows that the safety critical property is valid and verified.
2
This document was generated using the LaTeX2HTML translator Version 98.1 release (February 19th, 1998)
Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
The command line arguments were:
latex2html -split 1
-no_navigation -show_section_numbers do-requirements.tex.
The translation was initiated by Joseph James Mongiat on 2001-12-07