CSCI 5828

Foundations of Software Engineering

Course Location
   1B 28

Course Time
   Tuesday and Thursday
   11:00 AM - 12:15 PM

   What's New (Home)
   Class Schedule
   Student Comments
   Contact Information
   Evaluation Criteria
   Status Reports

What's New Archives
   January, 1999
   February, 1999
   March, 1999

CSCI 5828 Homework 2: Operational Specifications

In this homework you will specify the behavior of a cruise-control system using Finite State Machines and Petri Nets.

Be careful to choose an "appropriate" level of detail. It is hard to be specific about what "appropriate" really means, but if you are modeling the movement of a human's foot on the accelerator pedal, for example, then you know you have gone too far! A more serious example is that you should only model the fact that acceleration is requested, not how much acceleration is requested; the quantity of acceleration is a data issue, not a control issue.

You should turn in your FSM and Petri Net specifications of the system along with a brief discussion of your reactions to using the FSM and Petri Net formalisms to specify this system. Which of the two appears to be more appropriate and why? What problems did you encounter as a specifer.


When turned on by the driver, a cruise-control system automatically maintains the speed of a car over varying terrain. When the brake is applied, the system must relinquish speed control until told to resume. The system must also steadily increase or decrease speed to reach a new maintenance speed when directed to do so by the driver. There are seven inputs:

System on/off: If on, denotes that the cruise-control system should maintain the car speed.

Engine on/off: If on, denotes that the car engine is turned on; the cruise-control system is only active if the engine is on.

Pulses from wheel: A pulse is sent for every revolution of the wheel.

Accelerator: Indication of how far the accelerator has been pressed. Note: The accelerator does not turn off the cruise-control system. The system temporarily deactivates while the user presses the accelerator and then reverts to the previously maintained speed once the user stops pressing the accelerator. Thus, if the maintained speed was 50 mph before the accelerator was pressed, upon letting go of the accelerator, the cruise control system will bring the car back to 50 mph.

Brake: On when the brake is pressed; the cruise-control system temporarily reverts to manual control if the brake is pressed.

Increase/Decrease Speed: Increase or decrease the maintained speed; only applicable if the cruise-control system is on.

Resume: Resume the last maintained speed; only applicable if the cruise-control system is on.

There is one output from the system:

Throttle: Value for the engine throttle setting.


The role of the accelerator is a bit confusing.

Think of it this way: The throttle is getting commands from two sources, the human and the cruise control system. The human adjusts the throttle by applying pressure to the accelerator pedal. Even if the cruise control is on, the human might attempt to increase speed (temporarily) by pressing on the accelerator pedal. On the other hand, the job of the cruise control is to maintain a certain speed. If it detects that the car is accelerating (e.g., because the car is going down hill), then it adjusts the throttle to slow it down. Now, what if the car is accelerating because the human is increasing the pressure on the accelerator pedal? In that case, the cruise control must not try to adjust the throttle. So, the fact that the human, through the accelerator pedal, is causing the increase in speed must be made known to the cruise control system as an input.


This assignment is easier than it looks. If your machine or net starts to get too complex, try to identify ways in which it can be simplified.

© Ken Anderson, 1999.
Last Updated: 8/16/00; 2:45:55 PM