Example of Multiparametric Solution Multiparametric LP ( ø R) 6 CR{,4} CR{,,3} Explicit Form of Model Predictive Control 4 CR{,3} CR{,3} x - -4-6 -6-4 - 4 6 x via Multiparametric Programming Finite-Time Constrained LQR x(t +)=Ax(t) +B u(t) y(t) =Cx(t) +D u(t) Linear Model min J(U, x()), P Tà U ky(k)k + ku(k)k k= Q R Quadratic Performance Index min U J(U, x()) = U HU + x ()FU + x ()Yx() Multiparametric Quadratic Programming min U HU + x FU + x Yx U U,{u(),u(),...,u(N à )} subj.to GU ô W + Kx U R d x X ò R n Objective: solve the QP for all x Coordinate transformation: z,u + H à F x (Bemporad et al., Automatica, in press) subject to GU ô W + Kx() U,{u(),u(),...,u(T à )} subject to u min ô u(k) ô u max y min ô y(k) ô y max Constraints (convex) QUADRATIC PROGRAM (QP) We want to show that: The optimal solution u(k) =f k (x(k)) can be determined in closed form and is continuous and piecewise affine. min z Hz z subj.to Gz ô W + Sx S, (K + GH à F ) z = optimization variables, x = parameters z R d 4
From () : Linearity of Solution x X solve QP to find (z, ) KKT optimality conditions: From () : identify active constraints form matrices Gà,Wà,Sà by collecting active constraints Gà z à Wà à S àx =, à Hz + G =, R q i (G i z à W i à S i x)= i, i =,...,q z = à H à Gà à à (x) =à (Gà H à Gà ) à (Wà + Sà x) z(x) =H à Gà (Gà H à Gà ) à (Wà + Sà x) min z Hz z subj.to Gz ô W + Sx Hz + Gà à = Gà z à Wà à S àx = In some neighborhood of x, λ and z are explicit linear functions of x () () Substitute Determining a Critical Region into the constraints à (x) =à (Gà H à Gà ) à (Wà + Sà x) Remove redundant constraints à (x) Gàz(x) ô Wà + Sàx critical region CR and CR = {Ax ôb} CR x-space z(x) =H à Gà (Gà H à Gà ) à (Wà + Sàx) CR is the set of all and only parameters x for which Gà,Wà,Sà is the optimal combination of active constraints at the optimizer x X Multiparametric QP Multiparametric QP R R x CR R 3 CR = {Ax ôb} R i = {x X : A i x>b i, A j z ôb j, j<i} x x x x-space R N R 4 X Theorem: {CR,R,...,R N} is a partition of X ò R n Proceed iteratively: for each region repeat the whole procedure with R i X R i CR CR CR x The active set of a neighboring region is found by using the active set of the current region + knowledge of the type of hyperplane we are crossing: x x Alternative: New mpqp Algorithm, based on exploring neighboring regions (much more efficient!!!) (Tondel,Johansen,Bemporad, CDC) Gz W + Sx ~ λ The corresponding constraint is added to the active set The corresponding constraint is withdrawn from the active set (Tøndel, Johansen, Bemporad, CDC ) 5
Convexity and Continuity Union of Regions.5.5 CR CR CR3 CR4 CR5 CR6 CR7 CR8 CR9.5.5 CR CR CR3 CR4 CR5 CR6 CR7 z(x) = arg min z Hz z subj.to Gz ô W + Sx continuous, piecewise affine (Bemporad et al., Automatica, in press).5 -.5 - -.5 -.5 -.5 - -.5 - V(x) = min z Hz z subj.to Gz ô W + Sx convex, continuous, piecewise quadratic -.5 -.5 - -.5 - -.5.5.5.5 U (x ()), [u (x ()),...,u Tà (x ())] -.5 -.5 - -.5 - -.5.5.5.5 Corollary: The optimal solution piecewise affine in x() u() = f(x()) is continuous and Regions where the first component of the solution is the same can be joined (when their union is convex). (Bemporad, Fukuda, Torrisi, Computational Geometry, ) Corollary: By using Bellman s principle of optimality, the optimal solution u(k) =f k (x(k)) is also a continuous and PWA feedback law t t+ Receding Horizon Control r(t) (Model Predictive Control) Predicted outputs Manipulated Inputs u(t+k) t+p At each time t, only apply the first optimal move of the finite horizon optimal control problem u(t) =f (x(t)) System: Constraints: Double Integrator Example y(t) = s ô u(t) x(t +)= ô x(t) + à ô u(t) ô Control objective: minimize sampling + ZOH T= s y(t) = [ ] x(t) P y (t)y(t) + u (t) t= u(t) u t+k = K LQ x(t + k t) k N u t+ t+ t+p+ Corollary: The MPC controller u(t) =f (x(t)) is a continuous and piecewise affine state-feedback Optimization problem: for N u = ô ô H =.93 5.47 F = 4.685.8 5.47 4.336.93 5.47 G = à W = K = à 6
mp-qp solution N u = Complexity N u =3 N u =4 N u =5 N u =6 CPU time 4 5 5 Explicit Controller Original MPC controller! (piecewise affine law) (implicit law: need to solve QP on line) # Regions 3 5 5 # free moves Tracking of reference r(t) : Extensions îu(t) =F(x(t),u(t à ),r(t)) Task: MPC Regulation of a Ball on a Plate Rejection of measured disturbance v(t) : Soft constraints: y min à ï ô y(t + k t) ô y max + ï Variable constraints: u min(t) ô u(t + k) ô u max(t) y min(t) ô y(t + k t) ô y max(t) îu(t) =F(x(t),u(t à ),v(t)) u(t) =F(x(t)) u(t) =F(x(t),u min(t),...,y max(t)) Tune an MPC controller by simulation, using the MPC Simulink Toolbox Get the explicit solution of the MPC controller. Validate the controller on experiments. Linear norms: min J(U, x(t)), P p U kqy(t + k t)k k= + kru(t + k)k (Bemporad, Borrelli, Morari, ) 7
Host TCP/IP Target B&P Experimental Setup Code Data u, u α,β x, y Ball & Plate System Ball & Plate Ball&Plate Experiment α β Specification of Experiment: Angle: -7 +7 Plate: -3 cm +3 cm Input Voltage: - V + V Computer: PENTIUM66 Sampling Time:3 ms Model: LTI 4 states Constraints on inputs and states Controller x: Regions, y: 3 Regions y δ α' γ β' x 5th June General Philosophy: () MPC Design Step : Tune the MPC controller (in simulation) General Philosophy: () Implementation Step : Solve mp-qp and implement Explicit MPC E.g: MPC Toolbox for Matlab (Bemporad, Morari, Ricker, ) E.g: Real-Time Workshop + xpc Toolbox 8
Explicit MPC Solution Controller: x: Regions, y: 3 Regions o x-mpc: sections at α x =, α x =, u x =, r x =8, r α = MPC Regulation of a Ball on a Plate Design Steps: 6 6 6 6 Tune an MPC controller by simulation, using the MPC Simulink Toolbox. Get the explicit solution of the MPC controller. Region : Region 6: LQR Controller (near Equilibrium) Saturation at - Validate the controller on experiments. Region 6: Saturation at + 5th June Comments on Explicit MPC Multiparametric Quadratic Programs (mp-qp) can be solved efficiently Model Predictive Control (MPC) can be solved off-line via mp-qp Explicit solution of MPC controller u = f(x) is Piecewise Affine Introduce slack variables: MILP Formulation of MPC min X Tà kqy(t + k + t)k + kru(t + k)k k= s.t.mld dynamics min x min ï s.t. ï x ï àx ï x k ï u k kqy(t + k t)k kru(t + k)k ï x k [Qy(t + k t)] i i =,...,p, k =,...,Tà ï x k à [Qy(t + k t)] i i =,...,p, k =,...,Tà ï u k [Ru(t + k))] i i =,...,m, k =,...,Tà ï u k à [Ru(t + k))] i i =,...,m, k =,...,Tà Eliminate heavy on-line computation for MPC Make MPC suitable for fast/small/cheap processes Set ø, [ï x,...,ïx N y, ï u,...,ï Tà, U,î,z] Mixed Integer Linear Program (MILP) Tà ï x i min J(ø, x(t)) = X ø k = s.t.gø ô W + Sx(t) + ï u i 9
Multiparametric MILP min f ø c + d ø d ø={ øc,ø d } s.t. Gø c + Eø d ô W + Fx ø c R n ø d {, } m mp-milp can be solved (by alternating MILPs and mp-lps) (Dua, Pistikopoulos, 999) Theorem: The multiparametric solution ø ã (x is ) piecewise affine Corollary: The MPC controller is piecewise affine in x Hybrid Control Examples (Revisited) Remarks on explicit MPC law: Automatic partitioning of state-space (no gridding!) Stability guarantee (value function=pwl Lyapunov function) Hybrid MPC - Example Hybrid MPC - Example Switching System: " # ô cos ë(t) à sin ë(t) x(t +)=.8 x(t) + u(t) sin ë(t) cos ë(t) y(t) = [ ] x(t) ù if [ ]x(t) ë(t) = 3 ù à if [ ]x(t) < 3 Closed loop: y(t), r(t) u(t) MLD system mp-milp optimization problem minn oj(v,x(t)), P kq(v(k) à k= ue)k + kq(î(k t) à îe)k + kq3(z(k t) à ze)k + kq4(x(k t) à xe)k v State x(t) variables Input u(t) variables Aux. binary vector δ(t) variables Aux. continuous vector z(t) 4 variables Constraint: à ô u (t) ô Open loop: time t time t subject to constraints to be solved in the region à 5 ô x ô 5 à 5 ô x ô 5 Computational complexity of mp-milp Linear constraints Continuous variables Binary variables Parameters Time to solve mp-milp Number of regions 84 3 min 7
mp-milp Solution mp-milp Solution Prediction Horizon T= X X PWA law ñ MPC law Linear constraints Continuous variables Binary variables Parameters Time to solve mp-milp Number of regions 84 3 min 7 X Prediction Horizon T=3 Prediction Horizon T=4 X Hybrid Control - An Example (Hedlund and Rantzer, CDC999) Alternate Heating of Two Furnaces (Bemporad, Borrelli, Morari, ) Objective: Control the temperature to a given set-point T, T mp-milp optimization problem min { u(t),u(t+),u(t+) } Pk= kr(u(t + k +)à u(t + k))k + kq(x(t + k t) à x e )k ô Tç Tç ô ô Bi = ô ô ô = à T à T if first furnace heated if second furnace heated if no heating + B i u Constraints: Only three operation modes: - Heat only the first furnace - Heat only the second furnace 3- Do not heat any furnaces Amount of heating power is constant u Parameter set à ô x ô à ô x ô ô u ô parameterized! Computational complexity of mp-milp Linear constraints Continuous variables Binary variables Parameters Time to solve mp-milp Number of regions 68 33 6 3 5 min 5
u =.4 mp-milp Solution u =.8 No Heat No Heat T Heat T Heat T Heat T Heat Hybrid Control Example: Traction Control System X X X Set point cannot be reached Set point is reached X NOTE: The control action of explicit and of implicit MPC are totally equal! Vehicle Traction Control Improve driver's ability to control a vehicle under adverse external conditions (wet or icy roads) Simple Traction Model Mechanical system ò ó ü t ωç e = ü c à b e ω e à Je gr ü t vç v = mv r t Manifold/fueling dynamics ü c = b i ü d(t à ü f) Model nonlinear, uncertain, constraints Controller suitable for real-time implementation MLD hybrid framework + optimization-based control strategy ω Tire torque τ t is a function of slip ω and road surface adhesion µ ω e v v ω = à gr rt Wheel slip
TIRE FORCE CHARACTERISTICS Hybrid Model Torque Nonlinear tire torque τ t =f( ω, µ) Maximum Braking Lateral Force Tire Forces Maximum Cornering Slip Target Zone Longitudinal Force Maximum Acceleration Steer Angle Tire Slip Longitudinal Force Lateral Force Torque µ Slip µ Slip PWA Approximation (PWL Toolbox, Julian, 999) (Ferrari et al., HSCC ) HYSDEL (Hybrid Systems Description Language) Mixed-Logical Dynamical (MLD) Hybrid Model (discrete time) MLD Model x(t +)=Ax(t) +B u(t) + B î(t) +B 3 z(t) y(t) =Cx(t) +D u(t) + D î(t) +D 3 z(t) E î(t) +E 3 z(t) ô E 4 x(t) +E u(t) +E 5 Control objective: Performance and Constraints min P N ω(k t) à ω k= des subj. to. MLD Dynamics State x(t) 9 variables Input u (t) variable Aux. Binary Var. d(t) 3 variables Aux. Continuous variables z(t) 4 variables Constraints: Limits on the engine torque: Logic Constraint: Hysteresis à Nm ô ü d ô 76Nm The MLD matrices are automatically generated in Matlab format by HYSDEL 3
Simulation - Control Scheme EXPERIMENTAL APPARATUS Traction Control System mur real mu mu we we Nonlinear Model Real mu Td vv Traction System we vv vv Zero-Order Simple "while" loop Hold MATLAB Function Clock Td Td Observer + Online Controller Slip Desired mue Estimated mu EXPERIMENTAL APPARATUS Experiment >5 regions ms sampling time Pentium 66Mhz + Labview 4
EXPERIMENTAL RESULTS EXPERIMENTAL RESULTS EXPERIMENTAL RESULTS Comments from Ford: Performance of the MPC controller is quite good given the limited development time, oversimplified plant model used, and minimal development iterations. The MPC controller requires much less supervision by logical constructs than controllers developed with traditional techniques. Further testing in real-world environments is needed for a complete comparison with traditional controllers. 5