For this project you are designing the controller for a mine pump1. The main function for this controller is to turn on the pump so that the water level in the mine is kept within safe bounds.There are also safety concerns that the controller must address.
This section lists the characteristics of the mine pump system you are controlling. Figure 1 shows a diagram of the system.
Figure 1. Mine Pump System modified from [1].
This section specifies the functional requirements for your system:
Your team will capture the behavior of this pump control system via a statechart created in Rhapsody. By the appropriate use of guards, events and actions you may be able to define the operation of this controller as only a single state. Note: this is not considered the best design choice.
After capturing the system behavior in a statechart your team will then use the Rhapsody code generation feature to create an executable version of the program in C++. The goal is to work entirely within the Rhapsody environment. This requires you to insert lines of application code for some functioning of the controller in appropriate places within the statechart.
You will also model, as a statechart, a test fixture which allows both manual and automatic generation of signals to the pump control system. Provide a way to change the mode of the program. You can assume that events can be used as the interface between the test fixture and the pump control system. In manual mode, the user will control your program with keyboard input. Each input has a defined letter as follows:
In automatic mode, your test fixture will simulate water filling the sump pump at a rate that will fill the tank from empty to low in 5 seconds, from low to high in 10 seconds, and from high to overflowing in 5 seconds. The pump can drain a full tank in 5 seconds.
Your program will use standard output to show its operation. The program should print a message whenever it changes state internally or changes the pump's running status. It should also indicate receiving input from the sensor and operator. In automatic mode, you should output information about the water level.
In a real controller, you would need to have an input scanner that scanned the digital inputs at a periodic rate. This can be modeled as an orthogonal region. In this project you need to read input values from the keyboard to determine which event is the next event. Since there is no timing stated in the requirements you should be able to code the keyboard input within Rhapsody even if the orthogonal region is not implemented by the Rhapsody framework as a separate thread of execution.
Work through this code generation tutorial. There is also information available in Rhapsody documents which you can access from the Help menu. The Rhapsody in C++ User Guide is a good starting place.
For your documentation of this project you will submit a single Word file that holds, at a minimum, the following information: (This list is not necessarily in the best order for presentation in your document.)
This paper should be 5 to 10 pages in length.
There will be no formal presentation for this project. On the day the project is due we will have a class discussion of the project. Several teams will be asked to discuss their model. Other teams will then be asked to run their implementation. Finally, some teams will be asked to discuss their assessment of the generated code. This will include highlighting actual code sections that you thought were particularly good or bad. The team order for this discussion will be random.
Submit a single zip file that contains your project documentation, a project
directory containing your Rhapsody project. Be sure to include an executable file in the submisson. Name the Rhapsody component, Pump, and the configuration, Submission. You may build it for either Microsoft or Cygwin C++. Place the zip file in the Code Generation dropbox in myCourses.
1. A. Burns and A. M. Lister, A Framework for Building Dependable Systems, Computer Journal, Vol. 34(2), pp. 173-181 (1991).