D. Tabak
Digitalisation of control systems Conversion of industrial control systems from conventional continuoustime to computerised discrete-time control (or in other words: digitalisation), is considered. A method utilising the z- and w - transform techniques is described. An example of digitalising a tracking antenna control system is presented.
The area of computer control has been one of the most active during the past ten years both in industry as well as in academic institutions. 1-4 There is a definite trend in modern industry to control processes and systems using digital computers. In many cases, systems which were designed to be controlled by conventional continuoustime controllers, are redesigned to be controlled by a digital computer. This transition from continuous to discrete-time control is called the digitalisation of the control system. Digitalisation of automatic control systems is a problem of considerable interest and importance in various branches of industry. In the subsequent chapters, the theory and techniques, underlying the digitalisation problem, are presented. As a particular application, the digitalisation of an antenna tracking control system is discussed. The system under consideration is the 40 ft. antenna control system of N A S A Goddard Space Flight Center. The results of the applicable computations are presented in detail.
The Laplace transform of the z.o.h, is given by Reference 6, p. 44: 1 - e -sT
Gh0(S) = - -
....(1)
S
The combined transfer function of the modified plant which includes the z.o.h, is 1 -
G(s)
= G~o(s) P(s)
e- Jr
= - -
P(s)
....
(2)
S
Using the translation, or shifting theorem Reference 6, p. 69; Reference 8, p. 3 the z-transform transfer function of the modified plant is obtained:
~I -e -'r G(z) = z[G(s)] = z
=
s
(l-z-1)z
-] P(s)J =
z_, [ %
=
- -
z
....
(3)
Z
The digital controller has the following general form:
S t a t e m e n t of the Problem The system under consideration is shown in Fig. !. The plant is represented by its Laplace transform transfer function P(s). The feedback system was designed to work with a continuous-time controller C(s). It may have been working for some time with this configuration or it may have been in the design period only. At a certain time it is decided to digitalise the system. The new configuration is shown in Fig. 2. The continuoustime controller is replaced by a digital controller D(z). The digital controller actually constitutes a program on a digital computer system placed in the loop. s- 7 The system shown in Fig. 2 is a sampled-data system. It is assumed that it is uniformly sampled with a sampling period T. It will be further assumed that the system operates with a zero-order-hold (z.o.h.). A system of this type is modelled using the z-transform, s- s
anz n "+ an- lz n- I Jr
D(z) .
.
.
D(z) = A l z " - m + A 2 z
a o
.
(4)
+ bo
....
1 ..}. . . . . . . .
(5)
Since n - m > 0, D(z) contains terms with positive powers of z, which indicates prediction, e and makes D(z) physically This project was supported by the N A S A contract N A S 5-9756-192. Digital computer system
1 I
I
I
t
I
I
I
~ ' 1 - " o ~ 1
l ,
WINTER 1971
. . . +
The coefficients at and b~ of the digital controller are unknown and are to be established as part of the digitalisation design. There is a restriction concerning the order of the numerator and denominator polynomials of the controller. Suppose for the moment that n > rn. Dividing the numerator by the denominator we obtain the following series:
I
Fig. 1
.
bmz m + bm-lZ m-1 + . . .
o,g,to,oootro,,er ,
-I - 1 1
P,o°t [
Fig. 2 13
unrealisable. Hence, in order to ma~e the controller physically realisable the following.coC[dition is imposed: m >i n
. . . . (6)
that is, the order of the denominator of D(z) is not smaller than the order of the numerator. Once the coefficients a, and b, of the digital controller D(z) are established, the controller can be programmed on a digital computer. There exists a variety of methods of programming D(z) Reference 7, Chapter 25. A detailed description of one of the methods is given later with a specific example. The original system, shown in Fig. 1, has certain performance properties that we want to preserve after the digitalisation is completed. These properties could be formulated for instance as the step response specifications, such as: rise time, overshoot, settling time, steady state error. The basic problem in the digitalisation process is to find an expression for the digital controller D(z), so that all the properties of the original continuous-time system are preserved. The data available are the transfer function of the plant, P(s), and the original controller C(s), which assures the desired system's performance in continuous-time operation. Based on these data and on the performance specifications, the coefficients a, and b, of the digital controller D(z) are to be established.
t
? (a) High sampling frequency (low period )
t=
Choice of t h e Sampling Period The choice of the sampling period for the digitalised control system is dictated by various considerations to be discussed in this section. It is intuitively obvious that the higher the sampling frequency, or the lower the sampling period, the better will be the transmission of a signal through a sampler and a zero-order-hold. This argument is demonstrated in Fig. 3, which shows a sinusoidal signal and its form after passing through a sampler and a zeroorder-hold. In Fig. 3(a) the sampling period is much lower and the original signal is reproduced much more precisely than the one in Fig. 3(b). Fig. 3 shows one period of the sinusoid. Had that period been ten times longer, the signal would be reproduced with sufficient precision even with the sampling period used in Fig. 3(b). The important measure in this case is the relative values of the lowest period of the original signal and the sampling period. This measure was formulated in a more precise manner in the famous Sampling Theorem. 9 If we denote the highest frequency contained in a signal as we, and the sampling period as T, the sampling theorem states:
Ira signal contains no frequency higher than wc (rad/sec), it is completely eharacterised by the vahws of the signal measured at instants of time separated by T = ½ (2~r/wc) seconds. In other words: T = ½To
. . . . (7)
where Tc = 2~/wc The sampling period should be no higher than half of the lowest period contained in the original signal. The sampling theorem establishes only the highest bound on the sampling period. Of course, the lower the period, the better reproduction of the original signal is obtained. Following this argument, the designer should strive to reduce the sampling period as much as possible.
14
( b ) Low sampling frequency ( high period)
Fig. 3 On the other hand, we should keep in mind that the sampling is realised by a practical digital computer interconnected with a real-life system. The computer must perform a prescribed amount of operations between the sampling instants. These operations last for a finite period of time. Therefore, the sampling period is bounded from below by some practical operational considerations which both the designer and the real-time programmer have to take into account. The choice of the sampling period should proceed as described in the following. The Laplace transform transfer function of the original plant is expressed in the following form:
P(s) =
N(s) s'(T,s + 1) (T~s + 1 ) . . . [(s + ~,)2 + o~1"]... . . . . (8)
The inverse Laplace transform of P(s) contains the following expressions: e - V r l ; e-Vr~; . . . . e-VT1 sin o J l t ; . . . We see that 7"1, T2. . . . . rl . . . . represent the time constants of the system, while ~1, oJ2. . . . represent its natural frequencies. Let 01, 02. . . . be the periods corresponding to ~ , oJ2. That is: 01 = 2rr/o~l;
0~ = 21r/oJ2;...
Now define the minimal period among all the periods and time constants of the system: T,. =
M i n [7"1, 7"2. . . . .
71, ~'2 . . . . .
01, 02 . . . .
]
....
(9)
COMPUTER AIDED DESIGN
According to the sampling theorem the sampling period T should satisfy the following inequality:
T<-~ T~/2
. . . . (10)
It is true that the sampling theorem was formulated t'or natural periods of the signals and not for time constants, however equations (9), (lO) serve as a good measure. If possible, it is advisable to choose
r <~ T,./4
. . . . (11)
This would insure better reconstruction of signals passing through the system. After having picked a sampling period T, following equations (9) - (11), we have to check whether all the necessary operations to be performed between the sampling instants can be accomplished within the time T. If not, we have to increase the T chosen, until all requirements are satisfied. If we cannot accomplish all the operations needed within a sampling period Tin* defined by: Tin* = ½ Min (el, 02. . . . )
. . . . (12)
which is the theoretical limit imposed by the sampling theorem, it means that the computer chosen is inadequate for the operation envisioned. A faster computer is to be picked in such a case.
Choice of the Digital Controller As mentioned in the statement of the problem, we have to choose the digital controller so that all the properties of the system with the continuous-time controller are preserved. To accomplish this, an instinctive, but erroneous idea, immediately comes to mind. Since the controller C(s) is already given in the Laplace transform, why can't we transform C(s) directly into z-transform, using the standard tables given in various References (5-8)? The fallacy of this approach is explained in the following. Using the Laplace transform C(s) of the controller we can always calculate what will be its response to any specific continuous time signal. By converting C(s) into
(a)
Continuous unit step response
e
-7-
- ~,'-2-1"-
~-
or
z-I w=-z+l
....(13)
l+w z = -1-w
. . . .(14)
The relationship between the z and the s-domains is: 5.6 z = e~r;
1
s = --~ln z 1
. . . . (15)
where T is the sampling period. Using the transformation equations (13) - (15) we can construct the mappings of the unit circle from the z-plane into the s and the w-plane as shown in Fig. 5. 6 The points along the unit circle in Fig. 5(a), designated as A to G, correspond to the same points shown in Figs 5(b) and (c). While the stability region is within the unit circle in the z-plane, it is in the left hand plane in both s and w-planes. Due to this fact we can work in w-plane in complete analogy with the s-plane, using the well established methods of design of linear automatic control systems. 1° For instance, we can use the Bode plot t° representation of transfer functions in w-domain in exactly the same way as in the s-domain. It should be noted however that generally, a certain point in the z-plane will not be mapped in the same locations in the s and the w-planes. Therefore, a certain frequency oJ in the s-domain will be transformed into a different frequency ~,~ in the w-domain. The specific relation of this frequency transformation can be derived from the equations (13), (15) as follows? ,s On the imaginary axes in the s and w-planes we have s=~
f/
w =jaJw T
0
its z-transform equivalent C ( z ) , for a specific period T using standard tables, we are able to precalculate its response to the same signal after it has been sampled with a period T. Naturally, the response will not be the same, since it really is not the same signal. If we introduce sampling into the loop shown in Fig. 1, and leave the same controller C(s), its behaviour under the same inputs to the system will be different, since these input signals are now sampled. Therefore, the overall closed loop system properties are changed. What we really want to achieve is demonstrated in Fig. 4. Suppose the unit step response e(t) of the controller is the one shown in Fig. 4(a). We want to replace the continuous-time controller C(s) by a digital controller D(z), whose unit step response, sampled with a period T, has the same form, or rather the same envelope, as that of C(s). [See Fig. 4(b).] By preserving the output/input properties of C(s), we will also preserve the closed loop properties of the system. The goal set forth previously is achieved using the bilinear transformation. Instead of converting directly from the s-domain into z- domain, we use an intermediary w-domain, defined as follows: 6,6
2T 3T....... (b)
Fig. 4 WINTER1971
Sampled unit step response
and the corresponding z: Z ~--- ¢./a~T
Therefore, using equation (13) we obtain
15
lmz
~
bleregion
~ -1 ~
Rez
frequency in the Bode plot of the new network. As stated before, we go through the w-domain first. Initially, we must compute the corner frequency in w-domain corresponding to the given corner frequency oJc = 0-32 rad/sec. Using equation (16) we obtain
~~:~ 1
oJcT oJw = t g - - ~
= tg
0.32 * 0.05 2 - 0.0081
z-Plane 1/o~, = I/0.0081 = 123.46 So the corresponding transfer function in w-domain is
lms=ico $tQbleregion
1/2 JCOs
F(w)-
Using equation (13) we obtain the desired z-transform transfer function :
Res
II
D
211"
_ (b) s-Plane
(E_ _l/al, -1/2i~s
~ l
Fig. 5
COs=T
lrnw=jcow
@L__~~®
®~-~1
.ew
0"177 I + z -~ = 0'00142 z - 1 1 - 0-9837z-1 123'46 + 1 z+l
A p p l i c a t i o n to a 40 ft. A n t e n n a T r a c k i n g System
cos~oT + j sinoJT - i costoT + j sino~T + 1
= j t g oJT[2
or . . . . (16)
oJw = t g oJT]2
F(z) =
This digital filter was checked out experimentally by applying sinusoidal signals of frequencies ranging from 0'05 to 1-0 rad/sec, sampled at T = 0.05 sec. The original shape of the Bode plot with the corner frequency of 0.32 rad/sec, both for amplitude and phase, was obtained.
(C)w'P,one
eJ~r- I J~=el'~r + 1
0-177 123.46w + 1
Using equation (16) we can compute the corresponding frequency a,w in w-domain for every given frequency ¢o in s-domain. This is particularly important in comparing the representation of systems in both domains using frequency-domain methods, such as the Bode plot. To illustrate this point, consider the following example.
The digitalisation techniques, described previously were applied to a 40 ft. antenna tracking system of NASA Goddard Space Flight Center. This control system was previously designed with continuous-time controllers. Under the current project, the control of the whole system was to be accomplished using an SDS Sigma-5 digital computer. The continuous-time controllers were to be replaced by digital controllers, while preserving the dynamic properties of the whole system. These digital controllers are actually programmed on the Sigma-5 computer using the canonical method of programming, described in reference [7], page 454. A simplified block diagram of the 40 ft. antenna control system, for one of the tracking channels, is shown in Fig. 6. The original plant P(s), which constitutes the power drive of the antenna control system, including the dynamics of the whole antenna system, is given. The control system i~ partitioned into two basic subsystems:
Example 1 - - L o w Pass Filter Given a low-pass filter whose transfer function for a continuous-time signal is F(s) -
0-0566 0.177 - s + 0.32 = 3-125s + 1
As we see, the corner frequency of this filter in its Bode plot is oJc = 0-32 rad/sec Now we want to replace this filter by a digital filter which will have the same frequency response for signals sampled with a period of T = 0.05 sec. In other words, we want to obtain the same corner 16
(a) The velocity subsystem, or tachometer loop. (b) The position loop. The velocity subsystem is compensated by the continuoustime controllers A(s) and B(s), while the position loop is compensated by C(s). All the controllers A(s), B(s) and C(s) have been designed before, assuming the whole system is working on a continuous-time basis. After this design was completed it was decided to digitalise the system, replacing the controllers by digital controllers A(z), B(z), C(z) while preserving the basic dynamic properties of the system. The new system configuration is shown by a block diagram in Fig. 7. The digital controllers A(z), B(z), C(z) are calculated using the w-transform as described in section 4. Before this is actually done, we have to establish the sampling period T. COMPUTER AIDED DESIGN
T h e transfer function o f the original plant is
P(s)
=
T., = Min [Tl; 0; %] = Min [0"0875; 0"166; 0"139]
1-6 × 10-as 2 + 1 (0'0875s
+
I)
(6"69 s2
x
10-4s "- + 9"6
x
10-as
= 0.0875 = Tt
1)
+
A c c o r d i n g to e q u a t i o n (10), the sampling period T to b e chosen s h o u l d satisfy
6250
+
= 2"74 (s + 11"42)(s 2 + 14"37s + 1500)
T ~ T,,/2
=
0.04375 see.
T h e lowest n a t u r a l frequency is Since there was a considerable a m o u n t o f calculations to be p e r f o r m e d by the c o m p u t e r in between the s a m p l i n g instants for various practical purposes, it was decided to fix the s a m p l i n g period at T = 0.05 see.
oJ, = ~/1500 = 38.7 rad/sec. T h e d a m p i n g ratio is
8
14-37 2 ~o.
=
2
14.37 x 38'7 - 0"185
N o w : 0/2 = 0.083 sec > T so the s a m p l i n g theorem, or e q u a t i o n (12) is satisfied a n d this choice o f T is acceptable. T h e digital controllers are c o m p u t e d in the following.
The time c o n s t a n t o f the q u a d r a t i c f o r m is ~° r~ = 1/3oJ,. = I/7.185 = 0.139sec.
A(z) Controller
The ac: Jal frequency o f oscillation is
,4(s)
a,,, = co. x/1 - 82 = 38-7 V'I - 0.1852 = 37.8 rad/sec. a n d the period c o r r e s p o n d i n g to it
~o = 1/0.47 = 2.128
The time c o n s t a n t c o r r e s p o n d i n g to the first o r d e r t e r m o f the d e n o m i n a t o r of P(s) is
T h e c o r r e s p o n d i n g c o r n e r frequency in w-domain is ~oT
=
0.47s + 1
T h e c o r n e r frequency o f the d e n o m i n a t o r is
0 = 2~r/oJ,. = O' 166 see.
T~
! .96
=
cow=tg-~--=tg
0"0875 sec.
2"128
×
2
0.05 tg
0"05319 -----0"0532
-
1.96
=
1/oJw ~- 18"9
This is the lowest time period a m o n g (7"1; 0; %).
1 "96 Velocity
X(w) =
(Tachometer) subsystem Antenna position
Antenna velocity
18.9w + 1 1.96
A(z) =
18.9 z - 1 +1 z+l
signal - \
z + 1 19.9z-
17.9
z+ 1 1 + z -1 = 0.099 - = 0.099 1 - 0"899z- x z - 0.899 V e l o c i t y loop
B(z) Controller
L_ Position Io0p
P(S)
1.6 x 10 . 4
= (0"0875
s + 1) ( 6 ' 6 9
B(s) = 2-31
0.0864s + 1 0"47s + 1
s2 x 1
x 10 - 4
s2 +
9 " 6 x 10 - 3
T h e d e n o m i n a t o r is the same as in A(s). T h e corner frequency o f the n u m e r a t o r is
s + 1)
1"96 A(S)
--
B(S)
=
C(S)
=
Fig. 6
0'47
s + 1
2.31
0-0864 0"47S
1.82
s + 1 +1
1.1 s + 1 s
Ref signalJ
Fig. 7
WINTER 1971
r-~ I I I ~
SDS Sigma-5 computer
1 I
I _~
A/D
=
Analogue to
D/A
=
Digital to Analogue
Digital
converter" converter
17
= 1/0"0864 = 11"574 11.574 × 0-05.
~T
~ = ~ = ~
2
- tg 0.2893 - - 0 . 2 9 7 7
As m e n t i o n e d before, the digital controllers were p r o g r a m m e d on the Sigma-5 c o m p u t e r using the canonical m e t h o d described in reference [7], page 454. They all have the general form o f a first o r d e r digital filter a0 + al z- 1
1/=w = 1/0.2977 = 3.359
D(z) -
1 + btz-1
Hence B(w) = 2.31
B(z) = 2"31
If e~(nT) are the input signals a n d e z ( n T ) - t h e o u t p u t signals, then the canonical m e t h o d generates a n intermediate function
3.359w + 1 18-9w + 1 4"359z - 2"359 19.9z -
17"9
0-51z - 0"274
f(nT)=
e~(nT)- blf[(n-
I)T];
n = 0,1,2...
z - 0"899 T h e o u t p u t signal is
0"51 - 0"274z - a e~.(nT) = aof(nT) + alf[(n -
1 -- 0"899z -1
Conclusion
l'ls + 1 C(s) = 1 . 8 2 - -
It was demonstrated how z- and w-transform techniques can be applied in the digitalisation o f c o n t r o l systems. T h e same techniques can be applied in a variety o f industrial applications, o t h e r t h a n the one presented o n page 16.
S
Numerator: = 1/1"1 = 0"909091
References
oJw = tg 0"022727 ~ 0"02273 l/ww = 43"993 Denominator: oJ=l
oJw = tg 0"025 ~ 0"025 l/o~w = 40
C(w) = 1.82
C(z) = 1-82
43.993w + 1 40w 44"993z - 42"993 40(z -
2"047 -
n = 1,2 . . . .
These expressions are easily p r o g r a m m a b l e .
C(z) Controller
co
I)T];
1)
1"956z- 1
1 --Z -1
2"047zz-1
1"956
Lee, T. H., Adams, G. E., Gaines, W. M. : "Computer Process Control: Modeling and Optimization,' Wiley, N.Y., 1968. " Smith, C. L., Murrill, P. W.: 'Advanced Concepts for Computer Control Systems,' Computer Control Workshop, 1969 JACC, Boulder, Colorado, Aug. 1969. Williams, T. J. : "Studying the Economics of Process Computer Control,' ISA J., 8, pp. 50-59, 1961. 4 S a v a s , E. S . : 'Computer Control of Industrial Processes,' McGraw Hill, N.Y., 1965. '~ Jury, E. I.: 'Sampled-Data Control Systems,' Wiley, N.Y., 1958. Kuo, B. C.: 'Analysis and Synthesis of Sampled-Data Control Systems,' Prentice Hall, Englewood Cliffs, N.J., 1963. 7 Monroe, A. J.: 'Digital Processes for Sampled Data Systems,' Wiley, N.Y., 1962. " Jury, E. I.: "Theory and Application of the z-Transform Method,' Wiley, N.Y., 1964. Oliver, R. M., Pierce, J. R., Shannon, C. E.: "The Philosophy of Pulse Code Modulation," Proc. IRE, 36, pp. 1324-1331, 1948. lo Kuo, B. C.: "Automatic Control Systems,' 2nd Edition, Prentice-Hall Inc., Englewood Cliffs, N.J., 1967. Received May 1970
D. Tabak, Ph.D. (EE), University of Illinois, 1967, is presently employed as a Senior Consultant with the Wolf Research and Development Corporation, Riverdale, Md., since April 1968. Prior to this, he has been a Guidance and Control Systems Engineer with the General Electric Company, Missile and Space Division, in Philadelphia, Pa. At the same time, during the academic years 1966-7 and 1967-8, Dr. Tabak taught automatic control courses at the Graduate Extension of Pennsylvania State University in King of Prussia, Pa.
18
COMPUTER AIDED DESIGN