inc447 digital control systems - kmuttwebstaff.kmutt.ac.th/~sarawan.won/inc447/handout2007.pdf ·...

85
INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems & Instrumentation Engineering, KMUTT Contents 1 Introduction 3 1.1 Basic elements of a discrete-data control system ......... 3 1.2 Sampled-data systems ....................... 4 1.2.1 Processing of sampling ................... 4 1.2.2 Zero-order hold ....................... 7 2 Discrete systems analysis 12 2.1 The z -transform ........................... 12 2.1.1 z -transform from Laplace transform ............ 13 2.1.2 Properties of z -transform .................. 14 2.1.3 z -transform inversion .................... 14 2.2 z -transfer function ......................... 17 2.2.1 The z -transfer function from the pulse transfer function . 17 2.2.2 The z -transfer function from difference equations .... 22 2.2.3 From z -transfer function to difference equation ...... 24 2.3 Dynamic response .......................... 26 2.3.1 The pulse response of first-order system ......... 26 2.3.2 The pulse response of second-order system ........ 28 2.4 Relationship between s and z ................... 31 2.4.1 Mapping the poles in s-plane to z -plane ......... 31 2.5 Effect of additional zero/pole ................... 34 2.6 Discrete frequency response .................... 37 1

Upload: others

Post on 23-Mar-2020

59 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

INC447 Digital Control Systems

S. Wongsa

June 2007

Department of Control Systems & Instrumentation Engineering, KMUTT

Contents

1 Introduction 31.1 Basic elements of a discrete-data control system . . . . . . . . . 31.2 Sampled-data systems . . . . . . . . . . . . . . . . . . . . . . . 4

1.2.1 Processing of sampling . . . . . . . . . . . . . . . . . . . 41.2.2 Zero-order hold . . . . . . . . . . . . . . . . . . . . . . . 7

2 Discrete systems analysis 122.1 The z-transform . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.1.1 z-transform from Laplace transform . . . . . . . . . . . . 132.1.2 Properties of z-transform . . . . . . . . . . . . . . . . . . 142.1.3 z-transform inversion . . . . . . . . . . . . . . . . . . . . 14

2.2 z-transfer function . . . . . . . . . . . . . . . . . . . . . . . . . 172.2.1 The z-transfer function from the pulse transfer function . 172.2.2 The z-transfer function from difference equations . . . . 222.2.3 From z-transfer function to difference equation . . . . . . 24

2.3 Dynamic response . . . . . . . . . . . . . . . . . . . . . . . . . . 262.3.1 The pulse response of first-order system . . . . . . . . . 262.3.2 The pulse response of second-order system . . . . . . . . 28

2.4 Relationship between s and z . . . . . . . . . . . . . . . . . . . 312.4.1 Mapping the poles in s-plane to z-plane . . . . . . . . . 31

2.5 Effect of additional zero/pole . . . . . . . . . . . . . . . . . . . 342.6 Discrete frequency response . . . . . . . . . . . . . . . . . . . . 37

1

Page 2: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

CONTENTS CONTENTS

2.7 Closed-loop stability analysis . . . . . . . . . . . . . . . . . . . . 392.7.1 Stability analysis . . . . . . . . . . . . . . . . . . . . . . 41

3 Emulation design 433.1 Continuous-time design . . . . . . . . . . . . . . . . . . . . . . . 43

3.1.1 Time-domain specifications . . . . . . . . . . . . . . . . 433.1.2 Relative stability . . . . . . . . . . . . . . . . . . . . . . 46

3.2 Discrete equivalents . . . . . . . . . . . . . . . . . . . . . . . . . 493.2.1 Discrete equivalents via numerical integration . . . . . . 503.2.2 Pole-zero matching equivalents . . . . . . . . . . . . . . . 563.2.3 Hold equivalents . . . . . . . . . . . . . . . . . . . . . . 583.2.4 Computation of discrete equivalent using Matlab . . . 60

3.3 Discrete Controllers . . . . . . . . . . . . . . . . . . . . . . . . . 61

4 Direct design 664.1 Control system specifications . . . . . . . . . . . . . . . . . . . . 66

4.1.1 Transient response specifications . . . . . . . . . . . . . . 664.1.2 Steady-state error . . . . . . . . . . . . . . . . . . . . . . 69

4.2 Direct design by root locus in the z-plane . . . . . . . . . . . . . 704.2.1 Root-locus of discrete-time systems . . . . . . . . . . . . 704.2.2 Discrete root locus design . . . . . . . . . . . . . . . . . 714.2.3 Compensator configuration . . . . . . . . . . . . . . . . . 744.2.4 Root-locus design examples . . . . . . . . . . . . . . . . 75

2 S. Wongsa, June 2007

Page 3: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

1 INTRODUCTION

1 Introduction to digital control systems

1.1 Basic elements of a discrete-data control system

Figure 1: Basic elements of a typical closed-loop digital control system.

Figure 1 shows the basic elements of a typical closed-loop system with sam-pled data.

• A/D converterAn analog-to-digital converter is a device which converts an analog signal(i.e. physical variable) to a digital-coded signal. The sampled data, likee∗(t), are therefore variable only at discrete times. We call these variablediscrete signals and notify them by *. The A/D converter also provides aquantised signal, i.e. the output of the A/D converter must be stored indigital logic composed of a finite number of digits.

• Digital processorA digital processor acts as a controller/compensator to hold the plantoutput y(t) close to the reference r(t). A system should have both gooddisturbance rejection and low sensitivity to changes in the plant parame-ters, i.e. good robustness.

• D/A converterA digital-to-analog converts a digitally coded input to an analog signal,e.g. a current or a voltage. The controller signal u(t) is usually built upusing zero-order hold (ZOH) which maintains the same analog signalthroughout the sample period.

3 S. Wongsa, June 2007

Page 4: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

1.2 Sampled-data systems 1 INTRODUCTION

1.2 Sampled-data systems

In sampled-data systems, there are two types of processes that generally oc-curs; sampling and data reconstruction. The sampling operation produces theimpulses whose magnitudes correspond to the signal levels at each time instant.As in general it is undesirable to apply a signal in sampled form to plant, there-fore a data reconstruction device, called a data hold, is inserted into the system.The reconstruction operation takes the discrete data from the sampler and pro-duces the piecewise constant output.

Figure 2: Representation of the sampler and data hold.

1.2.1 Processing of sampling

A sampler is usually represented by a switch and sampling period T .The sampling at t = kT ,where k is an integer, f ∗(t) can be represented as

the product of the (continuous) signal to be sampled f(t) and impulse train

f ∗(t) =∞∑

k=−∞f(t)δ(t− kT ) (1)

where δ(t) is dirac impulse

δ(t) =

{1 , t = 0

0 , t 6= 0

4 S. Wongsa, June 2007

Page 5: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

1 INTRODUCTION 1.2 Sampled-data systems

Figure 3: Sampling process

The frequency response of f ∗(t) can be obtained by taking the Laplace transformof f ∗(t) then using s = jω

F ∗(s)|s=jω = F ∗(jω) =1

T

∞∑

k=−∞F (jω − jkωs) (2)

with a sampling frequency ωs = 2π/T rad/sec.Based on (2), we can conclude the following properties of F ∗(s):

1. F ∗(s) is periodic in s with period jωs, as shown in Figure 4. Parts ofF (jω− jkωs) with k 6= 0 are aliases. In time, the phenomenon of aliasingmakes two continuous sinusoids of different frequencies indistinguishablewhen sampled, as shown in Figure 5.

Notice that to recover the original signal f(t) from its samples by lowpass filtering, the sampling frequency must be at least twice the highestfrequency in the signal. This is called Shannon’s or Nyquist samplingtheorem.

The frequency aliasing can be prevented either by

(a) using sufficiently high sampling frequency, practically 3 to 5 times ofthe maximum bandwidth component of the signal, or

5 S. Wongsa, June 2007

Page 6: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

1.2 Sampled-data systems 1 INTRODUCTION

Figure 4: Frequency spectra for F (jω) and F ∗(jω).

6 S. Wongsa, June 2007

Page 7: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

1 INTRODUCTION 1.2 Sampled-data systems

Figure 5: An example of aliasing which shows plot of two sinusoids, (ω = 1rad/sec) and (ω = 1− 2π rad/sec), that have identical values with T = 1.

(b) by placing an analog anti-aliasing filter, which is a low pass filterrejecting |ω| > ωs/2, in front of the sampler.

2. If F (s) has a pole at s = s1, then F ∗(s) must have poles at s = s1 + jnωs,n = 0,±1,±2, . . . .

We can see from Figure 4 that to recover F (jω) we need only process F ∗(jω)through a low-pass filter and multiply by T . Specifically, if F (jω) has zero energyfor frequencies in the bands above ωs/2, then an ideal low-pass filter with gainT for −ωs/2 ≤ ω ≤ ωs/2 and zero elsewhere would recover F (jω) from F ∗(jω)exactly (see Figure 7).

1.2.2 Zero-order hold

The simplest reconstruction device is the zero-order hold (ZOH), which extrap-olates sampled data to the piecewise constant signal fh(t), defined as

fh(t) = f(kT ), kT ≤ t < (k + 1)T (3)

7 S. Wongsa, June 2007

Page 8: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

1.2 Sampled-data systems 1 INTRODUCTION

Figure 6: Pole locations for F ∗(s) with corresponding frequency spectra.

8 S. Wongsa, June 2007

Page 9: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

1 INTRODUCTION 1.2 Sampled-data systems

Figure 7: Ideal reconstruction filter. L(jω) is the frequency response of thefilter.

(a)

(b)

Figure 8: Characteristics of ZOH. (a) Zero-order hold process (b) Delay of T/2introduced by ZOH; continuous-time signal (solid line); average ZOH-output(dash-dotted line)

9 S. Wongsa, June 2007

Page 10: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

1.2 Sampled-data systems 1 INTRODUCTION

Transfer function of ZOH If the input to a ZOH is a unit impulse function,the output of the ZOH is a pulse of height 1 and duration T seconds, i.e.

p(t) = 1(t)− 1(t− T ) (4)

The transfer function of ZOH can therefore be given from the Laplace transformof p(t), i.e.

GZOH(s) =1− e−sT

s(5)

The frequency properties of ZOH can be analysed from GZOH(jω)

GZOH(jω) = Te−jωT/2 sin(ωT/2)

ωT/2

= Te−jωT/2sinc(ωT/2) (6)

The frequency response of ZOH is shown in Figure 9 (a).

• |GZOH(jω)| = T |sincωT2| and ∠GZOH(jω) = −ωT

2imply that ZOH slowly

attenuates the magnitude of the input signal as ω gets larger and intro-duces a phase shift of ωT/2, which corresponds to a time delay of T/2. Itshould be noted that ZOH is a kind of reconstruction filter. The frequencyresponse of ZOH is deviating from the ideal filter at higher frequencies.

10 S. Wongsa, June 2007

Page 11: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

1 INTRODUCTION 1.2 Sampled-data systems

0 5 10 150

0.5

1

ωT

|GZ

OH/T

|

0 5 10 15−4

−3

−2

−1

0

ωT

Pha

se (

rad)

(a)

0 5 10 150

0.5

1

Fh

0 5 10 150

0.5

1

F

0 5 10 150

0.5

1

F*

(b)

Figure 9: Characteristics of ZOH. (a) Magnitude and phase of ZOH. (b) Si-nusoidal response of the sampler and zero-order hold; F - input signal to thesampler; F ∗ - output signal of the sampler; Fh - output signal from the ZOH.

11 S. Wongsa, June 2007

Page 12: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS

2 Discrete systems analysis

2.1 The z-transform

The z-transform is extensively used to determine the behaviour of discrete linearsystems.

The z-transform converts a discrete time-domain signal into a complex frequency-domain representation. The single-sided z-transform is defined as

F (z) = Z{f(t)} =∞∑

k=0

f(kT )z−k (7)

where z represents the bounded complex variable.

Note that for convenience, the T is occasionally dropped and f(k) is under-stood to be discrete data f(kT ) if the sequence f(k) is generated from a timefunction f(t) by sampling every T seconds.

Example 1: The z-transform

(a) Unit Step: f(k) = 1 for k ≥ 0, f(k) = 0 for k < 0Solution

F (z) =∞∑

k=0

z−k

=1

1− z−1, for |z| > 1

=z

z − 1

(b) Shifted sequence: y(k − l), y(k) = 0 for k < 0Solution

Y (z) =∞∑

k=0

y(k − l)z−k

=∞∑

n=0

y(n)z−nz−l, by substituting n = k − l

= z−lY (z)

12 S. Wongsa, June 2007

Page 13: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.1 The z-transform

(c) Exponential: f(k) = e−akT for k ≥ 0, f(k) = 0 for k < 0Solution

F (z) =∞∑

k=0

(e−aT z−1)k

=1

1− e−aT z−1=

z

z − e−aT, for |z| > e−aT

A table of z-transforms of some common functions is given in Appendix A.

2.1.1 z-transform from Laplace transform

There are two ways to derive F (z) from the F (s):

(i) Using F (s) =⇒ f(t) =⇒ f(kT ) =⇒ F (z)

(ii) Directly from F (s) using the method of residues

Let F (s) = N(s)D(s)

, then

F (z) =m∑

i=1

N(pi)

D′(pi)· 1

1− epiT z−1(8)

where D′ = ∂D∂s

and pi|i=1,...,m are the roots of of D(s) = 0.

Example 2: z-transform from Laplace transform

Find F (z) directly and indirectly from F (s) = 1s2+5s+6

Solution

1. Indirect method:F (s) = 1

s+2− 1

s+3

Take the inverse Laplace transform,

f(t) = e−2t − e−3t =⇒ f(kT ) = e−2kT − e−3kT

13 S. Wongsa, June 2007

Page 14: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.1 The z-transform 2 DISCRETE SYSTEMS ANALYSIS

The z-transform of f(kT ) is obtained from the table, i.e.

F (z) =z

z − e−2T− z

z − e−3T

2. Direct method:D(s) = (s + 2)(s + 3), i.e. p1 = −2, p2 = −3Using D′(s) = 2s + 5, then F (z) =

∑2i=1

12pi+5

11−epiT z−1

Substituting p1 and p2 gives

F (z) =z

z − e−2T− z

z − e−3T

2.1.2 Properties of z-transform

Some essential properties of the z-transform are summarised in Table 1. Notethat these properties are based on the assumption that all sequences equal zerofor k < 0.

Table 1: Properties of z-transforms.

Properties Sequence z transform

Linearity af1(k) + bf2(k) aF1(z) + bF2(z)Time Shift, f(k − n) z−nF (z)

where n ∈ Z+ f(k + n) znF (z)−∑n−1i=0 f(i)zn−i

Convolution∑∞

l=−∞ f1(l)f2(k − l) F1(z)F2(z)Scaling r−kf(k) F (rz)

Initial value f(0) = limz→∞ F (z) if the limit exists.Final value theorem limk→∞ f(k) = limz→1(z − 1)F (z)

if the poles of (z − 1)F (z) are inside the unit circle.

2.1.3 z-transform inversion

The inversion of the z-transform is defined as

f(k) =1

j2π

C

F (z)zk−1dz (9)

14 S. Wongsa, June 2007

Page 15: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.1 The z-transform

Equation (9) is the line integral in the z-plane along the closed path C, whereC is any path that encloses all the finite poles of F (z)zk−1.Three methods for determining the inverse z-transform are given here.

• Method of long divisionDivide the numerator by the denominator of F (z) to construct a power se-ries in z−1. The coefficient of z−k is automatically the sequence value f(k).

Example 3:

Determine f(k), given F (z) = z(z−1)(z−2)(z−3)

by using the method of longdivision.Solution

F (z) =z

z3 − 6z2 + 11z − 6= z−2 + 6z−3 + 25z−4 + . . .

Thus, f(k) = {0, 0, 1, 6, 25, . . . }

• Method of partial fractions and tableDecompose F (z) by partial-fraction expansion and look up the recognis-able components of the sequence f(k) in the table of z-transform.

Example 4:

Determine f(k), given F (z) = z(z−1)(z−2)(z−3)

by using the partial fractionexpansion.Solution

F (z) =1

2

z

z − 1− z

z − 2+

1

2

z

z − 3

Use table and shift property of z:

f(k) =1

2− 2k +

3k

2

• Method of residuesUsing the theorem of residues, we can find the solution of (9) via theexpression

f(k) =

p∑i=1

ri (10)

15 S. Wongsa, June 2007

Page 16: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.1 The z-transform 2 DISCRETE SYSTEMS ANALYSIS

where ri is residue of F (z)zk−1 at its ith pole and p is the number of allpoles of F (z)zk−1.

ri is evaluated as

– If F (z)zk−1 has a simple pole at z = a,

ri|z=pi= (z − pi)F (z)zk−1|z=pi

(11)

– If F (z)zk−1 has a pole of order m at z = a,

ri|z=pi=

1

m− 1!

dm−1

dzm−1[(z − pi)

mF (z)zk−1]|z=pi(12)

Example 5:

Determine f(k), given F (z) = z(z−1)(z−2)(z−3)

by using the method ofresidues.SolutionF (z)zk−1 has poles at p1 = 1, p2 = 2, p3 = 3The corresponding residues are r1 = 1/2, r2 = −2k, r3 = 3k/2, i.e. f(k) =12− 2k + 3k

2

16 S. Wongsa, June 2007

Page 17: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.2 z-transfer function

2.2 z-transfer function

The transfer function of linear, constant, discrete systems can be obtained usingthe z-transform analysis. The discrete transfer function G(z) is defined as theratio of the z-transform of the output Y (z) to the z-transform of the input U(z)with zero initial conditions.

2.2.1 The z-transfer function from the pulse transfer function

• The starred transfer function

T

) ( * s F ) ( s F

) ( t f ) ( * t f

Figure 10: Ideal Sampler.

The output signal of an ideal sampler shown in Figure 10 is defined as thesignal whose Laplace transform is

F ∗(s) = L{f ∗(t)} =∞∑

k=0

f(kT )e−kTs (13)

where f(t) is the input signal to the sampler. The function F ∗(s) is calledthe starred transform.

Inspecting (13) carefully indicating that the z-transform of f(t) can begiven from

F (z) = F ∗(s)|z=esT (14)

Example 6: Determine F ∗(s) for f(t) = 1(t), the unit step.

17 S. Wongsa, June 2007

Page 18: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.2 z-transfer function 2 DISCRETE SYSTEMS ANALYSIS

SolutionFrom (13),

F ∗(s) =∞∑

k=0

f(kT )e−kTs

= 1 + e−Ts + e−2Ts + ...

Using the sum of an infinite geometric series, the above expression can beexpressed in closed form

F ∗(s) =1

1− e−Ts, |e−Ts| < 1

The z-transform of f(t) can be also obtained by substituting z = esT inF ∗(s),

F (z) =1

1− z−1

Let a linear system with continuous-data input u(t) and output y(t) be describedby the transfer function G(s) = Y (s)/U(s), where U(s) and Y (s) are the Laplacetransforms of the input u(t) and the output y(t), respectively.

The discretisation of the system in Figure 11 with sampling time T = 2π/ωs

results in the starred transforms U∗(s) and Y ∗(s).We hence can define the pulse transfer function of the system in Figure 11

as

G∗(s) =Y ∗(s)U∗(s)

(15)

Substituting z = eTs in (15), we have the z-transfer function of the system inFigure 11:

G(z) =Y (z)

U(z)(16)

where G(z) is also defined as

G(z) =∞∑

k=0

g(k)z−k (17)

18 S. Wongsa, June 2007

Page 19: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.2 z-transfer function

Figure 11: Discretisation of an analog system.

The sequences g(k), k = 0, 1, 2, ... is defined as the impulse sequence of the systemG.

G(s)

T U(s) ) ( * s U ) ( s Y

G(s) U(s) ) ( s Y

(a)

(b)

Figure 12: (a) Continuous-time system with an impulse sampler at the input(b) Continuous-time system without an impulse sampler at the input.

The presence and absence of the input sampler is crucial in determining thepulse transfer function of a system. For example, for the system shown in Figure12(a), the starred Laplace transform of the output y(t) is

19 S. Wongsa, June 2007

Page 20: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.2 z-transfer function 2 DISCRETE SYSTEMS ANALYSIS

Y ∗(s) = [G(s)U∗(s)]∗

It can be shown that the starred Laplace transform of a product oftransforms, where some are ordinary Laplace transforms and others arestarred Laplace transforms as the expression above, the functions alreadyin starred transforms can be factored out of the starred Laplace transformoperation.

Using this fact, the above equation may be expressed as

Y ∗(s) = G∗(s)U∗(s)

which yieldsY (z) = G(z)U(z)

On the contrary, for the system shown in Figure 12 (b), the starred Laplacetransform of the output is

Y ∗(s) = [G(s)U(s)]∗ = [GU(s)]∗

which yieldsY (z) = GU(z) 6= G(z)U(z)

Example 7: Pulse transfer function of cascaded elements

Given the system with and without a sampler between cascaded elementsG(s) and H(s) as shown in Figure 13, the pulse transfer function of the systemin Figure 13 (a) is G(z)H(z), while the the pulse transfer function of the systemin Figure 13 (b) is GH(z).

Example 8: Pulse transfer function of a closed-loop system

Given a closed-loop system shown in Figure 14, find the closed-loop transferfunction Y (z)/R(z).

Y (s) = U(s)G(s)

20 S. Wongsa, June 2007

Page 21: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.2 z-transfer function

G(s)

T U(s)

(a)

H(s) ) ( s Y T T

G(s)

T U(s)

(b)

H(s) ) ( s Y T

U*(s) X(s) X*(s) Y*(s)

Y*(s) U*(s)

Figure 13: (a) Sampled system with a sampler between G(s) and H(s) (b)Sampled system without a sampler between G(s) and H(s).

Figure 14: Closed-loop system.

21 S. Wongsa, June 2007

Page 22: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.2 z-transfer function 2 DISCRETE SYSTEMS ANALYSIS

Y ∗(s) = [U(s)G(s)]∗

= [[R∗(s)−X∗(s)]G(s)]∗

= [[R∗(s)− Y ∗(s)H∗(s)]G(s)]∗

= R∗(s)G∗(s)− Y ∗(s)H∗(s)G∗(s)

In terms of the z-transform,

Y (z) = R(z)G(z)− Y (z)H(z)G(z)

,i.e.

Y (z)

R(z)=

G(z)

1 + H(z)G(z)(18)

2.2.2 The z-transfer function from difference equations

Consider a discrete system described by the following difference equation:

y(k) = −a1y(k − 1)− a2y(k − 2)− · · · − any(k − n) + . . .

b0u(k) + b1u(k − 1) + · · ·+ bmu(k −m) (19)

If the initial conditions are zero (i.e. y(0)=y(1)=...=y(n-1)=0), taking the z-transform to both sides of (19) and rearranging gives

(1 + a1z−1 + · · ·+ anz−n)Y (z) = (b0 + b1z

−1 + · · ·+ bmz−m)U(z) (20)

,i.e.

G(z) =Y (z)

U(z)

=b0 + b1z

−1 + · · ·+ bmz−m

1 + a1z−1 + · · ·+ anz−n(21)

NB: If the initial conditions are not zero, we have to include themin the solution of (19). This can be done by replacing k with k + n.

y(k + n) = −a1y(k + n− 1)− a2y(k + n− 2)− · · · − any(k) + . . .

b0 + b1u(k + n− 1) + · · ·+ bmu(k + n−m)

Then, use the shift property from Table 1 to include the initial conditionsin the solution of the difference equation.

22 S. Wongsa, June 2007

Page 23: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.2 z-transfer function

Example 9: Given the following difference equation,

y(k)− 0.8y(k − 1) = 2u(k)

, where y(k) = 0 for k < 0, solve the above difference equation if u(k) is a stepfunction.SolutionTaking the z transform of both sides of the difference equation yields

Y (z)− 0.8z−1Y (z) =2

1− z−1

, i.e.

Y (z) =2

(1− z−1)(1− 0.8z−1)

Expanding Y (z) into partial fractions gives

Y (z) =10

1− z−1− 8

1− 0.8z−1

the inverse z transform of Y (z) can be written as

y(k) = 10− 8(0.8)k

Example 10: Given the following difference equation,

y(k + 2) + 3y(k + 1) + 2y(k) = 0, y(0) = 0, y(1) = 1

, solve the above difference equation by use of the z transform method.SolutionTaking the z transform of both sides of the difference equation yields

z2[Y (z)− y(0)− z−1y(1)] + 3z[Y (z)− y(0)] + 2Y (z) = 0

Substituting the initial conditions and simplifying gives

Y (z) =z

z + 1− z

z + 2

Taking the inverse z-transform of the above expression results in

y(k) = (−1)k − (−2)k

23 S. Wongsa, June 2007

Page 24: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.2 z-transfer function 2 DISCRETE SYSTEMS ANALYSIS

2.2.3 From z-transfer function to difference equation

As opposed to the previous section, we sometimes may want to derive a differenceequation from a z-transfer function, for example, when we want to implement acontroller function, given its transfer function.

Assume given the following transfer function:

G(z) =b1z + b0

z2 + a1z + a0

=Y (z)

U(z)

Crossing multiplying the above equation gives

z2Y (z) + a1zY (z) + a0Y (z) = b1zU(z) + b0U(z)

Taking the inverse transform of the above expression gives

y(k + 2) + a1y(k + 1) + a0y(k) = b1u(k + 1) + b0u(k)

,i.e.y(k + 2) = −a1y(k + 1)− a0y(k) + b1u(k + 1) + b0u(k)

By using the above expression, the response of y(k) from k = 2 onwards can besimulated given the initial conditions y(0), y(1) and u(k).

Alternatively, one can use a Matlab function filter to perform this task.

Example 11:Recall the system in Example 9,

y(k)− 0.8y(k − 1) = 2u(k)

The transfer function of the above system is

G(z) =2

1− 0.8z−1(22)

The response of this system to a unit step input and a unit pulse input can beobtained by Matlab and is shown in Figure 15.

24 S. Wongsa, June 2007

Page 25: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.2 z-transfer function

%— Response to unit step input u1 and unit pulse input u2—num=[2];den=[1 -0.8];u1=ones(1,41);u2=[1 zeros(1,40)];y1=filter(num,den,u1);y2=filter(num,den,u2);figure;subplot(211);plot(0:40,y1,’o’);xlabel(’k’),ylabel(’y1(k)’);title(’Response to Unit Step Input’)subplot(212);plot(0:40,y2,’o’);xlabel(’k’), ylabel(’y2(k)’);title(’Response to Unit pulse Input’)

0 10 20 30 400

5

10

k

y1(k

)

Response to Unit Step Input

0 10 20 30 400

1

2

k

y2(k

)

Response to Unit Impulse Input

Figure 15: Response of the system defined by (22) to the unit step and unitpulse inputs.

• To use filter function, the discrete transfer function must be written as ra-tional expressions in z−1 with the numerator and denominator coefficientsbeing ordered in ascending powers of z−1.

25 S. Wongsa, June 2007

Page 26: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.3 Dynamic response 2 DISCRETE SYSTEMS ANALYSIS

• It should be noted that finding the response of the system Y (z)/U(z) =G(z) to a unit pulse input (or the Kronecker delta input) is the same asfinding the inverse z-transform of G(z).

2.3 Dynamic response in discrete-time systems

Given the z-transform of a discrete signal, we can gain intuition for the kindof response to be expected by considering the pole and zero positions of thetransform.

Let G(z) = B(z)A(z)

be the transfer function,

• The poles are the roots of A(z) = 0.

• The zeros are the roots of B(z) = 0.

If the input is deliberately selected to be the unit discrete pulse, u(k) = δ(k),

δ(k) =

{1 , k = 0

0 , k 6= 0

Since U(z) = 1, thenY (z) = G(z)

So the system pulse response is given by

y(k) = Z−1{Y (z)} = Z−1{G(z)}

, i.e. the system transfer function G(z) is given by the transform of the responseof the system, Y(z), to a unit pulse input.

We will study the unit pulse responses of the first-order and second-ordersystems and relate it to the system pole and zero locations in the z-plane.

2.3.1 The pulse response of first-order system

Given a first-order system with a pole at z = a,

G(z) =1

1− az−1=

z

z − a

so the pulse response is y(k) = ak.

26 S. Wongsa, June 2007

Page 27: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.3 Dynamic response

• If |a| < 1, the responses decay, i.e. the system is stable.

• If |a| > 1, the responses become unbounded as k approaches infinity, i.e.the system is unstable.

• If a is negative the responses alternate between positive and negative valueswith 2T between peaks of the same sign.

Figure 16: Pulse responses for the first order system with poles at0.5, 1.5,−0.5,−1.5.

27 S. Wongsa, June 2007

Page 28: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.3 Dynamic response 2 DISCRETE SYSTEMS ANALYSIS

2.3.2 The pulse response of second-order system

Given a second-order system with a pair of complex conjugate poles at z = re±jθ

G(z) =N(z−1)

(1− rejθz−1)(1− re−jθz−1)

where N(z−1) is a polynomial in terms of z−1.Using the partial fraction expansion, the above equation can be written as

G(z) =α + jβ

1− rejθz−1+

α− jβ

1− re−jθz−1

Then, the unit pulse response is

y(k) = Z−1{G(z)}= (α + jβ)rkejkθ + (α− jβ)rke−jkθ

= 2rk(α cos(kθ)− β sin(kθ))

, i.e. the pulse response of the second-order system is the modulated sinusoid,whose

• growth/decay rate depends on r.

– r < 1 =⇒ response decays. The closer r is to 0 the shorter the settlingtime.

– r = 1 =⇒ a signal with constant amplitude.

– r > 1 =⇒ signal grows.

• frequency of oscillation depends on θ. Specifically, the number of samples(N) per oscillation of a sinusoidal signal is

N =2π

θ|rad =

360

θ|deg

For example, a second-order system G(z) = z(z−r cos θ)z−2r(cos θ)z+r2 with r = {0.4, 0.7}

and θ = {π/4, π/2} has the pulse responses and pole/zero positions in the z-plane as shown in Figure 17.

The pulse responses for various pole locations in the z-plane are illustratedin Figure 18. You should keep this graphical information in your mind as ithelps to design what changes should be made in the poles and zeros of G(z) inorder to effect desired changes.

28 S. Wongsa, June 2007

Page 29: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.3 Dynamic response

Figure 17: The second-order pulse responses for r = {0.4, 0.7} and θ ={π/4, π/2}.

29 S. Wongsa, June 2007

Page 30: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.3 Dynamic response 2 DISCRETE SYSTEMS ANALYSIS

Figure 18: The pulse responses for various pole locations in the z-plane.

30 S. Wongsa, June 2007

Page 31: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.4 Relationship between s and z

2.4 Relationship between s and z

Sampling maps the s-domain poles to the z-domain via

z = esT (23)

where T is the sampling time. Solving for s in (23), we also obtain

s =1

Tln z (24)

With s = σ + jωd, we obtain

z = eσT ejωdT = |z|∠z (25)

where |z| = eσT and ∠z = ωdT . This relationship is very useful as it allows us

• to transfer our knowledge of s-plane features to equivalent z-plane prop-erties.

• to map the poles and zeros of a continuous-control design into poles andzeros of an approximating discrete design. This idea of design will bediscussed herein after.

2.4.1 Mapping the poles in s-plane to z-plane

Equation (23) tells us that

• The sample frequency affects the time response of the discrete system. Asshown in Figure 19, decreasing T leads to

– a decrease in decay rate (|z| → 1).

– a decrease in oscillation frequency (∠z → 0).

• the map from the s-plane to the z-plane is many-to-one, i.e. if

s2 = s1 + jn2π

T; n ∈ Z

then es1T = es2T . As pointed earlier in Section 1.2 that when a system issubject to sampled, one of the properties of the sampled function is that ithas an infinite number of poles, located periodically along a vertical axiswith intervals of ±nωs, with ωs = 2π/T and n = 0, 1, 2, ....

31 S. Wongsa, June 2007

Page 32: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.4 Relationship between s and z 2 DISCRETE SYSTEMS ANALYSIS

Figure 19: Impulse response of a second-order discrete system which is mappedfrom s = −1 + 10j with sampling times T=0.1 and T=0.05 sec.

From the sampling theorem, we know that there would be a one-to-onemap between the s-plane and the z-plane if −ωs/2 < ω < ωs/2. Theregion which extends from ω = −ωs/2 to ω = +ωs/2 is called the primarystrip. The other strips are referred to as the complementary strips (seeFigure 20).

As the primary strip in the s-plane maps into the entire z-plane, we can analysisthe relationship between the s and z planes by considering only the primarystrip. Corresponding pole locations between the s plane in the primary stripand the z plane can be found as shown in Figure 21.

Figure 21 and (25) tell us that

• the horizontal strip from −jπ/T to +jπ/T (or −jωs/2 to +jωs/2) in thes-plane is mapped onto the unit circle in the z-plane. All the points in theleft half of the s-plane correspond to points inside the unit circle in thez-plane. On the other hands, all the points in the right half of the s-plane

32 S. Wongsa, June 2007

Page 33: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.4 Relationship between s and z

Figure 20: Periodic strips in the s plane.

33 S. Wongsa, June 2007

Page 34: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.5 Effect of additional zero/pole 2 DISCRETE SYSTEMS ANALYSIS

Figure 21: Corresponding pole locations between the s-plane and the z-plane.

correspond to points outside the unit circle in the z-plane. That is, thestability boundary in discrete time is the unit circle |z| = 1.

• For any given damping locus σ1, the constant-damping locus in the s-plane, which is a vertical line, is mapped to a concentric circle with thecentre at z = 0 and radii r = eσ1T .

• For any given frequency ωd = ω1, the constant-frequency locus in thes-plane, which is a horizontal lines, is represented as a straight line em-anating from the origin at an angle of θ = ω1T rad, measured from thepositive real axis.

2.5 Effect of additional zero or pole on discrete step re-sponse

Understand how poles and zeros affect the time response is useful as it helpsguide the iterative design process.

34 S. Wongsa, June 2007

Page 35: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.5 Effect of additional zero/pole

• Effect of additional zeroConsider a second-order system with transfer function,

G(z) =z − z1

z2 − a1z + a2

=z − rcosθ

z2 − 2rcosθz + r2(26)

, we consider the effect of an extra zero to step response via this system.The percent overshoot versus location of z1 which is varied from -1 to 1are plotted in Figure 22 for θ = 18, 45 and 72 degrees. We can see that themajor effect of the zero z1 on the step response is to substantially changethe percent overshoot, especially as the zero comes near +1.

Figure 22: Percent overshoot versus zero location for the step response of thesystem (27) with θ = 18◦, 45◦, 72◦ (adapted from (G.F. Franklin et al (1998))).

35 S. Wongsa, June 2007

Page 36: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.5 Effect of additional zero/pole 2 DISCRETE SYSTEMS ANALYSIS

• Effect of additional poleConsider a second-order system with transfer function,

G(z) =(z + 1)2

(z − p1)(z2 − a1z + a2)=

(z + 1)2

(z − p1)(z2 − 2rcosθz + r2)(27)

, we consider the effect of an extra pole to step response via this system.

The rise time versus location of p1 which is varied from -1 to 1 are plottedin Figure 23 for θ = 18, 45 and 72 degrees. We can see that the pole p1

primarily affects on the rise time, i.e. as the pole comes near +1, theresponse slows down.

Figure 23: Rise time versus pole location for the step response of the system(27) with θ = 18◦, 45◦, 72◦ (adapted from (G.F. Franklin et al (1998)).

36 S. Wongsa, June 2007

Page 37: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.6 Discrete frequency response

2.6 Discrete frequency response

The discrete frequency response of a transfer function G(z) is defined as G(ejωT ),given by substituting z = ejωT into all of the z terms in G(z). The amplitudeand phase of G(ejωT ) determine how the system responds to sinusoidal signals.

Specifically, if a sinusoid of amplitude U and frequency ω0 is applied, then inthe steady state, the response samples will be a sinusoid of the same frequencywith amplitude |G(ejω0T )|U and phase φ = ∠G(ejω0T ).

Example 12: Frequency response functionCalculate the frequency response of the system represented by

G(z) =z

z − 0.8

The frequency response of G(z) is

G(ejωT ) = G(z)|z=ejωT =ejωT

ejωT − 0.8=

cos ωT + j sin ωT

(cos ωT − 0.8) + j sin ωT

If a unit-amplitude sinusoid with frequency ω0 = 1 rad/sec is applied, theresponse samples which sampled with T = 0.5 sec will be on a sinusoid withamplitude

A = |G(ej0.5)|= |1.2631− j1.6261| = 2.06

and phase

φ = ∠G(ej0.5)

= ∠1.2631− j1.6261 = −52.16◦

as shown in Figure 24.

• Bode diagram of frequency responseLikewise to continuous-time systems, the magnitude and phase of thefrequency response of discrete-time systems can be obtained using theMablab function bode.

37 S. Wongsa, June 2007

Page 38: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.6 Discrete frequency response 2 DISCRETE SYSTEMS ANALYSIS

13 18 23 28 31 36−3

−2

−1

0

1

2

3

Sample

inputoutput

Figure 24: Frequency response of the example system to a unit-amplitude sinu-soid.

For example, the magnitude and phase of the system in Example 12 at ω0

can be obtained using the following Matlab commands:

38 S. Wongsa, June 2007

Page 39: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.7 Closed-loop stability analysis

num=[1 0]; %numerator of G(z)den=[1 -0.8]; %denominator of G(z)

%Create G(z)=num/den with sampling time 0.5 sec% NB: On the contrary to filter command, by default for SISO models% the numerator and denominator coefficients are specified using% tf function in descending powers z.sys=tf(num,den,0.5) Transfer function:z——z - 0.8Sampling time: 0.5

% find the magnitude and phase at omega = 1 rad/sec[mag,phase]=bode(sys,1)mag =2.0590phase =-52.1600

% plots the Bode response with the frequency range being deter-mined automaticallybode(sys)

2.7 Closed-loop stability analysis

For a closed-loop system shown in Figure 14, the closed-loop transfer functionT (z) is

T (z) =G(z)

1 + G(z)H(z)=

K∏m(z − zi)∏n(z − pi)

The characteristic equation of this closed-loop system is

1 + G(z)H(z) = P (z) = 0 (28)

The system is stable provided that all the roots of (28) lie inside the unit circlein the z-plane, i.e. |pi| < 1, i = 1, ..., n.

Since many available techniques for continuous-time LTI system, e.g. theRouth-Hurwitz criterion and Bode techniques, are based on the property that

39 S. Wongsa, June 2007

Page 40: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.7 Closed-loop stability analysis 2 DISCRETE SYSTEMS ANALYSIS

−10

−5

0

5

10

15

Mag

nitu

de (

dB)

10−2

10−1

100

101

−60

−30

0

30

Pha

se (

deg)

Bode Diagram

Frequency (rad/sec)

Figure 25: Bode plot of the discrete-time system G(z) = z/(z − 0.8) with sam-pling time T=0.5 sec.

40 S. Wongsa, June 2007

Page 41: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2 DISCRETE SYSTEMS ANALYSIS 2.7 Closed-loop stability analysis

in the s-plane the stability boundary is the imaginary axis. Therefore, thesetechniques cannot be readily applied to LTI discrete-time system in the z-plane,whose stability boundary is the unit circle.

In what follows, the bilinear transformation, which maps the z plane toanother complex plane, the w plane, will be introduced. The bilinear trans-formation allows use of the Routh-Hurwitz stability criterion to be applied todiscrete-time systems.

2.7.1 Stability analysis using the bilinear transformation and theRouth stability criterion

The bilinear transformation is defined by

z =w + 1

w − 1(29)

which gives

w =z + 1

z − 1(30)

Let the complex variable w = σ + jω. Using (29), the inside of the unit circlein the z plane can be expressed as

|z| =∣∣∣∣w + 1

w − 1

∣∣∣∣ =

∣∣∣∣σ + jω + 1

σ + jω − 1

∣∣∣∣ < 1

or(σ + 1)2 + ω2

(σ − 1)2 + ω2< 1

Thus, we obtain(σ + 1)2 + ω2 < (σ − 1)2 + ω2

which yieldsσ < 0

That is, the bilinear transformation maps the inside of the unit circle in thez plane into the left half of the w plane.

• Given the characteristic equation P (z) = 0, by substituting (w+1)/(w−1)for z in P (z), it is possible to apply the Routh-Hurwitz in the same manneras in continuous-time systems.

41 S. Wongsa, June 2007

Page 42: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

2.7 Closed-loop stability analysis 2 DISCRETE SYSTEMS ANALYSIS

• Since the amount of computation required in this stability analysis ap-proach can be high as the system order n increases, in some cases, itmay be simpler to find the roots of the characteristic equation directly byMatlab functions, e.g. roots.

Example 13: Given the characteristic equation of a system as

P (z) = z2 − 1.2z + 0.32 = 0

, use the bilinear transformation to determine the system’s stability via Routh-Hurwitz.SolutionApply the bilinear transformation to P (z):

P (w) =

(w + 1

w − 1

)2

− 1.2

(w + 1

w − 1

)+ 0.32 = 0

which yieldsw2 + (1.36/0.12)w + (2.52/0.12) = 0

By formulating the Routh-Hurwitz array, one can prove that the system is stable.This result is confirmed by the roots of P (z), z = 0.8 and z = 0.4, which are allinside the unit circle.

42 S. Wongsa, June 2007

Page 43: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN

3 Digital design by emulation

Control design by emulation is mainly composed of two steps: (i) a controller de-sign is done in the continuous domain. (ii) according to a sample period selected,a discrete equivalent is computed and implemented in place of the continuousdesign. To verify the design, discrete analysis, simulation, or experimentationare used.

3.1 A brief of design of continuous system

Recall that the design specifications may be given in terms of desired dynamicperformance in the time domain or in the frequency response. These require-ments will put constraints on s-plane pole and zero locations or on the shape ofthe frequency response.

3.1.1 Time-domain specifications

The most frequently used parameters of system time response to a step inputare:

• the rise time (tr)

• the settling time (ts)

• the overshoot (Mp)

• the steady-state error (ess)

as shown in Figure 26. The first three are known as transient response specifi-cations, whereas the last one is a steady-state specification.

• Transient response specifications These requirements can be used tofind the locations of appropriate poles. The desired poles are usually ap-proximated via the the damping ratio (ζ) and natural frequency (ωn) ofthe second-order system (see Figure 27).

T (s) =ω2

n

s2 + 2ζωn + ω2n

(31)

The complex poles of this second-order system are at s = −σ± jωd whereσ = ζωn and ωd = ωn

√1− ζ2. Some step responses associated with the

pole locations in the s-plane are illustrated in Figure 27 (b).

43 S. Wongsa, June 2007

Page 44: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.1 Continuous-time design 3 EMULATION DESIGN

Figure 26: Definition of rise time (tr), settling time (ts), and overshoot (Mp).

Given a set of time specifications, we can approximate the desired polesbased on the following approximations:

tr ≈ 1.8

ωn

ts ≈ 4.6

ζωn

(1% criterion)

≈ 4

ζωn

(2% criterion)

≈ 3

ζωn

(5% criterion)

Mp ≈ e−πζ/√

1−ζ2, 0 ≤ ζ < 1 (32)

The transient response is also related to the system bandwidth. To de-crease rise time and increase speed of response, the system bandwidthmust be increased. However, systems with larger bandwidth become moresusceptible to noise. Therefore, a trade-off must be made.

• Steady-state error

44 S. Wongsa, June 2007

Page 45: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.1 Continuous-time design

(a)

(b)

Figure 27: Second-order system response in (31). (a) s-plane plot for a pair ofcomplex poles. (b) Time functions associated with points in the s-plane.

45 S. Wongsa, June 2007

Page 46: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.1 Continuous-time design 3 EMULATION DESIGN

C(s) G(s) +

- R(s) Y(s)

Figure 28: Continuous-time control system.

For a unity-feedback system shown in Figure 28, the steady state error canbe calculated using the final value theorem.

ess = lims→0

s(E(s)) (33)

where E(s) = R(s)1+C(s)G(s)

is the Laplace transform of the error. Con-sider the continuous-time control system whose open-loop transfer functionC(s)G(s) is given by

C(s)G(s) =K(b1s + 1)(b2s + 1)...(bms + 1)

sN(a1s + 1)(a2s + 1)...(ans + 1)(34)

The system type is classified according to the number of integrators in theopen-loop transfer function, i.e. a system is said to be of type 0, type 1and type 2 if N = 0, N = 1 and N = 2, respectively. Knowing the systemtype, we can predict if the system is going to have a finite steady-stateerror. The error characteristics for set-point inputs, related to system typecan be summarised in Table 2.

3.1.2 Relative stability

The closed-loop stability of the unity feedback system in Figure 28 can be de-termined from the open-loop frequency response. Two quantities that measurethe closed-loop stability via the frequency response of the open-loop transferfunction are the gain margin (GM) and the phase margin (PM).

Given the open-loop transfer function F (s) = C(s)G(s),

- Gain margin indicates how much the gain can be increased before thesystem becomes unstable. It is defined as the reciprocal of the magnitude

46 S. Wongsa, June 2007

Page 47: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.1 Continuous-time design

Table 2: Error characteristics for step, ramp and parabola inputs, related tosystem types 0, 1 and 2.

Type Step Ramp Parabola

Type 0 11+Kp

∞ ∞Type 1 0 1

Kv∞

Type 2 0 0 1Ka

Kp (the position constant) = lims→0 C(s)G(s)

Kv (the velocity constant) = lims→0 sC(s)G(s)

Ka (the acceleration constant) = lims→0 s2C(s)G(s)

|F (s)| at the frequency at which the phase angle is -180◦ (the phase overfrequency ωpc).

GM =1

|F (jωpc)|GM dB = −20 log |F (jωpc)| (35)

- Phase margin is the amount of additional phase lag at the gain crossoverfrequency ωgc (the frequency at which |F (s)| is unity) required to bringthe system to verge of instability.

PM = 180◦ + ∠F (jωgc) (36)

For a minimum-phase system both the PM and GM must be positive for thesystem to be stable, as shown in Figure 29.

The phase margin is generally related to damping of a system. For a second-order system, the commonly used approximation is

ζ ≈ PM

100(37)

All specifications previously discussed impose some constraints to the designof a controller. The controller parameters may be designed using the root locus

47 S. Wongsa, June 2007

Page 48: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.1 Continuous-time design 3 EMULATION DESIGN

Figure 29: Bode diagrams of phase and gain margins of stable and unstablesystems.

or frequency response techniques.

Example 14:

The transfer function of the system in Figure 28 is given by

G(s) =1

s(10s + 1)

The specifications for this system are

- Overshoot to a step input less than 16%

- Settling time to 1% to be less than 10 sec

- Tracking error to a ramp input of slope 0.01 rad/sec to be less than 0.01rad.

Design a continuous-time controller for this system.Solution

48 S. Wongsa, June 2007

Page 49: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.2 Discrete equivalents

- From the overshoot, the damping ratio must be ζ ≥ 0.5.

- From the settling time requirement, the roots must have a real part of σ ≥4.6/10 = 0.46.

- From the steady-state error requirement, the velocity constant is constrainedto be Kv ≥ 0.01/0.01 = 1.0.

Using lead compensation to cancel a plant pole, the transfer function of controlleris

C(s) =K(10s + 1)

s + 1

The acceptable region for closed-loop poles in the s-plane and the root locus forthis controller is displayed in Figure 30. The locations of the roots with K = 1corresponding to a velocity constant of Kv = 1 are marked by the dots. Thisgain may be a first choice for controller and it results in the step response inFigure 31.

Figure 30: Acceptable pole locations and root locus for compensated antennamodel.

3.2 Discrete equivalents

This section concerns computation of discrete equivalents from a continuousdesign. To find a discrete transfer function that will have approximately the

49 S. Wongsa, June 2007

Page 50: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.2 Discrete equivalents 3 EMULATION DESIGN

0 2 4 6 8 10 120

0.2

0.4

0.6

0.8

1

1.2

1.4

Time(sec)

PO = 16.3011 %, ts = 8.781 sec

Figure 31: Step response for compensated antenna model with K = 1.

same characteristics over the frequency range of importance as give continuoustransfer function, we discuss three approaches: numerical integration, pole andzero mapping and hold equivalent.

3.2.1 Discrete equivalents via numerical integration

The concept of this approach is to represent a given continuous controller C(s) asa differential equation and to find an approximation of the differential equationby numerical approximation of integration.

For example, a 2nd-order system

C(s) =Y (s)

U(s)=

1

s2 + a1s + a0

(38)

can be realised using gains, integrators (1/s) and summation blocks as shownin Figure 32.

The motivation here is that we want to find approximations for the integrator1/s. If the input and output of the integrator are X(s) and Y (s), respectively,the output y(t) is given as

y(t) = y(0) +

∫ t

0

x(τ)dτ

50 S. Wongsa, June 2007

Page 51: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.2 Discrete equivalents

Figure 32: Block diagram of a second order system

The output over a single sample period of T seconds, is given by

y(kT + T ) = y(kT ) +

∫ kT+T

kT

x(τ)dτ

Three commonly used approximations for the integration terms are the for-ward difference approximation, the backward difference approximation and thetrapezoidal approximation. The equivalent z-transforms of these three approxi-mations are displayed in Figure 33.

A discrete transfer function can then be obtained from any Laplace trans-form G(s) by substitution of an approximation for the frequency variable s aslisted in Table 3. For example, by using the three numerical approximations ofintegration, the example 2nd-order system C(s) in (38) has equivalent discretetransfer functions as:

- Forward rule

C(z) = C(s)|s= z−1T

=T 2

(z − 1)2 + a1T (z − 1) + a0T 2

- Backward rule

C(z) = C(s)|s= z−1Tz

=(Tz)2

(z − 1)2 + a1Tz(z − 1) + a0(Tz)2

51 S. Wongsa, June 2007

Page 52: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.2 Discrete equivalents 3 EMULATION DESIGN

Figure 33: Numerical approximations of integration by the forward, backwardand trapezoidal approximations.

52 S. Wongsa, June 2007

Page 53: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.2 Discrete equivalents

- Bilinear/Tustin’s rule

C(z) = C(s)|s= 2T

z−1z+1

=T 2(z + 1)2

4(z − 1)2 + 2a1T (z2 − 1) + a0T 2(z + 1)2

Table 3: Substitution of the frequency variable s by equivalent z function.

Method s → z z → s

Forward s = z−1T

z = 1 + TsBackward s = z−1

Tzz = 1

(1−Ts)

Bilinear s = 2T

z−1z+1

z = 1+Ts/21−Ts/2

Mapping of stability region

Here, we determine how stable s-plane poles are mapped by the three inte-gration approximations into the z-plane. Essentially, we want transformationsthat map the inside of the unit circle in the z-domain into the left half-plane inthe s-domain (and vice versa), in order not to change the stability of the model.

Using the relations in Table 3, the left (stable) half of the s-plane appearingin the z-plane can be obtained and is shown in Figure 34.

• the forward method may change a stable continuous-time system to anunstable discrete-time system, i.e. stable C(s) may result in unstableC(z).

• the backward method maps stable s-plane poles to stable z-plane poles,i.e. stable C(s) implies stable C(z) (but not vice versa).

• the bilinear method always preserves the stability of the system, i.e., map-ping the inside of the unit circle in the z-domain exactly into the lefthalf-plane in the s-domain. That is why this approximation is the mostcommonly used among the three approximation methods.

Bilinear approximation with prewarping

53 S. Wongsa, June 2007

Page 54: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.2 Discrete equivalents 3 EMULATION DESIGN

Figure 34: Maps of the left-half of the s-plane by the integration rules.

54 S. Wongsa, June 2007

Page 55: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.2 Discrete equivalents

Despite the preservation of stability under the Tustin’s method, there is agreat amount of frequency distortion or warping caused by the Tustin’s rule.

For example, consider a continuous-time system with transfer function

C(s) =a

s + a(39)

Now suppose a sinusoid at the continuous frequency of s = jω0 is applied to thesystem. The frequency response of C(s) is given by

C(jω0) =a

jω0 + a

Given the same sinusoid, the corresponding discrete frequency becomes z =ejω0T . Approximating G(s) using the Tustin’s rule, we have the correspondingdiscrete frequency response

C(ejω0T ) = a/(2

T

ejω0T − 1

ejω0T + 1+ a)

= a/(2

Tj tan(

ω0T

2) + a) (40)

Comparing (39) to (42), we can see that the frequency distortion occurs. Thisdistortion can be overcome by introducing the so-called prewarping, which is anextension of Tustin’s rule. The transformation of prewarping is in the form

s =ω0

tan(ω0T/2)

z − 1

z + 1(41)

By using this transformation, the discrete frequency response in (42) becomes

C(ejω0T ) = a/(ω0

tan(ω0T/2)

ejω0T − 1

ejω0T + 1+ a)

= a/(jω0 + a) = G(jω0) (42)

,i.e. the continuous frequency response at a selected frequency ω0 is recovered.

Example 15:Consider a third order low-pass Butterworth filter designed to have unity passbandwidth (ωp = 1),

G(s) =1

s3 + 2s2 + 2s + 1

55 S. Wongsa, June 2007

Page 56: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.2 Discrete equivalents 3 EMULATION DESIGN

we find the discrete equivalents using forward rule, backward rule , bilinear ruleand bilinear rule with prewarping at ω = 1, at sampling rates fs = 10, 1 and0.5 Hz and plot the corresponding frequency responses in Figures 35. It can beseen that at high sampling rate (fs = 10Hz) all the rules do reasonably well. Atthe slow rate of fs = 1Hz, the forward rule results in an unstable discrete-timesystem. At the very slow sampling frequency of fs = 0.5Hz, all methods areinaccurate. However, bilinear rule with prewarping can recover the magnitudeand phase of the continuous-time system at the cutoff frequency, which wasselected as the prewarping frequency.

3.2.2 Pole-zero matching equivalents

Pole-zero matching is the simplest method to apply computationally if the con-tinuous system is given in terms of its zeros and poles. This technique uses themap z = esT to locate the zeros and poles and set the gain of a discrete transferfunction that approximates the given C(s).

Given a continuous-time system C(s) with nz zeros and np poles, a discreteequivalent C(z) based on pole-zero matching can be found as follows:

i) All poles and finite zeros of C(s) are mapped according to z = esT .

ii) The zeros of C(s) at s = ∞ are mapped into z = −1. One of the zeros ofC(s) at s = ∞ is mapped into z = ∞, leaving the number of finite zerosof C(z) one fewer than the number of finite poles of C(z).

iii) The gain of C(z) is matched the gain of C(s) at a pre-selected criticalfrequency. Often in practice, the critical frequency used is at steady states = 0, i.e., giving C(s)|s=0 = C(z)|z=1.

Example 16:

Compute the discrete equivalent to G(s) = 1(s+0.5)(s+2)

by pole-zero matching.

Solution

The poles at s = −0.5,−2 will map to poles of G(z) at e−j0.5T and e−j2T ,respectively. There are two zeros of G(s) at s = ∞. One of them must bemapped to a zero of G(z) at z = −1, leaving G(z) with a number of finite zerosone fewer than the number of finite poles. To match the gain of G(s)|s=0 which

56 S. Wongsa, June 2007

Page 57: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.2 Discrete equivalents

0 0.5 1 1.5 2 2.50

0.5

1

1.5

|G|

0 0.5 1 1.5 2 2.5−250

−200

−150

−100

−50

0

Frequency (rad/sec)

Pha

se

ContinuousBilinearPrewarpingBackwardForward

0 0.5 1 1.5 2 2.50

0.2

0.4

0.6

0.8

1

|G|

ContinuousBilinearPrewarpingBackwardForward

0 0.5 1 1.5 2 2.5−250

−200

−150

−100

−50

0

Frequency (rad/sec)

Pha

se(a) (b)

0 0.5 1 1.5 2 2.50

0.2

0.4

0.6

0.8

1

|G|

0 0.5 1 1.5 2 2.5−250

−200

−150

−100

−50

0

Frequency (rad/sec)

Pha

se

ContinuousBilinearPrewarpingBackwardForward

(c)

Figure 35: Numerical integration of a third-order low-pass Butterworth filterusing forward rule, backward rule, bilinear rule and bilinear with prewarping atω = 1 at sampling rates (a) 10 Hz (b) 1 Hz (c) 0.5 Hz

57 S. Wongsa, June 2007

Page 58: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.2 Discrete equivalents 3 EMULATION DESIGN

is 1, the gain of G(z) must be (1 − e−0.5T )(1 − e−2T )/2. The final function isgiven by

G(z) =(1− e−0.5T )(1− e−2T )

2· z + 1

(z − e−0.5T )(z − e−2T )

3.2.3 Hold equivalents

D/A & hold ) ( s C Sampler ) ( kT u ) ( t u ) ( t y ) ( kT y

) ( z C

Figure 36: Sampled-data system.

For this method, we assume that a continuous-time system is part of asampled-data system and therefore is preceded by a hold device and is fol-lowed by a sampler as shown in Figure 36. It is desired to find the discrete-timetransfer function from input samples u(kT ) to output samples y(kT ) which willapproximate the continuous-time transfer function from continuous-time inputu(t) to continuous-time output y(t).

• Zero-order hold equivalentThe zero-order hold method assumes that samples are held constant untilthe next sampling instant. Thus, the unit pulse response of the plant C(s)(or controller in this case) is

CZOH(s) = (1− e−Ts)C(s)

s(43)

The z-transfer function of C(s) preceded by a ZOH is

C(z) = Z{CZOH(s)}= (1− z−1)Z

{C(s)

s

}

=(z − 1)

zZ

{C(s)

s

}(44)

58 S. Wongsa, June 2007

Page 59: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.2 Discrete equivalents

• First-order hold equivalentThe first-order hold (FOH) extrapolates the samples so as to connect sam-ple to sample in a straight line (Figure 37 (b)).

Figure 37: First-order hold. (a) impulse response of (non-causal) first-orderhold. (b) piecewise linear signal obtained from FOH.

The impulse response of the noncausal FOH is shown in Figure 37 (a) andhas the following Laplace transform,

FOH(s) =eTs − 2 + e−Ts

Ts2(45)

Therefore, the discrete equivalent of C(s) based on FOH is

C(z) =(z − 1)2

TzZ

{C(s)

s2

}(46)

NB: Since a ZOH is much easier to implement than a FOH with similarperformances, hence ZOH prevails in practical applications.

Example 17:

59 S. Wongsa, June 2007

Page 60: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.2 Discrete equivalents 3 EMULATION DESIGN

Find the ZOH and FOH equivalents to the first-order transfer functionG(s) = 1/s2

Solution

From the table of z-transforms,

Z{ 1

s3} =

T 2z(z + 1)

2(z − 1)3

and

Z{ 1

s4} =

T 3(z2 + 4z + 1)z

6(z − 1)4

The ZOH and FOH equivalents of G(s) are, respectively, found as

GZOH(z) =T 2

2

(z + 1)

(z − 1)2

and

GFOH(z) =T 2

6

(z2 + 4z + 1)

(z − 1)2

Bare in mind that as there is no a dominant technique that is best for everycase, several discrete equivalent algorithms should be explored by the designerbased on the particular system, the required performance speeds and the prac-tical constraints for implementation.

3.2.4 Computation of discrete equivalent using Matlab

Matlab provides the function c2d which converses continuous-time LTI sys-tems to discrete time as detailed below.

60 S. Wongsa, June 2007

Page 61: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.3 Discrete Controllers

SYSD = c2d(SYSC,Ts,METHOD)

converts the continuous-time LTI model SYSC to a discrete-time model SYSD withsample time Ts. The string METHOD selects the discretization method among thefollowing:

‘zoh’ Zero-order hold on the inputs‘foh’ Linear interpolation of inputs (triangle appx.)‘tustin’ Bilinear (Tustin) approximation‘prewarp’ Tustin approximation with frequency prewarping. The criticalfrequency Wc (in rad/sec) is specified as fourth input by SYSD =c2d(SYSC,Ts,’prewarp’,Wc)‘matched’ Matched pole-zero method (for SISO systems only).

Exercise: Compute the discrete equivalent of the systems in Examples 15, 16and 17 using c2d (when applicable) with T = 1 sec.

3.3 Discrete Equivalent Controllers

Given a continuous-time controller, an equivalent discrete-time controller can befound using any approximation techniques.

Example 18: Antenna Servo discrete controllerRecalling the antenna servo control system, illustrated in Example 38, whichhave

G(s) =1

s(10s + 1), C(s) =

10s + 1

s + 1

A block diagram of the sampled-data system with discrete controller of theantenna servo control system is shown in Figure 38.

Figure 38: Single-loop discrete system with unity feedback.

61 S. Wongsa, June 2007

Page 62: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.3 Discrete Controllers 3 EMULATION DESIGN

We first determine the z-transform of the continuous plant preceded by azero-order hold, i.e.

G(z) =z − 1

zZ{ 0.1

s2(s + 0.1)}

= 10(e−0.1T + 0.1T − 1)z + (1− e−0.1T − 0.1Te−0.1T )

(z − 1)(z − e−0.1T )

Next, we compute a discrete equivalent compensator. In this example, weuse the pole-zero matching approach.

C(z) =

(1− e−T

1− e−0.1T

)z − e−0.1T

z − e−T(47)

The effect of sampling rate to the performance of discrete control is deter-mined. Two sampling rates are considered: fs = 5 Hz and fs = 1 Hz. Thestep responses for these sampling rates are displayed in Figure 39. Figure 39shows substantial degradation of the response as a result of the slow samplingfs = 1Hz. The extra overshoot can be explained by the sample-hold delay.

In continuous design, the phase margin is found to be 51.8◦ at the gaincrossover frequency of ωgc = 0.8 rad/sec. With sampling period T , the sample-hold delay can be roughly approximated as T/2 sec. At ωgc, the phase marginof the discrete design is reduced by this delay. The effective reduction of phasemargin with a sample and hold for fs = 5 and 1 Hz is approximately 4.5 and23 degrees, respectively. The resulting small phase margin of 28.8◦ for fs = 1Hz leads to a small effective damping ratio of about 0.29 and the overshoot isexpected to be about 0.4 rather than 0.16 as required.

Example 18 points out the significance of selected sampling time to the suc-cess of discrete design by emulation. Larger sampling periods usually give riseto a higher overshoot in the step response and may eventually cause instability.

A rule of thumb is to sample 20 to 30 times the expected closed-loop band-width. From the time domain perspective, a reasonable choice of T is one thatresults in 8 to 10 samples in the closed-loop rise time for overdamped systemsand 8 to 10 samples per cycle of oscillation for underdamped systems.

62 S. Wongsa, June 2007

Page 63: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.3 Discrete Controllers

(a)

(b)

Figure 39: Step response of the discrete controllers with sampling rates (a) 1 Hz(b) 0.5 Hz

63 S. Wongsa, June 2007

Page 64: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3.3 Discrete Controllers 3 EMULATION DESIGN

10−1

100

101

10−4

10−2

100

102

Bode plot of the design for the antenna control

Mag

nitu

de

Frequency (rad/sec)

10−1

100

101

−270

−240

−210

−180

−150

−120

−90

Pha

se (

deg)

Frequency (rad/sec)

ContinuousDiscrete f

s = 5 Hz

Discrete fs = 1 Hz

Figure 40: Bode plot of the design for the antenna control.

64 S. Wongsa, June 2007

Page 65: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

3 EMULATION DESIGN 3.3 Discrete Controllers

Questions: From the example of antenna design, what are the natural fre-quency and the corresponding rise time for the given closed-loop pole locationsof the continuous design? Using this information, can you calculate the recom-mended sampling time?

65 S. Wongsa, June 2007

Page 66: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN

4 Direct design of digital controller

We now consider the direct discrete design methods. The fundamental conceptis that we first determine the z-transform of the continuous parts of the system,analysis and design can then be carried out purely in the discrete-time domain.

Several design methods for discrete controllers, e.g. pole placement, root-locus and frequency response methods, are analogous to the continuous timemethod, but the specifications and interpretation must be translated into thez-plane.

4.1 Control system specifications

4.1.1 Transient response specifications

We assume that the dominant behaviour of a system can be approximated bya second-order system. Given the transient response specifications as defined in(32), the desired ζ and ωn can be obtained, so can the acceptable region in thes-plane. The acceptable region is then mapped into the z-plane using z = esT .

Recall that for a second-order system with damping ratio ζ and natural fre-quency ωn a constant-damping-ratio line can be given by

s = −ζωn + jωn

√1− ζ2 = −σ + jωd

In the z plane this line becomes

|z| = exp(−2πωd

ωs

ζ√1− ζ2

) (48)

∠z = 2πωd

ωs

(49)

Using the above expressions, lines of constant damping ratio and of constantnatural frequency in the s plane can be mapped to the z plane. These linescan be obtained using the Matlab command zgrid. It superimposes z-planecontours corresponding to ζ = 0.1, 0.2, ..., 1 and ωn = π/10T, 2π/10T, ..., π/T onthe unit circle as seen in Figure 41 (b). Some examples of mapping a desirableregion from the s plane to the z plane are given in Figure 42.

66 S. Wongsa, June 2007

Page 67: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.1 Control system specifications

Figure 41: (a) Lines of constant damping and natural frequency in the s-plane.(b) z-plane contour of constant damping and natural frequency produced byMatlab zgrid command.

67 S. Wongsa, June 2007

Page 68: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4.1 Control system specifications 4 DIRECT DESIGN

(a)

(b)

Figure 42: Mapping of s plane and z plane regions. (a) Mapping of regionfor ζ > ζ1 in the s plane (b) Mapping of a desirable region in the s plane forclosed-loop pole locations.

68 S. Wongsa, June 2007

Page 69: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.1 Control system specifications

4.1.2 Steady-state error

The specifications on steady-state error to polynomial inputs is determined bythe error constant. To derive the error constant for the discrete case, we firstconsider the transfer function of error E(z) with respect to the reference inputR(z) for the unity feedback system in the form

E(z) = R(z)− Y (z) =R(z)

1 + F (z)(50)

For example, the system in Figure 38 has F (z) = C(z)G(z).

Using the final value theorem, we can calculate the final value of the errorwith respect to three common inputs - a step input, a ramp input and a parabolainput:

i) a step input R(z) = zz−1

ess = limz→1

(z − 1)z

(z − 1)

1

(1 + F (z))

=1

1 + Kp

(51)

where Kp = limz→1 F (z) is called the position error constant.

ii) a ramp input R(z) = Tz(z−1)2

ess = limz→1

(z − 1)Tz

(z − 1)2

1

1 + F (z)

=1

Kv

(52)

where Kv = limz→1(z−1)F (z)

Tis called the velocity constant.

iii) a parabola input R(z) = T 2(z+1)z2(z−1)3

ess = limz→1

(z − 1)T 2(z + 1)z

2(z − 1)3

1

(1 + F (z))

=1

Ka

(53)

where Ka = limz→1(z−1)2F (z)

T 2 is called the acceleration error constant.

69 S. Wongsa, June 2007

Page 70: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4.2 Direct design by root locus in the z-plane 4 DIRECT DESIGN

For discrete systems, the number of poles at z = 1 in F (z) specifies the systemtype. For example, for the unity feedback system in Figure 38, F (z) = z−1

(z−2)(z−3)

and F (z) = z(z−1)(z−2)(z−3)

are systems type 0 and 1, respectively. Carefully

inspecting (51) and (52) draws the same conclusions on errors versus systemtype, similarly to continuous systems (see Table 4).

Table 4: Errors versus system type for unity feedback.

Step Ramp Parabola

Type 0 1/(1 + Kp) ∞ ∞Type 1 0 1/Kv ∞Type 2 0 0 1/Ka

Kp (the position constant) = limz→1 F (z)

Kv (the velocity constant) = limz→1(z − 1)F (z)

T

Ka (the acceleration constant) = limz→1(z − 1)2F (z)

T2

Example 19: Consider the system in Figure 28 with C(z) = 1 and G(s) = 1s+1

.Using discrete analysis with T = 1, determine the system type and find thesteady-state errors to a unit step and unit ramp.

Solution: The system is type 0. Errors to a unit step and a unit ramp are 0.5and ∞, respectively.

4.2 Direct design by root locus in the z-plane

Recall that the root locus is a plot of the roots of characteristic equation as gainis varies. This technique shows how changes in the open-loop characteristicsinfluence the closed-loop dynamics characteristics. The design procedure is toadd poles and zeros via a controller so as to shift the roots of the characteristicequation to more appropriate locations in the z-plane.

4.2.1 Root-locus of discrete-time systems

The characteristic equation of the single-loop discrete system from Figure 38has the same form as that found for the s-plane, i.e.

70 S. Wongsa, June 2007

Page 71: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.2 Direct design by root locus in the z-plane

1 + F (z) = 0 (54)

Therefore, rules for construction of root-locus are identical to continuous s-domain, as summarised in Table 5. Moreover, guidelines of the continuous designby root locus can be used in discrete design if the specifications and interpreta-tion are made in the z-plane perspective.

Consider the closed-loop feedback system shown in Figure 43, sketch a rootlocus diagram of the system as the gain K varies, and comment on the stabilityof the system for G(z) = z

(z−1)(z−0.5).

Figure 43: Simple feed-back control.

Solution

The closed-loop transfer function: Y (z)/R(z) = Kzz2+(K−1.5)z+0.5

The characteristic equation: z2 + (K − 1.5)z + 0.5 = 0

That is, z = −K−1.52

±√

(K−1.52

)2 − 0.5. The root-locus diagram is shown in

Figure 44. The system is unstable for high K, specifically when K > 3.

4.2.2 Discrete root locus design

We can summarise the procedure of design discrete controllers using root locustechnique as follows:

1. Estimate the desired ωn and ζ from the continuous-time response specifi-cations using the approximations in (32) and (37).

71 S. Wongsa, June 2007

Page 72: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4.2 Direct design by root locus in the z-plane 4 DIRECT DESIGN

Table 5: Rules for root-locus construction

Given the characteristic equation 1 + F (z) = 0, the roots of the characteristic equationmust fulfill the following magnitude and angle conditions.

-Magnitude condition:|F (z)| = 1

-Angle condition:∠F (z) = ±180◦(2k + 1), k = 0, 1, 2, ...

General procedure for constructing root loci1. Rearrange the characteristic equation 1 + F (z) = 0 so that the parameter of interest,such as gain K > 0, appears as the multiplying factor in the form

1 + K (z+z1)(z+z2)...(z+znz )(z+p1)(z+p2)···(z+pnp)

= 0

2. Loci originate on poles of F (z) and terminate on the zeros of F (z).3. The root locus on the real axis always lies in a section of the real axis tothe left of an odd number of poles and zeros on the real axis.4. The root locus is symmetrical about the real axis.5. The point where the root loci intersect the imaginary axis (v) andthe corresponding gain K can be found by setting z = jv in characteristic equation,equating both the real part and the imaginary part to zero, and solving for v and K.6. The point where the root loci intersect the unit circle can be found by performingstability analysis, such as the Routh-Hurwitz analysis in w-domain.7. The number of asymptotes is equal to np − nz with angles given by

±180◦(2k + 1)/(np − nz)and asymptotes centered at σa

σa =∑

poles of F (z)−∑zeros of F (z)

np−nz

where k = 0, 1, 2, ..., np and nz are the number of poles and zeros of F (z), respectively.8. The breakaway and break-in points on the real axis are given by the roots of dK

dz= 0

9. The value of K at any point z1 on the root loci is determined fromthe magnitude condition, i.e. |F (z1)| = 110. The angle of departure of the root loci from a pole or the angle of arrival at a zeroof F (z) can be determined by applying the angle condition.

72 S. Wongsa, June 2007

Page 73: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.2 Direct design by root locus in the z-plane

Figure 44: Root locus diagram of for G(z) = z(z−1)(z−0.5)

.

2. Define and mark a region of acceptable pole locations or the locations ofdesirable poles for pole-placement design on the z-plane using z = esT .

• Rise time (tr) determines the natural frequency in s, i.e. ωn ≥ 1.8/tr,which maps to the angle of the pole in polar coordinates in the z-plane

θ = ωn

√1− ζ2T (55)

• The overshoot (Mp) determines the damping ratio (ζ) via the rela-

tionship Mp ≈ e−π ζ√

1−ζ2 or ζ = − ln(Mp)√(π2+(ln(Mp))2)

. The last expression

can be very crudely approximated by ζ ≈ 0.6(1−Mp).

• Settling time (ts) determine the real part of a pole in the s-plane(σ = ζωn) which maps to the radius of the pole in the z-plane

r = e−σT (56)

For example, if we require ts ≤ 5. For T = 1, this specificationis translated to σ = ζωn ≥ 4.6/ts = 0.92 in the s-plane, and r ≤e−0.92 = 0.3985 in the z-plane.

73 S. Wongsa, June 2007

Page 74: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4.2 Direct design by root locus in the z-plane 4 DIRECT DESIGN

3. Plot the root locus of the uncompensated system. If a compensator isnecessary, design and determine a value of the parameter considered (e.g.controller gain) which falls into the region of acceptable pole locations andsatisfies the specification of steady-state error.

4. Evaluate the closed-loop response with compensation in the z-domain. Ifthe desired specifications are not met, repeat the steps. You may needto select the location of the compensator pole(s) and zero(s) by trial anderror until you get the root-locus in desired location.

4.2.3 Compensator configuration

The problem of designing discrete control systems in the z-plane involves theselection of a controller configuration and the placing of their poles and zeros insuch a way that the design objectives are achieved. Keep in mind that alwayskeep the controller configuration as simple as possible.

Two extensively used compensators in control design are lead and lag com-pensators.

• Lead compensator (high pass)A lead compensator can be expressed in the form

C(z) = Kz − z0

z − zp

, zp < z0 (57)

– By placing the compensator pole to the left of the zero, the root-locuswill shift to the left, resulting in faster response time.

– A lead compensator is commonly used for improve stability margins.It, however, increases the system bandwidth which may be subjectedto high-frequency noise. Figure 45 shows how the root-locus shifts byplacing the pole and the zero.

– If it is desired to not let the lead compensator to affect the steady-state error, the gain must be K = 1−zp

1−z0.

• Lag compensator (low pass)The transfer function of a lag compensator is

C(z) = Kz − z0

z − zp

, zp > z0 (58)

74 S. Wongsa, June 2007

Page 75: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.2 Direct design by root locus in the z-plane

Figure 45: Phase-lead design. Dashed line represents the uncompensated root-locus diagram. By using the lead compensation, the root locus is shifted to theleft, resulting in faster response time.

– Unlike the lead compensator, the lag compensator pole is placed tothe right of the zero.

– The lag compensator is used to improve the steady-state accuracy byallowing a higher open-loop gain to be used, i.e. low-frequency gainis increased. Figure 46 shows that by adding zero to the root-locus,the gain at za and z̄a increases, while the desired root locations stillremain in same place.

In some applications, a phase lag compensator is cascaded with a phaselead compensator to improve both the steady-state accuracy and the systembandwidth and stability margins. This type of compensator is known as a phaselag-lead compensator. The PID controller is a special case of a phase lag-leadcompensator.

4.2.4 Root-locus design examples

Example 20: Direct design of antenna tracking system

75 S. Wongsa, June 2007

Page 76: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4.2 Direct design by root locus in the z-plane 4 DIRECT DESIGN

Figure 46: Phase-lag design. za and z̄a indicate the desired pole locations. (a)Uncompensated root-locus. (b) Root-locus after including lag compensation.

We again consider the antenna angle-tracking system in Example 18 for theslow sampling case with fs = 1 Hz. The direct design using the discrete rootlocus will be considered here.

The time-specifications required are Mp ≤ 0.16, ts(1%) ≤ 10 sec, tr ≤ 2.4sec.

First, we translate the time-domain specifications into the z-plane. Recallthat time-specifications

- Mp ≤ 0.16 implies ζ ≥ 0.5

- ts ≤ 10 implies σ ≥ 0.46/10 = 0.46 or r ≤ e−0.46 = 0.63 on the z plane.

- tr ≤ 2.4 implies ωn ≥ 1.8/2.4 = 0.75

These specifications are translated into the corresponding acceptable regionon the z-plane as shown in Figure 47.

With the sampling time of 1 sec, the plant transfer function in the z-domainis

G(z) = 0.0484z + 0.9672

(z − 1)(z − 0.9048)

We plot the root locus of the uncompensated system as shown in Figure 48to see if a gain compensator is sufficient. Obviously, the gain compensator isnot sufficient and some dynamic compensation is required.

76 S. Wongsa, June 2007

Page 77: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.2 Direct design by root locus in the z-plane

Figure 47: Acceptable region of z-plane corresponds to ζ ≥ 0.5, ωn ≥ 0.75 andσ ≥ 0.46 with T = 1 sec.

Figure 48: Root locus for compensated antenna tracking system with C(z) beinga gain compensator.

77 S. Wongsa, June 2007

Page 78: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4.2 Direct design by root locus in the z-plane 4 DIRECT DESIGN

Next, we try a lead compensator. We first cancel the plant pole at z = 0.9048and select the compensator pole well into the acceptable region, say z = 0.1.Specifically, the transfer function of the compensator is

C(z) = Kz − 0.9048

z − 0.1

The root locus for compensated antenna model is shown in Figure 49 (a).The gain of C(z) can be selected such that the root locus falls in the acceptableregion. For example, the locus shows that with K = 5 all roots are within theacceptable region. The step response of the compensated system using K = 5 isplotted in Figure 49 (b) and shows that all specifications are met. It should benoted that because the system is type 1, the steady-state error to a step inputis zero.

A Matlab program that performs the calculations in this example is givenby

78 S. Wongsa, June 2007

Page 79: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.2 Direct design by root locus in the z-plane

(a)

(b)

Figure 49: Antenna design with C(z) = K z−0.9048z−0.1

. (a) Root locus. Solid dotsindicate the roots when K = 5. (b) step response with K = 5.

79 S. Wongsa, June 2007

Page 80: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4.2 Direct design by root locus in the z-plane 4 DIRECT DESIGN

% Example of antenna tracker design

% Define the plantT=1; %T - sampling timesysd=c2d(tf(1,[10 1 0]),T); % Define G(z)

% Root locus superimposed on the acceptable regionC=tf([1 -0.9048],[1 -0.1],T);figure;rlocus(C*sysd); % Root-locus of uncompensated systemholdzeta=0.5; % Damping ratiown=0.75; % undamped natural frequencyzgrid(zeta,wn/T) % Plot lines of constant zeta and wnr063=0.63*exp([0:0.01:2*pi]*j); % a circle with radius 0.63plot(real(r063),imag(r063))

K=5 % Define Controller gainC=zpk(0.9048,0.1,K,T); % Define controller C(z)

% Plot step response of compensated systemsyscls=feedback(C*sysd,1); % syscls - closed-loop transfer functionfigure;step(syscls); % Step response of compensated system

Next, we demonstrate the design for the case when the tracking error to aramp input of slope 0.01 rad/sec less than 0.01 rad is also required. This re-quirement impose a constrain to the lead compensator, i.e. Kv must be no lessthan 1. With the current pole and zero locations of C(z), this requires K to beat least 9.45 which would violate the transient specifications as the poles wouldbe moved out of the acceptable z-plane pole locations (see Figure 49 (a)).

The only way to raise Kv and to meet the requirements for damping andsettling time is to move zero and pole to the left. A compensation that achievesthe desired result is

C(z) = 12.5z − 0.88

z + 0.5

80 S. Wongsa, June 2007

Page 81: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.2 Direct design by root locus in the z-plane

Using this lead compensator, the transient specifications are met and the gainis high enough to produce Kv = 1.0 which satisfies the steady-state specification.

Example 21: Pole-placement design

Consider the unity feedback system in Figure 38. With the transfer functionof the plant G(s) = 1

s(s+2)and sampling time T of 0.2 sec, design a digital con-

troller such the dominant closed-loop poles have a damping ratio ζ = 0.5 and asettling time of 2 sec (5% criterion).

Solution:

The settling time of 2 sec implies the undamped natural frequency ωn of 4.The locations of the desired dominant closed-loop poles in the s plane are ats = −ζωn ± jωn

√1− ζ2 = −2.0000± j3.4640.

The corresponding desired dominant closed-loop poles in the z plane are ob-tained using z = esT . With T = 0.2 sec, the corresponding dominant closed-looppoles on the z plane are z = 0.5158± j0.4281.

Next, the discrete transfer function of the plant is computed as G(z) =(1− z−1)‡{ 1

s(s+2)} = 0.01758 z+0.8760

(z−1)(z−0.6703).

The transfer function for the controller may be assumed to be

C(z) = Kz − α

z − β

The purpose here is to place the closed-loop poles at the desired pole locations.We first decide to cancel the pole at z = 0.6703 by the zero of the controller.Then the location of the controller pole can be found using the angle condition.Recall that the angle condition states that the sum of the angles at a particularpoint in the root locus must be equal to ±180◦. With the angles from the zeroz = −0.8760 and the poles z = 1 to the desired pole in the upper half of the zplane being θz = 17.10◦ and θp = 138.52◦, respectively, we have

17.10◦ − 138.52◦ − θβ = −180◦

That is, the angle from the compensator pole must be 58.58◦. Thus, the poleof the controller is determined as a point at z = 0.2543 (see Figure 51).

81 S. Wongsa, June 2007

Page 82: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4.2 Direct design by root locus in the z-plane 4 DIRECT DESIGN

(a)

(b)

Figure 50: Antenna design with C(z) = K z−0.88z+0.5

. (a) Root locus. Solid dotsindicate the roots when K = 12.5. (b) step response with K = 12.5.

82 S. Wongsa, June 2007

Page 83: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.2 Direct design by root locus in the z-plane

Figure 51: Root locus of the system considered in Example 21. Solid squaresindicate the desired poles with θz = 17.10◦, θp = 138.52◦ and θβ = 58.58◦.

83 S. Wongsa, June 2007

Page 84: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4.2 Direct design by root locus in the z-plane 4 DIRECT DESIGN

The controller gain K can be determined from the magnitude condition:|C(z)G(z)|z=0.5158+j0.4281. Hence

K|0.01758(z + 0.8760)

(z − 0.2543)(z − 1)|z=0.5158+j0.4281 = 1

which gives K = 12.67.The designed controller is

C(z) = 12.67z − 0.6703

z − 0.2543

The step response in Figure 52 shows that the designed controller results inMp ≈ 16% (i.e. ζ ≈ 0.5) and ts ≈ 2 sec which are satisfied.

Step Response

Time (sec)

Am

plitu

de

0 0.5 1 1.5 2 2.5 3 3.5 4 4.50

0.2

0.4

0.6

0.8

1

Figure 52: Step response of the system designed in Example 21.

Comments

- The design of a discrete-data system in the z-plane using a root-locusdiagram is essentially a pole-placement problem solved by trial-and-error.As the root locus method allows only one parameter to vary at a given time,therefore for systems with an order higher than third, finding appropriatevalues of the controller parameters using root-locus diagram can be verydifficult.

84 S. Wongsa, June 2007

Page 85: INC447 Digital Control Systems - KMUTTwebstaff.kmutt.ac.th/~sarawan.won/INC447/Handout2007.pdf · INC447 Digital Control Systems S. Wongsa June 2007 Department of Control Systems

4 DIRECT DESIGN 4.2 Direct design by root locus in the z-plane

- Never cancel zero(s) outside the unit circle via controller poles becausethis will lead to instability.

- The pole-zero cancellation compensation scheme does not always providea satisfactory solution. Inexact cancellation, which is almost inevitablein practice, could involve excessive complexity or result in a conditionallystable system as can be seen in Figure 53.

−1.5 −1 −0.5 0 0.5 1−1

−0.5

0

0.5

1

Root Locus

Real Axis

Imag

inar

y A

xis

Figure 53: Root-locus diagram illustrating the a conditionally stable system asa result of inexact cancellation of undesirable poles.

- It is useful to investigate the effect of the various pole-zero configurationsof the digital controller on the overall system performance and the charac-teristic equation roots. The investigation may be done by use of sisotoolof the Matlab Control System Toolbox.

85 S. Wongsa, June 2007