59
1 Optimization-based Control of Hybrid Dynamical Systems Lisbon, September 11, 2006 Alberto Bemporad COHES Group Control and Optimization of Hybrid and Embedded Systems http://www.dii.unisi.it/~bemporad University of Siena (founded in 1240) Department of Information Engineering

Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

1

Optimization-based Control of Hybrid Dynamical Systems

Lisbon, September 11, 2006

Alberto Bemporad

COHES GroupControl and Optimization of Hybrid and Embedded Systems

http://www.dii.unisi.it/~bemporad

University of Siena(founded in 1240)

Department of

Information Engineering

Page 2: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

Contents

• Models of hybrid systems

• Model predictive control of hybrid systems

• Explicit reformulation

• Automotive applications

Page 3: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

3

Hybrid systems

Hybrid Systems

Computer

Science

ControlTheory

Finite

state

machines

Continuous dynamical systems

systemu(t) y(t)

AB

C

C

A

B

B

C

Page 4: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

4

Hybrid Systems

Computer

Science

ControlTheory

Page 5: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

5

continuous dynamical system

discrete inputs

Embedded Systems

symbolssymbols

continuous states

continuous inputs

automaton / logic

interface

• Consumer electronics

• Home appliances

• Oce automation

• Automobiles

• Industrial plants

• ...

Page 6: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

6

Motivation: “Intrinsically Hybrid”

• Transmission

Discrete command

(R,N,1,2,3,4,5)

• Four-stroke engines

Automaton,

dependent on

power train motion

Continuous

dynamical variables

(velocities, torques)+

Page 7: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

Key Requirements for Hybrid Models

• Descriptive enough to capture the behavior of the system

– continuous dynamics (physical laws)

– logic components (switches, automata, software code)

– interconnection between logic and dynamics

• Simple enough for solving analysis and synthesis problems

“Make everything as simple as possible, but not simpler.”! — Albert Einstein

linear hybrid systems

Page 8: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

8

Piecewise Ane Systems

Can approximate nonlinear and/or discontinuous dynamics arbitrarily well

(Sontag 1981)

state+input space

Page 9: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

9

Discrete Hybrid Automaton(Torrisi, Bemporad, 2004)

Event Generator

Finite State Machine

Mode Selector

Switched Ane System

1

2

s

mode

time orevent counter

continuous

discrete

Page 10: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

10

Switched Ane System

The ane dynamics depend on the current mode i(k):

continuous

discrete

Page 11: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

11

Event Generator

Event variables are generated by linear threshold conditions over continuous states, continuous inputs, and time:

Example: ["(k)=1] ! [xc(k)"0]

continuous

discrete

Page 12: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

12

Finite State Machine

The binary state of the nite state machine evolves according to a Boolean state update function:

Example:

continuous

discrete

Page 13: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

13

The active mode i(k) is selected by a Boolean function of the current binary states, binary inputs, and event variables:

Mode Selector

Example: 0

1

0 1

the system has 3 modes

continuous

discrete

The mode selector can be seen as the output function of the discrete dynamics

Page 14: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

14

(Glover 1975, Williams 1977,Hooker 2000)

Logic and Inequalities

Finite State Machine

Mode Selector

Switched Ane System

1

2

s

Event Generator

Page 15: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

15

Mixed Logical Dynamical Systems

(Bemporad, Morari 1999)Mixed Logical Dynamical (MLD) Systems

HYSDEL(Torrisi, Bemporad, 2004)

Discrete Hybrid Automaton

• Computationally oriented (mixed-integer programming)

• Suitable for controller synthesis, verication, ...

Continuous and binary variables

Page 16: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

16

Hybrid Toolbox for MatlabFeatures:

• Hybrid model (MLD and PWA) design, simulation, verication

• Control design for linear systems w/ constraints and hybrid systems (on-line optimization via QP/MILP/MIQP)

• Explicit control (via multiparametric programming)

• C-code generation

• Simulink

(Bemporad, 2003-2006)

Support:

http://www.dii.unisi.it/hybrid/toolbox

Page 17: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

17

Mixed-Integer Models in OR

Translation of logical relations into linear inequalities is heavilyused in operations research (OR) for solving complex decision problems by using mixed-integer (linear) programming (MIP)

Example: Timetable generation (for demanding professors …)

CPU time: 0.2 s

Example: Optimal multi-period investments formaintenance and upgrade of electrical energy distribution networks

(Bemporad, Muñoz, Piazzesi, 2006)

Page 18: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

18

Major Advantages of Linear Hybrid Models

Many problems of analysis:

– Stability

– Safety / Reachability

– Observability

– Passivity

Many problems of synthesis:

– Controller design

– Robust control design

– Filter design (state estimation/fault detection)

(However, all these problems are NP-hard !)

(Johansson, Rantzer, 1998)

(Torrisi, Bemporad, 2001)

(Bemporad, Ferrari-Trecate, Morari, 2000)

(Bemporad, Bianchini, Brogi, 2006)

(Pina, Botto, 2006)

(Bemporad, Mignone, Morari, 1999)

(Bemporad, Morari, 1999)

(Ferrari-Trecate, Mignone, Morari, 2002)

can be solved through mathematical programming

(Silva, Bemporad, Botto, Sá da Costa, 2003)

Page 19: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

Contents

! Models of hybrid systems

• Model predictive control of hybrid systems

• Explicit reformulation

• Automotive applications

Page 20: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

20

Hybrid Control Problem

binary inputs

continuous inputs

binary states

continuous states

on-line decision maker

desired behavior

constraints

hybrid process

Page 21: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

21

• Apply only u(t)=u*(t) (discard the remaining optimal inputs)

• At time t solve with respect to the nite-horizon open-loop, optimal control problem:

MPC for Hybrid Systems

Predictedoutputs

Manipulated

y(t+k|t)

Inputs

t t+1 t+T

futurepast

u(t+k)

• Repeat the whole optimization at time t+1

ModelPredictive (MPC)Control

Page 22: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

22

Closed-Loop Convergence

Proof: Easily follows from standard Lyapunov arguments

(Bemporad, Morari 1999)

More stability results: see (Lazar, Heemels, Weiland, Bemporad, 2006)

Page 23: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

23

Open loop behavior

PWA system:

Hybrid MPC - Example

Constraint:

/demos/hybrid/bm99sim.m

Page 24: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

24

Hybrid MPC - Example

Closed loop:

Performance index:

Page 25: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

25

Hybrid MPC - Extensions

1

2

3

e, p12e

e, p13e¬e(Bemporad, Di Cairano, HSCC’05)

Stochastic Finite State Machine (sFSM)

Discrete-time Hybrid Stochastic Automaton (DHSA)

Event-based Continuous-time Hybrid Automaton (icHA)

Switched integral dynamics

(Bemporad, Di Cairano, Julvez, CDC05 &HSCC-06)

k = event counterAsynchronous FSM

k = discrete-time counter

All MPC techniques described earlier can be applied !

Page 26: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

26

Optimal Control of Hybrid Systems: Computational Aspects

Page 27: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

27

MPC for Linear Systems

This is a (convex) Quadratic Program (QP)

Quadratic performance index

Constraints

Linear model

Page 28: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

28

Mixed Integer Quadratic Program (MIQP)

MIQP Formulation of MPC(Bemporad, Morari, 1999)

• Optimization vector:

Page 29: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

29

MILP Formulation of MPC(Bemporad, Borrelli, Morari, 2000)

Mixed Integer Linear Program (MILP)

• Optimization vector:

• Basic trick: introduce slack variables:

• Generalization:

Page 30: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

30

BUT

• Mixed-Integer Programming is NP-hard

Mixed-Integer Program Solvers

• Extremely rich literature in Operations Research (still very active)

• No need to reach the global optimum for stability of MPC

(see proof of the theorem), although performance deteriorates

MILP/MIQP is nowadays a technology (CPLEX, Xpress-MP, BARON,

GLPK, see e.g. http://plato.la.asu.edu/bench.html for a comparison)

• Possibility of combining symbolic + numerical solvers Example: SAT + linear programming

(Bemporad, Giorgetti, IEEE TAC 2006)

#nodes=11 #nodes=6227

SAT-based B&B Pure B&B

Page 31: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

Contents

! Models of hybrid systems

! Model predictive control of hybrid systems

• Explicit reformulation

• Automotive applications

• Hybrid MPC over wireless sensor networks

Page 32: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

32

On-Line vs O-Line Optimization

• On-line optimization: given x(t) solve the problem at each time step t.

multi-parametric programming

Mixed-Integer Linear/Quadratic Program (MILP/MIQP)

• O-line optimization: solve the MILP/MIQP for all x(t)

" Good for large sampling times (e.g., 1 h) / expensive hardware …

… but not for fast sampling (e.g. 10 ms) / cheap hardware !

Page 33: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

-60 -40 -20 0 20 40 60-60

-40

-20

0

20

40

60

CRf2;3g

CRf1;4g

CRf1;2;3g

CRf1;3g

x1

x2

Example of Multiparametric SolutionMultiparametric LP ( )

Page 34: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

34

MPC for Linear Systems

Quadratic performance index

Constraints

Linear model

Objective: solve the QP for all (o-line)

Page 35: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

35

;;

Properties of multiparametric-QP

continuous,piecewise ane

convexcontinuous, piecewise quadratic, C1 (if no degeneracy)

Corollary: The linear MPC controller is a continuous piecewise ane function of the state

Optimizer

Valuefunction

Feasiblestate set convex polyhedral

(Bemporad et al., 2002)

Page 36: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

36

Polyhedral Invariant Sets for Closed-loop Linear MPC Systems

• Convexity of value function implies convexity of the piecewise

ellipsoidal sets and

• Any polyhedron P contained in between is a positively

invariant set for the closed-loop MPC system

(Note: explicit form of MPC not required)

• By changing # invariant polyhedra of arbitrary size can be

constructed for the closed-loop MPC system

(Alessio, Bemporad, Lazar, Heemels, CDC’06)

Page 37: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

37

Explicit Hybrid MPC (PWA)

• The MPC controller is piecewise ane in x,r

Note: in the 2-norm case the partition may not be fully polyhedral

(x,r)-space

1

2

3

M4

5 6

(Borrelli, Baotic, Bemporad, Morari, Automatica, 2005)

(Mayne, ECC 2001) (Alessio, Bemporad, ADHS 2006)

Page 38: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

38

Open loopbehavior:

PWA system:

Hybrid Control - Example

Constraints:

Closed loop:

HybTbx: /demos/hybrid/bm99sim.m

Objective:

Page 39: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

39

Explicit PWA Controller

PWA law MPC law

(CPU time: 1.51 s, Pentium M 1.4GHz)

HybTbx: /demos/hybrid/bm99sim.m

-10 -8 -6 -4 -2 0 2 4 6 8 10-10

-8

-6

-4

-2

0

2

4

6

8

10Section with r=0

12345

x1

x2

Page 40: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

40

Hybrid MPC - ExampleClosed loop:

Page 41: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

41

Explicit PWA Regulator

Prediction Horizon N=1

HybTbx: /demos/hybrid/bm99benchmark.m

Objective:

Prediction Horizon N=2 Prediction Horizon N=3

Page 42: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

42

Comments on Explicit Solutions

• Alternatives: either (1) solve an MIP on-line or (2) evaluate a PWA function

• For problems with many variables and/or long horizons: MIP may be preferable

• For simple problems (short horizon/few constraints):

- time to evaluate the control law is shorter than MIP

- control code is simpler (no complex solver must be included in the control software !)

- more insight in controller’s behavior

Page 43: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

Contents

! Models of hybrid systems

! Model predictive control of hybrid systems

! Explicit reformulation

• Automotive applications

Page 44: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

44

Hybrid Control of a DISC Engine

(joint work with N. Giorgetti, G. Ripaccioli, I. Kolmanovsky, and D. Hrovat)

(Photo: Courtesy Mitsubishi)

Page 45: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

45

DISC EngineTwo distinct regimes:

Regime fuel injection

air-to-fuel ratio

Homogeneouscombustion

intake stroke

$=14.64

Stratiedcombustion

compression stroke

$ >

14.64

Objective: Design a controller for the engine that

• Automatically choose operating mode (homogeneous/stratied)

• Can cope with nonlinear dynamics

• Handles constraints (on A/F ratio, air-ow, spark)

• Achieves optimal performance

Page 46: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

46

Hybridization of DISC Dynamics

DYNAMICS (intake pressure, air-to-fuel ratio, torque):

CONSTRAINTS on:

• Denition of two operating points;

• Numerical linearization of nonlinear dynamics;

• Time discretization of the linear models.

• Air-to-Fuel Ratio: $min(%)#$(t)#$max(%);

• Mass of air through the throttle: 0 # Wth # K;

• Spark timing: 0#"(t)# "mbt($, %)

%-dependent dynamic

equations

%&dependent constraints

Hybrid system with 2 modes (switched ane system)

• Proprietary nonlinear model of the DISC engine developed and validated at Ford Research Labs (Dearborn)(Kolmanovsky, Sun, …)

• Model good for simulation, not good for control design!

MODEL HYBRIDIZATION

Page 47: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

47

Integral Action

Integrators on torque error and air-to-fuel ratio error added to obtain zero osets in steady-state:

Simulation based on nonlinear model conrms zero osets in steady-state

(despite the model mismatch)

brake torque and air-to-fuel references

= sampling time

Reference values are automatically generated from 'ref and $ref

by numerical computation based on the nonlinear model

Page 48: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

48

DISC Engine - HYSDEL List

SYSTEM hysdisc{

INTERFACE{

STATE{

REAL pm [1, 101.325];

REAL xtau [-1e3, 1e3];

REAL xlam [-1e3, 1e3];

REAL taud [0, 100];

REAL lamd [10, 60];

}

OUTPUT{

REAL lambda, tau, ddelta;

}

INPUT{

REAL Wth [0,38.5218];

REAL Wf [0, 2];

REAL delta [0, 40];

BOOL rho;

}

PARAMETER{

REAL Ts, pm1, pm2;

}

}

IMPLEMENTATION{

AUX{

REAL lam,taul,dmbtl,lmin,lmax;

}

DA{

lam={IF rho THEN l11*pm+l12*Wth...

+l13*Wf+l14*delta+l1c

ELSE l01*pm+l02*Wth+l03*Wf...

+l04*delta+l0c };

taul={IF rho THEN tau11*pm+...

tau12*Wth+tau13*Wf+tau14*delta+tau1c

ELSE tau01*pm+tau02*Wth...

+tau03*Wf+tau04*delta+tau0c };

dmbtl ={IF rho THEN dmbt11*pm+dmbt12*Wth...

+dmbt13*Wf+dmbt14*delta+dmbt1c+7

ELSE dmbt01*pm+dmbt02*Wth...

+dmbt03*Wf+dmbt04*delta+dmbt0c-1};

lmin ={IF rho THEN 13 ELSE 19};

lmax ={IF rho THEN 21 ELSE 38};

}

CONTINUOUS{

pm=pm1*pm+pm2*Wth;

xtau=xtau+Ts*(taud-taul);

xlam=xlam+Ts*(lamd-lam);

taud=taud; lamd=lamd;

}

OUTPUT{

lambda=lam-lamd;

tau=taul-taud;

ddelta=dmbtl-delta;

}

MUST{

lmin-lam <=0;

lam-lmax <=0;

delta-dmbtl <=0;

}

}

}

Page 49: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

49

MPC of DISC Engine

pm

'

$

Wth

Wf "

%

MPC

Weights:

Solve MIQP problem (mixed-integerquadratic program)to compute u(t)

q' q$

r%

s(' s($

(prevents unneeded chattering)

main emphasis on torque

Page 50: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

50

Simulation Results (nominal engine speed)[N

m]

Time (s)

Air-to-Fuel Ratio

Time (s)

Engine Brake Torque

Time (s)

Combustion mode

• Control horizon N=1;

• Sampling time Ts=10 ms;

• PC Xeon 2.8 GHz + Cplex 9.1

$ 3 ms per time step

14

(PurgeLean NOx Trap)

homogeneous

stratied

) = 2000 rpm

Page 51: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

51

Simulation Results (varying engine speed)[N

m]

Time (s)

Air-to-Fuel Ratio

Time (s)

Engine Brake Torque

Time (s)

Engine speed

Hybrid MPC design is quite robust with respect to engine speed variations

20 s segment of the Europeandrive cycle (NEDC)

Control code too complex (MILP) % not implementable !

Page 52: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

52

Explicit MPC Controller

N=1 (control horizon)

75 partitions

Cross-section by the 'ref-$ref plane

• Time to compute the explicit MPC: 3.4750 s;

• Sampling time Ts=10 ms;

• PC Xeon 2.8 GHz + Cplex 9.1

$ 8 *s per time step

Explicit control law:

where:

%=0

%=1

Page 53: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

53

Microcontroller Implementation

Implementable !

• C-code automatically generated by the Hybrid Toolbox

• Microcontroller Motorola MPC 555 (custom made for Ford)

• 43 Kb memory available

• Floating point arithmetic

• Further reduction of number of partitions possible

• C-code can be further optimized

& 3ms execution time

sampling period = 10ms

(Alessio, Bemporad, 2005)

(Tøndel, Johansen, Bemporad, 2003)

Page 54: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

54

Conclusions• Hybrid systems as a framework for new applications, where both logic and continuous dynamics are relevant

y(t)u(t)

Plant

OutputInput

Measurements

• Piecewise Linear MPC Controllers can be synthesized o-line via multiparametric programming for fast-sampling applications

• Supervisory MPC controllers schemes can be synthesized via on-line mixed-integer programming (MILP/MIQP)

Hybrid modelingand MPC design

Multiparametricprogramming

C-code download& testing

Page 55: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

55

Hybrid MPC & Wireless Sensor Networks

• Measurements acquired and sent to base station (MPC) by wireless sensors

• MPC computes the optimal plan when new measurements arrive

• Optimal plan implemented by local controller if received in time, otherwise previous plan still kept

Packet loss possible along both network links, delayed packets must be discarded (out-of-date data)

network links

Page 56: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

56

Challenges in Wireless MPC

• Synchronization schemes must ensure correct prediction in spite of packet loss

• MPC algorithm must be robust w.r.t. packet loss % stochastic hybrid MPC, robust hybrid MPC

• Wireless sensors must be interfaced to optimization tools

Network

measurements

optimal plan

network link

Stabilized plant

plant

local control

Page 57: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

57

Demo Application in Wireless Automation

• Telos motes provide wireless temperature feedback in Matlab

• Hybrid MPC algorithm adjust belt speed and coordinate linear motors (via Simulink/xPC-Target link)

(Automatic Control Lab, Univ. Siena)

Telos motes

(Bemporad, Di Cairano, Henriksson)

Page 58: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

58

Acknowledgements

A. Alessio, M. Baotic, F. Borrelli, B. De Schutter, S. Di Cairano, G. Ferrari-Trecate, K. Fukuda, N. Giorgetti, M. Heemels, D. Hrovat, J. Julvez, I. Kolmanovski, M. Lazar, L. Ljung, D. Mignone, M. Morari, D. Munoz de la Pena, S. Paoletti, G. Ripaccioli, J. Roll, F.D. Torrisi

• 10th “Hybrid Systems: Computation and Control” Conference (Pisa, Italy, April 3-5, 2006). Submission: Oct. 9, 2006

• 2nd PhD School on Hybrid Systems, Siena, 2007

Announcements

Page 59: Optimization-based Control of Hybrid Dynamical Systemscse.lab.imtlucca.it/~bemporad/talks/lisbona_2006.pdf · Continuous dynamical systems u(t) system y(t) A B C C A B B C. 4 Hybrid

The End

MPC controller - SIMODC-ServomotorHybrid Toolbox

http://www.dii.unisi.it/hybrid/toolbox