pole placement matlab toolbox help and example
DESCRIPTION
pole placement MATLAB toolbox help and exampleTRANSCRIPT
NEW MODIFICATION OF MATLAB-TOOLBOX FOR CAD OF SIMPLEADAPTIVE CONTROLLERS
Vladimír Bobál, Petr Chalupa
Department of Control Theory, Institute of Information Technologies,
Tomas Bata University in Zlin, Nám. TGM 275, 762 72 Zlín, Czech Republic,
Tel.:+420 67 754 3217, E-mail: [email protected]
Abstract: The contribution presents a MATLAB-Toolbox for design, simulation and verification of single inputsingle output (SISO) discrete self-tuning controllers. The proposed adaptive controllers who are included into aToolbox can be divided into two parts. The first part covers PID adaptive algorithms using traditional Ziegler-Nichols method for the setting of the controller parameters, the second part of described controllers is based onthe pole placement design. It is considered as a SIMULINK block library of individual adaptive controllers andit is a completely open system based on SIMULINK features. The MATLAB-Toolbox is very successfully usedin Adaptive Control Course in education practice for design, simulation and verification of self - tuning controlsystems in real - time conditions. The Toolbox is supplemented by very friendly User’s Manual. This Toolbox issuitable for design and verification of the industrial adaptive controllers, too.
Key words: Self-tuning control; ARX model; recursive least squares; PID control; pole assignment; MATLAB–Toolbox.
1. INTRODUCTION
Adaptive control methods have been developing significantly over the past tree decades. The aim of this researchwas to solve the problem of designing a controller for systems where the characteristics are not completelyknown or vary. Different approaches were proposed and utilized. One successful approach is represented by self-tuning controllers (STC). The main idea of an STC is based on the combination of a recursive identificationprocedure and a selected controller synthesis. Different branches of the STC differ mainly in the method of thecontroller design while the identification recursive least squares method (RLSM) applied to a regression (ARX)model forms a standard.
Despite intensive research activity, there is a lack of controllers, which are able to cope with practicalrequirements. Industrial applications on a large scale are still missing, however, many realized cases weresuccessful. It is evident that until to now application has required a control engineer skilled in specifictechnology as well as versed in modern control methods.
Also the aim of this contribution is to bridge the gap between theory and practice and to present some simplecontroller algorithms in a form acceptable for industrial users. The theoretical background not only these simplealgorithms, also algorithms based on polynomial solutions of controller synthesis and controllers what arederived from the use of minimization of linear quadratic criterion, are given in Bobál, et al. (1999a).
All the explicit self-tuning controllers who are included into MATLAB-Toolbox have been algorithmicallymodified in the form of mathematical relations or as flow diagrams so as to make them easy to program andapply. Some are original algorithms based on a modified Ziegler-Nichols criterion, others have been culled frompublications and adapted to make them more accessible to the user.
2. THEORETICAL BACKGROUND
2.1 Recursive identification
In the identification part of the designed controller algorithms the regression (ARX) model of the following form
( ) ( ) ( ) ( )knkkky T +−= 1φΘ (1)
is used, where
( ) [ ]nbnaT bbbaaak …… 2121=Θ (2)
is the vector of the parameter estimates and
( ) ( ) ( ) ( ) ( ) ( ) ( )]2121[1 nbkukukunakykykykT −−−−−−−−−=− ……φ (3)
is the regression vector ( y(k) is the process output variable, u(k) is the controller output variable). The non-measurable random component n(k) is assumed to have zero mean value E[n(k)] = 0 and constant covariance(dispersion) R = E[n2(k)]. For calculating of the parameter estimates (2) is utilized the recursive least squaresmethod, where adaptation is supported by directional forgetting (Kulhavý, 1987).
2.2 Algorithms of digital Ziegler-Nichols PID controllers
The PID controllers are still widely used in industry. These types of controllers are more convenient for usersowing to their simplicity of implementation, which is generally well known. Provided the controller parametersare well chosen they can control a considerable part of continuous technological processes. To get a digitalversion of the PID controller, it is necessary to discretize the integral and derivative component of thecontinuous-time controller. For discretizing the integral component we usually employ the forward rectangularmethod (FRM), backward rectangular method (BRM) or trapezoidal method (TRM). The derivative componentis mostly replaced by the 1st order difference (two-point difference). For practical use the recurrent controlalgorithms which compute the actual value of the controller output u(k) from the previous value u(k-1) and fromcompensation increment seem to be suitable
( ) ( ) ( ) ( )121)( 210 −+−+−+= kukeqkeqkeqku (4)
where 210 ,, qqq are the controller parameters and T0 is the sampling period.
It is subsequently possible to derive further variants of digital PID controllers. For example the PID controllerwith a filter constant in the D-part (Isermann, 1989), Takahashi’s PID controller (Takahashi, et al., 1971), thePID controller based on the ideas of Åström, et al. (1992), Dahlin's PID controller (Dahlin, 1968) or the PIDcontroller designed by Bányász and Keviczky (1993).
Fmgcdi
2
Acc
+
e(k) y(k)
( )11
−zP( )( )1
1
−
−
zAzB
_
β
+_
w(k) u(k)e(k)w(k) u(k) y(k)
( )( )1
1
−
−
zPzQ ( )
( )1
1
−
−
zAzB
_
+a) PID - A controller b) PID - B controller
Fig. 1 Block diagrams of control loops with pole placement PID controllers
irst group of proposed self-tuning PID controllers is based on the classical Ziegler and Nichols (1942)ethod. In this well-known approach the parameters of the controller are calculated from the ultimate (critical)
ain Kpu and the ultimate period of oscillations Tu of the closed loop system. The analytical expressions foromputing of these critical parameters are derived in Bobál, et al. (1999a) and Bobál, et al. (1999b). The flowiagrams for the computing of the critical parameters for the second- and for the third-order model arentroduced in the same publications.
.3 Pole placement PID controllers
controller based on the pole placement method in a closed feedback control loop is designed to stabilise thelosed control loop whilst the characteristic polynomial should have a previously determined pole. Digital PIDontrollers is possible can be expressed in the form of a discrete transfer function
( )1−zQ
( ) ( )( )
( )( ) ]1)(1( 11
22
110
1
1
−−
−−
−
−
+−++
===zz
zqzqqzPzQ
zEzUzGR γ
(5)
If the process is given by the transfer function
)()(
)()()( 1
1
−
−
==zAzB
zUzYzGP (6)
with the polynomials A(z-1), B(z-1) for degree n = 2 then the characteristic polynomial of the closed-loop systemwith a PID-A controller (see Fig. 1a)) is in the form
( ) ( ) ( ) ( ) ( )11111 −−−−− =+ zDzQzBzPzA (7)
The pole placement of the characteristic polynomial (7) determines the dynamic behaviour of the closed - loopsystem. The characteristic polynomial D(z-1) can be specified by different methods. It is usually described by thedominant poles for a second order continuous model (controller PID A-1)
( ) 22 2 nnsssD ωξω ++= (8)
The dominant poles are given by the desired damping factor ξ and the natural frequency ωn of the closed-loop.
A PID controller with the characteristic polynomial (controller PID A-2)
( ) ( ) ( )[ ] ( )[ ]ωαωαα jzjzzzD −−+−−= 2 (9)
is proposed in Bobál, et al. (1999a). Characteristic polynomial (9) has a double real pole α=2,1z within interval
0 ≤ α < l and a pair of complex conjugated poles ωα jz ±=4,3 , where 22 ωα + < 1. The parameter α influencesthe speed of the control-loop transient response and influences controller output changes, too. By changingparameter ω it is possible to influence the desired overshoot.
The structure of the control loop with controller PID B is shown in Fig. 1b). The characteristic polynomial has inthis case form
[ ] )()(')()()( 11111 −−−−− =++ zDzQzBzPzA β (10)
where polynomial P(z-1) has the same form as in the transfer function (5) and second polynomial in equation (10)is given
))(1()(' 1'2
'0
11 −−− −−= zqqzzQ (11)
Using equation (7) it is possible to derived controller PID A-2, using equation (10) controller PID B-2.
3. TOOLBOX DESCRIPTION
First modification of this Toolbox has been programmed in the version MATLAB 4.2. This modification madeuse of a GUI. Here all actions are guided by prepared graphical windows that checks any action and leads theuser step by step to correct settings. This version is typically efficient in education.
Because the individual GUI are depended on the individual MATLAB versions, the second modification is basedon the use a SIMULINK block library of individual adaptive controllers. In this case it is a completely opensystem based on SIMULINK features (Bobál and Böhm, 2000).
These two versions differ in the upper level appearance, however, use the same or slightly different lower levelfunctions. The SIMULINK oriented part uses only SIMULINK features. The choice of a specific controller,setting its parameters connection to the system, use of additional blocks etc. all must be done by user. Comparedwith a GUI form this offers, on one side, large flexibility, on the other side, it requires some knowledge andresponsibility to avoid misuse of the controller.
The survey of the individual controllers with name of the m-files and requisite input parameters is contained inTable 1. The detailed description of all controller algorithms with the recursive identification procedure isintroduced in Bobál, et al. (1999a). This Toolbox is suitable for real-time control using the acquisition cardADVANTECH PCL-812 PG with Extended Real Time Toolbox (see User's Manual, 1996), too.
Table 1 Survey of individual controllers
Contr. No. m-file
Controller algorithm Input parameters Controller type
1
zn2fr.mzn3fr.m
( ) ( ) ( ) ( ) ( )121 210 −+−+−+= kukeqkeqkeqku
+=
00 1
TT
Kq DP ;
+−−=
0
01 21
TT
TTKq D
IP ;
02 T
TKq D
P=
KPu; Tu; T0PID – forward rectangular method
2
zn2br.mzn3br.m
( ) ( ) ( ) ( ) ( )121 210 −+−+−+= kukeqkeqkeqku
++=
0
00 1
TT
TTKq D
IP ;
+−=
01 21
TT
Kq DP ;
02 T
TKq D
P=
KPu; Tu; T0
PID – backward rectangular method
3
zn2tr.mzn3tr.m
( ) ( ) ( ) ( ) ( )121 210 −+−+−+= kukeqkeqkeqku
++=
0
00 2
1TT
TTKq D
IP ;
+−−=
0
01
22
1TT
TTKq D
IP ;
02 T
TKq DP=
KPu; Tu; T0
PID - trapezoidal rectangular method
4
zn2fpd.mzn3fpd.m
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )[ ]
( )1
43226126
10
0
−+
+
−+−+−−−+++−−=
ku
kekekekekeT
Tke
TT
kekeKku D
IP
KPu; Tu; T0PID - backward rectangular
method, replacing derivationby a four- point difference
5
zn2fd.mzn3fd.m
( ) ( ) ( ) ( ) ( ) ( )2121 21021 −+−++−+−= keqkeqkeqkupkupku
12
4
0
01
+
−=
TT
TT
pf
f
; 1
2
12
0
02
+
−=
TTTT
pf
f
; 1
2
)12
(2
2
0
0
0
00
+
+++
+=
TT
TT
TTK
TTT
KKq
f
f
I
PDfPP
12
42
0
0
0
1
+
+−
=
TT
TTT
KTTK
qf
DfP
I
P
;
12
22)2(
0
0
0
0
02
+
−++−=
TT
KTTK
TTK
TTKK
TT
qf
PI
PDP
I
PP
f
; ⟩⟨∈= 20;3; αα
Df
TT
KPu; Tu; T0; TfPID - filtration of D-component, Tustin approximation
6
zn2tak.mzn3tak.m
)1()]()2()1(2[)]()([)]()1([)(
−++−−−−+−+−−=
kukykykyKkykwKkykyKku DIR
0
0
403
;2.1
;2
6.0TTKK
TTKKKKK uPu
Du
PuI
IPuR ==−=
KPu; Tu; T0
PID - Takahashi's controller
7
zn2sic.mzn3sic.m
( ) ( ) ( ) ( )kukukuku DIP ++=
( ) ( )keKku PP = ; ( ) ( ) ( )10 −+= kukeTT
Kku II
PI ; ( ) ( ) ( )[ ]10
−−= kekeTTKku D
PD
KPu; Tu; T0 PID - component form
8
zn2ast.mzn3ast.m
( ) ( ) ( )kukuku DPI +=
( ) ( ) ( )[ ] ( ) ( )[ ] ( ) ( )[ ] ( )1112
1 0 −+−−+−++−−= kukwkwKkekeTTKkykyKku PIPI
PPPI β
( ) ( ) ( )[ ] ( )1100
−+
+−−+
= kuTT
Tkyky
TTT
Kku DD
D
D
DPD αα
α
KPu; Tu; T0 PID - Åström's controller
9
ba2.m
)1()2()1()()( 210 −+−+−+= kukeqkeqkeqku
00 b
kq I= ; 1
0101 a
bk
aqq I== ; 20
202 abk
aqq I==
121−
=d
kI (γ = 0);)1)(1(2
1γγ −+
=d
kI (γ > 0);0
1
bb=γ
d - time delay PID - Bányász - Keviczky's controller
10
da2.m
( ) ( ) ( ) ( ) ( ) ( ) ( )[ ] ( )121210
0 −+
−+−−++−−= kukekekeTTke
TTkekeKku D
IP
1
21 )2(b
QaaKP+−= ;
021
0
12
1TT
aa
TTD
I++
+
−=
1
20
bKQaT
TP
D = ; BT
eQ0
1−
−=
B - adjustment factor T0
PID - Dahlin's controller
11
pp2a_1.m
)2()1()1()2()1()()( 210 −+−−+−+−+= kukukeqkeqkeqku γγ
)1(111
10 γ−−+= ad
bq ; )1(
2
1
2
12
2
21 +−−=
aa
bb
qba
q ; 1
12 r
sq −=
; 2
22 a
bq=γ
[ ])())(( 21221212212121 bdbdbbbababbas −−+−+= ; ))(( 22
212211211 bbabbabbr +++=
ωn - natural frequencyξ - damping factor PID A-1 pole placement controller
12
pp2a_2.m
)2()1()1()2()1()()( 210 −+−−+−+−+= kukukeqkeqkeqku γγ
1
320 r
rrq
−= ;
1
541 r
rrq
+−= ;
2
242 b
axq
γ+= ;
1
6
rr
=γ
))(( 22
212211211 bbabbabbr +++= ; ))(( 12212112 bababbxr −+=
[ ])( 21231242
13 xxbxbbxbr +−−= ; [ ])( 32211224
2114 xxbbxbxbar +−+=
[ ]324112212215 )()( xbxbxbxbabbr +−−+= ; 1322
223214
2116 )( xbxbxbbxbbr −+−=
α, ω - real and imaginarycomponent of the pole
PID A-2 pole placement controller
13
pp2b_1.m
[ ])()2()1()1(
)2()1()()()()( 2200
kwkukukyqkyqqkyqku
βγγβ
+−+−−−−−′+−′+′−+′−=
2
2
2
1
2
120 )(
ba
aa
bb
qq −−′=′ ; 1
12 r
sq =′ ;
2
22 a
bq ′=γ ; )1(1
01111
qbadb
′−−−+= γβ
[ ]{ }21212221211221 )1()()( badbadbbbabas −+−−++=
))(( 22
212211211 bbabbabbr −−+=
ωa - natural frequency ξ - damping factor PID B-1 pole placement controller
14
pp2b_2.m
[ ])()2()1()1(
)2()1()()()()( 2200
kwkukukyqkyqqkyqku
βγγβ
+−+−−−−−′+−′+′−+′−=
1
4320
+r
rrrq
−−=′ ;
1
762 r
rrq +=′ ; 1
5
rr
=γ ; 21
4321
bbxxxx
++−+
=β
))(( 22
212211211 bbabbabbr −−+= ; [ ]124321212 )( xbxxxbbar −++=
[ ])( 432112123 xxxbxbbar +−−= ; [ ])()( 43241214 xxbxbbbr −−++=
1322
223214
2115 )( xbxbxbbxbbr −+−= ; ( )424132
216 xaxaxabr −+−=
( ) ( )[ ]412242241127 xxabxxaxabbr +−−+=
α, ω - real and imaginary componentof the pole
PID B-2 pole placement controller
15
zn2pd.m
( ) ( ) ( ) ( ) ( )[ ]
−−+−= kykyTTkykwKku D
P 10
PuP KK 4.0= ;20
UD
TT =
KPu; Tu; T0 PD controller
16
zn2pi.m
( ) ( ) ( ) ( )1110 −+−+= kukeqkeqku
+=
IP T
TKq
21 0
0 ;
−−=
IP T
TKq2
1 01
KPu; Tu; T0 PI controller
17
mv2.m( ) ( ) ( ) ( ) ( ) ( )[ ] ( )121211
2121 −++−−−−−+−= kukwkubkubkyakyaq
kuq - penalisation factorminimum variance controller
Notes:
m-file name: xx(x)a(yyyy).m
xx(x) - controller type, n = 2 or 3 - process model order, (yyyy) - controller further details
Controllers number 1,2,3,4,6,7,8,16 and 17:
PuP KK 6.0= ; uI TT 5.0= ; uD TT 125.0=
Controllers number 11 and 13:
)1cos()exp(2 2001 ξωξω −−−= TTd nn for 1≤ξ , )1cosh()exp(2 2
001 ξωξω −−−= TTd nn for 1⟩ξ ,)2exp( 02 Td nξω−=
Controllers number 12 and 14:
gxafxaadxacx =+=−+=−+= 42321211 ;;;1
)();2(2;6;4 2222222 ωααωααωαα +=+−=+=−= gfdc
4. CONCLUSIONS
The Toolbox is widely used in the education, laboratory training and some practical applications. Its structurecan address various users. The example of a typical SIMULINK scheme of adaptive control – loop using thedigital PID controller based on the Zigler-Nichols method with discretization using backward rectangularmethod, replacing derivation by a four- point difference is shown in Fig. 2.
Fig. 2 Typical SIMULINK scheme of self-tuning controller
The MATLAB - Toolbox is used not only for simulation of designed self-tuning controllers but it is used for thecontrol a number of laboratory equipments in practical courses. PID controllers have been implemented e. g. forcontrol of the coupled tanks apparatus, ball and plate model, electronic analog models, laboratory thermo –analyser, laboratory through – flow heater etc.The purpose of this contribution was to arrange the brief informative User's Manual about MATLAB-Toolbox.This Toolbox is free and will be installed from 1 November 2001 on the www pages:
www.utb.cz/stctool
ACKNOWLEDGEMENTS
This work was supported in part by the Grant Agency of the Czech Republic under grants No.102/99/1292,102/00/0526 and in part by the Ministry of Education of the Czech Republic under grant MSM 281100001.
REFERENCESÅström, K. J., C. Hang, P. Pearson and W. K. Ho (1992). Towards intelligent PID control, Automatica, 28, 1-9.Bányász, Cs. and L. Keviczky (1993). Design of adaptive PID regulators based on recursive estimation of the
process parameters. Journal of Process Control, 3, 1993, 53-59.Bobál, V., J. Böhm, J. Prokop and J. Fessl (1999a). Practical Aspects of Self-Tuning Controllers: Algorithms and
Implementation. VUTIUM Press, Brno University of Technology, Brno, (in Czech).Bobál, V., J. Böhm, and R. Prokop (1999b). Practical aspects of self-tuning controllers. International Journal of
Adaptive Control and Signal Processing, 13, 1999, 671-690.Bobál, V. and J. Böhm (2000). Matlab - Toolbox for design and verification of self - tuning controllers.
Preprintd of IFAC Symposium on Advanced in Control Education, Gold Coast, Australia, Paper 10S-1.Dahlin, D. B. (1968). Designing and tuning digital controllers. Inst. Cont. Syst., 42, 1968, 77-83.Isermann, R., Digital Control Systems, Springer Verlag, Berlin, 1989.Kulhavý, R. (1987). Restricted exponential forgetting in real time identification. Automatica, 23, 586-600.Takahashi, Y., C. Chan and D. Auslander (1971). Parametereinstellung bei linearen DDC-Algorithmen,
Regelungstech. Prozessdatenver., 19, 237-284.User’s Manual (1996). Real Time Toolbox for Use with MATLAB. Humusoft s. r. o. Praha.Ziegler, J. G. and N. B. Nichols (1942). Optimum settings for automatic controllers. Trans. ASME, 64, 759-
768.