Control-based Programming of Electromecahincal Controllers

Hao-Chi Wong, Markus Fromherz, Vineet Gupta, Vijay Saraswat


We are developing techniques for model-based construction of software for computationally-controlled electromechanical systems, such as photocopiers. These systems are examples of real-time, reactive systems - those that react continuously with their environment at a rate controlled by the environment. Execution in a reactive system proceeds in bursts of activity. In each phase, the environment stimulates the system with an input (e.g. a sensor is tripped by a passing sheet), which starts a computation (e.g., a timer to activate a downstream gate) and responds with the output. The system then stays inactive until the next input comes in from the environment. In such a setting, real-time response is as important as standard liveness and safety requirements.

Our approach to constructing such software is based on the development of compositional and declarative models of the components that make up the electromechanical device. The intuition is that these models can be combined with software systems corresponding to specific tasks (such as simulation, control code generation etc.), via customized reasoning engines. These engines will take as input the specification of a system configuration, the software architecture and the model of the components to semi-automatically produce the target system. This general approach can be used for producing a variety of systems including controllers, simulators, testers, productivity analysers and diagnosis tools.

In this paper we compare the control-oriented paradigm with the data-oriented paradigm for programming reactive controllers. In the control-oriented paradigm, time is embodied in the control structure of the program; in the data-oriented paradigm, timed interactions are mediated through explicit data-structures representing clocks, timers and suspension lists. We argue, through a detailed example, that the control-oriented paradigm supported by synchronous programming languages such as tcc is superior to the traditional data-oriented paradigm in programming control software, with respect to requirements such as modularity, efficiency, time handling, verification and real-time performance measurements.

Postscript file (82K)
Pdf file (76K)