JAVA-BASED REAL-TIME PROGRAMMING
JAVA-BASED REAL-TIME PROGRAMMING
JAVA-BASED REAL-TIME PROGRAMMING
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
trolled periodically to prepare the material for casting with the proper<br />
quality.<br />
2. The piston of the cylinder should be controlled sequentially to actually<br />
perform the casting.<br />
Note that the tasks according to items 1 and 2 need to be handled concurrently,<br />
and each task has to be carried out in real time. Otherwise the machine will<br />
not work.<br />
Item 1 is a simple temperature regulator. Since reading the measured<br />
value (temp) and computing the control signal (doHeat) takes some time,<br />
such feedback control, when done in software, by necessity has to be carried<br />
out periodically. In each period (also called a sample), the controlled system in<br />
measured (sampled), and the computed control signal is sent to the controlled<br />
system. For reasons of control performance, the time between each sample<br />
should not be too long. For computing (CPU-load) reasons, we want to have<br />
as long sampling period as possible. Hence, a tradeoff between control and<br />
computing efficiency has to be made. This type of control is time driven since<br />
it is run with respect to (real) time without waiting for conditions/events.<br />
Item 2 is an example of sequencing control, which is event driven (execution<br />
advances when certain events occurs and arrives to the software); writing<br />
this as a periodic controller would imply unnecessary sampling and evaluation<br />
of the state of the application. On the other hand, if execution only advances<br />
on incoming events, how should then the temperature control be carried out<br />
(in the same program)?<br />
The reader could try to write one sequential program performing both<br />
these tasks. Note that neither the temperature control nor the sequencing<br />
doPush<br />
doHeat<br />
~<br />
doPull<br />
isIn<br />
isOut<br />
temp<br />
isEmpty<br />
Figure 1.1: Schematic figure of a machine for manufacturing of LEGO bricks<br />
13