**Tutorial on Logic-based Control**Switched Supervisory Control João P. Hespanha University of Californiaat Santa Barbara**Summary**• Supervisory control overview • Estimator-based linear supervisory control • Estimator-based nonlinear supervisory control • Examples**Supervisory control**Motivation: in the control of complex and highly uncertain systems, traditional methodologies based on a single controller do not provide satisfactory performance. supervisor exogenous disturbance/ noise s switching signal measured output w controller 1 s y bank of candidate controllers process u controller n control signal • Key ideas: • Build a bank of alternative controllers • Switch among them online based on measurements For simplicity we assume a stabilization problem, otherwise controllers should have a reference input r**Supervisory control**Motivation: in the control of complex and highly uncertain systems, traditional methodologies based on a single controller do not provide satisfactory performance. supervisor exogenous disturbance/ noise s switching signal measured output w controller 1 s y bank of candidate controllers process u controller n control signal • Supervisor: • places in the feedback loop the controller that seems more promising based on the available measurements • typicallylogic-based/hybrid system**Multi-controller**s switching signal controller 1 s bank of candidate controllers y u measured output control signal controller n Conceptual diagram: not efficient for many controllers & not possible for unstable controllers**Multi-controller**s switching signal controller 1 s bank of candidate controllers y u measured output control signal controller n Given a family of (n-dimensional) candidate controllers s switching signal y u measured output control signal**Multi-controller**switching times s(t) switching signal s = 1 s = 1 s = 3 s = 2 t Given a family of (n-dimensional) candidate controllers s switching signal y u measured output control signal**Supervisor**y measured output supervisor u control signal s switching signal y u Typically an hybrid system: ´ continuous state d´ discrete state continuous vector field discrete transition function output function**Types of supervision**Pre-routed supervision Performance-based supervision (direct) s = 2 • keep controller while observed performance is acceptable • when performance of current controller becomes unacceptable, switch to controller that leads to best expected performance based on available data s = 1 s = 3 • try one controllers after another in a pre-defined sequence • stop when the performance seems acceptable Estimator-based supervision (indirect) • estimate process model from observed data • select controller based on current estimate – Certainty Equivalence not effective when the number of controllers is large**Summary**• Supervisory control overview • Estimator-based linear supervisory control • Estimator-based nonlinear supervisory control • Examples**Estimator-based supervision’s setup: Example #1**process control signal u y measured output Process is assumed to be unknown parameters p*=(a*, b*) 2P [–1,1] £ {–1,1} we consider three candidate controllers: controller C1: u = 0 to be used when a*· –.1 controller C2: u = 1.1y to be used when a* > –.1 & b* = –1 controller C3: u = – 1.1y to be used when a* > –.1 & b* = +1 process parameter p* is equal to p(a,b) 2P use controller Cq with controller selection function**Estimator-based supervision’s setup**w exogenous disturbance/noise control signal process u y measured output unmodeled dynamics Process is assumed to be in a family Mp´ small family of systems around a “nominal” process model Np parametric uncertainty for each process in a family Mp, at least one candidate controller Cq, q2Q provides adequate performance. controller selection function controller Cq with q =c(p)provides adequate performance process in Mp, p2P**Estimator-based supervisor: Example #1**y measured output – y multi-estimator + – u control signal + Process is assumed to be unknown parameters p*=(a*, b*) 2P [–1,1] £ {–1,1} Multi-estimator 8p=(a, b) 2P [–1,1] £ {–1,1} yp´estimate of the output y that would be correct if the parameter was p=(a,b) ep´output estimation error that would be small if the parameter was p=(a,b) consider the yp corresponding to p = p* Since P has infinitely many elements, this multi-estimator would have to be infinite dimensional !? (not a very good multi-estimator)**Estimator-based supervisor: Example #1**y measured output – y switching signal decisionlogic multi-estimator + s – u control signal + Process is assumed to be unknown parameters p*=(a*, b*) 2P [–1,1] £ {–1,1} Multi-estimator 8p=(a, b) 2P [–1,1] £ {–1,1} yp´estimate of the output y that would be correct if the parameter was p=(a,b) ep´output estimation error that would be small if the parameter was p=(a,b) Decision logic: processlikely in Mp should useCq, q = c(p) epsmall set s = c(p) Certainty equivalence inspired**Estimator-based supervisor**y measured output – y switching signal decisionlogic multi-estimator + s – u control signal + Process is assumed to be in family process inMp,p2P controller Cq, q =c(p)provides adequate performance Multi-estimator yp´estimate of the process output y that would be correct if the process was Np ep´output estimation error that would be small if the process was Np Decision logic: processlikely in Mp should useCq, q = c(p) epsmall set s = c(p) Certainty equivalence inspired**Estimator-based supervisor**y measured output – y switching signal decisionlogic multi-estimator + s – u control signal + A stability argument cannot be based on this because typically process in Mp)ep small but not the converse Process is assumed to be in family process inMp, p2P controller Cq,q =c(p)provides adequate performance Multi-estimator yp´estimate of the process output y that would be correct if the process was Np ep´output estimation error that would be small if the process was Np Decision logic: processlikely in Mp should useCq, q = c(p) epsmall set s = c(p) Certainty equivalence inspired**Estimator-based supervisor**y measured output – y switching signal decisionlogic multi-estimator + s – u control signal + Process is assumed to be in family process inMp, p2P controller Cq,q =c(p)provides adequate performance Multi-estimator yp´estimate of the process output y that would be correct if the process was Np ep´output estimation error that would be small if the process was Np detectable means “small ep) small state” Decision logic: overall system is detectable through ep sets = c(p) overall state is small epsmall Certainty equivalence inspired, but formally justified by detectability**Performance-based supervision**measured output y switching signal decisionlogic performancemonitor s u control signal Candidate controllers: Performance monitor: pq´measure of the expected performance of controller Cq inferred from past data Decision logic: psis acceptable keep current controller ps is unacceptable switch to controller Cq corresponding to bestpq**Abstract supervision**Estimator and performance-based architectures share the same common architecture multi-est. or perf. monitor decision logic switching signal w s multi- controller u process y measured output control signal In this talk we will focus mostly on an estimator-based supervisor…**Abstract supervision**Estimator and performance-based architectures share the same common architecture multi-estimator decision logic switching signal w s multi- controller u process y measured output control signal switched system**The four basic properties (1-2) : Example #1**Multi-estimator is Process is Matching property: At least one of the ep is “small” Why? decision logic ep* is“small” essentially a requirement on the multi-estimator switching signal detectable means “small ep) small state” s Detectability property: For each p2P, the switched system is detectable through ep when s = c(p) index of controller that stabilizes processes in Mp**Detectability**a system is detectable if for every pair eigenvalue/eigenvector (li,vi) of A <[li] ¸ 0 )C vi¹ 0 for short: pair (A,C) is detectable From solution to linear ODEs… ¹ 0 (assuming Adiagonalizable, otherwise terms in tk eli t appear) y(t) bounded )ai C vi = 0 (for <[li] ¸ 0) )ai = 0 (for <[li] ¸ 0) )y(t) bounded Lemma: For any detectable system: y(t) bounded )x(t) bounded & y(t) ! 0)x(t) ! 0**Detectability**system is detectable if for every pair eigenvalue/eigenvector (li,vi) of A <[li] ¸ 0 )C vi¹ 0 Lemma: For any detectable system: y(t) bounded )x(t) bounded & y(t) ! 0)x(t) ! 0 Lemma: For any detectable system, there exists a matrix K such that is asymptotically stable (all eigenvalues of A – KC with negative real part) Can re-write system as (output injection) asympt. stable confirms that: y is bounded /!0 ) x is bounded /!0**The four basic properties (1-2) : Example #1**detectable means “small ep) small state” Detectability property: For each p2P, the switched system is detectable through ep when s = c(p) index of controller that stabilizes processes in Mp Why? consider, e.g., p=(a,b)= (.5,1) )use controller C3: u=– 1.1y (3 = s = c(p)) .5 – 1.1 = –.6 < 0 Thus, ep small ) yp small )y = yp– ep small )u small etc. • Questions: • Where we just lucky in getting –.6 < 0 ? NO (why?) • Does detectability hold if u=– 1.1y does not stabilize the process (e.g., a* = .5, b*=-1)? YES (why?)**The four basic properties (1-2)**process in Matching property: At least one of the ep is “small” Why? decision logic 9p*2P: processin Mp* ep* is“small” essentially a requirement on the multi-estimator switching signal s Detectability property: For each p2P, the switched system is detectable through ep when s = c(p) index of controller that stabilizes processes in Mp essentially a requirement on the candidate controllers This property justifies using the candidate controller that corresponds to a small estimation error. Why? Certainty equivalence stabilization theorem…**The four basic properties (3-4)**Small error property: There is a parameter “estimate” r : [0,1) !P for which er is “small” compared to any fixed ep and that is consistent with s, i.e., s = c(r) r(t) can be viewed as current parameter “estimate” decision logic controller consistent with parameter “estimate” switching signal s Non-destabilization property: Detectability is preserved for the time-varying switched system (not just for constant s) Typically requires some form of “slow switching” Both are essentially (conflicting) properties of the decision logic**Decision logic**• For boundedness one wants er small for some parameter estimate r consistent with s (i.e., s = c (r)) decision logic “small error” • To recover the “static” detectability of the time-varying switched system one wants slow switching. “non-destabilization” switching signal s • These are conflicting requirements: • r should follow smallest ep • s = c(r) should not vary**Dwell-time switching**monitoring signals start p2P measure of the size of ep over a “window” of length 1/l forgetting factor wait tD seconds Non-destabilizing property:The minimum interval between consecutive discontinuities of s is tD> 0. (by construction)**Small error property**(e.g., L2 noise and no unmodeled dynamics) Assume P finite and 9p*2P : when we select r = p at time t we must have • Two possible cases: • Switching will stop in finite time T at some p2P: < 1 ·C***Small error property**(e.g., L2 noise and no unmodeled dynamics) Assume P finite and 9p*2P : when we select r = p at time t we must have • Two possible cases: • After some finite time T switching will occur only among elements of a subset P* of P, each appearing in r infinitely many times: < 1 ·C***Small error property**(e.g., L2 noise and no unmodeled dynamics) Assume P finite and 9p*2P : when we select r = p at time t we must have Small error property: (L2case)Assume thatPis a finite set. If 9p*2P for which then at least one error L2 “switched” error will be L2**Implementation issues**monitoring signals start How to efficiently compute a large number of monitoring signals? Example #1: Multi-estimator input is linear comb. ofy andu wait tD seconds ß by linearity ß state-sharing we can generate as many errors as we want with a 2-dim. systems**Implementation issues**monitoring signals start How to efficiently compute a large number of monitoring signals? Example #1: Multi-estimator state-sharing wait tD seconds ß 1. we can generate as many monitoring signals as we want with a (2+6)-dim. system 2. finding r is really an optimization**Implementation issues**monitoring signals start When P is a continuum (or very large), it may be issues with respect to the optimization for r. Things are easy, e.g., 1. P has a small number of elements 2. model is linearly parameterized on p (leads to quadratic optimization) 3. there are closed form solutions (e.g., mp polynomial on p) 4. mp is convex on p wait tD seconds usual requirement in adaptive control results still hold if there exists a computational delay tC in performing the optimization, i.e.**The four basic properties**r(t) can be viewed as current parameter “estimate” Small error property: There is a parameter “estimate” r : [0,1) !P for which er is “small” compared to any fixed ep and that is consistent with s, i.e., s = c(r) decision logic controller consistent with parameter “estimate” Non-destabilization property: Detectability is preserved for the time-varying switched system (not just for constant s) switching signal s Matching property: At least one of the ep is “small” Detectability property: For each p2P, the switched system is detectable through ep when s = c(p) index of controller that stabilizes processes in Mp**Analysis outline(linear case, w = 0)**1st by the Matching property: 9p*2Psuch that ep* is “small” 2nd by the Small error property: 9r such that s = c(r) and er is “small”(when compared with ep*) 3rd by the Detectability property: there exist matrices Kp such that the matrices Aq– Kp Cp, q = c(p) are asymptotically stable 4th the switched system can be written as decision logic switching signal s injected system asymptotically stable by non-destabilization property “small” by 2nd step )x is small (and converges to zero if, e.g., er2L2)**Example #2: One-link flexible manipulator**mass at the tip x mt y(x, t) deviation with respect to rigid body q torque applied at the base IH T axis’s inertia (.023) PDE (small bending): Boundary conditions: beam’s length(113 cm) transversalslice’s inertia beam’s elasticity beam’smass density(.68Kg total mass)**Example #2: One-link flexible manipulator**mass at the tip x mt y(x, t) deviation with respect to rigid body q torque applied at the base IH T axis’s inertia (.023) Series expansion and truncation: eigenfunctions of the beam**Example #2: One-link flexible manipulator**mass at the tip x mt y(x, t) q torque applied at the base Assumed not known a priori: mt2 [0, .1Kg] xsg2 [40cm, 60cm] IH T axis’s inertia (.023) Control measurements: ´ base angle ´ base angular velocity ´ tip position ´ bending at position xsg(measured by a strain gauge attached to the beam at position xsg)**Example #2: One-link flexible manipulator**u torque transfer functions as mtranges over [0, .1Kg] and xsgranges over [40cm, 60cm]**Example #2: One-link flexible manipulator**u torque Class of admissible processes: Mp´ family around a nominal transfer function corresponding to parameters p (mt, xsg) parameter set: grid of 18 points in [0, .1]£[40, 60] unknown parameter p (mt, xsg) For this problem it is not possible to write the coefficients of the nominal transfer functions as a function of the parameters because these coefficients are the solutions to transcendental equations that must be computed numerically. Family of candidate controllers: 18 controllers designed using LQR/LQE, one for each nominal model**Example #2: One-link flexible manipulator**0.7 0.6 3 0.5 0.4 mt 2 0.3 xsg 0.2 0.1 1 0 0 5 10 15 20 25 t 0 s -1 18 16 -2 tip position 14 torque 12 10 set point 8 -3 0 5 10 15 20 25 6 t 4 2 0 0 5 10 15 20 25 30 t**Example #2: One-link flexible manipulator**(open-loop)**Example #2: One-link flexible manipulator**(closed-loop with fixed controller)**Example #2: One-link flexible manipulator**(closed-loop with supervisory control)**Example #3: Uncertain gain**+ - C 1 ·k < 4 The maximum gain margin achievable by a single linear time-invariant controller is 4 Doyle, Francis, Tannenbaum, Feedback Control Theory, 1992**Example #3: Uncertain gain**+ - multi- controller 1 ·k < 40**Example #3: Uncertain gain**output reference true parameter value monitoring signals**Example #3: 2-dim SISO linear process**–1 +1 Class of admissible processes: nominal transfer function nonlinear parameterized on p Any re-parameterization that makes the coefficients of the transfer function lie in a convex set will introduce an unstable zero-pole cancellation unstable zero-pole cancellations But the multi-estimator is still separable and state-sharing can be used …**Example #3: 2-dim SISO linear process**output reference true parameter value (without noise)