Using a statechart, define the behavior for a device that specifies the desired speed setpoint for an automotive cruise controller. There is a second device that performs the actual speed control. There are also several buttons on the steering column that the driver uses to control the cruise control. The following is the interface to the cruise speed setpoint controller.
| Signal | Use | Direction | |
|---|---|---|---|
| User interface to the cruise control system | ON/OFF | Turn cruise control on and off | Button input to setpoint controller. When button is closed, the cruise control is on. When button is open, the cruise control is off. |
| SET | Set cruise speed setpoint to the current speed | Button input to setpoint controller. When button is pressed, set the cruise speed setpoint to the current speed. | |
| CANCEL | Stop controlling speed | Button input to setpoint controller. When button is pressed, stop controlling the speed, i.e. ACTIVE is off. | |
| RESUME | Resume controlling speed at the last cruise speed setpoint | Button input to setpoint controller. When button is pressed, start controlling the speed, i.e. ACTIVE is on. | |
| ACCELERATE | Increase the setpoint speed by 1 mile/hour. | Button input to setpoint controller. While the button is pressed, increase the speed setpoint by 1 mile/hour. While button remains depressed, increase the speed setpoint by 1 mile/hour every 2 seconds. | |
| DECELERATE | Decrease the setpoint speed by 1 mile/hour. | Button input to setpoint controller. While the button is pressed, decrease the speed setpoint by 1 mile/hour. While button remains depressed, decrease the speed setpoint by 1 mile/hour every 2 seconds. | |
| Interface between the setpoint controller and the speed controller | ACTIVE | Turn speed controller on and off | Output signal to speed controller. While ACTIVE is on the speed controller will maintain the car's speed at the SETPOINT value. |
| SETPOINT | The desired speed | Output signal to speed controller. If ACTIVE is on, this signal indicates the setpoint speed that the speed controller attempts to maintain. | |
| CURRENT | The current speed | Input signal to the setpoint controller. This signal indicates the car's current speed to the setpoint controller. |
For this exercise, you will start working with the Rhapsody tool. You can find it in Start menu -> All Programs -> IBM Rational -> IBM Rational Rhapsody for C++.
Model1 Object Model Diagram. This should display a set of tools on the right side of the workarea.Class and click to place a new class in the model. Give it a class name of SpeedSetpoint.SpeedSetpoint class and add a new statechart.When you are done with your statechart, copy the diagram and paste it into a Word file, and place that file into the dropbox for the Cruise Control exercise.
$Id: CruiseControl.html 170 2012-12-05 06:26:27Z jrv $