complicated systems and extending di erent properties of Witsenhausen type systems .... Recently, the area of control networks has attracted increased interest. .... Each station uses the identifier to filter the incoming messages, employing pre- .... The continuous state satisfies a di erential equation whose right hand-side ...
CONTROL NETWORKS by
Octavian V. Beldiman Department of Electrical and Computer Engineering Duke University
Date:
Approved:
Linda G. Bushnell, Supervisor Paul P. Wang David G. Schaeer Kishor S. Trivedi
A thesis submitted in partial ful llment of the requirements for the degree of Master of Science in the Department of Electrical and Computer Engineering in the Graduate School of Duke University 1998
Abstract In this thesis we model and analyze complex distributed control systems known as control networks. We discuss a class of hybrid systems called switched systems or Witsenhausen systems. We study the existence of a solution to the state trajectory equation as well as conditions for global existence of solutions. We also present a discussion about the continuity of the solutions with respect to the initial condition. Then we prove some facts about the stability of equilibria and about the linearization of such a system. The theory is then applied for designing a stabilizing controller for a nonlinear switched system. This kind of hybrid systems is then extended by adding both a discrete output and input. This extended model is used for modeling an ideal network of interactive hybrid systems. An equivalence is established between the network model and the Witsenhausen model. This equivalence allows for simulating complicated systems and extending dierent properties of Witsenhausen type systems to control network systems. A simple HVAC application is modeled using the above equivalence.
ii
Contents Abstract
ii
List of Figures
v
1 Introduction
1
1.1 Control Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
1.2 Control Network Standards . . . . . . . . . . . . . . . . . . . . . . .
2
1.2.1 CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
1.2.2 BACNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
1.3 Hybrid System Models . . . . . . . . . . . . . . . . . . . . . . . . . .
6
1.3.1 Witsenhausen Model . . . . . . . . . . . . . . . . . . . . . . .
7
1.3.2 Tavernini Model . . . . . . . . . . . . . . . . . . . . . . . . . .
8
1.3.3 Back-Guckenheimer-Myers Model . . . . . . . . . . . . . . . .
8
1.3.4 Brockett Model . . . . . . . . . . . . . . . . . . . . . . . . . .
8
1.3.5 Timed Automata Model . . . . . . . . . . . . . . . . . . . . .
9
1.3.6 Phase Transitions Systems Model . . . . . . . . . . . . . . . .
9
1.3.7 Hybrid Automata Model . . . . . . . . . . . . . . . . . . . . . 10 1.3.8 Game Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2 Analysis of Switched Systems
12
2.1 The Witsenhausen Model . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2 Existence of Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.3 Continuity with Respect to Initial Conditions . . . . . . . . . . . . . 18 2.4 Stability and Linearization . . . . . . . . . . . . . . . . . . . . . . . . 22 iii
3 The Equivalent Model of a Control Network
27
3.1 Extended Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.1.1 State Dependent Control Switching . . . . . . . . . . . . . . . 27 3.1.2 Discrete External Commands . . . . . . . . . . . . . . . . . . 28 3.2 A Network of Systems . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4 Applications
38
4.1 An Example of Hybrid Controller . . . . . . . . . . . . . . . . . . . . 38 4.2 A Simple HVAC Application . . . . . . . . . . . . . . . . . . . . . . . 39
5 Conclusions
45
Bibliography
47
iv
List of Figures 2.1 An example of a trajectory for a Witsenhausen system . . . . . . . . 14 2.2 Trajectory for switched system with initial condition (0.1,0.1). . . . . 25 3.1 Block diagram for an extended Witsenhausen system. The solid lines represent continuous signals and the dotted lines represent discrete signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.2 Block diagram of a network connection. . . . . . . . . . . . . . . . . . 32 4.1 Pendulum without controller. Initial condition (1; 0). The pendulum switches the discrete state at times 1.96 and 5.87. . . . . . . . . . . . 40 4.2 Pendulum with the controller. Initial condition (0:1; 0). No switching of the discrete state occurs. . . . . . . . . . . . . . . . . . . . . . . . 40 4.3 Pendulum with the controller. Initial condition (?0:1; 0). There is a switching at time 2.43, and then the pendulum remains in a discrete state. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.4 Plan of a building. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.5 Underlying nite state automaton for room 1. . . . . . . . . . . . . . 43 4.6 Temperature in the three rooms for the two fan control strategies. We used Tmax = 1, Tmin = 0:4, r = 1. . . . . . . . . . . . . . . . . . . . . 44
v
Chapter 1 Introduction 1.1 Control Networks Recently, the area of control networks has attracted increased interest. A control network is de ned as a collection of hybrid systems, exchanging information for achieving a common goal. Control networks are seen as a possible way to analyze and design complex dynamical systems that either are scattered over a large area, or have realtime requirements that make the data transmission process critical. Several architecture standards have been developed in industry. Some of the most representative are described in section 1.2. An excellent survey of CAN architectures can be found in [27]. Modeling and analysis of control networks have just started to develop. Although some introductory papers have been published ([25],[27]) very few papers discuss modeling or analysis issues. In [36] Walsh studies the race condition behavior for networks of hybrid systems. In [33], Tindell et. al. give bounds on the message response times in a CAN network. More recently, Wong and Brockett [38] study the eect of the communication bandwidth constraints upon these systems. The subject of control networks is strongly connected to the modeling and analysis of hybrid systems. A vast amount of literature on the analysis, modeling and control of hybrid systems can be found in both the eld of control and computer science. A few of the most used models are presented in section 1.3. Nevertheless, a general methodology for designing hybrid controllers is lacking; most of the controllers are being designed speci cally to the problem on hand. 1
In this thesis we study some mathematic properties of a special class of hybrid systems, (Witsenhausen systems or switched systems) that allow for a general way of designing controllers. As an illustration, we examine the design of a controller for a simple pendulum. Then we present a way of modeling a control network by equating it to a switched system. This equivalence would allow us to use any analysis/design methodology that we develop for hybrid systems for control networks. This thesis is structured as follows: in the next two section we informally discuss control networks and hybrid systems models. The emphasis is on two particular control network protocols: CAN and BACNet. Then in chapter 2 we develop some analysis tools for a special class of hybrid systems: switched systems. In chapter 3 we extend this class of systems by adding discrete input capabilities and prove that a control network consisting of such systems can be modeled as a single switched system. In chapter 4 we present some simple applications for the previous two chapters: a simple controller for a hybrid systems, and modeling of a simple HVAC application. Finally in chapter 5 we draw some conclusions and discuss further research directions. Most of the work presented in the second part of this thesis was published in [12].
1.2 Control Network Standards Although control networks are similar to data networks in the sense that they both divide up a centralized system into a set of smaller interconnected processors, the similarities stop here. Data networks use large data packets and relatively infrequent transmission rates, while control networks must shuttle many small but frequent packets among a relatively large set of nodes. As a consequence many control network architectures are designed speci cally for distributed control. Some of the leading architecture are presented in the next table, taken from [27]. 2
Characteristics Application targeted OSI Layers System control (command or status based) System type Error correction Addressing schemes Max. data rate (Mb/s) Max. number of nodes
BACNet Building Automation 1,2,3,7 Both
CAN CEBus Automotive Consumer
IEEE-488 Instrumentation 1,2,7 Command
LonWorks All
1,2 Command
1,2,3,7 Command
Network CRC All
Bus CRC Broadcast
Net CRC All
Net CRC All
0.01
Bus Unicast, Broadcast 8
10
1
248
40
216
961
248
1-7 Both
1.25
Table 1. Architecture for distributed control We are especially interested in two of these standards: BACNet (Building Automation and Control Network) and CAN (Controller Area Network), because they are the most used for applications. The next subsections discuss these two standards in detail.
1.2.1 CAN CAN has been designed primarily for automotive applications. Due to its performance and low cost, it is also being considered in automated manufacturing and process control environment for interconnecting intelligent devices such as smart sensors and actuators. The CAN protocol uses a multi-master (contention based) bus con guration for the transfer of communication objects between the nodes of a network. This multimaster bus is also referred as CSMA/CR (Carrier Sense, Multiple Access, with Collision Resolution) and runs at speeds up to 1 Mbit/sec. A communication object consists of an identi er along with a control data segment, and has variable length. The identi ers must be unique (i.e. two nodes on the same bus must not send frames with the same identi er). 3
Each station uses the identi er to lter the incoming messages, employing prede ned masks. Also, the identi er is used for collision resolution. When a station needs to send a message it rst listens to the bus. If the bus is free, the station starts sending the message with the identi er rst. If a recessive bit (logical one) is being transmitted and a dominant level (logical zero) is monitored on the bus, then the station must abort its transmission. In this way only one station will have the bus, namely the one which sends the lowest message identi er. The network actually implements a wired AND. The interface between the CAN bus and the CPU is usually called a CAN controller. There are now lots of CAN controllers around. For instance, INTEL produces the CAN controller 82527, and Motorola produces TOUCAN, MSCAN and MCAN controllers. The CAN protocol standard (ISO 11898/1993) speci es only the rst three layers in the network ISO-OSI model. Presently there are two protocol versions: CAN 1.0 and CAN 2.0, the main dierence consisting in the length of a frame. Several higher-level protocols are in development. All the major European car manufacturers are developing models where CAN plays a major role in the connection of dierent electronic components. There are also higher-level protocols developed for industrial applications: DeviceNet, SDS. The theoretical research about CAN has just started to develop. Some bounds on the message response time are computed by Tindell et. al. in [33] and improved in [32]. The problem of scheduling messages on CAN for real-time application is studied by Zuberi and Shin in [39]. Brauninger et. al [10] propose to use CAN for truck and bus application, while Sparks ([29] advocates the use of CAN for aerospace applications. Several papers discuss industrial applications for CAN. Cena and Velzano [14] propose two slight modi cations to CAN for satisfying two automated manufacturing 4
requirements: granting an upper bound on the transmission times and sharing the bandwidth among dierent devices fairly. Rietz et. al ([28]) propose using CAN for multi-sensor signal processing. A very good place for information related to CAN is the CAN Web page [34] maintained by Ken Tindell.
1.2.2 BACNet BACnet is an ASHRAE control network protocol (standard ASHRAE 135-1995) designed to provide a standard communication and environmental control network for commercial and government buildings and campus environments. The primary application for this standard is HVAC control. It can be used by virtually any type of building automation equipment, regardless of what manufacturer produced it. The rules governing the exchange of data over the network relate speci cally to the needs of building automation and control equipment i.e., they cover things like how to ask for the value of a temperature, de ne a fan operating schedule, or send a pump status alarm. The BACNet protocol is object oriented. It de nes communication objects having several properties. Each communication object has at least an object identi er, an object name and an object type. BACNet de nes a number of standard object types like analog input, analog output, calendar, command, device etc., and the vendors can de ne additional proprietary object types. BACNet de nes several types of services: object access services, alarm and event services, le access services, virtual terminal services and remote device management services. The applications will use these services to implement inter-node communication. Several distributed network control companies (Cimetrics Technology, Alerton Technologies Inc. etc.) provides support for the BACNet protocol. 5
The theoretical study of BACNet, or control networks in building automation in general is in an incipient stage. A short introduction to BACNet can be found in [24]. The impact of BACNet on the digital control of building systems is discussed in [23]. A description of the BACNet standard is presented in [13]. Also information about some current applications of BACNet can be found on the World Wide Web ([19], [31]).
1.3 Hybrid System Models By hybrid systems we mean dynamical systems that combine continuous and discrete behaviors. The development of computers and digital controllers has emphasized the need of studying the digital eects that they introduce on a purely continuous systems. Also there are real-life systems that are inherently hybrid, for instance the transmission system of a car, walking robots, ight controllers, industrial processes and many others. In a survey of the current hybrid system models, Branicky ([9]) distinguishes four kind of discrete behavior in a hybrid systems: 1. autonomous jumps - when the continuous state jumps discontinuously on hitting prescribed regions of the state space; 2. autonomous switch - the vector eld changes discontinuously when the continuous state hits certain boundaries (so what we call the discrete state is changing); 3. controlled jump - when the continuous state jumps discontinuously in response to a control command (like in a reset command); 4. controlled switch - when the vector eld changes abruptly in response to a control command. 6
One can nd a large number of models in the literature covering one or several of these phenomena. Historically, the research in hybrid systems comes from two elds: from computer science, particularly the real-time systems, and from control theory. Consequently there are two distinct approaches to hybrid systems. The control scientists and engineers tend to model the system using dierential equations whose vector elds depend on the discrete state. Thus a change in the discrete state is equivalent to a change in the vector eld. To describe the behavior of the discrete part theory of nite state automaton or a Petri net or some other discrete structure is linked to the theory of dierential equations. This approach is useful for studying concepts such as controllability and stability, and for designing low-level control laws, but fails to catcher a larger perspective and to discuss the issues of correctness and veri ability. On the other hand, the computer scientists tend to model the system as a nite automaton, a discrete event system, or some other discrete structures, ignoring the underlying dierential equation. The system is either sampled at a predetermined frequency, or at the times when discrete events are recorded. This approach allows for design speci cation and veri ability, but fails to answer questions regarding stability and controllability. Next we brie y describe a few models from each approach. For a more complete survey of the rst approach, the reader is directed to [9]. Most of the second approach models can be found in [8], [15], [4], [3], [5], [17].
1.3.1 Witsenhausen Model In [37], Witsenhausen introduced a simple model for continuous-time hybrid systems. The state of the system has two components: a continuous part and a discrete part. 7
The continuous state satis es a dierential equation whose right hand-side depends on the discrete state. The discrete state changes when the continuous state hits certain regions in the state space. We shall present this model in detail in the next chapter
1.3.2 Tavernini Model Tavernini proposed a dierential automaton ([30]) to model hybrid phenomena like hysteresis. This model is based on the same idea as the Witsenhausen model. The states of the automaton are the possible values for the discrete state of the system. To each state of the automaton a vector eld is attached. The continuous state evolution is governed by the active vector eld. Transition occurs when the continuous state reaches a switching boundary.
1.3.3 Back-Guckenheimer-Myers Model This model [7] extends the Tavernini model by allowing jumps in the continuous state space and setting of parameters when a switching boundary is hit. This is done through transition functions de ned on the switching boundaries. Also the model allows for a more general state space. The model was able to be used for rather complex hybrid systems - for instance for Mark Raipert's one-legged hopping robot ([26]).
1.3.4 Brockett Model In [11] Brockett proposed four models for hybrid systems. In the \B model" the system has only a continuous part, evolving according to a dierential equation. This equation, however, can change as a consequence of a discrete input command. To allow for an arbitrary time distribution of the input command, Brockett introduced 8
a special counter variable p. The discrete control is exercised only at times when p passes through integer values. In the \D model" the state is divided in a continuous part, evolving according to a dierential equation, and a discrete part, evolving according to a nite dierence equation. The discrete control inputs aect directly the equation for the discrete state. Again a counter variable p is introduced to express the times when the a new discrete control command arrives, or the discrete state changes.
1.3.5 Timed Automata Model Alur and Dill proposed in [2] the timed automata to model the behavior of real-time systems. A timed automata is a normal automata augmented with a number of timers. Each transition can have a timing constraint and could reset some of the timers. This kind of automaton accepts the so called timed-languages, which can describe the behavior of a real time system. Such a model could be used to automatically verify a design - for instance to check that a certain assertion is always true or can never be true. One example is a gate controller at a railway crossing. One correctness assertion is that whenever the train is inside the gate, the gate should be closed. This assertion can be veri ed automatically using the timed automaton model.
1.3.6 Phase Transitions Systems Model Phase transition systems were used as a hybrid system model by Manna and Pnueli in [22]. A phase transition system (V; ; T; A; I ) consists of:
V a nite set of state variable which can be both continuous and discrete 9
the initial conditions T a nite set of transitions A a nite set of activities I a set of important events The system can evolve by two means: it either has a transition from the set T that will change some of the discrete states, or the continuous states evolves according to some dierential equations given by the set of activities. The set of important events is the set of events whose change in the truth value must not be missed. One of the main problems in discretizing a real hybrid system is that an important change may occur just between two consecutive sampling instances, and so it may be unnoticed. The set of important events allows for avoiding this situation. A system modeled by a phase transition system can be described either using charts or using textual languages, and are especially good for system speci cation. The model allows as well for proving invariance rules. The authors applied the model to a gas burner example.
1.3.7 Hybrid Automata Model In [1] the timed automaton model is generalized to the hybrid automaton model. This is introduced as a model and speci cation language for hybrid systems. The generalization consists in allowing the behavior of variables in each state to be governed by a set of dierential equations.
1.3.8 Game Theory An interesting approach is using game theory for designing controllers for hybrid systems. The idea was introduced by Asarin, Maler and Pnueli in [6]. The controller 10
is synthesized by nding a winning strategy for certain games de ned by automata or by timed automata. A similar approach is proposed by Lygeros, Godbole and Sastry [21]. The hybrid design is seen as a game between two players. One is the disturbance that enters the dynamics. The second player is the control, which is chosen by the designer. This methodology is also used by Tomlin, Lygeros and Sastry in [35] to design controllers for aircraft con icts resolution.
11
Chapter 2 Analysis of Switched Systems 2.1 The Witsenhausen Model The Witsenhausen model is an older and simpler model [37], and seems to be a good starting point for modeling control networks. Our proposed model allows for distinguishing between the low-level, continuous dynamics and the high-level, discrete switching commands in the network. The high-level strategy is implemented with regard to the way the systems respond to events. We will see that this is actually established by choosing the discrete input transition sets and network priorities assignments. In this section we describe the Witsenhausen model for hybrid systems. Without loss of generality we consider only autonomous models. Time-varying vector elds may be made autonomous by adding time as a new state. The Witsenhausen model for hybrid systems is developed as follows:
state: (m; x) 2 M 0 such that 8 jx1 ? x0 j < :
jx(t; x0 ; m0; t0 ) ? x(t; x1 ; m0 ; t0)j < < : Then all the solution starting in the ball B (x0 ) will not intersect any of the transition sets. Thus the solution is strictly continuous with respect to the initial condition. Now let's consider the case where the solution has switching. Since the system is well-de ned, the solution has only a nite number of switchings (cf. proposition 1). Without loss of generality, we can assume that there is only one switching (the case with several switchings is a simple extension of this case). Let m1 the next discrete state after m0 and let t1 the time when this switching takes place. This means that x(t1 ; x0 ; m0; t0 ) 2 @Jm0 m1 and in the interval [t0 ; t1) 20
the solution does not cross any other transition set. Let > 0 and denote by x the solution in state m0 if we ignore the transitions: x(t1 ) = x(t1 ). Since the solution is continuous in time, 91 > 0 such that 8 < 1 , jx(t1 + ) ? x(t1 )j < =2 and 8 2 (?1 ; 1), jx (t1 + ) ? x (t1)j < =4. Since the solution is transversal, 9t > t1 such that 8t1 < t < t , x (t) 2 Int(Jm0 m1 ). Take 0 < t < min(t ? t1 ; 1). Then x (t1 +t) 2 Int(Jm0 m1 ) and x (t1 ? t) 2= Jm0 m1 . Since Int(Jm0 m1 ) and C Jm0 m1 are open, we can nd an v1 > 0 such that B1 (x (t1 + T )) Int(Jm0 m1 ) and B1 (x (t1 ? T )) C Jm0 m1 . If we ignore the transitions, the solution is continuous with respect to the rst state, since f (m0 ; ) is globally Lipschitz. Therefore we can choose 2 > 0 such that if a solution starts in B2 (x0 ) it will stay within a min(1 ; =4) distance of x (t) on the interval [t0; t1 + T ]. In accordance with the rst part of the proof we can choose 2 small enough so that the solution will not cross any transition set except Jm0 m1 . Let y(t; x1; m0; t0 ) be a solution starting in the B2 (x0) ball. We notice this solution must cross @Jm0 m1 since at time t1 + t it is in the interior of the transition set. Moreover the time when this crossing takes place, let it be t01 , is in the interval (t1 ? t; t1 + t), since the solution at time t1 ? t is outside the transition set. At the transition time t01 we have:
jy(t01) ? x (t01 )j < =4 and since
jx(t01 ) ? x(t1 )j < =4 we get:
jy(t01) ? x(t1 )j < =2: 21
Since t01 < t1 + t due to the choice of t we have:
jx(t01 ) ? x(t1 )j < 2 : Hence:
jy(t01) ? x(t01 )j < : For the discrete state m1 , applying a Gronwall type argument (for two solution that start at t01 with initial conditions y(t01); x(t01) ) we get:
jy(t) ? x(t)j < jy(t01) ? x(t01 )j exp(k(t ? t01)); 8t 2 (t01; T ] where k is a Lipschitz constant for f (m1; ). Then:
jy(t) ? x(t)j < exp(k(T ? t0)); 8t 2 [t01 ; T ]: So, after the switching, we can have the trajectories arbitrary close by choosing a suciently small , which proves the proposition.
Remark 5 If a solution is not transversal to the system, then it may not be continuous with respect to the initial condition.
2.4 Stability and Linearization In this section we give some simple results about the stability of an equilibrium point, and about the linearization of a Witsenhausen model. There are several approaches we can take when studying the stability of these hybrid systems. One interesting one is: if you have a collection of unstable dierential equations, can you implement a switching strategy amongst them (de ne the transition sets) so that the new system is stable? However we will follow a simpler approach. We will suppose that we have a collection of stable systems and we will check if the switching amongst them will lose this stability. 22
De nition 5 x0 is called an equilibrium point for the Witsenhausen system (M; ; f; d; J ) if f (m; x0 ) = 0; 8m 2 M . Remark 6 De nition 5 implies that if the system reaches the point x0 no matter in what discrete state, it is going to stay there forever. Other interesting situations occur when f (m0 ; x0 ) = 0 for a given discrete state m0 , which means that the system will remain at x0 only if the discrete state is m0 .
In some applications we might be interested in keeping the discrete state constant (for instance in controlling the temperature in a room, we do not care about small variation in temperature, as long as we do not need to turn the heater on). It would be interesting to de ne equilibrium for discrete states only.
De nition 6 The initial condition (m0 ; x0 ) is called admissible, if and only if x0 2=
Jm?0 .
De nition 7 An equilibrium point x0 is stable if 8 > 0 9 > 0 such that 8x1 with jx1 ? x0 j < we have jx(t; x1 ; m; t0) ? x0 j < , for all admissible initial conditions (m; x1 ) with m 2 M and jx1 ? x0j < . Proposition 4 If an equilibrium point is not on the boundary of any of the departure sets of a well-de ned Witsenhausen system and if it is stable for each of the vector elds corresponding to admissible discrete states, then it is stable.
Proof. If x0 is in the interior of a departure set Jm? we can ignore the discrete state m since the state m is not admissible in the de nition of the stability: suppose that x0 2= Jm?; 8m 2 M . Since Jm? is closed, and there is a nite number of discrete states, we can nd an 1 > 0 such that the ball B(x0 ) does not meet any of the departure sets. 23
Let > 0, and suppose < 1. If this is not the case we can prove stability for 1 and this proves stability for . Let m be a discrete state. Since the x0 is stable for f (m; ) we can nd a m such that if the solution starts in the ball Bm (x0 ) it will stay in the ball B(x0 ). Moreover, by the choice of the solution will never meet another transition set, so it is going to stay in B(x0 ) forever.
Proposition 5 If an equilibrium point is on the boundary of the transition sets Jmi ni with i = 1; : : : ; k of a well-de ned Witsenhausen system and if it is stable for each of the vector elds corresponding to admissible discrete states and to the states m1 ; : : : ; mk , then it is stable.
Proof. Let x0 be the equilibrium point and > 0. If x0 2 Jmini then x0 2= Jn?i This means that in discrete state ni we can nd an
i > 0 such that the ball Bi (x0 ) does not cross the departure set Jn?i , i.e., if the solution stays in the ball Bi (x0) it will never switch in other discrete state. Since the the system in discrete state ni is stable at x0 , we can nd a i0 > 0 such that all the solutions starting in the ball Bi (x0 ) will stay in the ball Bmin(;i) (x0) and they will never switch. In state mi the discrete x0 is also stable, so we can nd i such that all solutions starting in Bi (x0 ) will stay in the ball Bmin(i ;)(x0) and will not cross any other transition set except possible Jmi ni . If the initial discrete state is any other then m1; : : : ; mk , as in proposition 4, we can nd a that proves stability. Then, taking = minf1; : : : ; k ; g, all the solutions starting in B (x0 ) will stay in the ball B(x0 ). Hence x0 is stable. 0
0
Remark 7 The last two propositions show that if we have a well-de ned Witsenhausen system with an equilibrium state which is stable for all the individual dier-
24
ential equations, then it is stable. So we do not lose stability by switching the discrete state.
The condition of \well-de ned" is essential for stability. Next we give an example of a Witsenhausen system that is not \well-de ned," having an unstable equilibrium point, although this point is stable for all of the individual dierential equations.
Example 1 (Due to Branicky [9]). 120
100
80
60
y
40
20
0
−20
−40
−60
−80 −250
−200
−150
−100 x
−50
0
50
Figure 2.2: Trajectory for switched system with initial condition (0.1,0.1). Consider f1 (x) = Ax and f2(x) = Bx where:
A = ??010:1 ?10:1
#
B = ??01:1 ?10 0:1
#
"
"
For the switched system we use f1 in the second and fourth quadrant, and f2 in the rest. This is not a well-de ned Witsenhausen system. Each of the individual dierential equation is stable at 0, but the overall system is not. An example of a solution with the initial condition (0:1; 0:1) is shown in gure 2.2.
25
The propositions about stability are based on the fact that in a well-de ned system, with all the vector elds stable, we can nd a small enough neighbourhood around the equilibrium point so that the system will have at most one transition. Based on this fact, the linearization theory can also be generalized.
De nition 8 Let (M; ; f; d; J ) be a well de ned Witsenhausen system, with x0 an equilibrium point. Then the system (M; ; g(m)x; d; J ) is called its linearization, i g(m) = @f @x (m; x0 )x.
Proposition 6 If all the component vector elds of the linearization of a well-de ned Witsenhausen system are asymptotically stable, then the system is stable.
Proof. Suppose the equilibrium point x0 is not on the boundary of any of the departure sets. Consider an admissible initial condition (m; x). Now consider the vector eld corresponding to the discrete state m (f (m; )). The linearization of this vector eld is asymptotically stable, hence, due to the linearization principle, the system x_ = f (m; x) is asymptotically stable in the equilibrium point x0 . This means that if we start with a value close enough to x0 , we can make the continuous state to stay as close of x0 as we want. Then we can use the same argument as in the proof of proposition 4 to prove stability. Now suppose x0 is in one of the departure sets - let's say x0 2 Jmn. The systems corresponding to the states m and n (ignoring all the transitions) has asymptotically stable linearizations, so they are asymptotically stable, and again we can parallel the argument in proposition 5 to prove stability.
Corollary 2 It the linearization of a Witsenhausen system is stabilizable then the system is stabilizable.
26
Chapter 3 The Equivalent Model of a Control Network 3.1 Extended Models The Witsenhausen model covers a large class of hybrid systems, although some discrete phenomena (like autonomous or controlled jumps in the continuous state) are not taken into account. The model lacks the ability to exchange information with the external world. Even with adding a discrete output function, as in section 2.1 the model still has no discrete input capabilities. In a network environment, however, the systems have to exchange information. To use a Witsenhausen model for these systems, it has to be augmented with discrete inputs. The eect of these discrete inputs will be to change the control law, and hence the vector eld of the closed loop system, rather than the vector eld of the open loop system. This extension is presented in this chapter.
3.1.1 State Dependent Control Switching The rst extension is the case where the control can be switched when the continuous state meets certain conditions, even if the vector eld is not modi ed. We assume that the control changes when the continuous state reaches some transition sets that respect condition similar to those from the Witsenhausen model. For each discrete state the control may be one of a nite numbers of controls, depending on the continuous state. Then we can replace that discrete state with a nite number of discrete states, one for each possible control. 27
Using this method we obtain a new set of discrete states M~ . The only new switchings are those introduced by a change in control and we assumed that the transition sets for these switching respect Assumption 1. For each discrete state m 2 M~ , we have a continuous input: ~ um(t) = um(t; x(t)); m 2 M: The switching in the discrete state is governed by the continuous state, therefore this extended system is of Witsenhausen type. Such systems are met when the control strategy is dierent for dierent regions in the state space.
Example 2 An example of such system is an inverted pendulum. For small deviation, the linearization is a good approximation and a classical controller, e.g., state feedback, can be used. When the pendulum is outside this region the controller can be switched to some other controller, e.g., a bang-bang controller.
3.1.2 Discrete External Commands In a more general context, the control can be switched not only as a consequence of reaching some regions in the state space, but when receiving some external commands as well. A typical example of such switching is when a hybrid system receives a reset command: the control is switched to the control law corresponding to a given initial discrete state. These systems are no longer equivalent to the Witsenhausen systems described in section 2.1. For this extension, the discrete commands can come at any time, no matter where the continuous state is. Therefore, the switching in the control, and thus the discrete state is not determined by the continuous state alone. We will assume that at a given time the system receives a nite sequence of inputs. The equation for the continuous state is the same: 28
x_ (t) = f (m; x(t); u(m; t)) but the switching in the state is no longer triggered only when x(t) reaches Jm?. The system now has an additional discrete input vk 2 V , where V is a nite set. For any discrete states m; n 2 M there is a set Vmn V , maybe empty, having the property that if the system was in the discrete state m and received a discrete input vk 2 Vmn , then the system switches to the discrete state n. Denote by Vm+ = Si Vim the arrival input set for state m, i.e., the set of discrete inputs that would switch the system to state m. Let Vm? = Si Vmi be the departure input set for state m, that is, the set of all discrete inputs that would force the system to leave the discrete state m. Assumptions similar to those for the transition sets in section 2.1 are needed:
Assumption 1 (1) for all i; j; m 2 M the sets Vmi and Vmj are distinct if i 6= j , and (2) for all m 2 M the sets Vm? and Vm+ are disjoint. We can de ne V 2 P (V ) the set of the input transition sets, and the discreteinput discrete-state transition function v : M V ! M , such that v(m; Vmn) = n (Vmn is the set of discrete inputs that would produce a transition from discrete state m in discrete state n). After receiving a discrete input the system jumps in the corresponding state (which may be the same state). If the continuous state is in one of the transition sets for that state, the system jumps instantaneously in the new state. In order to avoid a loop when connecting these system in a network we assume that the discrete output is triggered by the continuous state only (more precisely when the continuous state reaches one of the transition sets). 29
The mathematical model of these systems is therefore represented as (M; V; ; f; d; !; J ; V ; v), where: (M; ; f; d; !; J ) is a Witsenhausen system de ned in section 2.1, V is a nite set of integers representing the discrete input set, V 2 P (V ) is the set of discrete transition sets and v : M V ! M is the discrete-input discrete-state transition function that indicates the next discrete state corresponding to a given input. We will call such a system an extended Witsenhausen system.
Remark 8 The only assumption we made about the time distribution of the discrete input is that at a given time the system receives a nite sequence of inputs. Suppose that at a given time the system receives the inputs fv1 ; v2 ; :::; vk g. Then the resulting discrete state is obtained by sequentially processing these inputs. More exactly, the next discrete state will be v(v(: : : v(m0 ; v1 ); : : : ; vn?1 ); vn), where m0 is the initial discrete state.
The extended Witsenhausen systems interact with the environment via discrete inputs and discrete outputs. A block diagram for such a system is shown in gure 3.1. v u
Hybrid Plant
o x
Hybrid Controller
Figure 3.1: Block diagram for an extended Witsenhausen system. The solid lines represent continuous signals and the dotted lines represent discrete signals. 30
These are the types of systems that one would expect in a network environment. Dierent systems in the network interact with each other, possibly changing their internal state when receiving messages from the other systems in the network. Messages are external commands that do not depend on the continuous state of the system, at least not directly. From this point of view, each individual system in the network is of the extended Witsenhausen type. In the next section we will assume that all the extended Witsenhausen systems have the same input and output alphabet.
3.2 A Network of Systems A control network is a collection of hybrid systems exchanging information to achieve a common goal. The term information stresses the fact that the systems exchange messages in response to some change in their discrete states. A control network is not the communication channel between a plant and its controller. In this section, we will show a way to model a network composed of extended Witsenhausen systems. There are a number of ways one can connect extended Witsenhausen systems: 1. parallel connection: The systems have the same discrete input. This connection is trivial in the sense that each system evolves individually, without interacting with the others. 2. serial connection: The discrete output of a system is the discrete input of the next system. Such connection could model a pipelined environment, such as a manufacturing line. Each stage signals when it nishes processing an item. The the next stage receives this signal and knows that it has to start working on the item. 31
3. loop connection: The discrete output of one system is the discrete input of the second, and the discrete output of the second is the discrete input of the rst. This can model any kind of hybrid plant / hybrid controller system. 4. network connection: This is the connection we are interested in for this paper. The discrete output of a system is the discrete input of all the other systems (except itself). Each of the systems has a priority, such that if several systems send a discrete output at the same time, they will be arranged in the order of the priorities. In that case all the systems will receive a nite ordered sequence of inputs, and will process it according with the above remark. Note that the network connection described above neglects the transmission delays associated with the network. Hence, any two systems in the network can communicate with each other without transmission delays. A block diagram of a network connection of extended Witsenhausen systems is shown in gure 3.2.
System 1 v
1
o
1
System N
System 2 v
2
o
v
2
N
o
N
Network
Figure 3.2: Block diagram of a network connection. Consider N extended Witsenhausen hybrid systems connected in a network, labeled in the decreasing order of their collision priorities: (Mi ; Vi; i; fi; !i; di; Ji; Vi; vi); i = 1; : : : ; N: 32
Proposition 7 A network of N extended Witsenhausen hybrid systems is equivalent to a Witsenhausen system obtained by concatenating the individual systems.
More precisely, the system obtained by concatenating the individual systems is (M; ; f; d; !; J ), where:
M = M 1 M2 M N = 1 2 N f = [f1; f2 ; : : : ; fN ]T ! = (!1; !2; : : : ; !N ) J = fA1 A2 AnjAi 2 Ji or 9Bi 2 Ji; Ai = C (Bi ) 8i and there is at least an i for which Ai 2 Jig, where C is the usual notation for set complement. d is the discrete state transition function which is de ned as follows: Let m = (m1 ; m2; : : : ; mN ) 2 M and J = (A1; A2; : : : ; AN ) 2 J . We have to de ne n = (n1 ; n2; : : : ; nN ) such that n = d(m; J ). Construct the sequence fik g1kr of indices for which Aik 2 Jik (in increasing order). Then we can also construct the sequence fvk g1kr such that vk = !ik (mik ; Aik ). Take nik = dik (mik ; Aik ). For the other components, construct iteratively the next state, considering as a sequence of discrete inputs the sequence fvk g. Note that the case when the sequence fik g has more than one element corresponds to a collision (because several systems will try to send their output on the network at the same time). Then the network will broadcast their output 33
in the order of their priority (due to our assumption that the systems has been labeled in decreasing order of their priorities, e.g., system 1 has the highest priority).
Remark 9 For this composed system the continuous state is the concatenation of all individual continuous states:
x(t) = [x1 (t); x2(t); : : : ; xn(t)]T and the discrete state takes values in the Cartesian product of the discrete state spaces of each system (still a nite set):
m = (m1; m2 ; :::; mn) 2 M1 M2 : : : Mn:
Proof. We have to prove two things: rst we have to prove that the transition sets for the network respect the three assumptions needed for the Witsenhausen model, and then we have to prove that the switching of the discrete state for the network is triggered by its continuous state. We will consider N = 2. The proof for a general N is a simple extension of this case. Suppose we aggregate two Witsenhausen models. One of them has continuous state x(t) 2 M and discrete state d 2 D, and in the other has continuous state y(t) 2 N and discrete state e 2 E . Denote by Jxd+ and Jxd? the arrival set into and the departure set from the discrete state d for the rst system, and by Jye+ and Jye? the arrival set into and the departure set from the discrete state e for the second system. Since the two system are Witsenhausen, the sets Jxd? and Jye+ are closed (in M , respectively N ). 34
Let's denote by Jde+ and Jde? the arrival set into and the departure set from the discrete state (d; e) for the composed system (the model for the network). If we ignore the interaction between the two systems (the fact that the switching in the discrete state of one of the systems could generate a message through the network that may trigger the switching of the discrete state for the second system) then we have:
Jde? = (Jxd? N ) [ (M Jye? ) Jde+ = (Jxd+ C (Jye? )) [ (C (Jxd? ) Jye+ ) Indeed, the network leaves state (d; e) either when the rst system leaves state d or when the second system leaves state e. Similarly, the network comes into state (d; e) either when the rst system comes into state d and the second does not leave state e or the other way around. These new sets respect the Assumption 1: 1. To prove that Jde? \ Jde+ = ;, suppose that there is a point in this intersection: (x; y) 2 Jde? \ Jde+ . Then (x; y) 2 Jde? . So either x 2 Jxd? or y 2 Jye? . In both cases (x; y) cannot belong to Jde+ , thus the departure and arrival sets are disjoint. 2. Jde? is closed because it is a nite union of closed sets. 3. The third assumption (the fact that the sets of the form J(de)(fg) are disjoint) is ensured by the fact that the sets Jx(d)(f ) and Jx(e)(g) are disjoint since they are transition sets for Witsenhausen systems (and the former sets are simple Cartesian products of the later sets). However this does not take into account the switching generated by sending messages on the net. Assume now that there is some interaction between the two systems. 35
This does not change the departure sets (only their distribution), but aects the arrival sets. The eect is that one arbitrary transition set, let's say J(mn)(dn) is added to Jde+ (the transition of m to d could send a message to trigger n to e). Then we have a problem if J(mn)(dn) 2 M Jxe? . But the way we de ned the transition function for the composed system allows us to get rid of this problem: the discrete state of the network goes directly to the nal state, avoiding the possible transparent state. So, even if we take into account the messaging, the transition sets still verify the assumptions from the Witsenhausen model. The only thing left to prove is that a change in the discrete state is triggered only when the continuous state reaches one of the sets in J . A change in the discrete state of the overall system happens if and only if some of the individual systems change their discrete states. An individual system p can change its discrete states i in two cases: either its continuous state reached the departure set Ji? or an external command in the departure input set Vi? has been received through the network. In the rst case the change in the discrete state is triggered by the continuous state. In the second case, let q be the system that issued the command. System q can send an output on the net only when its continuous state reaches one of the transition sets. So in this case, the change in the discrete state of the system p is triggered by the continuous state of the system q. That means that in general, the change in the discrete state of the composed system is triggered by its continuous state. This proves the fact that the system obtained by concatenating all the individual system from the network is of Witsenhausen type.
2 36
Example 3 Consider two extended Witsenhausen systems: x_i (t) = fi(qi ; xi); i = 1; 2 having two discrete states qi 2 f0; 1g with transition sets: J01(i) = fxjx ai g and
J10(i) = fxjx bi g; i = 1; 2 (the notation Jmn actually means that d(m; Jmn) = n). Take 1 = 2 = 0; 1, !1(m) = !2 (m) = m, and V1 = V2 = 0; 1. Suppose Vi = fV01 g = ff1gg (if the system was in state 0 and receives an input 1 then it will switch to state 1). The equivalent system for a network composed of these two systems is presented as:
M = f0; 1g f0; 1g = f(0; 0); (0; 1); (1; 0); (1; 1)g
= 1 2 = f(0; 0); (0; 1); (1; 0); (1; 1)g f = [f1 ; f2]T ! : M ! ; !(m) = m
J = fJ01(1) J01(2) ; J01(1) J10(2) ; J01(1) C (J0(2)? ); J01(1) C (J1(2)? ); J10(1) J01(2) ; J10(1) J10(2) ; J10(1) C (J0(2)? ); J10(1) C (J1(2)? ); C (J0(1)? )J01(2) ; C (J0(1)? )J10(2) ; C (J1(1)? )J01(2) ; C (J1(1)? ) J10(2) g Denote by J1 ; : : : ; J12 the elements of J , then: d((0; 0); J1) = d((0; 0); J2) = d((0; 0); J3) = (1; 1), d((1; 0); J4) = (0; 0), d((1; 0); J5) = d((1; 0); J6) = (1; 1), d((0; 1); J7) = (0; 0), d((0; 1); J8) = d((0; 1); J9) = (1; 1), d((1; 1); J10) = (1; 0), d((1; 1); J11) = (0; 1), and d((1; 1); J12) = (0; 0). This example illustrates the equivalence between a control network of two extended Witsenhausen systems and a Witsenhausen system.
37
Chapter 4 Applications 4.1 An Example of Hybrid Controller In this section we design a simple controller for stabilizing a pendulum. Consider a pendulum having the property that some of its parameters change when the angle passes some limits. For example if the pendulum hits an wall at a certain angle, the mass of the pendulum may change. For this example consider a system with two discrete states q 2 f0; 1g. For each discrete state the dierential equation is: (t) = ?ai sin((t)) ? bi_(t) + cTi(t), where Ti(t) is an external torque in state i. The system switches from discrete state 0 to discrete state 1 when 1 and from discrete state 1 to discrete state 0 when 2 . This system is a well-de ned Witsenhausen system. We want to stabilize this pendulum around an angle > 0. First we pass to the state space representation for each discrete state using the variables x1 = ? and x2 = x_1 :
x_ i1 = xi2 x_ i2 = ?ai sin(xi1 + ) ? b1 xi2 + ai sin() + cui(t) The torques are written in the form Ti (t) = ai sin()=c + ui(t). We can linearize each of these systems to get linear systems of the form:
x_ i = Aixi + Biui, 38
where Ai = [0; 1; ?ai cos(); ?bi] and Bi = [0; ci]t . In [20] it is proven that these linear systems are stabilizable and a state feedback controller is given by ui = [ki1 ; ki2]x where ki1 and ki2 must satisfy the relations:
ki1 < ai cos()=c; ki2 < bi =c. The proposition 6 implies that we can stabilize the initial system using the following law for the external torques (controls): Ti (t) = ai sin()=c + [ki1 ; ki2]x. In gure 4.1 a simulation of the pendulum without any control is presented. Notice that after a few switches (at time 1.96 and 5.87) the pendulum is going to x1 = ?, which corresponds to the lowest position ( = 0). In gure 4.2 a simulation of the pendulum with the controller is presented. Note that the pendulum stays in one discrete state (for small enough initial condition). This case corresponds to the proposition 4 since the equilibrium point is not on the boundary of any departure set. In gure 4.3 the equilibrium point was chosen on the boundary of one departure set = 1. The pendulum starting in the discrete state 0 will switch to discrete state 1 at time 2.43s (when x1 becomes 0), and will stay in discrete state 1. This corresponds to the proposition 5. In all the simulations the parameters were: a0 = 1; b0 = 0:01; a1 = 2; b1 = 1; c = 1; = =8; 1 = 0:5; 2 = ?0:2.
4.2 A Simple HVAC Application In this section we present a very simple temperature control problem to illustrate the extended Witsenhausen model and the equivalent model of a control network. In gure 4.4 we show a plan of a building with 9 rooms, 2 ventilation fans and 3 39
No control. The pendulum goes to the lowest position 1
0.5
x
2
x ,x
1 2
0
x
1
−0.5
−1
−1.5
0
5
10
15 t
20
25
30
Figure 4.1: Pendulum without controller. Initial condition (1; 0). The pendulum switches the discrete state at times 1.96 and 5.87.
The pendulum stabilized to δ. (x =0) 1
0.1
x1
0.08
0.06
x1,x2
0.04
0.02
0
−0.02
−0.04 x −0.06
0
2
5
10
15
t
Figure 4.2: Pendulum with the controller. Initial condition (0:1; 0). No switching of the discrete state occurs.
temperature sensors. We will consider that the sensors and the fans are connected by a network so that they can exchange information, and that there is no central controller involved. We want to model this system so that we can simulate its behavior for dierent control strategy for the fans. The fans can have only two states: on and o. We denote by m1 the state of the 40
The pendulum stabilized to δ. (x =0) 1
0.1
0.08
0.06 x
2
0.04
x1,x2
0.02
0
−0.02
−0.04 x
1
−0.06
−0.08
−0.1
0
5
10
15
t
Figure 4.3: Pendulum with the controller. Initial condition (?0:1; 0). There is a switching at time 2.43, and then the pendulum remains in a discrete state.
room 3
S3
F2 F = fan
room 2
S = temp. sensor
S2 room 1
F1
S1
Figure 4.4: Plan of a building. rst fan (m1 = 0 if the rst fan is o and m1 = 1 is the rst fan is on), and by m2 the state of the second fan. If a fan is on, the adjacent rooms are heated with a rate r, and the third room is heated with a rate r=2. We will assume very simple equations for the temperature in the rooms (u represents the temperature):
room 1: u01 = ?u1 + rm1 + 0:5rm2 room 2: u02 = ?u2 + rm1 + rm2 41
room 3: u03 = ?u3 + 0:5rm1 + rm2 The sensors will send a signal if the temperature in that room is above an upper limit Tmax or below a lower limit Tmin . We notice that we don't need to model the fans because their in uence is implicit in the temperature equations for the rooms. We will consider the following control strategy:
if the temperature in room 1 is above Tmax switch fan 1 o. if the temperature in room 1 is below Tmin switch fan 1 on. if the temperature in room 3 is above Tmax switch fan 2 o. if the temperature in room 3 is below Tmin switch fan 2 on. if the temperature in room 2 is above Tmax switch both the fans o. if the temperature in room 2 is below Tmin switch both the fans on. Each room can be modeled as an extended Witsenhausen model with four discrete states, each state corresponding to a possible combinations of states for the fans. The equations corresponding to room 1, for each discrete state are:
q1 = 0 : u01 = ?u1 (both fans are o) q1 = 1 : u01 = ?u1 + r ( rst fan on, the second o) q1 = 2 : u01 = ?u1 + 0:5r ( rst fan o, the second on) q1 = 3 : u01 = ?u1 + 1:5r (both fans on) The equations for the other two rooms are similar. Figure 4.5 presents the underlying nite state automaton for the rst room. Note that transitions can occur either if the temperature passes the limits, or if a discrete 42
v=3 1
2 u>Tmax o=0
u>Tmax o=0
v=2
v=1
v=1 v=0
v=0
v=3
u