79
Model Predictive Control Hybrid MPC examples Alberto Bemporad imt.lu/ab ©2020 A. Bemporad - "Model Predictive Control" 1/73

ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Model Predictive ControlHybrid MPC examples

Alberto Bemporad

imt.lu/ab

©2020 A. Bemporad - "Model Predictive Control" 1/73

Page 2: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Course structure

Basic concepts of model predictive control (MPC) and linearMPC

Linear time-varying and nonlinearMPC

MPC computations: quadratic programming (QP), explicitMPC

• HybridMPC

• StochasticMPC

• Data-drivenMPC

Course page:

http://cse.lab.imtlucca.it/~bemporad/mpc_course.html

©2020 A. Bemporad - "Model Predictive Control" 2/73

Page 3: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC Examples

Page 4: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �2

Hybrid MPC for cruise control

GOAL:

Commandgearratio,gaspedal,andbrakestotrackadesiredspeedandminimizefuelconsumption

Disclaimer:Thisisanacademicexample

Hybrid MPC for cruise control

©2020 A. Bemporad - "Model Predictive Control" 3/73

Page 5: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �3

Hybrid model

Fe =Rg(i)

ksC

Fex = C�

•Vehicledynamics

•Transmissionkinematics

discretizedwithsamplingtime

C=enginetorque

ω =enginespeed

i=gear

=vehiclespeed

=brakeforce

=tractionforce

powerbalance:

(drawing by Dong Du Bosque)

Hybrid MPC for cruise control - Model

©2020 A. Bemporad - "Model Predictive Control" 4/73

Page 6: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

i = R,1,2,3,4,5

IF gi = 1 THEN Fei =Rg(i)

ksC ELSE 0

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �4

Hybrid model

•Gearselection(tractionforce):

dependsongear#i

defineauxiliarycontinuousvariables:

similarly,alsorequires6auxiliarycontinuousvariables

•Gearselection(engine/vehiclespeed):

•Gearselection: foreachgear#i,defineabinaryinput

Fe =Rg(i)

ksC

Hybrid MPC for cruise control - Model

©2020 A. Bemporad - "Model Predictive Control" 5/73

Page 7: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Note:inthiscasethePWLconstraintisconvex,itcouldbehandledbylinearconstraintswithoutintroducinganybinaryvariable!

�C�e (!) C C+

e (!)

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �5

Hybrid Model

1000 2000 3000 400060

80

100

120

140

160

180•maxenginetorque:

Piecewise-linearization(PWL Toolbox, Julián, 2000)

•Minenginetorque

requires:4binaryauxvariables4continuousauxvariables

•enginetorque

C C+e (!)

Hybrid MPC for cruise control - Model

©2020 A. Bemporad - "Model Predictive Control" 6/73

Page 8: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �6

HYSDEL model

gotodemo/demos/cruise/init.m

SYSTEM cruisecontrolmodel { INTERFACE { PARAMETER { REAL mass = 1020; /* kg */ REAL beta_friction = 25; /* W/m*s */

[snip] } STATE { REAL position [0,10000]; REAL speed [vmin,vmax]; }

INPUT { REAL torque [Cmin,Cmax]; REAL F_brake [0,max_brake_force]; BOOL gear1, gear2, gear3, gear4, gear5, gearR; } }

IMPLEMENTATION { AUX {REAL F, Fe1, Fe2, Fe3, Fe4, Fe5, FeR; REAL w, w1, w2, w3, w4, w5, wR; BOOL dPWL1,dPWL2,dPWL3,dPWL4; REAL DCe1,DCe2,DCe3,DCe4; }

LINEAR {F = Fe1+Fe2+Fe3+Fe4+Fe5+FeR; w = w1+w2+w3+w4+w5+wR; }

AD { dPWL1 = wPWL1-w<=0; dPWL2 = wPWL2-w<=0; dPWL3 = wPWL3-w<=0; dPWL4 = wPWL4-w<=0; } DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2}; Fe3 = {IF gear3 THEN torque/speed_factor*Rgear3}; Fe4 = {IF gear4 THEN torque/speed_factor*Rgear4}; Fe5 = {IF gear5 THEN torque/speed_factor*Rgear5}; FeR = {IF gearR THEN torque/speed_factor*RgearR};

w1 = {IF gear1 THEN speed/speed_factor*Rgear1}; w2 = {IF gear2 THEN speed/speed_factor*Rgear2}; w3 = {IF gear3 THEN speed/speed_factor*Rgear3}; w4 = {IF gear4 THEN speed/speed_factor*Rgear4}; w5 = {IF gear5 THEN speed/speed_factor*Rgear5}; wR = {IF gearR THEN speed/speed_factor*RgearR}; DCe1 = {IF dPWL1 THEN (aPWL2-aPWL1)+(bPWL2-bPWL1)*w}; DCe2 = {IF dPWL2 THEN (aPWL3-aPWL2)+(bPWL3-bPWL2)*w}; DCe3 = {IF dPWL3 THEN (aPWL4-aPWL3)+(bPWL4-bPWL3)*w}; DCe4 = {IF dPWL4 THEN (aPWL5-aPWL4)+(bPWL5-bPWL4)*w}; } CONTINUOUS { position = position+Ts*speed; speed = speed+Ts/mass*(F-F_brake-beta_friction*speed); MUST { /* max engine speed */ /* wemin <= w1+w2+w3+w4+w5+wR <= wemax */ -w1 <= -wemin; w1 <= wemax; -w2 <= -wemin; w2 <= wemax; -w3 <= -wemin; w3 <= wemax; -w4 <= -wemin; w4 <= wemax; -w5 <= -wemin; w5 <= wemax; -wR <= -wemin; wR <= wemax; -F_brake <=0; F_brake <= max_brake_force; -torque-(alpha1+beta1*w) <=0; torque-(aPWL1+bPWL1*w+DCe1+DCe2+DCe3+DCe4)-1<=0; -((REAL gear1)+(REAL gear2)+(REAL gear3)+(REAL gear4)+ (REAL gear5)+(REAL gearR))<=-0.9999; (REAL gear1)+(REAL gear2)+(REAL gear3)+(REAL gear4)+ (REAL gear5)+(REAL gearR)<=1.0001; dPWL4 -> dPWL3; dPWL4 -> dPWL2; dPWL4 -> dPWL1; dPWL3 -> dPWL2; dPWL3 -> dPWL1; dPWL2 -> dPWL1; } } }

Hybrid MPC for cruise control - HYSDEL

©2020 A. Bemporad - "Model Predictive Control" 7/73

Page 9: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �7

Hybrid model

•MLDmodel

•2continuousstates:x, v

•2continuousinputs:C, Fb

•6binaryinputs:gR, g1, g2, g3, g4, g5

•1continuousoutput:v

•4auxiliarybinaryvars:

•18auxiliarycontinuousvars:

(enginetorque,brakeforce)

(vehiclespeed)

(gears)

(vehiclepositionandspeed)

(6+1tractionforce,6+1enginespeed,4PWLmaxenginetorque)

(PWLmaxenginetorquebreakpoints)

•100mixed-integerinequalities

Hybrid MPC for cruise control - MLD model

©2020 A. Bemporad - "Model Predictive Control" 8/73

Page 10: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �8

Hybrid controller

•Max-speedcontroller

MILPoptimizationproblem

(x(t)isirrelevant)

0

50

100

150

200

250

LinearconstraintsContinuousvariablesBinaryvariablesParametersTimetosolvemp-MILP(SunUltra10)Numberofregions

9618101

45s11

(parameters:RenaultClio1.9DTIRXE)

Objective:maximizespeed

(toreproducemaxaccelerationplots)

v(t)

x(t)

• Maximum-speed controller

maxu(t) v(t+ 1|t)s.t. MLDmodel

v(t|t) = v(t)

x(t|t) = x(t)

Hybrid MPC for cruise control - Controller

©2020 A. Bemporad - "Model Predictive Control" 9/73

Page 11: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC for cruise control - Results

• Maximum-speed controller

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �9

Hybrid controller•Max-speedcontroller

0 50 1000

50

100

150

200Velocity (km/h)

0 50 1000

1000

2000

3000

4000

5000

6000Engine speed (rpm)

Time (s)

0 50 1000

50

100

150

200Engine Torque (Nm)

Time (s)

0 50 1001

2

3

4

5Gear

0 50 1000

10

20

30

40

50

60Power (kW)

Time (s)

0 50 100-1

-0.5

0

0.5

1

Fraction of Max Torque (Nm)

0 50 100-1

-0.5

0

0.5

1Road Slope (deg)

Time (s)

0 50 100-1

-0.5

0

0.5

1Brakes (Nm)

©2020 A. Bemporad - "Model Predictive Control" 10/73

Page 12: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC for cruise control - Controller

• Cruise controller

minu(t) |v(t+ 1|t)− vd(t)|+ ρ|ω|s.t. MLDmodel

v(t|t) = v(t)

x(t|t) = x(t)

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �10

Hybrid controller

•Trackingcontroller

0 40 80 120 160 2000

50

100

150

200

250

MILPoptimizationproblemLinearconstraintsContinuousvariablesBinaryvariablesParametersTimetosolvemp-MILP(PC850Mhz)Numberofregions

9819102

43s49

gotodemo/demos/cruise/init_exp.m

vd(t)

v(t)

©2020 A. Bemporad - "Model Predictive Control" 11/73

Page 13: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC for cruise control - Results• Cruise controller minu(t) |v(t+ 1|t)− vd(t)|+ ρ|ω|, ρ = 0.001

0 100 200

0

20

40

60

80

100

120

Velocity (km/h), Desired velocity (km/h)

0 100 200

0

1000

2000

3000

4000

5000

6000

Engine speed (rpm)

Time (s)

0 100 200

-200

-100

0

100

200

Engine Torque (Nm)

Time (s)

0 100 200

1

2

3

4

5

Gear

0 100 200

-100

-50

0

50

100

Power (kW)

Time (s)

0 100 200

-1

-0.5

0

0.5

1

Fraction of Max Torque (Nm)

0 100 200

-6

-4

-2

0

2

4

6

Road Slope (deg)

Time (s)

0 100 200

0

2000

4000

6000

8000

10000

Brakes (Nm)

©2020 A. Bemporad - "Model Predictive Control" 12/73

Page 14: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC for cruise control - Controller• Smoother cruise controller

minu(t) |v(t+ 1|t)− vd(t)|+ ρ|ω|s.t. MLDmodel

|v(t+ 1|t)− v(t)| ≤ amaxTs

v(t|t) = v(t)

x(t|t) = x(t)

0 40 80 120 160 2000

50

100

150

200

250

MILP optimization problem

Linear constraintsContinuous variables

Binary variablesParameters

Time to solve mp-MILP(PC 850Mhz)

Number of regions

10019102

47 s54

vd(t)

v(t)©2020 A. Bemporad - "Model Predictive Control" 13/73

Page 15: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC for cruise control - Results• Smoother cruise controller

0 100 200

0

20

40

60

80

100

120

Velocity (km/h), Desired velocity (km/h)

0 100 200

0

1000

2000

3000

4000

5000

6000

Engine speed (rpm)

Time (s)

0 100 200

-200

-100

0

100

200

Engine Torque (Nm)

Time (s)

0 100 200

1

2

3

4

5

Gear

0 100 200

-100

-50

0

50

100

Power (kW)

Time (s)

0 100 200

-1

-0.5

0

0.5

1

Fraction of Max Torque (Nm)

0 100 200

-6

-4

-2

0

2

4

6

Road Slope (deg)

Time (s)

0 100 200

0

2000

4000

6000

8000

10000

Brakes (Nm)

©2020 A. Bemporad - "Model Predictive Control" 14/73

Page 16: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC for Traction Control

Page 17: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �15

Vehicle Traction Control

Controller:suitableforreal-timeimplementation

Improvedriver'sabilitytocontrolavehicleunderadverseexternalconditions(wetoricyroads)

Solution:MLDhybridframework+explicithybridMPCstrategy

Model:nonlinear,uncertain,constraints

Vehicle traction control problem

©2020 A. Bemporad - "Model Predictive Control" 15/73

Page 18: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �16

Tire force characteristicsTire force characteristics

©2020 A. Bemporad - "Model Predictive Control" 16/73

Page 19: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

vt = !trt =!e

grrt

�! =1

rt(vt � vv) =

!e

gr�

vvrt

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �17

SimpletractionmodelSimple traction model

• TiretorqueτtisafunctionofslipΔωandroadsurfaceadhesioncoefficientμ

•Mechanicalsystem

•Manifold/fuelingdynamics

wheelslip

(Borrelli,Bemporad,Fodor,Hrovat,2006)

vt

vv

Simple traction model

©2020 A. Bemporad - "Model Predictive Control" 17/73

Page 20: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �18

HybridmodelHybrid modelTo

rque

Mixed-Logical

Dynamical(MLD)HybridModel

(discretetime)

Slip

Torq

ue

μ

PWAapproximation

μ Slip

HYSDEL

Nonlineartiretorque

τt=f(Δω,μ)

Δω

Hybridization of tire characteristics

©2020 A. Bemporad - "Model Predictive Control" 18/73

Page 21: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

state x(t) 2 R4

input u(t) 2 Raux. binary �(t) 2 {0,1}aux. continuous z(t) 2 R3

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �19

MLD model

TheMLDmatricesareautomaticallygeneratedinMATLABformatbyHYSDEL

numberofmixed-integerinequalities=14

MLD traction model

©2020 A. Bemporad - "Model Predictive Control" 19/73

Page 22: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �20

Performance and constraints

•Controlobjective:

•Constraints:•Limitsontheenginetorque:

Performance and constraints

©2020 A. Bemporad - "Model Predictive Control" 20/73

Page 23: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �21

ExperimentalresultsExperimental results

Whe

elSpe

eds,[r

ad/s]

15

10

5

0

20

9630 12

Engine

Tor

queCo

mman

d,[N

m]

150

100

50

0

200

Time,[s]9630 12

Contro

llerR

egion 25

20

15

10

5

0

30

(250msdelayfromcommandedtoactualenginetorqueàinitialoverspin)

controller is triggered ON

average driven wheel speed

target speed

average non-driven wheel speed

Experimental results

©2020 A. Bemporad - "Model Predictive Control" 21/73

Page 24: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Experiments(Borrelli, Bemporad, Fodor, Hrovat, 2006)

©2020 A. Bemporad - "Model Predictive Control" 22/73

Page 25: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid control of a DISC engine

Page 26: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �24

DISCenginecontrolproblemDISC engine control problemObjective:developacontrollerforaDirect-InjectionStratifiedCharge(DISC)enginethat:

• automaticallychoosesoperatingmode(homogeneous/stratified)

• cancopewithnonlineardynamics

• handlesconstraintsonA/Fratio,air-flow,spark

• achievesoptimalperformance(trackdesiredtorqueandA/Fratio)

Homogeneous Stratified

DISC engine control problem

©2020 A. Bemporad - "Model Predictive Control" 23/73

Page 27: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �25

DISCengineDISC engineTwodistinctregimes:

Periodicalcleaningoftheaftertreatmentsystemneeded(λ=14.00,homogeneousregime)

normal purge

•Modeisswitchedbychangingfuelinjectiontiming(late/early)

•Betterfueleconomyduringstratifiedmode

regime fuelinjection air-to-fuelratio

Homogeneouscombustion

intakestroke λ=14.64

Stratified combustion

compressionstroke

λ>14.64

thestratifiedoperationcanonlybesustainedinarestrictedpartoftheengineoperatingrange

DISC engine

©2020 A. Bemporad - "Model Predictive Control" 24/73

Page 28: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �26

DISCengineDISC engine

- Air-to-fuelratio(duetoengineroughness,misfiring,smokeemiss.)

- Sparktiming(toavoidexcessiveengineroughness)

- Massflowrateonintakemanifold(constraintsonthrottle)

Dynamicequationsarenonlinear,dynamicsandconstraintsdependonregimeρ

• States:intakemanifoldpressure(pm)

• Outputs:Air-to-fuelratio(λ),torque(τ),max-brake-torquesparktiming(δmbt)

• Continuousinputs:sparkadvance(δ),airflow(Wth),fuelflow(Wf)

• Binaryinput:sparkcombustionregime(ρ)

• Disturbance:enginespeed(ω)[measured]

• Constraintson:

DISC engine

©2020 A. Bemporad - "Model Predictive Control" 25/73

Page 29: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �27

DISCdynamicsDISC dynamicsNonlinearmodeloftheenginedevelopedandvalidatedatFord

with

whereθa,θb,δmbtarefunctionsofλ,δandρ

•Intakemanifoldpressure:

•In-cylinderAir-to-Fuelratio:

•Enginetorque:

✓Goodforsimulation

✖Notsuitableforoptimization-basedcontrollersynthesis

Assumptions:-noEGR(exhaustgasrecirculation)rate,-enginespeed=2000rpm.

functionsofpm

(Kolmanovsky,Sun,…)

DISC engine dynamics

©2020 A. Bemporad - "Model Predictive Control" 26/73

Page 30: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �28

HybridizationofDISCmodelHybridization of DISC model

DYNAMICS(intakepressure,air-to-fuelratio,torque):

CONSTRAINTSon:

•Definitionoftwooperatingpoints;•Linearizationofnonlineardynamics;•Timediscretizationofthelinearmodels.

•Air-to-FuelRatio:λmin(ρ)≤λ(t)≤λmax(ρ)•Massofairthroughthethrottle: 0≤Wth≤K

•Sparktiming:0≤ δ(t)≤ δmbt(λ,ρ)

ρ-dependentdynamicequations

ρ−dependentconstraints

Hybridsystemwith2modes(switchingaffinesystem)

Hybridization of DISC model

©2020 A. Bemporad - "Model Predictive Control" 27/73

Page 31: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �29

Integral action

✏⌧,k+1 = ✏⌧,k + Ts(⌧ref(t)� ⌧k)✏�,k+1 = ✏�,k + Ts(�ref(t)� �k)

Integratorsontorqueerrorandair-to-fuelratioerrorareaddedtoobtainzerooffsetsinsteady-state:

Simulationbasedonnonlinearmodelconfirmszerooffsetsinsteady-state(despitethemodelmismatch)

=referencesonbraketorqueandair-to-fuelratio

Ts=samplingtime

Integral action

©2020 A. Bemporad - "Model Predictive Control" 28/73

Page 32: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �30

MPCofDISCengineMPC of DISC engine

where:

and:

N =controlhorizon

x(t)=currentstate

Referencevaluesareautomaticallygeneratedfromτrefandλrefbynumericalcomputationsbasedonthenonlinearmodel

MPC of DISC engine

©2020 A. Bemporad - "Model Predictive Control" 29/73

Page 33: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �31

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; } } }

DISC engine - HYSDEL

©2020 A. Bemporad - "Model Predictive Control" 30/73

Page 34: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �32

MPC-TorquecontrolmodeMPC – Torque control mode

pm

t

l

Wth

Wf d

r

MPC

Weights:

SolveMIQPproblemtocomputeu(t)

(prevents unneeded chattering)

main emphasis on torqueqτ qλ

sετ sελ

MPC – Torque control mode

©2020 A. Bemporad - "Model Predictive Control" 31/73

Page 35: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �33

Simulation results (nominal engine speed)[N

m]

Time (s)

Air-to-fuelratioEnginebraketorque

Combustionmode

•ControlhorizonN=1;

•SamplingtimeTs=10ms;

•PCXeon2.8GHz+Cplex9.1

≈ 3mspertimestep

14(PurgeLeanNOxTrap)

ω / 2000rpm

homogeneous

stratified

Time (s) Time (s)

Simulation results (nominal engine speed)

©2020 A. Bemporad - "Model Predictive Control" 32/73

Page 36: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �34

Simulation results (varying engine speed)[N

m]

Air-to-FuelRatioEngineBrakeTorque

Enginespeed

HybridMPCdesignisquiterobustwithrespecttoenginespeedvariations

20ssegmentoftheEuropeandrivecycle(NEDC)

Time (s) Time (s)

Time (s)

Simulation results (varying engine speed)

©2020 A. Bemporad - "Model Predictive Control" 33/73

Page 37: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �35

Simulation results (varying engine speed)[N

m]

Air-to-FuelRatio

Time (s)

EngineBrakeTorque

Time (s)

Enginespeed

HybridMPCdesignisquiterobustwithrespecttoenginespeedvariations

20ssegmentoftheEuropeandrivecycle(NEDC)

Controlcodetoocomplex(MIQP)!notimplementable!

rpm

[Nm]

Time (s)Time (s)

4Nm

Time (s)

Simulation results (varying engine speed)

©2020 A. Bemporad - "Model Predictive Control" 34/73

Page 38: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �36

Explicit MPC controller

N=1(controlhorizon)

42partitions

•TimetocomputeexplicitMPC:¼3s;

•SamplingtimeTs=10ms;

•PCXeon2.8GHz+Cplex9.1

! 8μspertimestep

Explicitcontrollaw:

where:

Cross-sectionbytheτref-λrefplane

ρ/0

ρ/1

¼ 3mson

μ−controllerMotorolaMPC55543kbRAM(custommadeforFord)

Explicit MPC

©2020 A. Bemporad - "Model Predictive Control" 35/73

Page 39: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �37

Explicit MPC controller (N=2)

N=2(controlhorizon)

747partitions

Explicitcontrollaw:

where:

EngineBrakeTorque Air-to-FuelRatio

Closed-loopN=1 adequate!Closed-loopN=2

Explicit MPC controller (N=2)

©2020 A. Bemporad - "Model Predictive Control" 36/73

Page 40: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Explicit Hybrid MPC of Semiactive Suspensions

Page 41: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Active suspensions

activesuspensions

passivesuspensions

ActiveSuspensionSystemFordMercurXR40i

�39

Active suspensions(Giorgetti, Bemporad, Tseng, Hrovat, 2006)

©2020 A. Bemporad - "Model Predictive Control" 37/73

Page 42: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �40

Quest of optimal semi-active suspensions

ClippedOptimal

tiredeflection

suspensiondeflection

Cmax

Cmin

C=f(x)/(x4-x2),wheref(x)istheoptimalactivesuspensionforce

C=sat[f(x)/(x4-x2)]

x4sprungmassvelocity

x2unsprungmassvelocity

Optimal =?

ForSemi-ActivewithVariableDamping,f(x)=C*(x4-x2)

Ms=suspendedmassMus=unsprungmass

Quest of optimal semi-active suspensions

©2020 A. Bemporad - "Model Predictive Control" 38/73

Page 43: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Model

�41

J =�

(qx1x21 + qx3x

23 + x2

4)dt

=�

(x�Qx + x24)dt

41

•Output:

•State-spacemodel

•Time-discretization:

•Cost:

Suspension model

©2020 A. Bemporad - "Model Predictive Control" 39/73

Page 44: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Constraints

�4242

hybridmodel

Quarter-carmodel

1)Passivitycondition:

(1),(2)arenonlinear&nonconvexphysicalconstraints

x4-x2

f

ok

ok

linearmodel

no

no

Constraints:

2)Maxdissipationpower:

3)Saturation:

tiredeflection

suspensiondeflection

-

Constraints on suspension model

©2020 A. Bemporad - "Model Predictive Control" 40/73

Page 45: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �43

Constraints1)Passivitycondition:

x4-x2

f

ok

ok

no

no

2)Maxdissipationpower:

3)Saturation:

-

where

Hybrid model of semiactive constraints

©2020 A. Bemporad - "Model Predictive Control" 41/73

Page 46: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �44

HYSDEL model/* Semiactive suspension system (C) 2003-2005 by A.Bemporad, D.Hrovat, E.Tseng, N.Giorgetti */

SYSTEM suspension { INTERFACE { STATE { REAL x1 [-0.05,0.05]; REAL x2 [-5,5]; REAL x3 [-0.2,0.2]; REAL x4 [-2,2]; } INPUT{ REAL u [-10,10]; /* m/s^2 */ } OUTPUT { REAL y; } PARAMETER { REAL A1dot,A2dot,A3dot,A4dot,B4dot,ws; REAL A11,A12,A13,A14,B1,A21,A22,A23,A24,B2; REAL A31,A32,A33,A34,B3,A41,A42,A43,A44,B4; } }

IMPLEMENTATION { AUX { BOOL sign; BOOL usign; REAL F; } AD { sign = x4-x2<=0; usign = u<=0; } DA { F={ IF sign THEN u-(2*25.5*ws)*(x4-x2) ELSE -u+(2*25.5*ws)*(x4-x2)}; } OUTPUT { y=A1dot*x1+A2dot*x2+A3dot*x3 +A4dot*x4+B4dot*u; } CONTINUOUS { x1 = A11*x1+A12*x2+A13*x3+A14*x4+B1*u; x2 = A21*x1+A22*x2+A23*x3+A24*x4+B2*u; x3 = A31*x1+A32*x2+A33*x3+A34*x4+B3*u; x4 = A41*x1+A42*x2+A43*x3+A44*x4+B4*u; } MUST { sign -> usign; ~sign -> ~usign; F>=0; } } }

>>S=mld('semiact3',Ts)

>>[X,T,D,Z,Y]=sim(S,x0,U);

gettheMLDmodelinMATLAB

simulatetheMLDmodel

Semiactive suspension model - HYSDEL

©2020 A. Bemporad - "Model Predictive Control" 42/73

Page 47: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �45

Hybrid PWA model

•PWAmodel

•4continuousstates

•1continuousinput

•2polyhedralregions

>>P=pwa(S);

Semiactive suspension model - PWA form

©2020 A. Bemporad - "Model Predictive Control" 43/73

Page 48: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �46

Simulation in SimulinkOpen-loop simulation of PWA suspension model

©2020 A. Bemporad - "Model Predictive Control" 44/73

Page 49: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �47

Performance specs

min

0

@N�1X

k=11100x21,k +100x23,k + x24,k

1

A+x0NPxN

tire deflession

suspension deflession

vertical acceleration

terminal weight (Riccati matrix)

MPC performance specifications

©2020 A. Bemporad - "Model Predictive Control" 45/73

Page 50: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �48

Closed-loop MPC results (command line)

>>[XX,UU,DD,ZZ,TT]=sim(C,S,r,x0,Tstop);

>>C=hybcon(S,Q,N,limits,refs);

>>refs.y=1; % weights output #1 >>Q.y=Ts*rx4d;% output weight … >>Q.norm=2; % quadratic costs >>N=1; % optimization horizon >>limits.umin=umin; >>limits.umax=umax;

>> C

Hybrid controller based on MLD model S <semiact3.hys> [2-norm]

4 state measurement(s) 1 output reference(s) 1 input reference(s) 4 state reference(s) 0 reference(s) on auxiliary continuous z-variables 4 optimization variable(s) (2 continuous, 2 binary) 13 mixed-integer linear inequalities sampling time = 0.01, MIQP solver = 'cplex' Type "struct(C)" for more details. >>

Closed-loop MPC results

©2020 A. Bemporad - "Model Predictive Control" 46/73

Page 51: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �49

Closed-loop MPC results (Simulink)Closed-loop MPC results (Simulink)

©2020 A. Bemporad - "Model Predictive Control" 47/73

Page 52: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �50

Explicit hybrid MPC

>>E=expcon(C,range,options);

>> E

Explicit controller (based on hybrid controller C) 4 parameter(s) 1 input(s) 8 partition(s) sampling time = 0.01 The controller is for hybrid systems (tracking) [2-norm]

This is a state-feedback controller. Type "struct(E)" for more details. >>

Explicitsolution(N=1,x1=x2=0):

Explicit hybrid MPC

©2020 A. Bemporad - "Model Predictive Control" 48/73

Page 53: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �51

Explicit hybrid MPC

generatedC-code

Explicit hybrid MPC

©2020 A. Bemporad - "Model Predictive Control" 49/73

Page 54: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �52

Quest of optimal semiactive suspensionsQuest of optimal semiactive suspensions

©2020 A. Bemporad - "Model Predictive Control" 50/73

Page 55: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course �53

Simulation results

PerformanceIndex

N=1,samecostvalue!

•Simulationswithroadnoise.

•Initialconditionx(0)=[0000]’

•SimulationtimeT=20s,samplingtimeTs=10ms

•HorizonN=1:sameasClipped-LQR!

•Betterclosed-loopperformanceforincreasingN

Explicit hybrid MPC - Results

©2020 A. Bemporad - "Model Predictive Control" 51/73

Page 56: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Vehicle Yaw Stability Control

Page 57: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Yaw stability control problem

• Problem: Control vehicle stabilitywhile tracking driver’s desired trajectory

– Electronic Stability Control (ESC) (Koibuchi et al., 1996)

– Active Front Steering (AFS) (Ackermann, 1997)

• Main control objective: Make the yaw rate of the vehicle track a time-varying

reference computed from the driver’s steering angle and current velocity

• Approach: Consider the steering command as a reference generator and

actuate steering and differential braking (=coordinated AFS and ESC action)

(Bernardini, Di Cairano, Bemporad, Tseng, 2009) (Di Cairano, Tseng, Bernardini, Bemporad, 2012)

©2020 A. Bemporad - "Model Predictive Control" 52/73

Page 58: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

tan (↵f + �) =vy + ar

vx

tan↵r =vy � br

vx

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Vehicle model

�56

• Bicyclemodelappropriateinhighspeedturns(Gillespie,1992)

x

y

- referenceframe(x,y,z)movingwiththevehicle

- frontsteeringangleδ[rad]

- tireslipanglesαf, αr[rad]

- yawrater[rad/s]

Vehicle model

©2020 A. Bemporad - "Model Predictive Control" 53/73

Page 59: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

• Criticalslipanglesarethresholdvalueswheredynamicsswitch

pf , pr

Ff (�f ) =�

�cf�f if �pf ⇥ �f ⇥ pf

�(df�f + ef ) if �f > pf

Fr(�r) =�

�cr�r if �pr ⇥ �r ⇥ pr

�(dr�r + er) if �r > pr

• Foraconstantlongitudinalslip,weuseapiecewiseaffinemodel

Fj

�j

tireforcescharacteristics

• Forsymmetry,wecanrestricttoanalyzeclockwiseturns(counter-clockwiseturnscanbehandledbyopportunelyinvertingsigns)

pj

�pj

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Tire force model

�57

• Tireforcecharacteristics:arenonlinearfunctionsoftheslipanglesandofthelongitudinalslip

tireforces

Tire force model

©2020 A. Bemporad - "Model Predictive Control" 54/73

Page 60: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Tire force model

©2020 A. Bemporad - "Model Predictive Control" 55/73

Page 61: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Dynamical model

�59

�f = vy+arvx

� ⇥

�r = vy�brvx

slipangles

r =vx

a + b(�f � �r + ⇥)

staticyawrate

r =aFf cos � � bFr + Y

Iz

yawratederivative

vy =Ff cos � + Fr

m� rvx

lateralvelocity

�f = Ff +Fr

mvx� vx

a+b (�f � �r + ⇥) + avxIz

(aFf � bFr + Y )�r = Ff +Fr

mvx� vx

a+b (�f � �r + ⇥)� bvxIz

(aFf � bFr + Y )r = vx

a+b (�f � �r + ⇥)

overalldynamicalmodel

Vehicle dynamical model

©2020 A. Bemporad - "Model Predictive Control" 56/73

Page 62: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

⇥f = 0 ⇥ �f � pf

⇥r = 0 ⇥ �r � pr

x = [�f �r]�

u = [Y �]� y = r

x(k + 1) = Aix(k) + Biu(k) + fi

y(k) = Cx(k) + Du(k)i ⇥ {1, . . . , 4} : Hix(k) � Ki

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Piecewise-affine model

�60

• TheoveralldynamicsmodelisrecastasaPWAsystembyintroducingtheBooleanvariables

• BydiscretizingwithsamplingperiodTs= 0.1 sweobtain

where

slipangles frontsteering

yawmoment

yawrate

Vehicle dynamical model - PWA form

©2020 A. Bemporad - "Model Predictive Control" 57/73

Page 63: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

• Controlgoal:stabilizethesystemattheequilibriumobtainedwithwhileminimizingtheuseofthebrakeactuator()

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Reference generation

�61

�(k) = �(k)Y (k) = 0

�f =mv2

xbcr ⇥

mv2x(acf � bcr)� cfcr(a + b)2

�r = �facf

bcr

r =vx

a + b(�f � �r + ⇥)

• Time-varyingset-pointsaredefinedusingtheoveralldynamicalmodel

• Equilibriumconditioninthelinearregion:

�f = Ff +Fr

mvx� vx

a+b (�f � �r + ⇥) + avxIz

(aFf � bFr + Y )�r = Ff +Fr

mvx� vx

a+b (�f � �r + ⇥)� bvxIz

(aFf � bFr + Y )

• Currentlongitudinalvelocityvx(k)isusedtoupdateset-points

� 0

driver’ssteeringangle

0

Reference generation

©2020 A. Bemporad - "Model Predictive Control" 58/73

Page 64: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Ir(k + 1) = Ir(k) + r(k)� rs(k)rs(k + 1) = rs(k)

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Hybrid prediction model

�62

• Yawratetracking:zerotrackingerrorinsteadystateisprovidedbyintegralaction

Ai =

⇧Ai

0 00 0

vxa+b

�vxa+b 1 �1

0 0 0 1

⌃, Bi =

⇧Bi

0 vxa+b

0 0

⌃, fi =

⇤fi00

⌅,

C =� vx

a+b�vxa+b 0 0

⇥, D =

�0 vx

a+b

⇥,

Hi =�

Hi 0 0⇥, Ki = Ki .

z(k + 1) = Aiz(k) + Biu(k) + fi

y(k) = Cz(k) + Du(k)i ⇥ {1, . . . , 4} : Hiz(k) � Ki

• Theglobalhybriddynamicalmodelofthevehicleisgivenby

z =

⇧⇧⇤

�f

�r

Ir

rs

⌃⌃⌅

augmentedstate

integraloftrackingerror

yawrateset-point

Hybrid prediction model

©2020 A. Bemporad - "Model Predictive Control" 59/73

Page 65: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

minuk

N�1⇤

j=0

�(zk+j|k � z)⇥Qz(zk+j|k � z)

+(yk+j|k � y)⇥Qy(yk+j|k � y)

+(uk+j|k � u)⇥Qu(uk+j|k � u)⇥

s.t. zk|k = z(k)hybrid dynamicsstate and input constraints

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Control problem formulation

�63

• Theoptimalcontrolproblemsolvedateverytimestepkis

[z]1(k) ⇥ �pf

[z]2(k) ⇥ �pr

|[u]1(k)| � 1000 [Nm]|[u]2(k)| � 0.35 [rad]

• Stateandinputconstraints:

MIQP

penaltyonactuatorsaction

yawratetracking

slipanglestracking&int.action

frontslipangle

frontsteeringyawmoment

rearslipangle

Control problem formulation

©2020 A. Bemporad - "Model Predictive Control" 60/73

Page 66: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Simulations results

�64

•Simulationsrunonanonlinearvehiclemodelincluding:

yawratedynamicslongitudinalandlateralvehicledynamics

steeringactuationdynamics

•Controllersetupaftercalibration:

‣ Predictionhorizon

‣ Weightmatrices

N = 3

Qz =�

.1 0 0 00 .1 0 00 0 1 00 0 0 0

⇥, Qu = [ 1 0

0 1 ], Qy = 1

•Driver’ssteeringcommandconstantoverthesimulationinterval

Simulation setup

©2020 A. Bemporad - "Model Predictive Control" 61/73

Page 67: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Simulations results

�65

open-loopvsclosed-loop

open-loopspin

•Controllerhastocopewithlinearizationerrors

•Stabilityanalysisundernominalconditions(with):� = 0

Closed-loop simulations results

©2020 A. Bemporad - "Model Predictive Control" 62/73

Page 68: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Simulations results

�66

stableinitialconditionsunstableinitialconditions

open-loop

controlaction

closed-loop

closed-loopprovidesalargerstabilityregion

•Stabilityanalysisundernominalconditions(with):� = 0

Closed-loop simulations results

©2020 A. Bemporad - "Model Predictive Control" 63/73

Page 69: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

•Robustnessanalysisw.r.t.modelmismatches(with):

‣ nominallongitudinalvelocity

‣ reallongitudinalvelocityand

� = �0.05

vx = 20 m/s

vx = 25 m/svx = 15 m/s

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Simulations results

�67

controlsignalsstatesignals

•Stabilityandfasttrackingresponseareprovided

Closed-loop simulations results

©2020 A. Bemporad - "Model Predictive Control" 64/73

Page 70: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

•Turnsonslipperyroadsurface(with):

‣ severalvaluestested:,,, s = 0.35s = 0.30s = 0.20

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Simulations results

�68

� = �0.05

•Gooddegreeofrobustnesswithrespecttoslipmismatches

s = 0

Closed-loop simulations results

©2020 A. Bemporad - "Model Predictive Control" 65/73

Page 71: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Simulations results

�69

•Computationalissues:

‣ MPC-basedapproachisviableforexperimentaltests(averageCPUtime17ms,worst-caseCPUtime63 msinMATLAB), butrequiresaMIQPsolverintheECU

•ExplicitsolutionofhybridMPCcontrolproblem:

‣ Exploitsmultiparametricprogrammingtechniquestoprovideadescriptionofthecontrollawasanexplicitfunctionofthestate

‣ Allthecomputationisexecutedoff-line,onlysimpleset-membershiptestsandfunctionevaluationsareperformedon-linetocomputethecontrolaction

‣ However,theexplicitsolutionrequiresmemory (around5000polytopestobestored,inthiscase!)

‣ Anapproximationofthesolutionisneededforrealimplementation

Computational issues

©2020 A. Bemporad - "Model Predictive Control" 66/73

Page 72: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Switched MPC solution

©2020 A. Bemporad - "Model Predictive Control" 67/73

Page 73: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Experimental results

©2020 A. Bemporad - "Model Predictive Control" 68/73

Page 74: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Experimental results

©2020 A. Bemporad - "Model Predictive Control" 69/73

Page 75: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Experimental results

• Experimental results (double-lane change):

• Alternative: use switched linearMPC andmpQP (Di Cairano, Tseng, 2010)

©2020 A. Bemporad - "Model Predictive Control" 70/73

Page 76: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC OF Induction of Escherichia Coli

Page 77: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC OF Induction of Escherichia Coli

©2020 A. Bemporad - "Model Predictive Control" 71/73

Page 78: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

also advantageous if accurate models are used in controllersynthesis. This is so because predictive control provides usan estimate of future behavior. For instance, Parker et al [12]made a review of control algorithms for noninvasive moni-toring and regulation in type I diabetic patients and showedthat model-based predictive control is an attractive choicefor blood glucose concentration regulation. There is a recentattempt to apply external control to neuropharmacology [13].Finally, we also find applications of control laws to buildeffective strategies in gene therapies and tissue engineering[14].

In this paper, we study the problem of controlling a colonyof E. coli by means of global sensing and actuation [15],[16]. In this problem, we assume that we do not have accessto the state of individual cells. Rather, we assume that bysensing we can only measure an averaged quantity across thepopulation. Global actuation means we can only manipulatethe environment of the whole colony without being able tomanipulate the bacteria individually. The control method thatwe use is hybrid model predictive control [17] based on apiecewise affine model of the colony dynamics. Similar con-trol algorithms have been applied in several other applicationdomains, for example in automotive control systems [18],and related theoretical aspects of stability have been recentlystudied in [19].

Model predictive control has characteristics that make itan attractive choice for biomedical systems. This is becausethe controller architecture is particularly well suited to themultivariable nature of these systems, as well as the inherentconstraints involved in the related control problems [20].

II. MATHEMATICAL MODEL OF THE LACTOSE

REGULATION SYSTEM OF E. COLI

A. ODE model

Yildirim and Mackey [5] proposed a biochemicallyfounded ordinary differential model of the lactose-inducednetwork shown in the upper panel of Figure 1. In our earlierwork [15], [16], we adopted the structure of this model andapplied it to the TMG-induced network (lower panel of thesame figure). The equations of motion for induction by TMG(T ) are:

dM

dt= αM

1 + K1(e−µτM T (t − τM ))n

K + K1(e−µτM T (t − τM ))n+ Γ0 − γMM, (1a)

dB

dt= αBe−µτB M(t − τB) − γBB, (1b)

dT

dt= αLP

Te

KTe+ Te

− βLPT

KL1+ T

− γLT, (1c)

dP

dt= αP e−µ(τP +τB)M(t − τP − τB) − γP P. (1d)

The variables M , P , and B signify the concentrations ofmRNA, permease, and β-galactosidase in the cell. We takeinto account time delays due to transcription and translation.Variables without an argument are taken at time t, timedelays are indicated by an explicit argument, e.g., M(t−τB)is the value of the variable M delayed with τB .

The symbol Te in equation (1c) signifies the external TMGconcentration. If the system is to be viewed as an input-statesystem, then Te can be thought of as an input to the system,while the other four concentrations are the state variables.

0 0.01 0.02 0.03 0.04 0.05 0.06 0.070

0.01

0.02

0.03

0.04

0.05

0.06

External concentration of TMG (mM)

Inte

rna

l co

nce

ntr

atio

n o

f T

MG

(m

M)

Fig. 2. The equilibria of the system given by (1). The middle range of Te

has three branches of equilibria.

The other symbols in the equation are constant parameters,given by the Table I, together with the following relations

TABLE I

SYSTEM PARAMETERS

Value Unit Value Unit

µ 2.26 · 10−2 min−1 KTe6.5·10−4 mM

γM 0.411 min−1 γB 8.33 · 10−4 min−1

γA 0.52 min−1 Γ0 1.0 · 10−6 mM/min

K 7200 αM 9.97 · 10−4 mM/min

τB 2.0 min K1 6.3 · 105 (mM)−2

KL10.36 mM αB 1.66 · 10−2 min−1

τP 0.83 min βL 546.32 min−1

τM 0.1 min αP 10.0 min−1

γL 1.52 min−1 γP 0.6274 min−1

αL 81 min−1 n 2

γM = γM + µ, γB = γB + µ, (2)

γA = γA + µ, γP = γP + µ. , (3)

where µ is the growth rate. The values of the constantsare based on those in [21] but have been modified to giveconsistent behavior to the TMG model in the limit of a largebut finite cell population.

When the value of Te is maintained between 1.4 - 32 µM,the system has three equilibria. Two of these equilibria arestable, giving rise to bistability of the system. Also, varyingthe value of Te causes a hysteresis behavior. See Figure 2for the illustration.

B. Stochastic hybrid model

The upper and lower stable branches of the equilibriacorrespond to the so called induced and uninduced statesof the bacteria. Experimental results have shown that in acolony of bacteria, both states coexist with possibly differentdistributions. Also, the system can spontaneously switchbetween the two states [22]. These results underline thenecessity of expressing stochasticity in the model, if we wantto capture these phenomena.

46th IEEE CDC, New Orleans, USA, Dec. 12-14, 2007 ThC01.3

3914

Te = external concentration of TMG

internal concentration of TMG

06 -(C)2018A.Bemporad-“ModelPredictiveControl”course

Hybrid MPC OF Induction of Escherichia Coli

�75

• BistablelactoseregulationsystemofE.coli

Low state(uninduced)

High state(induced)

λ1(Te)

λ2(Te)

Fig. 3. Two state continuoustime Markov chain model.

1 2 3 4 50

1

2

3

4

5

6

7

8x 10

−3

external concentration of TMG (µM)

ave

rage tra

nsi

tion r

ate

(m

in−

1)

λ2

λ1

Fig. 4. The relation betweenthe transition rates λ1 and λ2of the Markov chain and Te.

In our earlier work, we expressed the stochasticity of thesystem by constructing a stochastic hybrid system model ofthe system [15], [16]. This stochastic hybrid model is basedon a modified Gillespie’s explicit τ -leaping algorithm [23].

In terms of stochastic differential equations, our hybridstochastic model can be written as follows.

dMt = dMt − dMt, (4a)

dBt = dBt − dBt, (4b)

dTt

dt=

TeαLPt

KLe+ Te

−βLPtTt

KL1+ Tt

− γLTt, (4c)

dPt

dt= αP e−µ(τP +τB) M(t−τP −τB)

CN− γP Pt. (4d)

Here the processes Mt and Mt are the Poisson processesthat are responsible for the creation and breaking up of themessenger RNA molecules, respectively. Similarly, Bt andBt are the Poisson processes that are responsible for thecreation and breaking up of the β - galactosidase molecules,respectively. The rates of these processes are state dependent,and are given as follows.

λM (t) = CN

!

αM

1 + K1(e−µτM T(t−τM ))n

K + K1(e−µτM T(t−τM ))n+ Γ0

"

, (5a)

λM (t) = γMMt, (5b)

λB(t) = αBe−µτBM(t−τB), (5c)

λB(t) = γBBt, (5d)

where the conversion constant CN = 6.023 · 104 moleculesmM .

C. Two state Markov chain model

In our earlier work [15], [16], we also proposed anabstraction for the stochastic hybrid model described in theprevious subsection. The fact that the cells can spontaneouslyswitch between the two phenotypical states (induced anduninduced) is captured by modeling the system as a two-statecontinuous time Markov chain, whose states are induced

and uninduced (see Figure 3). The transition rates betweenthe two states are assumed to be functions of the externalTMG concentration (Te) (see Figure 4).

Given the continuous time Markov chain model as inFigure 3, we can compute the probability distribution of thestates as follows. Define xlo(t) and xhi(t) as the probability

fractionof

induction

CONTROLLER

ext.TMG

reference input

u(t) y(t)

y (t)r

Fig. 5. The control block diagram.

of finding the system at time t in the low and high state re-spectively. The probability distribution satisfies the followingdifferential equation.

d

dt

!

xlo

xhi

"

=

!

−λ1(Te) λ2(Te)λ1(Te) −λ2(Te)

" !

xlo

xhi

"

. (6)

III. INDUCTION CONTROL OF A COLONY OF E. COLI

The architecture of the control system that we discuss inthis paper is illustrated in Figure 5. The plant to be controlledin a large colony of E. coli bacteria. The controller affectsthe plant by adjusting of the external concentration of TMGin the environment. Feedback information is read from theplant in the form of a global quantity, which we consideras the output of the control system. By this, we mean thecontroller does not have any information about the individualcells in the colony. Rather, the controller relies on sensing aglobal quantity, for example, the fraction of induced cells inthe population. The control goal is to make the output tracka given reference trajectory or attain a desired level.

Control actuation by means of adjusting the externalconcentration of TMG in the environment can be realizedas follows. Increasing the concentration can be done, forexample by injecting the enzyme into the plant. There area number of limitations associated to this method. First,the concentration cannot be made arbitrarily high since itcan only be as high as the concentration of the injectedenzyme. Second, the concentration cannot evolve arbitrarilyfast. Decreasing the external concentration can be done, forexample through dilution of the enzyme in the plant.

Sensing activity level of the colony can be done throughsensing of certain protein concentrations in the cells. Acertain protein called the gfp (green fluorescent protein) canbe encoded in the lac operon. When the genes in the operonare expressed, gfp is also produced. Thus, the concentrationof gfp in the cell can be used as an indicator for the activityof the cell. The protein gfp emits green light. Therefore wecan use the luminescence of the cells as a way to measureits level of activity. This is actually a standard procedure insynthetic biology [3], [24].

In [15], [16], we have proven that the design of a feedbackcontroller for such a control problem can be cast as thefollowing problem.

46th IEEE CDC, New Orleans, USA, Dec. 12-14, 2007 ThC01.3

3915

Low state(uninduced)

High state(induced)

λ1(Te)

λ2(Te)

Fig. 3. Two state continuoustime Markov chain model.

1 2 3 4 50

1

2

3

4

5

6

7

8x 10

−3

external concentration of TMG (µM)

ave

rage tra

nsi

tion r

ate

(m

in−

1)

λ2

λ1

Fig. 4. The relation betweenthe transition rates λ1 and λ2of the Markov chain and Te.

In our earlier work, we expressed the stochasticity of thesystem by constructing a stochastic hybrid system model ofthe system [15], [16]. This stochastic hybrid model is basedon a modified Gillespie’s explicit τ -leaping algorithm [23].

In terms of stochastic differential equations, our hybridstochastic model can be written as follows.

dMt = dMt − dMt, (4a)

dBt = dBt − dBt, (4b)

dTt

dt=

TeαLPt

KLe+ Te

−βLPtTt

KL1+ Tt

− γLTt, (4c)

dPt

dt= αP e−µ(τP +τB) M(t−τP −τB)

CN− γP Pt. (4d)

Here the processes Mt and Mt are the Poisson processesthat are responsible for the creation and breaking up of themessenger RNA molecules, respectively. Similarly, Bt andBt are the Poisson processes that are responsible for thecreation and breaking up of the β - galactosidase molecules,respectively. The rates of these processes are state dependent,and are given as follows.

λM (t) = CN

!

αM

1 + K1(e−µτM T(t−τM ))n

K + K1(e−µτM T(t−τM ))n+ Γ0

"

, (5a)

λM (t) = γMMt, (5b)

λB(t) = αBe−µτBM(t−τB), (5c)

λB(t) = γBBt, (5d)

where the conversion constant CN = 6.023 · 104 moleculesmM .

C. Two state Markov chain model

In our earlier work [15], [16], we also proposed anabstraction for the stochastic hybrid model described in theprevious subsection. The fact that the cells can spontaneouslyswitch between the two phenotypical states (induced anduninduced) is captured by modeling the system as a two-statecontinuous time Markov chain, whose states are induced

and uninduced (see Figure 3). The transition rates betweenthe two states are assumed to be functions of the externalTMG concentration (Te) (see Figure 4).

Given the continuous time Markov chain model as inFigure 3, we can compute the probability distribution of thestates as follows. Define xlo(t) and xhi(t) as the probability

fractionof

induction

CONTROLLER

ext.TMG

reference input

u(t) y(t)

y (t)r

Fig. 5. The control block diagram.

of finding the system at time t in the low and high state re-spectively. The probability distribution satisfies the followingdifferential equation.

d

dt

!

xlo

xhi

"

=

!

−λ1(Te) λ2(Te)λ1(Te) −λ2(Te)

" !

xlo

xhi

"

. (6)

III. INDUCTION CONTROL OF A COLONY OF E. COLI

The architecture of the control system that we discuss inthis paper is illustrated in Figure 5. The plant to be controlledin a large colony of E. coli bacteria. The controller affectsthe plant by adjusting of the external concentration of TMGin the environment. Feedback information is read from theplant in the form of a global quantity, which we consideras the output of the control system. By this, we mean thecontroller does not have any information about the individualcells in the colony. Rather, the controller relies on sensing aglobal quantity, for example, the fraction of induced cells inthe population. The control goal is to make the output tracka given reference trajectory or attain a desired level.

Control actuation by means of adjusting the externalconcentration of TMG in the environment can be realizedas follows. Increasing the concentration can be done, forexample by injecting the enzyme into the plant. There area number of limitations associated to this method. First,the concentration cannot be made arbitrarily high since itcan only be as high as the concentration of the injectedenzyme. Second, the concentration cannot evolve arbitrarilyfast. Decreasing the external concentration can be done, forexample through dilution of the enzyme in the plant.

Sensing activity level of the colony can be done throughsensing of certain protein concentrations in the cells. Acertain protein called the gfp (green fluorescent protein) canbe encoded in the lac operon. When the genes in the operonare expressed, gfp is also produced. Thus, the concentrationof gfp in the cell can be used as an indicator for the activityof the cell. The protein gfp emits green light. Therefore wecan use the luminescence of the cells as a way to measureits level of activity. This is actually a standard procedure insynthetic biology [3], [24].

In [15], [16], we have proven that the design of a feedbackcontroller for such a control problem can be cast as thefollowing problem.

46th IEEE CDC, New Orleans, USA, Dec. 12-14, 2007 ThC01.3

3915

• Theprobabilitiesxlo,xhitobeinlow/highstatesatisfythedynamics

two-state Markov chain

Controller design: Given a plant model

d

dt

!

x1

x2

"

=

!

−λ1(u) λ2(u)λ1(u) −λ2(u)

" !

x1

x2

"

, (7a)

y(t) = x2(t), (7b)

design a controller that reads the output y(t) and outputs thecontrol input u(t), such that the output of the system y(t)tracks a given reference signal yr(t).

IV. HYBRID MODEL PREDICTIVE CONTROL SOLUTION

In this paper, we propose a model predictive control solu-tion to the above mentioned control problem. The underlyingidea is to approximate the plant model (7) by a piecewiselinear model that is obtained by assuming that λ1(u) andλ2(u) are piecewise constant functions

λi(u) = λji if uj−1 ≤ u < uj , j = 1, . . . , 6, i = 1, 2 (8)

where the intervals [uj−1, uj) and the corresponding values

of λji are given by Table II. The values of λ1 and λ2 in the

table are determined from the identified rates as in Figure 4.

TABLE II

TRANSITION RATES AS PIECEWISE CONSTANT FUNCTIONS OF u.

u[10−3mM] λ1(u)[min−1] λ2(u)[min−1][1.4, 1.5) 8.68 · 10−4 5.91 · 10−3

[1.5, 1.6) 9.27 · 10−4 3.61 · 10−3

[1.6, 1.7) 1.13 · 10−3 2.36 · 10−3

[1.7, 1.8) 1.39 · 10−3 1.54 · 10−3

[1.8, 1.9) 1.67 · 10−3 9.53 · 10−4

[1.9, 2.0) 1.93 · 10−3 5.54 · 10−4

The control input u(t) is assumed to be a piecewiseconstant signal that changes value every interval of lengthTs. Thus, the idea is to compute and (if necessary) alterthe control input value once every sampling interval Ts. Themodel described by (7), (8) and Table II is then discretizedas follows.

x ((n + 1)Ts) = eA(u(nTs))Tsx(nTs), (9a)

u((n + 1)Ts) = u(nTs) + ∆n, (9b)

y(nTs) = x2(nTs), (9c)

for any n ∈ Z+. The matrix A(u(nTs)) is given by

A(u(nTs)) =

!

−λ1(u(nTs)) λ2(u(nTs))λ1(u(nTs)) −λ2(u(nTs))

"

,

where the values of λ1 and λ2 are given in Table II. Theterm ∆n represents the update of the control input value.

At any time t = nTs, the update of the control inputis computed by solving the following receding horizonoptimization problem (RCOP) iteratively.Receding horizon optimization problem (RCOP). Find∆n+k, k ∈ {0, . . . , N − 1} that minimize the cost

J =N−1#

k=0

|y((n + k)Ts) − yr((n + k)Ts)| + γ |∆n+k| ,

(10)subject to

timet t+Ts ... t+NTs

implemented control input

optimization horizon

Fig. 6. The receding horizon optimization problem. At any time t, onlythe first interval of the computer control input is implemented.

• the initial condition x(nTs)• the system dynamics ((8), (9) and Table II ), and• for k ∈ {0, . . . , N − 1},

|∆n+k| ≤ 2 · 10−3,

1.4 · 10−3 ≤ u((n + k)Ts) ≤ 2 · 10−3.

Variable N defines the length of optimization horizon.Although the optimization is solved for N steps, only thecontrol input value of the first interval is actually imple-mented. At the next step, the RCOP is re-initialized with theactual state as the initial condition. A schematic describingthe algorithm is shown in Figure 6.

The cost function J in (10) is designed such that thetracking error y−yr is minimized. However we also includea term that carries a penalty for ∆. The idea behind thisinclusion is to make sure that the update of the control inputdoes not fluctuate too much.

One advantage of using model predictive control over theother control strategies that we have designed in [15], [16]is that we can impose that the control input value doesnot fluctuate a lot while making sure that the output ofthe system (the fraction of induction) tracks the referencevalue. Although at sampling times the control input can bediscontinuous, if the sampling interval Ts is large enough,the control can still be realistically implemented.

V. SIMULATION RESULTS

We simulate the application of the MPC controller on aplant with 5000 cells. We fix the horizon length N = 2and the weight γ = 10 in the cost function (10). Thereference signal is fixed at 0.5. That is, we aim at attainingand maintaining a 50% induction fraction.

The hybrid dynamical system defined by (8), (9) and TableII is modeled in HYSDEL [25] and translated into a mixedlogical dynamical system [17] having 3 continuous states,1 continuous input, 2 continuous outputs, 15 continuousauxiliary variables, 5 binary variables, and 80 mixed-integerlinear inequalities.

Figure 7 shows the comparative simulation results of boththe abstract model and stochastic hybrid model of the colonyof bacteria with 5000 cells for two initial conditions, fullyinduced and fully uninduced. The sampling time is fixedat Ts = 10 min. We can see that the desired fraction ofinduction of 50% is attained and maintained.

In Figure 7 we can also see that the simulation resultsusing the abstract model and the stochastic hybrid model areclose. This demonstrates the effectiveness of using the muchsimpler abstract model in designing the controller, despite ofthe application on the stochastic hybrid model.

46th IEEE CDC, New Orleans, USA, Dec. 12-14, 2007 ThC01.3

3916

• Transitionratesλ1,λ2modeledaspiecewiseconstantfunctionsofTe

Te Te Te

Hybrid MPC OF Induction of Escherichia Coli

©2020 A. Bemporad - "Model Predictive Control" 72/73

Page 79: ModelPredictiveControlcse.lab.imtlucca.it/~bemporad/teaching/mpc/imt/6-hybrid... · 2020-05-11 · DA { Fe1 = {IF gear1 THEN torque/speed_factor*Rgear1}; Fe2 = {IF gear2 THEN torque/speed_factor*Rgear2};

Hybrid MPC OF Induction of Escherichia Coli

©2020 A. Bemporad - "Model Predictive Control" 73/73