Hierarchical Timing Language |
|
AbstractIn order to test the HTL compiler and the E Machine we provide some examples.Hierarchical HTL Compiler examples.The case study implements a distributed real-time controller for a three-tank system (3TS in short), this is a real application. The system (Figure 1) consists of three tanks T1, T2 and T3 each with an evacuation tap tap1, tap2 and tap3 respectively. The tanks are interconnected via taps tap13 and tap23. Two pumps, P1 and P2, feed water in the tanks T1 and T2 respectively. The goal of the controller is to maintain the level of water in tanks T1 and T2. The controller is designed to work under the presence and absence of perturbations (simulated by the evacuation taps). If there are no perturbation a P (proportional) controller is used to control the fluid level. Under perturbations, a PI (Proportional Integral) controller is used. The modeling generates four possible scenarios: (1) both pumps controlled by P controllers, (2) P1 and P2 controlled by P and PI controllers respectively, (3) P1 and P2 controlled by PI and P controllers respectively, and (4) both pumps controlled by PI controllers. Figure 1. Overview of three tanks system The controller is implemented in a distributed fashion on three E machines (Figure 2). Each E Machine is implemented in C on an Unix machine with an Intel Core 2 processor (2.4 GHz, 2 GB RAM) running Fedora Core 6 operating system. The three E machines implement the controller for P1, the controller for P2, and the interface controller. The tasks are implemented in C. We have used the scheduler in the Unix machines for scheduling the released tasks. The E Machines communicate with each other through UDP. Communication with the 3TS plant is done via a Windows 98 machine with a DAC 98 card. A TCP server has been implemented on theWindows 98 machine. A client can send two types of messages to the server: either it can request the server to read the heights of water in the two tanks and send it back, or it can request the server to set the fill debit for each of the pumps. The Windows Figure 2. Overview of implementation Figure 3. Three tank system under runs Video Demo
Download video demo of the 3TS plant controled using an HTL controller: Full Video (WMV, 10 min.) or Short Video (WMV, 4 min.) Flat HTL Compiler examples.DownloadsExamples: examples.tar.gz.Three Tanks System (3TS) Simulator: 3ts.tar.gz. Steer By WireThis sample program can be found in “steer_by_wire.htl” file. The program is a relatively complex one, there are many modules and modes, and refining programs. This is a very good example for what can be done with HTL. The program is to be run on 8 different hosts.The basic concept of any steer-by-wire architecture is the removal of the mechanical linkage between the steering wheel and the wheel. The mechanical linkage is replaced by a set of steering wheel angle sensors, an electric motor that controls the wheel angle, road wheel angle sensors and some electronics that compute the closed loop control system. To maintain a realistic road condition feel for the driver, there is also a force feedback actuator on the steering wheel. How To Run Steer By Wire Example?First of all each module has to be mapped to run on a particular host, by default the mapping is for the local host (don't forget to modify the makefile to point to steer-by-wire.htl file). Next for each host which is defined in the HTL program, it has to be performed a new compilation of the HTL program and the E Machine. After E Machine was compiled for a host, the resulting binary file (e-machine), has to be saved, since a new compilation will override the previous file.In the end each E Machine has to be run on the particular host, for which it was compiled. The E Machines will synchronize themselves and only after each E Machine was started, the generated E code will be interpreted. Three Tanks System (3TS)This sample program can be found in “3TS.htl” file. The program implements the timing for a control application. The 3TS plant consists of 3 water tanks interconnected, also each tank has an evacuation tap, which can be used to simulate perturbation, two of the tanks have a pump which can pump water into corresponding tank. 3TS plant is a very nonlinear one, and it is impossible to control it using one controller for each pump. The solution implemented here uses three different controllers for each pump:
How To Run 3TS Example?Download the 3TS simulator suite (3ts.tar.gz).3TS simulator suite consists of two Java programs: (1) a program that simulates the 3TS plant, and (2) a program that can be used to view the signals in the 3TS plant simulator and also to send commands to it.
Schedulability Test ExamplesThere are two such programs: sched-1.htl and sched-2.htl. One can play with this two programs in order to test the schedulability test algorithm or other features. This programs have only a didactic purpose, they don't implement the timing of a real application as the previous two programs do.How To Run Schedulability Test Examples?This should not be run on the E Machine, they are just to test the schedulability algorithem. |