Lecture 12: Event based Control HYCON EECI Graduate School on Control 2010 15 19 March 2010 Vijay Gupta University of Notre Dame U.S.A. Karl H. Johansson Royal Institute of Technology Sweden Lecture 12: Event based control Time and event triggered communication Architecture for event based control Optimal event detector Packet loss Packet acknowledgements PID control 1
Future wireless control architecture Local control loops closed over wireless multi hop network Potential for a dramatic change: From fixed dhierarchical h centralized system to flexible distributed d Move intelligence from dedicated computers to sensors/actuators Smart Actuator Smart Sensor Time and event triggered platforms Protocols for wireless sensor and control networks support both thtdma and CSMA/CA Time triggered periodically scheduled communication Periodic superframe of N slots Event triggered contention based communication TDMA = Time division multiple access, CSMA/CA = Carrier Sense Multiple Access with Collision Avoidance 2
Time triggered communication and control Leads to hybrid closed loop loop systems Schedules for each loop can represented as automata Feasible overall schedules computed as intersections of automata Alur, D Innocenzo, J, Pappas, Weiss, 2009 Event triggered communication and control Medium access control (MAC) of eventti triggered communication influence control Networked control design needs to integrate appropriate models of MAC MAC with CSMA/CA mechanism can be modeled as Markov chain Plant Wireless network 3
Tx CSMA/CA mechanism of a node CCA CCA Idle state Backoff stage 1 Backoff stage m Retransmission stage n Park, Di Marco, Soldati, Fischione, J, 2009 A transmitting node delays for a random number of backoff periods in [0, 2 m 0 1], where m 0 is the initial backoff exponent. If two consecutive clear channel assessments (CCA) are idle, the node starts the transmission and waits for an ACK If the channel is busy, the procedure is repeated increasing the backoff windows until a maximum backoff exponent m b. After a maximum number of backoffs m the packet is discarded. In case of collision the procedure is restarted and repeated until a retry limit n Markov chain model of CSMA/CA Tx CCA CCA Idle state Backoff stage 1 Backoff stage m Retransmission stage n Park, Di Marco, Soldati, Fischione, J, 2009 Markov state (s,c,r) s: backoff stage c: state of backoff counter r: state of retransmission counter Model characteristic parameter q 0 : traffic condition (q 0 =0 saturated) m 0, m, m b, n:mac parameters Computed characteristics α: busy channel probability during CCA1 β: busy channel probability during CCA2 P c : collision probability Validated in simulation and experiment 4
Lecture 12: Event based control Time and event triggered communication Architecture for event based control Optimal event detector Packet loss Packet acknowledgements PID control Architecture for event based control Actuator Plant Sensor Control Generator Event Detector Wireless network Åström, 2007, Rabi and J., WICON, 2008 5
When to transmit? Medium access control like mechanism at sensor E.g., threshold crossing Actuator Plant Sensor Control Generator Event Detector How to control? Wireless network Execute control law over fixed control alphabet E.g., piecewise constant controls, impulse control Rabi et al., 2008 Example: Fixed threshold with impulse control Event detector implemented as fixedlevel threshold at sensor Event based impulse control better than periodic impulse control Actuator u Control Generator Plant Wireless network Sensor Event Detector t y Åström & Bernhardsson, IFAC, 1999 6
Design of control generator and event detector 1. Impulse 1. Fixed threshold 2. Zero order hold 3. Higher order hold 2. Time varying 3. Adaptive Actuator Plant Sensor Control Generator Event Detector Wireless network Plant model and control cost Plant v is a Wiener process: Cost function Discussion later on how to treat general dynamics, sensor noise etc 7
Periodic impulse control Impulse applied at events Periodic reset of state every event. State grows linearly as between sample instances, because Average variance over sampling period is so the cost is Åström, 2007 Periodic ZoH control Traditional sampled data control theory gives that is minimized i i dfor the sampled ldsystem with derived from The minimum gives the cost Åström, 2007 8
Event based impulse control with fixed threshold Suppose an event is generated whenever generating impulse control One can show that the average time between two events is and that the pdf of is triangular: The cost is Åström, 2007 Pdf is the solution to the forward Kolmogorov forward equation (or Fokker Planck equation) 9
Comparison Åström, 2007 Lecture 12: Event based control Time and event triggered communication Architecture for event based control Optimal event detector Packet loss Packet acknowledgements PID control 10
Event based ZoH control with adaptive sampling Actuator Plant Sensor Control Generator Event Detector Wireless network Rabi et al., 2008 Controlled Brownian motion with one sampling event A joint optimal control and optimal stopping problem Rabi et al., 2008 11
Envelope defines optimal level detector Actuator Optimal level detector Dynamic level detector Plant Sensor Controller Level Detector Wireless network 12
Proof 13
14
Actuator Optimal level detector Dynamic level detector Plant Sensor Controller Level Detector Wireless network 15
For Policy iteration we have in general the cost function where and is the solution of the system with constant control Necessary condition for optimality suggests iterative search algorithm. Computationally intensive. Example: Non zero initial conditions 16
Multiple samples Extension to N>1 samples through nested single sample problems Extension to variable budget sampling, allowing number of samples to depend on x. Lecture 12: Event based control Time and event triggered communication Architecture for event based control Optimal event detector Packet loss Packet acknowledgements PID control 17
Multiple control loops Event based control often outperforms periodic control for single control loops [Åström & Bernhardsson, 1999] What if multiple loops share a contention based medium? What amount of packet losses can the event based scheme endure and still perform better than TDMA? Multiple control loops N control loops share the same wireless network Time division multiple access and contention based medium access TDMA and contention-based time slots Periodic superframe of N slots 18
System model and performance measures Plant Sampling events Impulse control Actuator Control Generator Plant Wireless network Sensor Event Detector Average sampling rate Average cost Periodic sampling of multiple loops Sampling events Slot length L gives Average sampling rate Average cost Periodic superframe of N slots 19
Level triggered control Ordered set of levels Multiple levels needed because we allow packet loss Lebesgue sampling Level triggered control For Brownian motion, equidistant sampling is optimal First exit time Average sampling rate Average cost 20
Comparison between periodic and event based control gives equal average sampling rate for periodic control and event based control Event based impulse control is 3 times better than periodic impulse control What about the influence of communication losses? When is event based sampling better and vice versa? Influence of communication losses Times when packets are successfully received Average rate of packet reception Define the times between successful packet receptions Average cost 21
IID losses Proposition If packet losses are IID, then equidistant Lebesque sampling gives Actuator Control Generator Plant Wireless network Sensor Event Detector Remark Event based control better than periodic control under IID losses if So if the loss probability then TDMA do better than event based sampling. Rabi and J., 2009 Losses depending on the other loops Suppose the loss processes across the different loops are independent, so that the sample streams of the other sensors only matterthrough through their average behaviour The likelihood that a sample generated in one loop faces at least one competing transmission is then 22
Losses depending on the other loops Average cost Trade off between control performance and network resources Scalability Lebesgue sampling better than TDMA sampling for 23
Lecture 12: Event based control Time and event triggered communication Architecture for event based control Optimal event detector Packet loss Packet acknowledgements PID control Sensor data ACK s Actuator Control Generator If controller perfectly acknowledges packets to sensor, event detector can adjust its sampling strategy Let where number of samples lost since last successfully transmitted packet Gives independent of Better performance than fixed Plant ACK Wireless network Sensor Event Detector for same sampling rate: 24
Proportion Integral Derivative control Actuator Plant Sensor Controller How extend PID control to event based control? Event detector for PID control Rabi and J., WICON, 2008 25
Control generator for PID control Control alphabet consists of three symbols, which are activated depending on the event Rabi and J., WICON, 2008 Example: Integral control Disturbance Communicate only when integral error triggers events 26
References K. J. Åström and B. Bernhardsson, Comparison of periodic and event based sampling for first order stochastic systems, IFAC World Congress, 1999. M. Rabi, Packet based Inference and Control, PhD thesis, University of Maryland, 2006 K. J. Åström, Event based control, In Analysis and Design of Nonlinear Control Systems: In Honor of Alberto Isidori. Springer Verlag. 2007. T. Henningsson, Event Based Control and Estimation with Stochastic Disturbances, Lic Thesis, Lund University, 2008. M. Rabi and K. H. Johansson, Event triggered strategies for industrial control over wireless networks, WICON, 2008. M. Rabi, K. H. Johansson, and M. Johansson, Optimal stopping for event triggered triggered sensing and actuation, IEEE CDC, 2008. M. Rabi and K. H. Johansson, Optimal stopping for updating controls, International Workshop on Sequential Methods, 2009. M. Rabi and K. H. Johansson, Scheduling packets for event triggered control, ECC, 2009. Summary Lecture 12: Event based Control Time and event triggered communication Architecture for event based control Optimal event detector Packet loss Packet acknowledgements PID control If it ain t broken, don t fix it [Åström] 27