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 jacques.gangloff@unistra.fr 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 jacques.gangloff@unistra.fr 3
1. Introduction 1.2. Principle of MPC r( t +1)!! r t + N " 2 $ & & & +! N 2 future references Optimization u( t) " $ $! $ u t + N u!1 ' ' ' & N u future control signals u( t) System y( t +1)!! y t + N " 2 $ & & & Prediction N 2 predicted outputs y( t) 10/12/12 jacques.gangloff@unistra.fr 4
1. Introduction 1.2. Principle of MPC y r Receding Horizon t + N 1 t + N 2 t Goal of the optimization : minimizing 10/12/12 jacques.gangloff@unistra.fr 5
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 jacques.gangloff@unistra.fr 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 jacques.gangloff@unistra.fr 7
2. Modelling 2.1. Example of MAC Input-output relationship : " y( t)= h i u t! i i=1 Truncation of the response : N ŷ( t + k t)= h i u t + k! i t " i=1 Drawbacks : Model is not in its minimal form. Computationally demanding. 10/12/12 jacques.gangloff@unistra.fr 8
2. Modelling 2.2. The case of the GPC CARMA modelling (Controller Auto- Regressive Moving Average) : A( q ) -1 y( t)= q -d B( q -1 )u t!1 With : + C q-1 D q -1 e t! A( q -1 )=1+ a 1 q -1 + a 2 q -2 + + a na q -na " B( q -1 )= b 0 + b 1 q -1 + b 2 q -2 + + b nb q -nb C( q -1 )=1+ c 1 q -1 + c 2 q -2 + + c nc q $ -nc Usually : D( q -1 )=!( q -1 )=1" q -1 10/12/12 jacques.gangloff@unistra.fr 9
3. GPC cost function For the GPC : J = N 2! r( t + j) & " ŷ t + j t $ + ' " (u t + j!1 j!n 1 2 N & u j=1 $ 2 Quadratic error Energy of the control signal Tuning parameters : N 1 N 2 N u λ 10/12/12 jacques.gangloff@unistra.fr 10
4. GPC prediction equations First Diophantine equation : C = E j!a+ q -j F j With C=1 : 1= E j!a+ q -j F j with Let : deg( E j )= j "1 $ deg( F j )= na & Ay( t)= Bq -d u( t!1)+ e t & "E $ " j q j '( * "AE j y( t + j)= E j B"u( t + j! d!1)+ E j e t + j 10/12/12 jacques.gangloff@unistra.fr 11
4. GPC prediction equations Using the Diophantine equation : ( 1! q -j F ) j y( t + j)= E j B"u( t + j! d!1)+ E j e t + j Which yields : Thus, the best prediction is : y( t + j)= F j y( t)+ E j B!u( t + j " d "1)+ E j e( t + j) ŷ( t + j t)= E j B!u( t + j " d "1)+ F j y( t) 10/12/12 jacques.gangloff@unistra.fr 12
4. GPC prediction equations Second Diophantine equation : E j B = G j + q -j! j Separation of control inputs : ŷ( t + j t)= G j!u( t + j " d "1)! " $ +!u ( t " d "1 j )+ F j y( t)! " $ Forced response Prediction equation : ' With : ŷ =! ŷ t +1+ d t ŷ = G!u+ ˆf " ŷ t + N 2 + d t ) ) T (!u =! " u( t t) u( t + N u &1 t) $ ) ˆf = ˆf ( t +1 t) ˆf T )! " ( t + N 2 t) * $ $ T Free response 10/12/12 jacques.gangloff@unistra.fr 13
4. GPC prediction equations And : G N2 =!N u $ g 0 0! 0 g 1 g 0! 0 " " " g N2 "1 g N2 "2! g 0 " " " " g N2 "1 g N2 "2! g N2 "N u With g 0 g N2-1 the samples of the system s step response. & ( ( ( ( ( ( ( ( '( 10/12/12 jacques.gangloff@unistra.fr 14
5. Optimal control Cost function : Let : J = ( ŷ! r) T ( ŷ! r)+ "!u T!u!u opt s.t. dj d!u = 0!!u opt = ( G T G + "I ) -1 G T r ˆf With : r =! r( " t +1) r t + N 2 Future references Only the first optimal control sample is applied to the system. $ T 10/12/12 jacques.gangloff@unistra.fr 15
6. Examples 6.1. First order system A system in the CARMA form has the following parameters : " A = 1! 0.7q -1 $ B = 0.9! 0.6q -1 $ C = 1 Compute the system s prediction equations 3 steps ahead. 10/12/12 jacques.gangloff@unistra.fr 16
6. Examples 6.1. First order system Using three times the CARMA model : 10/12/12 jacques.gangloff@unistra.fr 17
6. Examples 6.1. First order system Putting everything in matrix form : 10/12/12 jacques.gangloff@unistra.fr 18
6. Examples 6.1. First order system Optimal control (differential) : Optimal control (absolute) : 10/12/12 jacques.gangloff@unistra.fr 19
6. Examples 6.2. Simulation results 10/12/12 jacques.gangloff@unistra.fr 20
6. Examples 6.2. Simulation results 10/12/12 jacques.gangloff@unistra.fr 21
7. Tuning the GPC Parameter λ : Increase : response slow down. Decrease : more energy in the control signal, thus faster response. Parameter N 2 : At least the size of the step response of the system. Parameter N 1 : Greater than the system s delay. Parameter N u : Tends toward dead-beat control when N u tends toward zero. 10/12/12 jacques.gangloff@unistra.fr 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 jacques.gangloff@unistra.fr 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 jacques.gangloff@unistra.fr 24