24
Optimal control University of Strasbourg Telecom Physique Strasbourg, ISAV option Master IRIV, AR track Part 2 – Predictive control

Part 2 – Predictive control - Unistraicube-avr.unistra.fr/fr/images/d/d6/Cours_mpc_2012.pdf · Part 2 – Predictive control . Outline 1. Introduction 2. System modelling 3. Cost

Embed Size (px)

Citation preview

Optimal control University of Strasbourg Telecom Physique Strasbourg, ISAV option Master IRIV, AR track Part 2 – Predictive control

Outline 1.  Introduction 2.  System modelling 3.  Cost function 4.  Prediction equation 5.  Optimal control 6.  Examples 7.  Tuning of the GPC 8.  Nonlinear predictive control 9.  References

10/12/12 [email protected] 2

1. Introduction 1.1. Definition of MPC

� Model Predictive Control (MPC) �  Use of a model to predict the behaviour of the

system. �  Compute a sequence of future control inputs that

minimize the quadratic error over a receding horizon of time.

�  Only the first sample of the sequence is applied to the system. The whole sequence is re-evaluated at each sampling time.

10/12/12 [email protected] 3

1. Introduction 1.2. Principle of MPC

10/12/12 [email protected] 4

r t +1( )!

r t + N2( )

!

"

###

$

%

&&&

+!

Prediction

y t +1( )!

y t + N2( )

!

"

###

$

%

&&&

Optimization

u t( )!

u t + Nu !1( )

"

#

$$$

%

&

'''

u t( )System

y t( )

N2 future references

N2 predicted outputs

Nu future control signals

1. Introduction 1.2. Principle of MPC

10/12/12 [email protected] 5

t t + N1 t + N2

Receding

Horizon

r

y

Goal of the optimization : minimizing

1. Introduction 1.3. Various flavours of MPC

� DMC (Dynamic Matrix Control) �  Uses the system’s step response. �  The system must be stable and without integrator.

� MAC (Model Algorithmic Control) �  Uses the system’s impulse response.

�  PFC (Predictive Functional Control) �  Uses a state space representation of the system. �  Can apply to nonlinear systems.

� GPC (Generalized Predictive Control) �  Uses a CARMA model of the system. �  The most commonly used.

10/12/12 [email protected] 6

1. Introduction 1.4. Advantages / drawbacks of MPC

� Advantages �  Simple principle, easy and quick tuning. �  Applies to every kind of systems (non minimum

phase, instable, MIMO, nonlinear, variant). �  If the reference of the disturbance is known in

advance, it can drastically improve the reference tracking accuracy.

�  Numerically stable.

� Drawback �  Good knowledge of the system model.

10/12/12 [email protected] 7

2. Modelling 2.1. Example of MAC

�  Input-output relationship :

� Truncation of the response :

� Drawbacks : �  Model is not in its minimal form. �  Computationally demanding.

10/12/12 [email protected] 8

y t( )= hiu t ! i( )

i=1

"

#

y t + k | t( )= hiu t + k ! i | t( )

i=1

N

"

2. Modelling 2.2. The case of the GPC

� CARMA modelling (Controller Auto-Regressive Moving Average) :

� With :

� Usually :

10/12/12 [email protected] 9

A q-1( ) y t( )= q-d B q-1( )u t !1( )+ C q-1( )

D q-1( ) e t( )

A q-1( )=1+ a1q-1 + a2q

-2 +…+ anaq-na

B q-1( )= b0 + b1q-1 + b2q

-2 +…+ bnbq-nb

C q-1( )=1+ c1q-1 + c2q

-2 +…+ cncq-nc

!

"##

$##

D q-1( )= ! q-1( )=1" q-1

3. GPC cost function �  For the GPC :

� Tuning parameters : N1 N2 Nu λ

10/12/12 [email protected] 10

J = y t + j | t( )! r t + j( )"# $%

2

j!N1

N2

& + ' (u t + j !1( )"# $%2

j=1

Nu

&

Quadratic error Energy of the control signal

4. GPC prediction equations

�  First Diophantine equation :

� With C=1 :

� Let :

10/12/12 [email protected] 11

C = E j!A+ q-j Fj

1= E j!A+ q-j Fj with deg E j( )= j "1

deg Fj( )= na

#$%

&%

Ay t( )= Bq-du t !1( )+ e t( )"

#

$%%

&

'(() "E jq

j

*"AE j y t + j( )= E j B"u t + j ! d !1( )+ E je t + j( )

4. GPC prediction equations

� Using the Diophantine equation :

� Which yields :

� Thus, the best prediction is :

10/12/12 [email protected] 12

1! q-j Fj( ) y t + j( )= E j B"u t + j ! d !1( )+ E je t + j( )

y t + j( )= Fj y t( )+ E j B!u t + j " d "1( )+ E je t + j( )

y t + j | t( )= E j B!u t + j " d "1( )+ Fj y t( )

4. GPC prediction equations

�  Second Diophantine equation :

�  Separation of control inputs :

� Prediction equation : � With :

10/12/12 [email protected] 13

E j B = Gj + q-j! j

y t + j | t( )= Gj!u t + j " d "1( )Forced response

! "### $###+# j!u t " d "1( )+ Fj y t( )

Free response! "#### $####

y = G !u+ f

y = y t +1+ d |t( )… y t + N2 + d |t( )!" #$T

!u = %u t | t( )…%u t + Nu &1| t( )!" #$T

f = f t +1| t( )… f t + N2 | t( )!" #$T

'

(

))

*

))

4. GPC prediction equations

� And :

� With g0 … gN2-1 the samples of the system’s step response.

10/12/12 [email protected] 14

GN2!Nu=

g0 0 ! 0

g1 g0 ! 0

" " # "gN2"1 gN2"2 ! g0

" " " "gN2"1 gN2"2 ! gN2"Nu

#

$

%%%%%%%%%

&

'

(((((((((

5. Optimal control

� Cost function : � Let :

� With :

� Only the first optimal control sample is applied to the system.

10/12/12 [email protected] 15

J = y ! r( )Ty ! r( )+" !uT !u

!uopt s.t. dJd !u

= 0

! !uopt = GTG +" I( )-1GT r # f( )

r = r t +1( )…r t + N2( )!" #$T

Future references

6. Examples 6.1. First order system

� A system in the CARMA form has the following parameters :

� Compute the system’s prediction equations 3 steps ahead.

10/12/12 [email protected] 16

A = 1! 0.7q-1

B = 0.9! 0.6q-1

C = 1

"

#$

%$

6. Examples 6.1. First order system

� Using three times the CARMA model :

10/12/12 [email protected] 17

6. Examples 6.1. First order system

� Putting everything in matrix form :

10/12/12 [email protected] 18

6. Examples 6.1. First order system

� Optimal control (differential) :

� Optimal control (absolute) :

10/12/12 [email protected] 19

6. Examples 6.2. Simulation results

10/12/12 [email protected] 20

6. Examples 6.2. Simulation results

10/12/12 [email protected] 21

7. Tuning the GPC � Parameter λ :

�  Increase : response slow down. �  Decrease : more energy in the control signal, thus

faster response.

� Parameter N2 : �  At least the size of the step response of the system.

� Parameter N1 : �  Greater than the system’s delay.

� Parameter Nu : �  Tends toward dead-beat control when Nu tends

toward zero.

10/12/12 [email protected] 22

8. Nonlinear predictive control � The system can be nonlinear. � The optimal solution is computed using

an iterative optimization algorithm. � The optimization is performed at each

sampling time. � Additional constraints can be added. � The cost function can be more complex. � Main drawback : very computationally

intensive.

10/12/12 [email protected] 23

9. References � R. Bitmead, M. Gevers et V. Wertz,

« Adaptive Optimal control – The thinking man's GPC », Prentice Hall International, 1990.

� E. F. Camacho et C. Bordons, « Model Predictive Control », Springer Verlag, 1999.

�  J.-M. Dion et D. Popescu, « Commande optimale, conception optimisée des systèmes », Diderot, 1996.

� P. Boucher et D. Dumur, « La commande prédictive », Technip, 1996.

10/12/12 [email protected] 24