Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
29 views

05 Introduction To Digital Control

Intro to digital control....
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

05 Introduction To Digital Control

Intro to digital control....
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Introduction to Digital Control

Introduction
The basic aim of any control system is to make the controlled output variable y, produced by some process, behave in a specified
way as defined by the reference variable r. A controller is usually designed to ensure that the output y is as close as possible to
the reference variable r. Figure 5.1 shows the most common form of controller, that of a cascade controller as part of a feedback
control system, in this case the controller operates on the error signal, e, to produce the control signal u.

Controlled variable
Reference + CONTROLLER PROCESS
r(t) y(t)
-

MEASUREMENT

Figure 5.1

In the Part III module it was assumed that the controller is in the form of a continuous time or analogue circuit. An increasingly
common approach is to implement the controller in the form of a computer, microprocessor or microcontroller program. The
advantages of using digital controllers include the following:
 greater flexibility and versatility
 reduction of noise effects on the system
 ability to use advanced control methods
 storage of data e.g. for further processing
 communication possibilities
 increasing system cohesion and integration
 possible cost advantages

There are some potential disadvantages:


 possibility of a total system crash
 problems from bugs
 possibility of quantization errors

The remainder of these lecture notes will look at the analysis and design of such digital control systems (often called discrete-
time control systems). It is important to realize that the basic ideas of control theory are common to both continuous-time and
discrete-time control systems, it is the details of analysis and design that may differ.

Because of time limitations we shall restrict ourselves to control algorithms which are linear constant coefficient difference
equations where the corresponding control systems are causal, SISO, and linear time invariant (LTI).

The digital algorithm


Corresponding to the function of a continuous-time controller, the object of the control algorithm is to take the current error
value and produce a corresponding control action value of u which is a linear function of the current and past errors and past
control values thus:
𝑢 = 𝑓 (𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑒𝑟𝑟𝑜𝑟, 𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝑒𝑟𝑟𝑜𝑟, 𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝑐𝑜𝑛𝑡𝑟𝑜𝑙 𝑣𝑎𝑙𝑢𝑒𝑠)

Figure 5.2 illustrates the formula.

40
New error value, e
DIGITAL New control value, u
Old e values
MEMORY ALGORITHM
DATA Old u values
STORAGE

Figure 5.2

The computer program running the algorithm can be:


1. Clock driven: i.e. the program runs at regular time intervals.
2. Free running: i.e. the program starts a new run as soon as the previous run is finished.
3. Event driven: i.e. the program is run when some external event requires an updated value from the algorithm.

The most common approach and the one we will restrict ourselves to is the clock driven algorithm where the algorithm runs
every T seconds. Additionally, we will assume that the processing time of the algorithm is significantly less than T such that
the new control action occurs simultaneously with the measurement of e. Finally, we will assume that the processor (plus the
ADC and DAC) are all of sufficient word length to make quantization errors negligible. These simplifying assumptions are
reasonable for many real control problems. In cases where they do not apply modification of the basic analysis described here
are covered in textbooks on digital control.

The algorithm program thus runs at time 𝑡 = 0, 𝑇, 2𝑇, 3𝑇, ⋯ , 𝑘𝑇, ⋯

For each run, e.g. at time 𝑡 = 𝑘𝑇, the algorithm requires:


1. the current error value 𝑒(𝑘𝑇), written simply as 𝑒(𝑘)
2. the previous m error values say, i.e. 𝑒(𝑘 − 1), 𝑒(𝑘 − 2), 𝑒(𝑘 − 3), ⋯ , 𝑒(𝑘 − 𝑚)
3. the previous n control values, i.e. 𝑢(𝑘 − 1), 𝑢(𝑘 − 2), ⋯ , 𝑢(𝑘 − 𝑛)

Note that, when the program starts initially, these previous error and control action values must be given initial values, e.g. 0.0.

The resulting linear algorithm is of the form:


𝑢(𝑘) = 𝑏0 𝑒(𝑘) + 𝑏1 𝑒(𝑘 − 1) + ⋯ + 𝑏𝑚 𝑒(𝑘 − 𝑚) − 𝑎1 𝑢(𝑘 − 1) − 𝑎2 𝑢(𝑘 − 2) − ⋯ − 𝑎𝑛 𝑢(𝑘 − 𝑛) (1)

where the a and b coefficients are constants.

An equation of this form is called a linear difference equation with constant coefficients and is the form of control algorithm
we will consider in this course.

The Z-transform
The Z-transform does for linear difference equations what the Laplace transform does for linear differential equations, i.e. it
transforms them into polynomial forms which can be operated on using algorithmic methods.

Definition
Given the ordered sequence of numbers
{𝑓(𝑘)} = 𝑓 (0), 𝑓 (1), 𝑓(2), 𝑓(3), ⋯

defined for 𝑘 ≥ 0 (i.e. we assume 𝑓(𝑘) = 0 for 𝑘 < 0) then the one-sided z-transform of this sequence is defined as:
𝑍{𝑓(𝑘)} = 𝐹 (𝑧) = 𝑓 (0) + 𝑓 (1)𝑧 −1 + 𝑓 (2)𝑧 −2 + 𝑓(3)𝑧 −3 + ⋯

Or 𝑍{𝑓(𝑘)} = 𝐹 (𝑧) = ∑∞
𝑘=0 𝑓 (𝑘 )𝑧
−𝑘
(2)

where the complex number z is chosen such that 𝐹(𝑧) converges in some region in the z-plane. For example, for the sequence
{𝑓(𝑘)} = {1,2,3,43 ⋯ }, the z transform is
𝐹(𝑧) = 1 + 2𝑧 −1 + 3𝑧 −2 + 3𝑧 −3 + ⋯

41
The inverse operation is 𝑍 −1 [𝐹(𝑧)] = {𝑓(𝑘)}, 𝑘 = 0, 1, 2, ⋯

Properties of the z-transform


Linearity
The z-transform is a linear operator, i.e. it is additive and homogenous and thus obeys the principle of superposition.

If 𝑍{𝑓(𝑘)} = 𝐹 (𝑧) and 𝑍{𝑔(𝑘)} = 𝐺 (𝑧), where a and b are constants, then:
𝑍{𝑎𝑓(𝑘) + 𝑏𝑔(𝑘)} = 𝑎𝑍{𝑓 (𝑘)} + 𝑏𝑍{𝑔(𝑘)} = 𝑎𝐹(𝑧) + 𝑏𝐺 (𝑧) (3)

Effect of scaling factor


𝑍{𝑐 𝑘 𝑓 (𝑘)} = 𝐹(𝑧⁄𝑐 ) , where c is a constant (4)

In particular
𝑍{𝑒 −𝑎𝑘 𝑓(𝑘)} = 𝐹 (𝑒 𝑎 𝑧)

Time delay (right shift)


If the one-sided sequence {𝑓(𝑘)} is shifted n places to the right (𝑛 > 0) and z-transformed with 𝑓(𝑘) = 0 for 𝑘 < 0, then:
𝑍{𝑓(𝑘 − 𝑛)} = 𝑧 −𝑛 𝐹(𝑧) (5)

Thus, for a sequence delayed by one place:


𝑍{𝑓(𝑘 − 1)} = 𝑧 −1 𝐹(𝑧)

Time advance (left shift)


If the one-sided sequence {𝑓(𝑘)} is shifted n places to the left (𝑛 > 0) and z-transformed, then:
𝑍{𝑓(𝑘 + 𝑛)} = 𝑧 𝑛 𝐹(𝑧) − 𝑧 𝑛 𝑓(0) − 𝑧 𝑛−1 𝑓 (1) − ⋯ − 𝑧 2 𝑓 (𝑛 − 2) − 𝑧𝑓(𝑛 − 1) (6)

Thus, for a sequence advanced by one place


𝑍{𝑓(𝑘 + 𝑛)} = 𝑧𝐹 (𝑧) − 𝑧𝑓 (0)

Time shifts are illustrated in figure 5.3 for 𝑛 = 1.

ADVANCE DELAY
f(k+1) f(k) f(k-1)

0 T 2T 3T 4T 5T 0 T 2T 3T 4T 5T 0 T 2T 3T 4T 5T 6T

Figure 5.3

Multiplication by index k
Given that 𝑛 > 0
𝑑 𝑛
𝑍{𝑘 𝑛 𝑓(𝑘)} = (−𝑧 𝑑𝑧) 𝐹(𝑧) for 𝑛 = 1, 2, 3, ⋯ (7)
In particular
𝑑𝐹(𝑧)
𝑍{𝑘𝑓 (𝑘 )} = −𝑧 𝑑𝑧

Initial value theorem


lim 𝑓 (𝑘 ) = 𝑓 (0) = lim (𝑧 − 1)𝐹(𝑧) (8)
𝑘→0 𝑧→∞

Final value theorem


lim 𝑓(𝑘) = 𝑓(∞) = lim(𝑧 − 1)𝐹(𝑧) = lim(1 − 𝑧 −1 )𝐹 (𝑧), if these limits exist. (9)
𝑘→∞ 𝑧→1 𝑧→1

42
Convolution
𝑍{∑∞𝑛=0 𝑓 (𝑘 − 𝑛 )𝑔(𝑛 )} = 𝑍[𝑓 (𝑘 ) ∗ 𝑔(𝑘 )] = 𝐹 (𝑧)𝐺 (𝑧) (10)

Inverse Z-transform
To find the sequence {𝑓(𝑘)} which corresponds to a given 𝐹(𝑧), either of the following methods may be used.

Partial fractions
𝐴𝑧
Resolve 𝐹(𝑧) into linear factors of the form 𝐹(𝑧) = 𝑧−𝑐 then the required sequence is
{𝑘𝑓(𝑘)} = 𝐴𝑐 𝑘

Long division
𝑁(𝑧)
If the given z-transform is 𝐹(𝑧) = 𝑃(𝑧) then divide out to give 𝐹 (𝑧) = 𝑎0 + 𝑎1 𝑧 −1 + 𝑎2 𝑧 −2 + ⋯ and the required sequence
is thus {𝑓(𝑘} = {𝑎0, 𝑎1, 𝑎2, ⋯ }

Z-transforms of common sequences


Constant sequence
𝑓(𝑘) = 𝑐 where c is a constant, i.e. {𝑓 (𝑘)} = 𝑐, 𝑐, 𝑐, ⋯
1
So 𝐹(𝑧) = 𝑐 + 𝑐𝑧 −1 + 𝑐𝑧 −2 + 𝑐𝑧 −3 + ⋯ = 𝑐 (1 + 𝑧 −1 + 𝑧 −2 + 𝑧 −3 + ⋯ ) = 𝑐 1−𝑧 −1

𝑐𝑧
i.e. 𝑍{𝑐} = (11)
𝑧−1

Geometric sequence
𝑓(𝑘) = 𝑐 𝑘 , where c is a constant, i.e {𝑓 (𝑘)} = 𝑐 0 , 𝑐 1 , 𝑐 2 , ⋯
1
So 𝐹(𝑧) = 𝑐 0 + 𝑐 1 𝑧 −1 + 𝑐 2 𝑧 −2 + 𝑐 3 𝑧 −3 + ⋯ = (𝑐⁄𝑧)0 + (𝑐⁄𝑧)1 + (𝑐⁄𝑧)2 + ⋯ = 1−(𝑐⁄
𝑧)

𝑧
i.e. 𝑍{𝑐 𝑘 } = 𝑧−𝑐 (12)

𝑧
Thus if 𝑐 = 𝑒 𝑎𝑇 , then 𝑍{𝑒 𝑎𝑇𝑘 } = 𝑧−𝑒 𝑎𝑇 (13)

Ramp sequence
𝑓(𝑘) = 𝑇𝑘 where T is a constant, i.e. {𝑓 (𝑘)} = 0, 𝑇, 2𝑇, 3𝑇, ⋯

𝑇𝑧 −1
So 𝐹(𝑧) = 0 + 𝑇𝑧 −1 + 2𝑇𝑧 −2 + 3𝑇𝑧 −3 + ⋯ = 𝑇𝑧 −1 (1 + 2𝑧 −1 + 3𝑧 −2 + 4𝑧 −3 + ⋯ ) = (1−𝑧 −1)2

𝑇𝑧
i.e. 𝑍{𝑇𝑘} = (𝑧−1)2 (14)

The above z-transforms, together with those of other commonly met sequences, are summarized in the table of z-transforms
provided.

Z-Transfer Functions
The z-transform can be used to model the linear algorithm of equation 1 via a z-transfer function.

Example 5.1
Consider an algorithm of the form: 𝑢(𝑘) = 2𝑒(𝑘) + 𝑒(𝑘 − 1) − 0.5𝑢(𝑘 − 1) − 0.25𝑢(𝑘 − 2)

From the time delay shift property of the z-transform we have:


𝑍{𝑢(𝑘)} = 𝑈 (𝑧) , 𝑍{𝑢(𝑘 − 1)} = 𝑧 −1 𝑈(𝑧), 𝑍{𝑢(𝑘 − 2)} = 𝑧 −2 𝑈(𝑧)
𝑍{𝑒(𝑘)} = 𝐸 (𝑧) , 𝑍{𝑒(𝑘 − 1)} = 𝑧 −1 𝐸 (𝑧)

So taking the z-transform of both sides of the above algorithm, we have


𝑈(𝑧) = 2𝐸 (𝑧) + 𝑧 −1 𝐸 (𝑧) − 0.5𝑧 −1 𝑈(𝑧) − 0.25𝑧 −2 𝑈(𝑧)
43
i.e, (1 + 0.5𝑧 −1 − 0.25𝑧 −2 )𝑈(𝑧) = (2 + 𝑧 −1 )𝐸 (𝑧)

2+𝑧 −1
Or 𝑈(𝑧) = 1+0.5𝑧 −1 −0.25𝑧 −2 𝐸 (𝑧)

Or multiplying by 𝑧 2 :
𝑧(2𝑧+1)
𝑈(𝑧) = (𝑧 2−0.5𝑧+0.254) 𝐸 (𝑧) = 𝐷(𝑧)𝐸 (𝑧) say,

𝑧(2𝑧+1)
Where 𝐷(𝑧) = (𝑧 2−0.5𝑧+0.254) is a z-transfer function which models the linear digital algorithm.

In general, taking the z-transform of the algorithm in equation (1) gives:


𝑈(𝑧) = 𝑏0 𝐸 (𝑧) + 𝑏1 𝑧 −1 𝐸 (𝑧) + ⋯ + 𝑏𝑚 𝑧 −𝑚 𝐸(𝑧) − 𝑎1 𝑧 −1 𝑈(𝑧) − 𝑎2 𝑧 −2 𝑈(𝑧) − ⋯ − 𝑎𝑛 𝑧 −𝑛 𝑈(𝑧)
𝑏 +𝑏 𝑧 −1 +⋯+𝑏𝑚𝑧 −𝑚
𝑈(𝑧) = 1+𝑎0𝑧 −11+𝑎 −2 +⋯+𝑎 𝑧 −𝑛 = 𝐷(𝑧)𝐸 (𝑧) say
1 2𝑧 𝑛

For a strictly proper system, we require 𝑚 < 𝑛 so that


𝑏 +𝑏 𝑧 −1 +⋯+𝑏𝑚𝑧 −𝑚 𝑏 𝑧 𝑛+𝑏1 𝑧 𝑛−1 +⋯+𝑏𝑚𝑧 𝑛−𝑚
𝐷(𝑧) = 1+𝑎0𝑧 −11+𝑎 −2 +⋯+𝑎 𝑧 −𝑛 = 𝑧 𝑛0+𝑎 𝑛−1 +𝑎 𝑧 𝑛−2 +⋯+𝑎 (15)
1 2𝑧 𝑛 1𝑧 2 𝑛

A z-transfer function is usually the quotient of two polynomials in z, i.e of the form:
𝑁(𝑧)
𝐺 (𝑧) = 𝑄(𝑧)

The zeros of 𝐺(𝑧) are the roots of the equation 𝑁(𝑧) = 0 and the poles of 𝐺(𝑧) are the roots of the equation 𝑄(𝑧) = 0.
𝑄(𝑧) is the characteristic polynomial of 𝐺(𝑧), and 𝑄(𝑧) = 0 is the characteristic equation of 𝐺(𝑧).

Application of z-transforms to difference equations


Just as the Laplace transform can be used to simplify the solution of ordinary differential equations so can the z-transform be
used to simplify the solution of the difference equation. This is best shown by a couple of examples.

Example 5.2
Solve 𝑥(𝑘 + 2) = 3𝑥(𝑘 + 1) − 2𝑥(𝑘) with 𝑥(0) = 0 and 𝑥(1) = 1.

SOLUTION
Take the z-transform of each side using the advance shift property.
𝑧 2 𝑋(𝑧) − 𝑧 2 𝑥(0) − 𝑧𝑥 (1) = 3[𝑧𝑋(𝑧) − 𝑧𝑥(0)] − 2𝑋 (𝑧)
(𝑧 2 − 3𝑧 − 2)𝑋(𝑧) = 𝑧 2 𝑥(0) + 𝑧𝑥(1) − 3𝑧𝑥(0)
𝑧 𝑧 𝑧
So 𝑋(𝑧) = (𝑧−2)(𝑧−1) = (𝑧−2) − (𝑧−1)

Taking the inverse transform from the tables:


𝑥 (𝑘 ) = 2𝑘 − 1

Checking this using the original difference equation:


𝑥 (0 ) = 0 = 20 − 1
𝑥 (1 ) = 1 = 21 − 1
𝑥 (2 ) = 3(1) − 2(0) = 3 = 22 − 1
𝑥 (3 ) = 3(3) − 2(1) = 7 = 23 − 1
𝑥(4) = 3(7) − 2(3) = 15 = 24 − 1

Example 4.3
Solve 𝑦(𝑘) = 2𝑒(𝑘) − 𝑦(𝑘 − 1) where 𝑒(𝑘) = 1, i.e a unit step.

SOLUTION
Take the z-transform of each side using the delay shift property:
𝑌(𝑧) = 2𝐸 (𝑧) − 𝑧 −1 𝑌 (𝑧) or (1 + 𝑧 −1 )𝑌 (𝑧) = 2𝐸 (𝑧)

44
2 2𝑧 2𝑧 2 𝑧
So 𝑌(𝑧) = 1+𝑧 −1 𝐸 (𝑧) = 𝑧+1 𝐸 (𝑧) = (𝑧−1)(𝑧+1) as 𝐸 (𝑧) = (𝑧−1)

𝑧 𝑧
Thus 𝑌(𝑧) = 𝑧−1 + 𝑧+1

Taking the inverse transform from the tables 𝑦(𝑘) = 1 + (−1)𝑘

Chapter 5 Tutorial Questions


1. Find the z-transform of the following sequences from first principles and then check your answers from the table of z-
transforms.

(i) f(k)  e a , (ii) f(k)  ke a , (iii) f(k)  sin ωk  , (iv) f(k)  ke ak

2. Find the sequence whose z-transforms are:

3z 3 3z 2
(i) (ii) (iii)
z  1z  2 z  1z  2 z  1z  2

[ Answer: (i) f(k)  1   2 k (ii) f(k)  1   2k -1 (iii) f(k)  1   2k 1 ]

3. Find the z-transfer function for these difference equations:

 2z 2 
(i) u(k)  2e(k)  0.6u(k  1)  0.4u(k  2)  D(z)  2 
 z  0.6z  0.4 
 z(z  0.5) 
(ii) u(k)  e(k)  0.5e(k  1)  1.5u(k  1)  0.5u(k  2)  D(z)  2 
 z  1.5z  0.5 

4. Find the algorithms which implement these z-transfer functions:

5z  2
(i) u(k)  5e(k)  2e(k  1)  2u(k 1)  3u(k  2)
z  1z  3
3z 2  z
(ii) u(k)  3e(k)  e(k  1)  1.5u(k  1)  0.5u(k  2)
z  1z - 0.5
5. Determine the output sequence from the following digital algorithm:

u(k)  3e(k) - 0.5u(k  1)


when { e(k) } represents a unit step input sequence. Draw a graph of u(k) against time for the case T = 1 second.

u(k)   0.5  2
k

5z
6. Find the values of c(kT) when C(z)= , for k = 0 to 4.
z  3z  2
2

 c(kT)  e k ln2

1

45

You might also like