You are on page 1of 101

i

...
!..


ii



.

.
.


( )
.
Jonathan Currie


( )
.

iii


.

.



.
:

.

[ .]1


.


.

iv



[.]1

.

.

.


.




.



.

:

.


Model

.Predictive Controllers
.


.
:



.

Model Predictive Control


.

vi


.


MATLAB/Simulink MPC TOOL
.
.

PI

.


.

.



.
.

2011/7/3 /21432/

vii


iv ....................................................................................................................................................
vi .....................................................................................................................................
viii .................................................................................................................................
xi ..............................................................................................................................................
1....................................................................................................................
1-1 2 ............................................................................................................................................
2-1 2 .............................................................................................................................
1-2-1 5 ...........................................................................................................................
2-2-1 5 ..........................................................................................................................
3-1 11........................................................................................................................... IDCOM
4-1 12...................................................................................... (DMC) Dynamic Matrix Control
5-1 13................................................................... (QDMC) Quadratic Dynamic Matrix Control
6-1 14......................................................................................... Predictive Functional Control
15............................................................................................
1-2 16...........................................................................................................................................
2-2 16.................................................................................................................................
1-2-2 18..............................................................................................................
2-2-2 19..................................................................................................
3-2-2 19...............................................................................................................
4-2-2 21............................................................................................................................
5-2-2 21..............................................................................................................................
6-2-2 22..................................................................................................................................
7-2-2 () 22...........................................................................................................

viii


3-2 23.........................................................................................
1-3-2 25.....................................................................................................................
1-1-3-2 27............................................................................................
2-3-2 28.........................................................................................................................
1-2-3-2 29............................................................................................
2-2-3-2 29.......................................................................................................
3-2-3-2

31.........................................................................

3-3-2 31........................................................................................................... FIR


1-3-3-2 31............................................................................. Impulse response
2-3-3-2 31......................................................................... Step response
4-2 32................................................................................................
32.....................................................................................................................
1-4-2 33.........................................................................................................
2-4-2 34.............................................................................................................
1-2-4-2 CARIMA
2-2-4-2 CARIMA

35.....................................................................
37...............................................................

5-2 38..........................................................................................................................
1-5-2 38........................................................................................................ GPC
1-1-5-2 38......................................................................................................
2-1-5-2 41.........................................................................................
3-1-5-2 41.......................................................................................................................
4-1-5-2 42...........................................................................................
2-5-2 43.............................................................................
1-2-5-2 44.......................................................
6-2 47........................................................................................................................
1-6-2 47....................................................................................................................
1-1-6-2 47......................................................................................................
2-1-6-2 48.......................................................................................................................
3-1-6-2 49......................................................................................................................

ix


2-6-2 51.....................................................................................................
52........................................................................................
1-3 53...........................................................................................................................................
2-3 53..................................................................................................................
3-3 56........................................................................................................
4-3 61.........................................................................................................................
1-4-3 61....................................................................................................
2-4-3 62.......................................................................................
3-4-3 63.......................................................................................................................
67.......................................................................................................................
1-4 68...........................................................................................................................................
2-4 69.........................................................................................................................
1-2-4 69.................................................................................
1-1-2-4 69...........................................................................................................
2-1-2-4 71.......................................................................................................
2-2-4 71................................................................................
1-2-2-4 71...................................................................................................................
2-2-2-4 72....................................................................................................................
3-2-4 73................................................................................
1-3-2-4

73.............................................................................................

2-3-2-4 74..............................................................................................
4-2-4 76.............................................................................................
1-4-2-4 76............................................................................................
2-4-2-4 76..............................................................................................
78...................................................................................................................

81



.
:
:

Toeplitz :Hankel
:

xi

Toeplitz:

Hankel :

xii

Toeplitz :

xiii


Introduction to Predictive Control


Introduction to Predictive Control
1-1:

.



.

.


.

2-1
( )1-1 .
]2[ Kalman
( )

.

Kalman


.

1-1

Kalman [:]2
][1-1
][1-2

.1


:
][1-3
||

||

||

||

||

|| :
||

||

:
||

||

.

(
) Kalman [:]2


.


1-2-1 :

(
)
. :
][1-4

][1-5

) (Estimator
.
2-2-1 :
:
][1-6

] [1-4 ] [1-5 ] [1-6

.Ricatti
Kalman ) (LQG
).(LQR
( )
[ .]2

( )

(Constraints) 1

[ ]2
[:]2
:System Constraints
.
:Process Nonlinearities
.

:Model Uncertainty



.


.

:

.

1

.


.

( )

.prediction horizon
.
.
( )

. ( ) (
)
. ( )2-1 .


.

Model Predictive Control

) (MPC .

2-1

[ ]2

[ .]3 ( )3-1
.
( )4-1





[.]2



.

.

3- 1

4- 1

3-1 :IDCOM
Richalet
Model Predictive Heuristic Control
( 1)MPHC IDCOM
.Identification and Command :

.
.
.
.

1 .Model Algorithmic Control [.]4

10


Richalet
) Manipulated Variables (MVs
) . Disturbance Variables (DVs
) .Controlled Variables (CVs ) (FIR
:
][1-7

.
( )N .
.

.
.


.
[:]4
][1-4

11

Richalet
:
.1 : .
.2 : .
.3 : .
.4 : .PID


.
.

.
.
.
150000 [.]2

4-1 :(DMC) Dynamic Matrix Control


Shell
.
[:]2
.
.

12

:
][1-8


.Dynamic Matrix
) (offline .
.
[ ]2

[:]4
][1-9


.
.

5-1 :(QDMC) Quadratic Dynamic Matrix Control





13


.

.
QDMC
[ ]2
.
12 .

6-1 :Predictive Functional Control


Richalet .
.

.
.
[:]4
][1-10

14


Model Predictive Controllers-Generalized
Predictive Control (GPC)

15


Model Predictive Controllers
)Generalized Predictive Control (GPC
1-2:
MPC

.
.


.
)Generalized Prediction Control (GPC
.

2-2 :

:

.

16

( )

:
.
.
( .)...
.
(
).

.

.

.



.
.


( )

17


.


( )
[ ]4 ( )1-2
.

1-2

1-2-2 :


18

2-2-2 :

. .
( )

.


.
[ ] 7
( )Offline

.

3-2-2 :


.
.

.

19


.
[ ]7

.

.

4-2-2 :
( )
) .
(

.


.
( )

.
(.)2-2

20

2-2

:


.
.
(
)
.

5-2-2 :
( )
.

.



.

21

6-2-2:

.
PID

[ ]7

.


.




.

.

7-2-2 () :

.

22


.

.



.

.1
: Hard Constraints
. Soft Constraints


.

.

3-2 :

2

1

.
2 [.]7

23

.
[.]7


(

...)


[:]7


( )

.
( )

.


(
) .

( )
.

24


[ ]7

LPF
.

.
.
FIR

.1

.


.
.2

1-3-2 :

:

1

. .
2 [ ]7 .

25

[]

[]

][2-1
]

[]

[]

:
][2-2

( )

.
.

.
.

:
1 .

:

.

).degrees of freedom (d.o.f.

26


1-1-3-2 :


. :
:

. :
][2-3



:

][2-4

:
]

] [

:

][2-5

:
}

27

][2-6

:
]

] [

2-3-2 :
CARIMA1

:
][2-7
:

.
.


.
:
1

Controlled Auto-Regressive Integrated Moving Average

28


][2-8
:

1-2-3-2 :

] [2-4 ].[2-5
2-2-3-2 :



.


] [2-7

29


][2-9

.
:

3-2-3-2

.1

. :
[

]
[.]7
.2

.
.3
.4

.FIR

.5

3-3-2 :FIR

:

30


1-3-3-2 :Impulse response

:
][2-10

][2-11



.

.

2-3-3-2 :Step response



:

][2-12

:
][2-13

31

4-2 :

.

.

.
:

][2-14
:
( .

) Toeplitz

32

1-4-2 :


:1
][2-15

:
][2-16

] [2-15 ] [2-16 :

][2-17


][2-18

][2-19

] [2-17:

] [2-15 ] [2-18:
}

( ) D=0
.

33



]} [2-20

][2-21
]
[

][

][2-22
[

:
][2-23

2-4-2 :

diophantine
[ ] 7
.

.

34

1-2-4-2 CARIMA

] [2-9
:
][2-24
:
][2-25

:
] [2-25 :

] [2-24
][2-26


d.o.f.
:
][2-27

] [2-27 ].[2-15


] [2-15 ] [2-16 ] [2-18 ] [2-27

... ] [2-27

35

.1 ] [2-26
( ) :

.2 :

]
]

][2-28
]

[ ]

[]

[
]

[
]

.3 ( Toeplitz/Hankel ) ][2-28
:
][2-29
.4 ] [2-29 :

36


][2-30

:
][2-31
:

2-2-4-2 CARIMA


.
:
][2-32
2 3 4 :
][2-33
:
][2-34
:

37

5-2 :

(
) .


.
GPC

.

1-5-2 :GPC
GPC

.
1-1-5-2 :
GPC

38

][2-35

(.)3-2

( )4-2

:
][2-36

3 -2


.
1

39

4 -2

:
][2-37

:


][2-38

40


- .
2-1-5-2 :
] [2-14

][2-39

|
]
]

] [2-36

)

][2-40

[
]

3-1-5-2 :
.
] [2-38 .

41

:
][2-41
:
][2-42
:
][2-43
:
][2-44

. ] [2-38

Quadratic Program

4-1-5-2 :
] [2-38

. (
) .

42


[.]7

2-5-2 :



.

( ) .
.

1 :

43

()

:
][2-46

1


.

:
][2-47
( )
.


.
.
1-2-5-2 :
:

( ) .
.

44


] [

][2-48

[ ]

[]

] [2-46

:
: ] [2-48 ] [2-23
] [2-37 :
][2-49

:
] [
:

:
]
][2-50

:
][2-51

:
]

:
]

45


]]

][2-52

[]

] [
:
]

] [2-51 1
.

:
] [2-52 ] [2-48 :
][2-53

] [


] [2-48

2 ] [2-15

1 .
2 d .x

46

6-2 :


.
.

.

1-6-2 :
.


.
( )
.
1-1-6-2 :
] [2-42
:

47

][2-54

][

][
:
][2-55
:
][2-56

2-1-6-2 :

:
][2-57

] [

:
][2-58

.
:

48

][2-59

] [

] [

] [2-57 :
][2-60
:
][2-61

3-1-6-2 :
] [2-31
:
][2-62

[.]7


:
][2-63

49

:
][2-64

2-6-2 :
] [2-63
:
] [2-49
][2-65



MATLAB
Active set algorithms .Interior point QP algorithms ( )5-2
Active set

50

( ) .1
[ ]5 [.]8

5-2 Active set


.
MATLAB

1
Active set algorithms .

51


Designing a Model Predictive Controller
Of a DC Motor

52


Designing a Model Predictive Controller
Of a DC Motor
1-3:


.
:
.
PI .
MATLAB/Simulink
MATLAB-MPC .JMPC
.

.

2-3 :
( .)1-3
:
][3-1

53

1-3

:
][3-2
]:[3-1
][3-3
]:[3-3
][3-4
:
][3-5
:
][3-6

54


][3-7

:
][3-8
MATLAB/Simulink
(.)2-3

2-3 MATLAB/Simulink
()3-3
(.)4-3

3-3

55

4-3

3-3 :
:

][3-9
:


.
P-PI
PI .
PI

56

][3-10

()

:
][3-11

][3-12

][3-13
][3-14
( .)5-3
( )6-3 ( )7-3 .

5-3 PI

57

6-3

7-3

PI
P-PI .
P :
][3-15

58


][3-16
][3-17

PI :

][3-18
][3-19

][3-20
][3-21
( .)8-3 ( )9-3
( )10-3 .

8-3 PI P-PI

59

9-3 P-PI

11-3 PI

60

4-3 :

.
Kalman

.
] [2-52
.

1-4-3 :
MATLAB/Simulink
:
;]Ac=[-Ra/La, -Cmphi/La ; Cmphi/J ,-B/J
;]Bc=[1/La 0;0 -TL/J
;]Cc=[1 0;0 1
;]Dc=[0 0;0 0

] [2-48 :
;)[Ap,Bp,Cp,Dp]=c2d(Ac,Bc,Cc,Dc,ts
;)[m1,n1]=size(Cp
;)[n1,n_in]=size(Bp
;)A_e=eye(n1+m1,n1+m1
;A_e(1:n1,1:n1)=Ap
;A_e(n1+1:n1+m1,1:n1)=Cp*Ap
;)B_e=zeros(n1+m1,n_in
;B_e(1:n1,:)=Bp
;B_e(n1+1:n1+m1,:)=Cp*Bp
;)C_e=zeros(m1,n1+m1

61

;)C_e(:,n1+1:n1+m1)=eye(m1,m1

A_e B_e C_e .

2-4-3 :
] [2-23

] [2-22
] [2-40 .
] [2-49
. ] [2-52



][3-1

:
][3-2



[ .] 6 :
;n=n1+m1
;h(1,:)=C_e
;P(1,:)=C_e*A_e
for k=2:Nu
;h(k,:)=h(k-1,:)*A_e

62

;P(k,:)= F(k-1,:)*A_e
end
;v=h*B_e
;)H=zeros(Nu,Ny
% Declare the dimension of H
;H(:,1)=v
% First column of H
for i=2:Ny
H(:,i)=[zeros(i-1,1);v(1:Nu-i+1,1)]; % Toeplitz matrix
end
;)BarRs=ones(Nu,1
;H_H= H'*H
;H_P= H'*P
;H_R=H'*BarRs

:
;))DeltaU=inv(H_H+Lambda*eye(Nu,Nu)*(H_R*r(k)-H_P*X(k
;)deltau=DeltaU(1,1
% First element of the control law

3-4-3 :

.

.
1
. :
% Initial value of state variables
% Initial value of state feedback
% Number of simulation samples
)% Set point (here of speed
% u(k-1) =0
1

;)[n,n_in]=size(B_e
;]xm=[0;0
;)Xf=zeros(n,1
;N_sim=200
;r=ones(N_sim,1)*209.4
;u=0

63

;y=0
;for k=1:N_sim
;)DeltaU=inv(H_H+Lambda*eye(Nu,Nu))*(H_R*r(k)-H_P*Xf
;)deltau=DeltaU(1,1
;u=u+deltau
;u1(k)=u
;y1(k)=y
;xm_old=xm
;xm=Ap*xm+Bp*u
;y=Cp*xm
;]Xf=[xm-xm_old;y
end

(
) .
MATLAB/Simulink
Jonathan Currie
.
MATLAB/Simulink

MPC TOOL Model Predictive Control


. ( )1-3
.
MPC TOOL

.

.

64

1-3

C
(.)2-3

2-3 MPC TOOL

65

Simulink

:
.
.
.

66


Results and Discussion

67


Results and Discussion

1-4:

.

.
:
()
.
() ( )speed weight=10

.
() ( .)speed weight=0.1
.

.

68

2-4 :
1-2-4 :

( )2 :
1-1-2-4 :

( )1-4 (.)2-4

1-4

2-4

69


( )5A .
2-1-2-4 :
( ) w=10 rad/sec ( )3-4
(.)4-4

3-4

4-4

70

2-2-4 :
1-2-2-4 :
.

( )5-4 (.)6-4

5-4

6-4

71


.
2-2-2-4 :
.

. ( )7-4
(.)8-4

7-4

8-4

72

3-2-4 :
1-3-2-4


( )9-4 (.)10-4

9-4

11-4

73


2-3-2-4 :



( )11-4 ( )12-4 ( )13-4 (.)14-4
:J(new)=10J

11-4

12-4

74

:J(new)=0.5J

13-4

14-4

75

4-2-4 :
1-4-2-4 :

.
. ( )15-4
.

15-4

2-4-2-4 :

( )16-4 .

76

17-4

77



.


.
Generalized Predictive Control

.

.




.

.


.

78



.

.
.


.


. .

79



:
.1
.
.2
.
.3 .
.4
.
.5
.
.6
.

80

References

1. F. L. Lewis, Applied Optimal Control and Estimation, Prentice-Hall,


1992.
2. S. Joe Qin, Thomas A. Badgwell, A survey of industrial model
predictive control technology, 2002.
3. Iino Yutaka, Koichi Abe, Yasuhisa Tsukamoto, Hierarchical Model
Predictive Control applied to a Cement Raw Material Mixing Process,
2008.
4. E. F .Camacho, C Bardons, Model Predictive Control, Springer, 1999.
5. J. M. Maicejowski, Predictive Control With Constraints, Prentice-Hall.
6. L. Wang, Model Predictive Control System Design and Implementation
Using MATLAB, Springer, 2009.
7. J. A. ROSSITER, Model-Based Predictive Control, CRC Press, 2005.
8. M.Cannon, C4A Model Predictive Control, Course Lectures, 2010.
9. Michael Nikolaou, Model Predictive Controllers: A Critical Synthesis of
Theory and Industrial Needs, University of Houston.
10. Ky M. Vu, ISO, MPC and PID: The Good, The Bad and The Ugly
Discrete Controllers, AuLac Technologies Inc., 2008.
11. J.R. Raol, G. Girija and J. Singh, Modelling and Parameter Estimation
of Dynamic Systems, IET control engineering series.

.2010 " " .12


.2010 "1 " .13
14.

81

http://www.maorielectrical.com

Contents

3-4-2 Prediction and Optimazation ............................................................................................... 62


3-4-3 Closed Loop Performance .................................................................................................... 63
Results and Discussion .......................................................................................................................... 68
4-1 Introduction: ............................................................................................................................... 68
4-2 MPC Performance ....................................................................................................................... 69
4-2-1 Testing the Controller At Low and High Speed ..................................................................... 69
4-2-1-1 High Speed Performance ............................................................................................... 69
4-2-1-1 Low Speed Performance ............................................................................................... 70
4-2-2 Control and Prediction Horizons Effect ................................................................................. 71
4-2-2-1 Control Horizon Effect ................................................................................................... 71
4-2-2-2 Prediction Horizon Effect .............................................................................................. 72
4-2-3 Effect of Changing Motor Parameters .................................................................................. 73
4-2-3-1 Effect of Changing

................................................................................................... 73

4-2-3-1 Effect of Changing the Momentum .............................................................................. 74


4-2-4 Testing a time varient SetPoint ............................................................................................ 76
4-2-4-1 RampSet Point: .............................................................................................................. 76
4-2-4-2 Sine Set Point:................................................................................................................ 76
Conclusion and Future Work ................................................................................................................ 78

Contents
2-3-2-1 Disturbance Model ....................................................................................................... 29
2-3-2-2 Integral Action .............................................................................................................. 29
2-3-2-3 General Rules for Choosing

...................................................................................... 30

2-3-3 FIR Models ........................................................................................................................... 30


2-3-3-1 Impulse response .......................................................................................................... 31
2-3-3-2 Step response .............................................................................................................. 31
2-4 Prediction Prosedure .................................................................................................................. 32
General Prediction Structure ..................................................................................................... 32
2-4-1 Prediction in State Space Models ......................................................................................... 33
2-4-2 Prediction with Transfer Functions ....................................................................................... 34
2-4-2-1 SISO CARIMA Model with
2-4-2-2 MIMO CARIMA Model with

................................................................................ 35
.............................................................................. 37

2-5 Control Law Derivation ............................................................................................................... 38


2-5-1 GPC Basic Components ....................................................................................................... 38
2-5-1-1 Cost Fuunction and Optimization .................................................................................. 38
2-5-1-2 Effect of Control Horizon on Prediction ......................................................................... 41
2-5-1-3 System Constraints ....................................................................................................... 41
2-5-1-4 MIMO Systems ............................................................................................................. 42
2-5-2 State Space Based Control Law ............................................................................................ 43
2-5-2-1 Augmented Model Control Law ..................................................................................... 44
2-6 Constraints Handling ................................................................................................................... 47
2-6-1 Constraints Equations .......................................................................................................... 47
2-6-1-1 Input Changes Constraints ............................................................................................ 47
2-6-1-2 Input Constraints .......................................................................................................... 48
2-6-1-3 Output Constraints ....................................................................................................... 49
2-6-2 Optimisation with Constraints ............................................................................................. 50
Designing a Predictive Controller Of a DC Motor.................................................................................... 52
3-1 Introduction ................................................................................................................................ 53
3-2 DC Motor Model .......................................................................................................................... 53
3-3 PI Controller of a DC Motor ......................................................................................................... 56
3-4 Model Predictive Controller ........................................................................................................ 61
3-4-1 AugmentedState Space Model ............................................................................................ 61

Contents

Contents
Introduction .......................................................................................................................................... iv
Purpose of the Project ....................................................................................................................... vi
Contents ............................................................................................................................................... viii
Sempol Guide ........................................................................................................................................ xi
Introduction to Predictive Control ......................................................................................................... 1
1-1 Introduction .................................................................................................................................. 2
1-2 Why MPC? .................................................................................................................................... 2
1-2-1 First Step ............................................................................................................................ 5
1-2-2 Second Step ....................................................................................................................... 5
1-3 IDCOM Algorithm ....................................................................................................................... 10
1-4 (DMC) Dynamic Matrix Control Algorithm ................................................................................... 12
1-6 (QDMC) Quadratic Dynamic Matrix Control Algorithm ................................................................ 13
1-7 Predictive Functional Control Algorithm ...................................................................................... 14
Model Predictive Controllers GPC ...................................................................................................... 15
2-1 Intrducttion ................................................................................................................................. 16
2-2 Basic Concepts ............................................................................................................................ 16
2-2-1 Depending on Prediction ..................................................................................................... 18
2-2-2 Model Based Prediction ....................................................................................................... 19
2-2-3 Choosing the Optimal Control Law ....................................................................................... 19
2-2-4 Reseeding Horizon ............................................................................................................... 20
2-2-5 Safe Performance ................................................................................................................ 21
2-2-6 Tuning .................................................................................................................................. 22
2-2-7 System Constraints .............................................................................................................. 22
2-3 Models Used Iin Predictive Control .............................................................................................. 23
2-3-1 State Space Models ............................................................................................................. 25
2-3-1-1 Disturbance Model ....................................................................................................... 27
2-3-2 Transfer Function Models ..................................................................................................... 28

Acknowledgment

Acknowledgment
This work was the result of a combination of efforts that have gathered
to present all the details and results achieved.
I would like to thank all the people who helped me along the way to
reach this point. Special thanks to my supervisor Dr. Abdulkader
Joukhadar who was the source of many ideas in this research.
Also, I give special thanks to Mr. Jonathan Currie who was a great help
to me, always answering my questions without hesitation.

Abstract

Abstract

PC is one of the most promising control techniques that has been


developed and implemented along the past two decades. It has
been widely used in many industrial plants and especially in chemical
processes. Yet, theoretical analysis of this technique and its stability is
still taking place until present. In this thesis, we present a review of
model predictive control through its implementation on a DC motor. The
generalized predictive control (GPC) algorithm is used to control
motors current and speed under constraints associated with each of
them. A comparison between MPC and the conventional controllers
represented by PID is present to reveal the advantages and disadvantages
of this type of controllers.

Keywords: MPC, prediction, constrained optimization, DC motor


control.

You might also like