Modeling Hybrid Control Systems
Most industrial processes include continuous elements and eventbased elements. These processes are described as hybrid in that the process can be continuous locally, but eventbased or discrete at a higher level. To model such a system requires combining continuous dynamics and eventbased dynamics. See more diagrams, equations, and development projects...

Most industrial processes include both continuous elements and eventbased elements. These processes are described as hybrid in that the process can be continuous locally, but eventbased or discrete at a higher level. To model such a system requires combining continuous dynamics and eventbased dynamics.
Continuous elements are most accurately characterized by matrices of nonlinear differential equations. It is very difficult to synthesize control laws on the basis of a nonlinear description of the complex system, however, therefore control engineers simplify the problem through linearization of the nonlinear equations around a working point. The result is that PID controllers, model predictive controllers, and other control types are designed on the basis of simplified linear models.
Most industrial processes, however, also include logic or eventbased parts, such as on/off switches, valves, and pumps. Typical practice is therefore to design controls for the continuous part of the system, then to handle the eventbased part of the system on the basis of practical plant operation knowledge, such as switching mechanisms in gainscheduling PID controllers.
The approach to analysis and design of hybrid control systems has changed over the past decades. Continuous and discrete dynamics were analyzed separately, but current approaches include:
Supervisory control;
Optimal control;
Predictive control;
Digital control;
Variable structure control; and
Switching control.
Panos J. Antsaklis in his paper “Hybrid Control Systems: An introductory discussion to the special issue” (IEEE Transactions on Automatic Control, April, 1998) points that “hybrid control systems arise from the interaction of discrete planning algorithms and continuous processes.”
Heating control system can be simply implemented with the use of statechart. 
John Lygeros in his Lecture Notes on Hybrid Control Systems describes hybridsystemdescription advantages: “It provides a convenient framework for modeling systems in a wide range of engineering applications: in mechanical systems continuous motion may be interrupted by collisions; in electrical circuits, continuous phenomena such as the charging of capacitors, etc. are interrupted by switches opening and closing, or diodes going on or off; in chemical process control the continuous evolution of chemical reactions is controlled by valves and pumps; in embedded computation systems a digital computer interacts with a mostly analogue environment.”
The aspects of complex control that make a hybrid system are hierarchical organization of discrete and continuous states, and multitasking processes with different sampling times. An example of this would be a system with both pressure variables (representing relatively short sampling intervals) and temperature variables (representing longer sampling intervals) controlled by a single PLC.
Complex control systems are organized hierarchically. A discrete decisionplanning algorithm at the higher level interacts with a continuous control algorithm at a lower level. Statecharts are a very convenient way to model the hybrid control system (See “Statecharts Can Help Program Powerful Systems” by Gerardo Garcia in the August, 2007 issue of Control Engineering ). The statechart programming language is a powerful method for implementating complex continuousdiscrete control algorithms.
Matlab/Simulink can be used for offline simulation as well as for the realtime computations. 
Examples
Here is a brief example of the thermostatheater system, given in “Hybrid Systems Control” by P.J. Antsaklis and X.D. Koutsoukos in Encyclopedia of Physical Science and Technology , Academic Press, 2002:
Hybrid control systems can be treated as computer control systems with advanced control algorithms. In this example, we use Stateflow Toolbox for Matlab/Simulink for statechart modeling. Combined with tools for automatic code generation, like B&R’s AR4Matlab, a tool for hybrid control systems simulation and implementation.
Let us assume that the thermostat is set to 70
In the hybrid version (MFCVH) there are arrays of models and model controllers changed by a swtiching algorithm ensures the selection of the model loop closest to the actual behavior of the process to be controlled. 
The dynamics of the two control modes of the system are:
When the heater is off, the temperature in the room falls according to the differential equation
d x(t) =  K x(t) , [1]
dt
where K is a thermal isolation constant.
When the heater is on, the temperature rises according to the equation
d x(t) =  K (hx(t)), [2]
dt
where h represents the heater temperature.
At the beginning, the temperature is equal to, say, 72
While implementing the control system in the programmable controller with the use of Stateflow toolbox and AR4Matlab, there are several things to do:
Define the interface between the Stateflow object (chart) and Simulink;
Define the states of operation algorithm;
Define state actions;
Define the transitions between all the states;
Decide, how to trigger the Stateflow object (it can be omitted according to the deployment in the programmable device); and
Deploy the chart into B&R’s Automation Studio project and program the controller.
A perturbed process with unknown electrical and mechanical time constants is controlled by the sum of the model control signal and the correcting signal  process velocity. 
After the successful implementation of the Stateflow object, the realtime control system can be connected to the simulation model in Simulink and run.
A second example is velocity control in the MFCV control system (see Vance VanDoren’s “Modelfollowing Process Control,” in the January 2007 issue of Control Engineering and the author’s “ModelFollowing Control Robustness and quality at the same time? Is it possible?”, Control Enginering Resource Center ( www.resource.controleng.com ), December 18, 2006). MFCV as well as its hybrid version MFCVH ensure higher control stiffness than a classic PID controller, and exhibit greater robustness.
The perturbed process has unknown electrical and mechanical time constants controlled by the sum of two control signals: a model control signal and the correcting processvelocity signal. The MFCV system uses the apriori selected model, while the MFCVH model loop is continuously switched to use the proper model. There are nine different model loops designed for the proposed velocity control system. There are arrays for each model and model controllers are changed by the switching algorithm included in a correcting controller. The switching algorithm ensures selection of the model loop closest to the actual behavior of the process to be controlled.
The MFCV (red line) system uses an a priori selected model, while the MFCVH (blue line) model loop is continuously switched for the proper model. 
In a few years, the hybrid control systems approach combined with the statechart programming model should gain popularity due to its taskoriented approach for programming industrial control devices like PLCs or PACs. Tools like National Instrument’s LabVIEW Statechart Module for PACs and Matlab/Stateflow combined with B&R’s AR4Matlab are very costeffective solutions for programming complex hybrid control systems. The statechart fits well with the hybrid control systems description and is likely to become the most popular language for programming complex control systems.
Author Information 
Krzysztof Pietrusewicz, PhD, teaches at the Institute of Control Engineering, Szczecin University of Technology, Szczecin, Poland. He is also editor for Control Engineering Poland. Reach him at krzysztof.pietrusewicz@ps.pl , or kp@controlengpolska.com 
Hybrid system simulationtool development projects
More tools are becoming available for modeling, simulation, validation, and compilation of hybrid control systems. Simultaneously, groups of researchers are engaging in projects connected with the hybrid systems.
One of the most active groups is The Hybrid Systems Group (Department of Information Technology and Electrical Engineering of the Swiss Federal Institute of Technology ETH in Zurich, Switzerland). Head of the Automatic Control Laboratory, Prof. Dr Manfred Morari, is known for his works concerning robust control, as well as hybrid systems. Tools prepared by his team include:
MultiParametric Toolbox (MPT)– a Matlab toolbox for multiparametric optimization and computational geometry; and
HYSDEL– Hybrid Systems DEscription Language for modeling the complex continuousdiscrete systems.
Alberto Bemporad, author of the Model Predictive Control toolbox for Matlab and Hybrid Control Toolbox, is with the Control and Optimization of Hybrid and Embedded Systems (COHES) group at the University of Siena.
On the Website,
Control and Optimization of Hybrid and Embedded Systems (COHES), University of Siena, Information Engineering Department;
Center for Hybrid and Embedded Software and Systems (CHESS), University of California, Berkeley, EECS;
Hybrid Systems Group, University of Pennsylvania;
MultiAgent, Robotics, Hybrid and Embedded Systems (MARHES) Laboratory, Oklahoma State University, Electrical & Computer Engineering;
Hamilton Institute, NUI Maynooth;
University of Ferrara, Department of Engineering;
Delft Center for Systems and Control, Delft University of Technology, The Netherlands; and
Center of Excellence DEWS, University of L’Aquila, Department of Electrical Engineering and Computer Science.
There are also conferences where topics addressed include problems concerning hybrid control systems, such as American Control Conference, Seattle, WA, USA, June 11– 13. A workshop devoted to “Robust Hybrid Control Systems” will take place during the conference.