52
/52 © 2009 by A. Bemporad Controllo di Processo e dei Sistemi di Produzione ‐ A.a. 2008/09 1 Model Predictive Control of Hybrid Systems

Model Predictive Control of Hybrid Systems

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 1

ModelPredictiveControlofHybridSystems

Page 2: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 2

HybridControlProblem

binaryinputs

continuousinputs

binarystates

continuousstates

on‐linedecisionmaker

desiredbehavior

constraints

hybridprocess

Page 3: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 3

ModelPredictiveControlofHybridSystems

y(t)u(t)

HybridSystem

Reference

r(t)

OutputInput

Measurements

Controller

• MODEL:useanMLD(orPWA)modeloftheplanttopredictthefuturebehaviorofthehybridsystem

• PREDICTIVE:optimizationisstillbasedonthepredictedfutureevolutionofthehybridsystem

• CONTROL:thegoalistocontrolthehybridsystem

MLDmodel

Page 4: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 4

•Attimetsolvewithrespecttothefinite‐horizonopen‐loop,optimalcontrolproblem:

Predictedoutputs

Manipulated

y(t+k|t)

Inputs

t t+1 t+T

futurepast

u(t+k)

ModelPredictive(MPC)Control

•Applyonlyu(t)=ut*(discardtheremainingoptimalinputs)

•Attimet+1:getnewmeasurements,repeatoptimization

HybridModelPredictiveControl

Page 5: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 5

Proof:EasilyfollowsfromstandardLyapunovarguments

(Bemporad,Morari1999)

Morestabilityresults:see(Lazar,Heemels,Weiland,Bemporad,2006)

Closed‐loopConvergence

Page 6: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 6

ConvergenceProof

Note:Globaloptimumnotneededforconvergence!

Lyapunovfunction

Page 7: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 7

Openloopbehavior

PWAsystem:

Constraint:

gotodemo/demos/hybrid/bm99sim.m

HybridMPC‐Example

Page 8: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 8

/demos/hybrid/bm99.hys

/* 2x2 PWA system - Example from the paper A. Bemporad and M. Morari, ``Control of systems integrating logic, dynamics, and constraints,'' Automatica, vol. 35, no. 3, pp. 407-427, 1999. (C) 2003 by A. Bemporad, 2003 */

SYSTEM pwa { INTERFACE { STATE { REAL x1 [-10,10]; REAL x2 [-10,10];}

INPUT { REAL u [-1.1,1.1];}

OUTPUT{ REAL y;}

PARAMETER { REAL alpha = 1.0472; /* 60 deg in radiants */ REAL C = cos(alpha); REAL S = sin(alpha);} }

IMPLEMENTATION { AUX { REAL z1,z2; BOOL sign; } AD { sign = x1<=0; }

DA { z1 = {IF sign THEN 0.8*(C*x1+S*x2) ELSE 0.8*(C*x1-S*x2) }; z2 = {IF sign THEN 0.8*(-S*x1+C*x2) ELSE 0.8*(S*x1+C*x2) }; } CONTINUOUS { x1 = z1; x2 = z2+u; }

OUTPUT { y = x2; } }}

HYSDELmodel

HybridMPC‐Example

Page 9: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 9

Closed‐loop:

Performanceindex:

HybridMPC‐Example

Page 10: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 10

HybridMPC–TemperatureControl

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

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

>>refs.x=2; % just weight state #2>>Q.x=1;>>Q.rho=Inf; % hard constraints>>Q.norm=2; % quadratic costs>>N=2; % optimization horizon>>limits.xmin=[25;-Inf];

>> C

Hybrid controller based on MLD model S <heatcoolmodel.hys>

2 state measurement(s) 0 output reference(s) 0 input reference(s) 1 state reference(s) 0 reference(s) on auxiliary continuous z-variables 20 optimization variable(s) (8 continuous, 12 binary) 46 mixed-integer linear inequalitiessampling time = 0.5, MILP solver = 'glpk' Type "struct(C)" for more details.>>

Page 11: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 11

HybridMPC–TemperatureControl

Page 12: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 12

OptimalControlofHybridSystems:ComputationalAspects

Page 13: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 13

MixedIntegerQuadraticProgram(MIQP)

(Bemporad,Morari,1999)

•Optimizationvector:

MIQPFormulationofMPC

Page 14: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 14

(Bemporad,Borrelli,Morari,2000)

MixedIntegerLinearProgram(MILP)

•Optimizationvector:

•Basictrick:introduceslackvariables

MIQPFormulationofMPC

Page 15: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 15

BUT

Phasetransitionshavebeenfoundincomputationallyhardproblems.

(Monassonetal.,Nature,1999)

0 2 3 4 5

RatioofConstraintstoVariables

6 7 8

1000

3000

CostofC

ompu

tatio

n

2000

4000

50var40var20var

•GeneralpurposeBranch&Bound/Branch&CutsolversavailableforMILP

andMIQP(CPLEX,Xpress‐MP,BARON,GLPK,...)

•Noneedtoreachglobaloptimum(seeproofofthetheorem),althoughperformancedeteriorates

http://plato.la.asu.edu/bench.htmlMoresolversandbenchmarks:

K‐SAT•Mixed‐IntegerProgrammingisNP‐complete

Mixed‐IntegerProgramSolvers

Page 16: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 16

SolvingMixed‐IntegerPrograms

•Somevariablesarecontinuous,somearediscrete(0/1)

•Ingeneral,itisaNP‐Hardproblem

•Naivesolution:enumerateallpossibleintegersolutionsandchoosethebestone.

Butmbinaryvariablesleadto2m solutions,eachofwhichrequiresaLPImpossiblebutforextremelysmallm!

Page 17: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 17

trueoptimum

Branch&BoundAlgorithm

1. Solvea“relaxed”problemwithallbinaryvariablestreatedascontinuous,0≤δi≤1.Thisgivesa(lower)boundonthe“bestpossible”solution.Unfortunately,someδimayhavefractionalparts.

3. Useaboundontheoptimalcosttoeliminateinoneshotalargenumberofcombinationsthatarecertainlynotleadingtotheoptimum(=advantageoverfullenumeration)

4. Branchagainonanothervariable,andsoon,untilnofurtherbranchingispossible.

constraints

2. Branchononebinaryvariable:setδj=0andδj=1intwoseparatesolutions,forsomej

Costfunction

“relaxed”optimum

Page 18: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 18

ASimpleExampleinSupplyChainManagement

manufacturerA

manufacturerB

manufacturerC

inventory1

inventory2

retailer1

Page 19: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 19

SystemVariables

xij(k)=amountofjholdininventoryi attime k(i=1,2,j=1,2)

•continuousstates:

yj(k)=amountofjsoldattimek (j=1,2)

•continuousoutputs:

uij(k)=amountofjtakenfrominventoryiattimek (i=1,2,j=1,2)

•continuousinputs:

UXij(k)=1ifmanufacturerXproducesandsendjtoinventoryiattimek

•binaryinputs:

Page 20: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 20

Constraints

•Maxcapacityofinventoryi:0·∑jxij(k)·xMi

•Maxtransportationfrominventories:0·uij(k)·uM

•Aproductcanonlybesenttooneinventory:

UA11(k)andUA21(k)cannotbe=1atthesametimeUB11(k)andUB21(k)cannotbe=1atthesametimeUB12(k)andUB22(k)cannotbe=1atthesametimeUC12(k)andUC22(k)cannotbe=1atthesametime

[UB11(k)=1orUB21(k)=1]and[UB12(k)=1orUB22(k)=1]cannotbetrue

•Amanufacturercanonlyproduceonetypeofproductatonetime:

Numericalvalues:xM1=10,xM2=10

Page 21: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 21

Dynamics

•Levelofinventories:

Numericalvalues:PA1=4,PB1=6,PB2=7,PC2=3

Page 22: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 22

HybridDynamicalModelSYSTEM supply_chain{INTERFACE { STATE { REAL x11 [0,10]; REAL x12 [0,10]; REAL x21 [0,10]; REAL x22 [0,10]; } INPUT { REAL u11 [0,10]; REAL u12 [0,10]; REAL u21 [0,10]; REAL u22 [0,10]; BOOL UA11,UA21,UB11,UB12,UB21,UB22,UC12,UC22; }

OUTPUT {REAL y1,y2;}

PARAMETER { REAL PA1,PB1,PB2,PC2,xM1,xM2;}}IMPLEMENTATION {

AUX { REAL zA11, zB11, zB12, zC12, zA21, zB21, zB22, zC22;}

DA { zA11 = {IF UA11 THEN PA1 ELSE 0}; zB11 = {IF UB11 THEN PB1 ELSE 0}; zB12 = {IF UB12 THEN PB2 ELSE 0}; zC12 = {IF UC12 THEN PC2 ELSE 0}; zA21 = {IF UA21 THEN PA1 ELSE 0}; zB21 = {IF UB21 THEN PB1 ELSE 0}; zB22 = {IF UB22 THEN PB2 ELSE 0}; zC22 = {IF UC22 THEN PC2 ELSE 0}; }

CONTINUOUS {x11 = x11 + zA11 + zB11 - u11; x12 = x12 + zB12 + zC12 - u12; x21 = x21 + zA21 + zB21 - u21; x22 = x22 + zB22 + zC22 - u22; }

OUTPUT { y1 = u11 + u21; y2 = u12 + u22; }

MUST { ~(UA11 & UA21); ~(UC12 & UC22); ~((UB11 | UB21) & (UB12 | UB22)); ~(UB11 & UB21); ~(UB12 & UB22); x11+x12 <= xM1; x11+x12 >=0; x21+x22 <= xM2; x21+x22 >=0; }} }/demos/hybrid/supply_chain.m

Page 23: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 23

Objectives

•Meetcustomerdemandasmuchaspossible:y1¼r1,y2¼r2

•Minimizetransportationcosts

•Fulfillallconstraints

Page 24: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 24

cost from C to inventories

PerformanceSpecspenalty on demand tracking error

cost for shippingfrom inv.#1 to market

cost for shippingfrom inv.#2 to market

cost from A to inventories

cost from B to inventories

Page 25: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 25

Simulationsetup

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

>>refs.y=[1 2]; % weights output2 #1,#2>>Q.y=diag([10 10]); % output weights…>>Q.norm=Inf; % infinity norms>>N=2; % optimization horizon>>limits.umin=umin; % constraints>>limits.umax=umax;>>limits.xmin=xmin;>>limits.xmax=xmax;

>> C

Hybrid controller based on MLD model S <supply_chain.hys> [Inf-norm]

4 state measurement(s) 2 output reference(s) 12 input reference(s) 0 state reference(s) 0 reference(s) on auxiliary continuous z-variables 44 optimization variable(s) (28 continuous, 16 binary)176 mixed-integer linear inequalitiessampling time = 1, MILP solver = 'glpk' Type "struct(C)" for more details.

>>

Page 26: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 26

Simulationresults

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

>>x0=[0;0;0;0]; % Initial condition>>r.y=[6+2*sin((0:Tstop-1)'/5) % Reference trajectories 5+3*cos((0:Tstop-1)'/3)];

CPUtime:¼30mspertimestep(usingGLPKonthismachine)

Page 27: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 27

ExplicitHybridMPC

Page 28: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 28

ExplicitHybridMPC(MLD)

•On‐lineoptimization:solvetheproblemforeachgivenx(t)

multi‐parametricMixedIntegerLinearProgram(mp‐MILP)

Mixed‐IntegerLinearProgram(MILP)

•Off‐lineoptimization:solvetheMILPforallx(t)inadvance

Page 29: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 29

‐60 ‐40 ‐20 0 20 40 60‐60

‐40

‐20

0

20

40

60

CR{2,3}

CR{1,4} CR{1,2,3}

CR{1,3}

x1

x2

ExampleofMultiparametricSolution

MultiparametricLP

Page 30: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 30

•Theorem:Themultiparametricsolutionispiecewiseaffine

(Dua,Pistikopoulos,1999)

•mp‐MILPcanbesolved(byalternatingMILPsandmp‐LPs)

MultiparametricMILP

•TheMPCcontrollerispiecewiseaffineinx,r (x,r)‐space

1

2

3

M4

5 6

Page 31: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 31

ExplicitHybridMPC(PWA)

•TheMPCcontrollerispiecewiseaffineinx,r

Note:inthe2‐normcasethepartitionmaynotbefullypolyhedral

(x,r)‐space

1

2

3

M4

5 6

Page 32: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 32

UseacombinationofDP(dynamicprogramming)andmpLP

ComputationofExplicitHybridMPC(PWA)

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

(Mayne,ECC2001)

Note:inthe2‐normcase,thefullyexplicitpartitionmaynotbepolyhedral

1‐Usebackwards(=DP)reachabilityanalysisforenumeratingallfeasiblemodesequencesI={i(0),i(1),…,i(T)};

2‐ForeachfixedsequenceI,solvetheexplicitfinite‐timeoptimalcontrolproblemforthecorrespondinglineartime‐varyingsystem(mpQPormpLP);

3‐Case1/1‐norm:Comparevaluefunctionsandsplitregions.Quadraticcase:keepoverlappingregions(possiblyeliminateoverlapsthatareneveroptimal)andcompareon‐line(ifneeded).

MethodA:

MethodB: (Bemporad,HybridToolbox,2003)(Alessio,Bemporad,ADHS2006)

(1‐norm,1‐norm),ormpQP(quadraticforms)

Page 33: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 33

HybridControlExamples(Revisited)

Page 34: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 34

Openloopbehavior:

PWAsystem:

Constraints:

Closedloop:

HybTbx:/demos/hybrid/bm99sim.m

Objective:

Hybridcontrolexample

Page 35: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 35

ExplicitPWAController

(CPUtime:1.51s,PentiumM1.4GHz)

HybTbx:/demos/hybrid/bm99sim.m

Sectionwith r=0

x1

x2

PWAlaw´MPClaw!

Page 36: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 36

Closedloop:

Hybridcontrolexample

Page 37: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 37

ExplicitPWARegulator

PredictionhorizonN=1

HybTbx:/demos/hybrid/bm99benchmark.m

Objective:

PredictionhorizonN=2 PredictionhorizonN=3

Page 38: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 38

ExplicitMPC–TemperatureControl

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

>> E

Explicit controller (based on hybrid controller C) 3 parameter(s) 1 input(s) 12 partition(s)sampling time = 0.5 The controller is for hybrid systems (tracking)This is a state-feedback controller. Type "struct(E)" for more details.>>

Sectioninthe(T1,T2)‐spaceforTref=30

Page 39: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 39

ExplicitMPC–TemperatureControl

GeneratedC‐code

utils/expcon.h

Page 40: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 40

•Alternatives: (1)solveMIPon‐line (2)evaluateaPWAfunction

•Smallproblems(shorthorizonN=1,2,oneortwoinputs):explicitPWAcontrollawpreferable

‐timetoevaluatethecontrollawisshorterthanMIP

‐controlcodeissimpler(nocomplexsolvermustbeincludedinthecontrolsoftware!)

‐moreinsightincontroller’sbehavior

•Medium/largeproblems(longerhorizon,manyinputsandbinaryvariables):MIPpreferable

ImplementationAspectsofHybridMPC

Page 41: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 41

physicalsystem

toocomplex

?

hybridmodel

implementation(Ccode)andexperiments

yes

no

simulationandvalidation

simulationandvalidation

optimalcontrolsetup

(on‐lineMIP)

PWAcontrollaw

controlobjectives&constraints

multi‐parametricsolver

Matlabtool:HybridToolbox

Hybridcontroldesignflow

Page 42: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 42

MovingHorizonEstimationFaultDetection&Isolation

Page 43: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 43

StateEstimation/FaultDetection

•Solution:UseMovingHorizonEstimationforMLDsystems(dualofMPC)

(Bemporad,Mignone,Morari,ACC1999)

•Inputdisturbances•Outputdisturbances

•Problem:givenpastoutputmeasurementsandinputs,estimatethecurrentstatesandfaults

MHEoptimization=MIQPConvergencecanbeguaranteed

(Ferrari‐T.,Mignone,Morari,2002)

AugmenttheMLDmodelwith:

Ateachtimetsolvetheproblem:

andgetestimate

Faultdetection: augmentMLDwithunknownbinarydistubances

t‐T t+1‐T t‐1 t+1‐1

Page 44: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 44

•:valveV1blockedfor

Example:ThreeTankSystem

•:leakintank1for

COSYBenchmarkproblem,ESF

Page 45: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 45

•:valveV1blockedfor

Example:ThreeTankSystem

•:leakintank1for

COSYBenchmarkproblem,ESF

• Addlogicconstraint

Page 46: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 46

AFewHybridMPCTricks…

Page 47: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 47

MeasuredDisturbances

•Augmentthehybridpredictionmodelwithaconstantstate

•Disturbancev(k)canbemeasuredattimek

INTERFACE{ STATE{ REAL x [-1e3, 1e3]; REAL xv [-1e3, 1e3]; } ... }IMPLEMENTATION{ CONTINUOUS{ x = A*x + B*u + Bv*xv xv= xv; ... }}

•InHysdel:

/demos/hybrid/hyb_meas_dist.m

Note:sametrickappliestolinearMPC

Page 48: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 48

HybridMPC‐Tracking

•Optimizationproblem:(MIQP)

•Optimalcontrolproblem(quadraticperformanceindex):

Note:sametrickasinlinearMPC

Page 49: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 49

IntegralActioninHybridMPC•Augmentthehybridpredictionmodelwithintegratorsofoutputerrorsasadditionalstates:

=samplingtime

INTERFACE{ STATE{ REAL x [-100,100]; ... REAL epsilon [-1e3, 1e3]; REAL r [0, 100]; } OUTPUT { REAL y; } ... }IMPLEMENTATION{ CONTINUOUS{ epsilon=epsilon+Ts*(r-(c*x)); r=r; ... } OUTPUT{ y=c*x; } }

•InHYSDEL:

•Treatr(k)asameasureddisturbance(=additionalconstantstate)

•Addweightonε(k)incostfunctiontomakeε(k)!0

/demos/hybrid/hyb_integral_action.m

Note:sametrickappliestolinearMPC

Page 50: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 50

VariableConstraintsProblem:changeupper(and/orlower)boundsonline

3.On‐lineimplementation:feedthestatebacktothecontroller

Note:sametrickappliestolinearMPC

1.Addaconstantstateandanewoutputinthepredictionmodel:

2.Addoutputconstraint

/demos/linear/varbounds.mou

tput

inpu

t

Page 51: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 51

AsymmetricWeights

•Sayyouwanttoweightavariableu(k)onlyifu(k)¸0

INTERFACE{ INPUT{ REAL u [-100,100]; REAL zu [-1, 1e3]; ... }IMPLEMENTATION{ MUST{ zu >= u; zu >= 0; } }

•InHysdel:

•Onewayistointroduceabinaryvariable[±=1]$[u¸0],acontinuousvariablezu=uif±=1,zu=0otherwise,andweightzu

•Bettersolution:avoid±andset:

Note:sametrickappliestolinearMPC

•When1‐normsareused,onecandothesametrick:

(betterway:iftheMILPproblemconstructorcanbeaccessed,avoidintroducingzuandjustremovetheconstraint²u(k)¸–[R]iu(k)usedtominimize|Ru(k)|,withconstraint²u(k)¸0)

Page 52: Model Predictive Control of Hybrid Systems

/52©2009byA.Bemporad ControllodiProcessoedeiSistemidiProduzione‐A.a.2008/09 52

GeneralRemarksAboutMIPModeling

Thecomplexityofsolvingamixed‐integerprogramlargelydependsonthenumberofinteger(binary)variablesinvolvedintheproblem.

Bethriftywithintegervariables!

Henceforth,whencreatingahybridmodelonehasto

Modelingisanart(aunifyinggeneraltheorydoesnotexist)

Generallyspeaking:

Addinglogicalconstraintsusuallyhelps...