MODELING AND SIMULATION OF DIGITAL CONTROLLERS FOR HYBRID DYNAMIC STRUCTURE SYSTEMS Fernando J. Barros Dept. Eng. Informática Universidade de Coimbra 3030 Coimbra, Portugal ABSTRACT Complex systems exhibiting structural changes can be better represented by models that can mimic these transformations. The Heterogeneous Flow System Specification (HFSS) is a comprehensive formalism that can represent a large variety of models using a unifying representation. The HFSS formalism represents models in a hierarchical and modular form. The explicit representation of structure makes possible to alter it dynamically. Among hybrid models, the most important include digital controllers and hybrid integrators. The HFSS ability to provide a common ground to represent all these elements permits to model complex systems in a simple framework. We present a detailed model of a PID controller and we show how this digital controller can be merged with other types of components. To illustrate formalism application we use a dynamic structure network of hybrid components to model a 2-stage rocket system, whose velocity is set by a PI digital controller. Simulation results for the rocket system are presented. 1. INTRODUCTION The representation of hybrid dynamic structure systems is a challenging problem to modeling and simulation methodologies. To help modeling these kind of systems we have developed the Heterogeneous Flow System Specification (HFSS) modeling and simulation formalism a novel and comprehensive framework for representing hierarchical and modular hybrid systems with adaptive structure. Examples include switched systems and mobile agent systems. To show the ability of the HFSS formalism to represent hybrid systems we model a two-stage rocket whose velocity is set by a digital controller. This model exhibits structural changes corresponding to rocket split when the first stage runs out of fuel. The ability to mimic system structure leads to better to understand rocket model. The model exhibits both continuous and discrete behavior. While rocket position and velocity are continuous variables regulated by differential equations, the digital controller introduces discontinuities in the rocket thrust that are represented by discrete event signals. The structural changes occurring in the rocket are also represented by discrete signals that originate model variation. Contrarily to discrete event systems, that have an exact and simple representation in digital computers, continuous systems can only be represented with some error. Discrete time machines are the most widely used formalism to represent numerical methods in digital computers. However, this formalism can only deal with a single time step, being unusable to provide the integration of components requiring independent time steps. This situation occurs, for example, when digital controllers need to be merged with ODEs solvers. This problem becomes even harder to solve when there is a need to use asynchronous solvers and/or digital controllers with variable sampling rates. Currently, most common tools are based on pure modeling formalisms translating models into ad hoc code specific of the tool vendor. To permit asynchronous time steps we have developed the concept of continuous flow and we have created the Continuous Flow System Specification (CFSS). CFSS formalism supersedes the traditional discrete time formalism allowing the representation of continuous systems with independent and variable time steps. CFSS models have a precise semantic enabling an algorithmic description of their simulators. This characteristic makes CFSS a modeling and simulation formalism enabling model interoperability, essential for supporting model communication in an infrastructure like the High Level Architecture (HLA) [5]. The HFSS formalism uses CFSS for representing continuous systems and it is able to integrate continuous and discrete types of models by offering a unifying representation to all components. The usual representation of hybrid systems assumes they are a combination of differential equations and discrete event systems [7], [8]. Thus, sample based systems like digital controllers have not been considered. Actually, these formalisms are intended for modeling and analysis and the inclusion of digital controllers would preclude a formal analysis. On the contrary, the HFSS formalism was designed for simulation purposes and it is intended to represent a larger number of systems. A particular structural change that has attracted the research on hybrid systems is commonly referred by switching systems [6]. These systems are controlled by a set of differential equations corresponding to a particular model of operation. When these conditions change, a .....