
Rasmussen H.Automatic tuning of PID-regulators
.pdf
3 ZIEGLER-NICHOLS TUNING METHODS |
11 |
unit step response
1.2
1
0.8
0.6
R
0.4
1
0.2
0 |
|
|
|
|
|
0 |
5 |
10 |
15 |
||
|
|
L |
time |
|
|
Figure 7: Unit step response
Table 2: Ziegler-Nichols ultimate period method
Regulator |
|
!" |
! |
P |
|
|
|
PI |
|
! |
|
PID |
|
! |
! |
|
|
|
|
Table 3: Ziegler-Nichols step response method
Regulator |
|
!" |
! |
P |
$ |
|
|
PI |
|
$ |
|
PID |
$ |
|

4 AUTO TUNING BASED ON RELAY FEEDBACK |
12 |
4 Auto Tuning based on relay feedback
Figure 8: Relay feedback
A difficulty with the ultimate gain method, seen from an automated point of view, is that the closed loop system is at the stability boundary. A special method where an appropriate frequency of the input signal is generated automatically is achieved by introducing a nonlinear feedback of the relay type in the control loop. Consider the system figure 8. Assume that there is a limit cycle with period ! so that the relay output is a periodically symmetric square wave. If the relay output is ,, a simple Fourier series expansion of the relay output for (no hysteresis) gives a first harmonic with amplitude , . If it is further assumed that the process dynamic has low-pass character and that the contribution from the first harmonic dominates the output, then the error signal has the amplitude
|
|
|
|
|
|
|
|
|
|
|
, |
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
! |
|
||
The condition for oscillation is thus that |
|
|
|
|
|||
|
|
|
|
|
|
||
|
|
|
|||||
|
|
|
|
|
|
||
|
|
|
|
|
|||
|
|
|
|
|
|||
|
|
|
|
||||
|
|
|
|
|
|
, |
|
Defining |
|
|
|
|
|
|
|
|
|
|
, |
|
|||
|
|
|
|
|
|
|
|
it is easily seen that with the above assumptions is the gain that brings the system to stability boundary under pure proportional control. The ultimate gain and the ultimate period ! are thus easily found from a relay experiment.
Figure 9 shows a relay experiment giving the ultimate period ! and gain . The PID controller can then be derived from table 2 and a closed loop step response with this controller is shown on the figure too. This method has only one parameter that must be specified in advance, namely the amplitude of the relay. A feedback loop from measurement of amplitude of the oscillation to the relay amplitude can be used to ensure that the output is within reasonable bounds during oscillation. Even the order of magnitude of the time constant of the process can be unknown. Therefore, this method is not only suitable as a tuning device, it can also be used in a pre-tuning phase in other

4 AUTO TUNING BASED ON RELAY FEEDBACK |
13 |
Speed [rpm]
800 |
|
|
|
|
|
|
|
|
|
70 |
|
700 |
|
|
|
|
|
|
|
|
|
60 |
|
600 |
|
|
|
|
|
|
|
|
|
50 |
|
500 |
|
|
|
|
|
|
|
|
|
40 |
[rad] |
400 |
|
|
|
|
|
|
|
|
|
30 |
|
300 |
|
|
|
|
|
|
|
|
|
20 |
Wslip |
|
|
|
|
|
|
|
|
|
|
||
200 |
|
|
|
|
|
|
|
|
|
10 |
|
100 |
|
|
|
|
|
|
|
|
|
0 |
|
0 |
|
|
|
|
|
|
|
|
|
-10 |
|
-100 |
0.05 |
0.1 |
0.15 |
0.2 |
0.25 |
0.3 |
0.35 |
0.4 |
0.45 |
-20 |
|
0 |
0.5 |
|
Time [s]
Figure 9: Ziegler-Nichols tuning of a PID controller by a relay experiment
tuning procedures where the time constant of the system has to be known, or it can be used to decide a suitable sampling period. Doing experiments with different amplitudes and hysteresis of the relay, several points on the Nyquist curve can be identified. Design methods based on two points can then be used.
Since limit cycling under relay feedback is a key idea of relay auto tuning, it is important to have methods for determination of the period and the amplitude of the oscillations.
Theorem 1 (Limit cycle period) Assume that the system defined in figure 8 has a symmetric limit cycle with period T. This period is then the smallest value greater than zero satisfying the equation
|
|
(9) |
|
|
|
where is the zero order hold sampling of the continuous system . |
||
|
|
|
Proof: Let denote the time where the relay switches to ,. |
Since it is |
|
assumed that the limit cycle is symmetric it follows that |
|
!
and that the control signal has been constant , for & . A time discrete control signal & ,put on a DAC + zero-order hold circuit is seen to give the same analog . Hence
&
Since &" &"-+ , "and switching occurs when it follows that
|
|
|
|
, |
|
which gives the equation (9). |
|
|
Example 2 Limit cycle period

4 AUTO TUNING BASED ON RELAY FEEDBACK |
|
|
14 |
||||||||||||||||||||||||
If the transfer function |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
& |
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
( |
|
|
|
|
|
|||||||||||||||
is sampled with a sampling period h greater than ! the zero order hold sampling is |
|||||||||||||||||||||||||||
given by |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(10) |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
. |
|
|
|
||||||||||||
with |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||
|
& |
|
& |
& |
|
|
|
|
& |
|
|||||||||||||||||
Hence the period ! is given by |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
+ |
|
|
|
|
|
|
|
(11) |
|||||||||||||||
|
|
|
|
|
|
. |
|
|
|
||||||||||||||||||
which gives |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(12) |
||||||||||||||
|
|
|
|
|
|
! ( |
|
|
|
|
|||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
This period has to be compared with the ultimate period ! defined by |
|
||||||||||||||||||||||||||
|
|
|
|
|
! |
|
|
|
|
|
( |
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||
|
|
|
|
|
|
|
|
& |
|
|
|||||||||||||||||
|
|
|
! |
|
|
|
! |
|
|
|
|
|
|
|
|
|
|
|
|
! |
|
|
|
For ( and ! the equation gives ! ! , where ! is computed from equation (12) giving the period obtained from an relay experiment.

5 TUNING WITH SPECIFIED PHASE AND AMPLITUDE MARGIN |
15 |
5 Tuning with specified phase and amplitude margin
Consider a situation where one point A on the Nyquist curve for the open loop system is known. With PID control it is possible to move the given point on the Nyquist curve to an arbitrary position in the complex plane, as shown in figure 10. The point may be moved in the direction of by changing the gain and in the orthogonal directions by changing the integral or the derivative time constants.
Imag Axis
1
im G(jw)
0.8
0.6 1/jw G(jw)
0.4
0.2
0 |
|
|
|
re G(jw) |
-0.2 |
|
|
|
|
-0.4 |
G(jw) |
|
|
|
A |
|
jwG(jw) |
|
|
|
|
|
||
-0.6 |
|
|
|
|
-0.8 |
|
|
|
|
-1 |
0 |
0.5 |
1 |
1.5 |
-0.5 |
Real Axis
Figure 10: Movement of the point A with a PID-regulator
Consider a process with transfer function as an example demonstrating the idea. The loop transfer function with PID control is
! !"
The point where the Nyquist curve of intersects the negative real axis is given by the ultimate frequency ! and ultimate gain , e.g. . If
! |
|
|
(13) |
!#" |
|
||
|
|
|
the argument of the open loop transfer function is now . If the magnitude |
|||||||
of the open loop transfer function is specified |
to simple trigonometric calculations |
||||||
give |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Equation 13 has many solutions for ! and !". If however

5 TUNING WITH SPECIFIED PHASE AND AMPLITUDE MARGIN |
16 |
|||||||||||||||
|
|
|
|
|
Table 4: PID controller |
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
Regulator |
|
|
|
!" |
! |
|
|
|
|||||||
|
Ziegler-Nichols |
|
|
|
|
|
|
|
|
|
||||||
|
ultimate period |
! |
! |
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
and |
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
! |
! |
|
|
||||
|
|
|
|
|
|
|
!" |
! |
|
|
|
|
|
|
||
with specified the equation 13 gives the following solution |
|
|
|
|||||||||||||
|
|
|
|
|
|
|
|
|||||||||
! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|||||||||
Example 3 Combined amplitude |
and phase margin specification |
|
A design method based on the requirement that the Nyquist curve intersects the circle with radius and an angle of is given.
|
|
|
|
Specifying gives the following PID controller |
|||
|
! |
! |
|
|
|
|
|
|
!" |
|
! |
|
|
|
|
Table 4 compares the coefficients found by this method to the coefficients found by Ziegler-Nichols ultimate period method. and ! may be determined by relay feedback.
Speed [rpm]
700 |
|
|
|
|
|
|
|
|
|
70 |
|
600 |
|
|
|
|
|
|
|
|
|
60 |
|
500 |
|
|
|
|
|
|
|
|
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
|
|
|
|
|
|
|
|
|
40 |
|
|
|
|
|
|
|
|
|
|
|
[rad] |
|
300 |
|
|
|
|
|
|
|
|
|
30 |
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
Wslip |
|
|
|
|
|
|
|
|
|
|
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
|
|
|
|
|
|
|
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
|
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
|
|
-10 |
|
-100 |
0.05 |
0.1 |
0.15 |
0.2 |
0.25 |
0.3 |
0.35 |
0.4 |
0.45 |
-20 |
|
0 |
0.5 |
|
Time [s]
Figure 11: Modified Ziegler-Nichols tuning of a PID-regulator by a relay experiment
Figure 11 shows a relay experiment giving the ultimate period and gain. The PID controller can then be derived from table 4 and a closed loop step response with this controller is shown on the figure too.

6 RELAY WITH HYSTERESIS |
17 |
6 Relay with hysteresis
|
2 |
|
|
|
|
|
|
|
im G(jw) |
|
|
|
1.5 |
|
|
|
|
|
1 |
|
|
|
|
|
0.5 |
|
|
|
|
Axis |
(-1,0) |
|
|
|
|
0 |
|
|
|
re G(jw) |
|
Imag |
|
|
|
||
|
|
|
|
|
|
|
-0.5 |
|
|
|
|
|
-1 |
|
|
|
|
|
N(a) |
A |
|
|
|
|
-1 |
|
|
|
|
|
|
|
|
|
|
|
-1.5 |
|
|
|
|
|
|
|
K G(jw) |
|
|
|
-2 |
0 |
1 |
2 |
3 |
|
-1 |
||||
|
|
|
Real Axis |
|
|
Figure 12: Stable limit cycle oscillation
With an ordinary relay, a small amount of noise can make the relay switch resulting in difficulties with determination of the period for a stable limit cycle. This can be overcome by introducing a relay with hysteresis as shown in figure 8. The describing function of such a relay is
|
|
|
(14) |
||
|
|
, |
, |
|
where ,is the relay amplitude and is the hysteresis width. This function is a straight line parallel to the real axis, in the complex plane. The intersection with the Nyquist curve (figure 12) gives the stable limit cycle period and amplitude. By choosing the relation between and , it is possible to specify the point A with a given imaginary part.
This property can be used to obtain a regulator witch gives the system a desired phase margin. Consider a process controlled by a proportional regulator. The loop transfer function is thus . If the specified phase margin is the relay characteristics has to be chosen so the describing function goes through the point . From figure 12 and equation 14 the following equations are obtained
, |
|
|
|
|
(15) |
||
|
|
|
where is the amplitude of process output oscillation.
Integral and derivative action can then be included, using the method described in the previous section.

7 OFFSET |
18 |
7 Offset
Figure 13: Relay feedback with corrective bias
In a typical auto-tuning setup (figure 13) a supervisory program will be activated to initialize the control error to zero and the bias to an appropriate level. Furthermore any request for set point changes is disabled during tuning to ensure that the relay will receive a zero mean input signal. Any static load disturbance or incorrect bias initialization will cause asymmetry in the relay switching intervals and thus give incorrect estimates of the ultimate gain and period.
If and are the intervals of positive and negative relay outputs respectively, and ,is the relay amplitude, then the corrective bias may be computed for each positive going
shift of the relay by:
,
Hence the supervisory program can monitor the switching intervals and automatically add the bias correction once the asymmetry condition is detected.
8 Auto Tuning based on Pole Placement
Suppose that the process to be controlled is characterized by the model
&
# & .
then the controller Eq. 8 gives the closed loop response
|
|
|
|
|
|
|
|
! |
|
|
|
|
|
|
|
|
|
# |
|
|
|
& & |
|
|
|
|
|||||||||
|
$ |
|
|
|
|
% |
(16) |
||||||||||
|
|
|
& |
& |
|
& |
& |
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ |
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ |
|
& |
|
& |
|
% |
. |
|
||||||
|
|
|
|
|
|
|
|||||||||||
with characteristic equation |
|
& & & |
& |
|
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
$ % |
|
|
|
(17) |
||||||||||||
where the relation between |
|
and |
|
& for a n'th order polynomial is given by |
|||||||||||||
|
|
|
|
|
|
& |
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|

8 AUTO TUNING BASED ON POLE PLACEMENT |
19 |
If we specify a stable closed loop polynomial and require that $ (integral action) then equation (17) has a unique solution for $ and % if and have no common roots and
$ %
The polynomial ! & may be computed in different ways e.g.:
! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
& |
|
|
|
|
|
|
|
|
|
|
& |
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
! |
& |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# |
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
! |
|
|
|
|
|
|
|
% |
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
& |
|
|
|
|
|
|
|
|
& |
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
For ! & & equation (16) gives: |
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||
|
|
|
|
|
|
$ |
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|||||||||||||||||||||
|
|
|
|
|
|
|||||||||||||||||||||
DC-gain equal to one is achieved for |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
# |
|
|
# |
|
|
|
|
|
% |
|
|
|
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If the ultimate gain ,ultimate period ! and the delay time ! are determined by |
|
|
|
a relay experiment in a pre-tuning phase, then suitable values for the sampling period |
|
and the closed loop dynamics may be chosen. |
|
Example 4 Second order model |
|
1.A relay experiment gives the ultimate period ! and the delay !
2.The sampling time is chosen as ! !
3. Based on the relay experiment the closed loop poles
may for instance be specified as |
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
with coefficients given by |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
||||||||||||
|
|
|
! |
|
|
|
|
|
|
! |
|
|
|||||
|
|
|
|
|
|
|
|
! |
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
and tuning parameters chosen as |
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 AUTO TUNING BASED ON POLE PLACEMENT |
|
20 |
||||||||||||||
4. A least square estimation method gives the model: |
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
- |
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
5. The controller coefficients: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ |
|
|
|
|
! |
||||||||||
|
|
|
|
|||||||||||||
|
% |
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|||||||||||
|
! |
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
||||||||
in the controller |
|
|
|
|
|
|
|
|
% |
|
||||||
|
|
|
|
! |
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# |
||
|
|
|
|
|||||||||||||
|
|
|
|
$ |
|
|
|
|
|
$ |
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
are calculated by solving the equations: |
|
|
|
|
|
|
|
|
|
|
|
$ %
$
The solution may be written in the following matrix form:
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|