Self-Tuning Control Matlab Toolbox - Memodology and Design
Self-Tuning Control Matlab Toolbox - Memodology and Design
Self-Tuning Control Matlab Toolbox - Memodology and Design
Abstract: The contribution presents a class of SISO discrete self-tuners for simulation and
industrial applications. The proposed adaptive controllers can be divided into two parts.
The first part covers PID adaptive algorithms with utilization of traditional methods. The
second part is based on polynomial solutions of control problems. Both class of algorithms
were unified and incorporated into a Matlab - like Toolbox for self-tuning control.
Key words: Self-tuning control, Recursive least squares, PID control, Pole assigment,
Polynomial equations.
127
first case the poles of the characteristic polynomial which holds a 2 + fJ2 = 1 . Then the
of closed-loop system must lie on the imaginary axis characteristic polynomial (5) includes a
and in left-hand of the s-plane. The computation of
quadratic three-term C/(z) = Z2 -2az+l .
Kpu and Tu can be obtaned by substitution s = jw. in
• The characteristic polynomial (5) includes one or
the characteristic polynomial. This solution is the
same as the experimental setting of proportional more real poles z, = a (imaginary part fJ = 0).
controller by Ziegler-Nichols method. The control loop is on the stability boundary in
case of a = -1 , because the positive pole a = 1
2.1 Determining of ultimate parameters will not put the control loop into oscillation.
Then characteristic polynomial (5) includes j-
The relations for tuning of discrete PID controllers terms C, (z) = (z + 1)', j = 1,2, .. . .
will be now derived. Let the process be described by
the single input single output (SI SO) system model The characteristic polynomial must be divisible by
in the form of the discrete transfer function one of these terms and it leads in the first case to the
solution of the polynomial equation
(1)
Z·+<I[A(Z-/)+Z-4 KJI'~Z-/)] =
(6)
where U(z) and Y(z) are the z-transforms of the =(Z2 -2az+l)zn+<l-2 E(Z-/)
controller output and the process output, d is the
time delay expressed as an integer multiple of the
sampling period To. A and B are n-degree
where
polynomial defined by
lI+d-l
Let the process (1) is controlled by the proportional and unknown parameters are Kpu, a and coefficients
e;of the polynomial E(z).
controller
In the second case we obtain the polynomial
G (z)= U(z) =K (3) equation
C E(z) P
(9)
(4)
128
previous value u(k-1) and from compensation
(11) increment seem to be suitable
The term CJ z) = z: - 2az + 1 has its equivalent 2.3 pm controller with a filter constant in the D-
in continuous form as the denominator
part
z: - 2 cOSOJ MTOZ + 1 of z-transformation of the Let the controller be described by a transfer function
harmonic function cos OJ t or sin OJ t and the real in the form
component a can be the expressed as
u(s)
G S =--=K 1 - +TdS)
( 1+ -- (16)
21rTo c() E(s) p T;s 1+TJs
a = cOS(J) MTO = cos-- (12)
T.,(To )
where T, is a filter constant improves the dynamic
The equation for computing of the ultimate period behaviour of the control loop. Using Tustin
can be easily derived from equation (12) approximation the transfer function (16) can be
transcribed into the form
(13)
u(k) = pJu(k -1) + p:u(k - 2)+q oe(k) +
+ qJe(k -1)+q:e(k - 2) . (17)
The relations for calculation of the ultimate
parameters for second order process model (n = 2, d
= 0 in equations (1) and (2» has been proposed by where PJ,P: = f(To'~) (see Isermann, 1989) and
BobaI (1995). The auto-tuning procedure for the
third process model (n = 3, d = 0 in equations (1) qo,qJ,q: =f(Kp,T;,Td,~,To). The PIDparameters
and (2» can be derived by some analytical ways. for computing of the controller parameters in the
BobaI (1994) used for the calculation of the poles of equations (15) and (17) are given by Ziegler-Nichols
the third order process model the Cardan formulas. (1942) relations
Calculation of the ultimate gain for the fourth and
higher order process model is necessary realize by T; = O.5TM ; Td = O.l25Tu (18)
numerical way, e.g. using MATLAB. It is suitable
use for deriving of the relations Symbolic Math
Toolbox. 2.4 Tahahashi's pm controller
2.2 Recurrent pm control algorithms Unfavourable large changes of the controller output
amplitude can be reduced, when the process output
Let the continuous PID controller be described by a reference value w(k) is included only in the integral
transfer function in the form component
u(S) ( 1 ) (14) T
Gc(S)=-() =Kp 1+-+TdS u(k) = K (y(k-1)- y(k)+2..[w(k)- y(k)] +
E S T;s p T;
T
To get a digital version of the PID controller, we +--f!... [2y(k -1) - y(k) - y(k -2)]) + u(k-1)
should discretize the integral and derivative To
component at the equation (14). For discretizing the (19)
integral component, usually forward rectangular This is a well-known recurrent control algorithm
method (FRM), backward rectangular method proposed by Takahashi et al. (1971), where
(BRM) or trapezoidal method (TRM) are used. The
derivative component is mostly replaced by the 1st
3Kpu Tu
order difference (two-point difference). For practical K =O.6K (1_T;,). T= KpTu . T =-"'---
use the recurrent control algorithms which compute P "" Tu' I 1.2Kpu' d 40Kp
the actual value of the controller output u(k) from the (20)
129
The relations (20) show that the PID parameters According to Fig. 1 the control law is governed by
depend only on the ultimate gain Kplb on the the equation:
ultimate period of oscillations Tu and on the
sampling period To . P(z-' )U(z-') = Q(z-' )(Y(z-') + N (z -'))
p (22)
+R(z -' )W(z-')
p y
q,=g (25)
p
where A. (z-') = A(z) and the quadratic
(deterministic) cost
130
Polynomial equations (23), (24) with spectral factors A (z·J )fPA.(z·J) + B(z·J)Z B.(z·J) =
(25), (27) yield the regulator polynomials under the (31)
= go + glz·J + z) + gl(Z·' + Zl)
following conditions:
a.) polynomials A and B are relatively prime
13) polynomials F", and B are relatively prime where
More details can be found in Ku~era and Sebek go = fP{l+a: +a:)+ Z{b: +b:)
(1984), Ku~ra (1980), Sebek and Ku~era (1982).
gJ = fP aJ(1+a 2 ) + Zbp, (32)
3.2 Parameter Estimation and Adaptive Control g, = za,
For spectral factorization (27), expression (31) is
Almost all mathematical models differs from similar with
physical systems. That is one of the reason for go = 1'(1+ a: +a;)+v(l+c: +c;)
adaptive control strategies. The most commonly used
approach for parameter estimation is the recursive gJ = .ooJ(l+a, ) + VCJ(1 + c,) (33)
least squares method. By re-arranging of (21) the g, = pa,
following equation
The spectral factors m(z·I), f(zol) are given:
y(k) = e'(k)z(k) + v(k) (29) go
~J =2-g, + (2+g,
g o ) 1 -gJ1
131
written in m-files using the functions Control System BobaI, V. (1994). Robust self-tuning PID controller.
Toolbox, Symbolic Math Toolbox, MATLAB 4.2 In: Proc. 1st IFAC Workshop on New Trends
and SIMULINK 1.3. This toolbox includes tools in Design of Control Systems, Smolenice,
which facilitate following: Slovak Republic, 312-317.
BobaI, V. , M. Kubal~ik and M . UIehla (1995). Auto-
1. Simulation of controlled process in the form of: tuning of digital PID controllers using recursive
continuous-time model, discrete time model, identification. In: Proc. 5th IFAC syposium on
model obtained by the recursive identification Adaptive Systems in Control and Signal
from the measurable date. Processing, Budapest, Hungary, 384-389.
2. Recursive identification: RLSM with exponential BobaI, V. (1995). Self-tuning Ziegler-Nichols PID
forgetting, RLSM with directional forgetting, controller. International Journal of Adaptive
projected algorithm. Control and Signal Processing, 9, 213-226.
3. Controller PID design on the basis of: Ziegler- Isermann, R. (1989). Digital control systems.
Nichols method, pole placement method (design Springer Verlag Berlin.
on the basis of the dominant poles for a second Ku~ra, V. (1980). A Dead-beat Servo Problem.
order continuous model, design using a double Int.J.ofControl, 32, No.1, p.107-113.
real pole and couple of complex conjugated poles Ku~era, v., Sebek, M.(1984). A Polynomial Solution
proposed by BobaI et al.(1995» . Unified design to Regulation and Tracking.Part I, 11.
based on the polynomial approach was Ky bernetilm, 20, p.177-188, 257-282.
incorporated into the Toolbox. Kulhavj, R. (1987). Restricted exponential
4. Real-time control using the acquisition card forgetting in real time identification.
PCL-812 PG with Real Time Toolbox. Automatica, 23, 586-600.
MacM~k , 1. , O. Dnibek and S. Krejci (1995).
Adaptive discrete PID controller. In: Proc.
5. CONCLUSIONS Scientific Papers, University of Pardubice, 58,
Czech RepUblic.
The paper is aimed to a class of self-tunning control PivoiUca, P. (1995). Modelling, adaptive, neural and
algorithms for SI SO systems. The self-tuners fuzzy control of coal power plants. In: Proc.
included in STC MATLAB-Toolbox are relatively 2nd IFAC Symposium on Power Plants and
simple, sufficiently robust and suitable for Power Systems, CancUn, Mexico.
controlling a large class of industrial processes. This Prokop, R., Turisova, Z., Meszaros, A. (1992).
toolbox has been used for implementation of the self- Unified Self-tuners for Industrial Applications,
tuning Ziegler-Nichols PID controllers. Controller In: Proc. IFAC Conf LCA , Wien, 167-172.
(19), (20) with tuning procedure for the second order Sebek, M., Ku~ra, V., (1982). Polynomial
model has been applied for temperature and pH Approach to Quadratic Tracking in Discrete
value control in laboratory fermenter (VaSek, 1995), Linear Systems. IEEE Trans.on AC, 27, 1007-
the same controller derived for the third order model 1010.
has been applied by PivoiUca (1995) for the control of Takahashi, Y. , C. Chan and D. Auslander (1971).
the 200 MW power plant. Controller (17), (18) has Parametereinstellung bei linearen DDC-
been successfully tested for the control of pilot Algorithmen. Regelungstech. Prozessdatenver.,
distillation column (MacM~ek et al ., 1995). The 19, 237-284.
unified approach to self-tuners was successfully VaSek, V. (1995). Laboratory fermentor computer
applied in metallurgic industry and some of results control. In: Proc. 10th Conference Process
were presented in Prokop et al. (1992). Control '95, Slovak Technical University
Bratislava, 243-247.
Ziegler, 1. G. and N. B. Nichols (1942). Optimum
ACKNOWLEDGEMENTS settings for automatic controllers. Trans.
ASME, 64, 759-768.
This work was supported by the Grant Agency of the
Czech Republic under grant No. 102/9610927 and by
the grant VUT Bmo No. FUZ 601 08.
REFERENCES
132