driver
driver
arith
step
setPoint
ctlX3.p1Flow
ctlX2.flowSet
ctlX1.inspFlag
ctlX2.I
ctlX2.E
ctlX2.respRate
State Machine
ctrlSM
ctrlSG
calcuSP
SPArithmetic
U16-float
Signal
Generator
expValveOutput
pidControlValue
init
close_IV
open_EV
close_EV
pid_control
inspFlag
inspFlag
expFlag
H
1
2
Ts
Kd
Ki
Kp
1
0
(EXPOPEN)
(EXPCLOSE)
setPoint
p1Flow
ctrlExpValve
2Multiplexer
U8-U8
ctrlInspValve
PID
float-float
action
expValveOutput
pidControlValue
ctlX1.expFlag
s
0
Figure 4: Control actor state machine implementation.
The Signal Generator of the example state
machine is shown in Fig. 4. It incorporates two
function block instances, i.e. a Multiplexor FB
instance generating on/off control signals for the
control steps open_EV and close_EV, and a PID FB
instance generating the signal pid_control and
close_IV. The PID function block encapsulates three
functions: initialize(), PID() and stop(). The first one
is invoked when executing the init control step and
the other two – when executing the control steps
pid_control and close_IV (by applying a zero
voltage to the inspiration valve of the ventilator).
The combination of state machine and signal
generator can be used to engineer sequential and
modal continuous control systems, as well as
systems generating continuous control signals in
some states and discrete on/off control signals in
other states, as shown in the example.
4 CONCLUSIONS
The paper presents a software design method for
embedded control applications, which employs two
types of reconfigurable component that can be used
to configure control system tasks (actors) – State
Machine and Signal Generator function blocks. The
State Machine function block realizes the reactive
(control flow) aspect of actor behaviour, in
separation from the transformational (data flow)
aspect, which is assigned to the Signal Generator.
The presented version of the State Machine
function block is capable of processing any kind of
input signal – Boolean, binary-coded or analogue in
order to compute Boolean event variables needed to
implicitly select the state to be activated, and to
explicitly select the control step to be executed in
that state. The index of the control step is then
indicated to the Signal Generator, in order to activate
the corresponding FB sequence used to generate the
corresponding control signals.
The State Machine has been implemented as a
reusable and reconfigurable function block using a
new BDD-based State Logic Controller design
pattern, resulting in a simple, yet powerful
component that can be combined with a
reconfigurable Signal Generator to efficiently
implement state machines of arbitrary complexity
for a broad range of sequential and hybrid control
applications.
REFERENCES
Samek, M., 2002. Practical Statecharts in C/C++:
Quantum Programming for Embedded Systems, CMP
Books.
John, K-H., Tiegelkamp, M., 2001. IEC61131-3:
Programming Industrial Automation Systems,
Springer.
Lewis, R., 2001. Modeling Control Systems Using IEC
61499, Institution of Electrical Engineers.
Wagner, F., Wolstenholme, P., 2003. Modeling and
Building Reliable, Re-usable Software. In 10th IEEE
International Conference and Workshop on the
Engineering of Computer-Based Systems. Huntsville,
USA.
Wang, S., Shin, K.G., 2002. Constructing Reconfigurable
Software for Machine Control Systems. In IEEE
Trans. on Robotics and Automation, vol. 18, No 4
Angelov, C., Sierszecki, K., Marian, N., 2005. Design
Models for Reusable and Reconfigurable State
Machines. In Lecture Notes in Computer Science, v.
3824, Springer
Angelov C., Ke, X., Guo Y., Sierszecki K., 2008.
Reconfigurable State Machine Components for
Embedded Applications. In SEAA 2008, 34th
EUROMICRO Conference on Software Engineering
and Advanced Applications, IEEE Computer Society
Zhou, F., Guan, W., Sierszecki, K., Angelov, C., 2009.
Component-Based Design of Software for Embedded
Control Systems: the Medical Ventilator Case Study.
In ICESS 2009, International Conference on
Embedded Software and Systems, IEEE Computer
Society
REUSABLE STATE MACHINE COMPONENTS FOR EMBEDDED CONTROL SYSTEMS
171