413Presentation2

Page 1

Prob. 3.6 The read arm on a computer disk drive has the transfer function

G(s) =

1000 s2

Design a digital controller that has a bandwidth of 100 Hz and a phase margin of 50. Use a sample rate of 6 kHz.

Method 1: Simplest approach is single lead with 10:1 lead ratio (b/a = 10) for PM = 50. For wbw = 2*pi*100, pick a = wbw/sqrt(10) & b = wbw*sqrt(10). Then adjust k so that crossover is at max. phase. ďƒ k = 1300. Bode Diagram Bode Diagram Gm = 0 dB (at 31.6 rad/sec) , Pm = 0 deg (at 31.6 Gm rad/sec) = Inf dB (at Inf rad/sec) , Pm = 54.9 deg (at 650 rad/sec) 20 100

50 Magnitude (dB)

Magnitude (dB)

10

0

-10

-20 -179

0

-50

-100 -120

Phase (deg)

Phase (deg)

-179.5 -180 -180.5 -181

-150

-180 1

2

10

5

10 Frequency (rad/sec)

10

EECE 413, Fall, 2006

Frequency (rad/sec)

% Prob_3_6.m % G = tf(1000,[1 0 0]); w = 2*pi*100; a = w/sqrt(10); b = w*sqrt(10); k = 1300; D = tf(k*[1 a],[1 b]); figure(1) subplot(2,2,[1 3]) margin(G),grid on subplot(2,2,[2 4]) margin(G),grid on,hold on margin(D*G),grid on,hold off figure(2) sysCL = feedback(D*G,1); margin(sysCL),grid 1 on

D( s) = k

s+a s+b


Prob. 3.6 - cont Phase decrease due to sampling is (p. 63, eqn. 3.10)

δφ = −

ωT =− 2

( 650 * 57.3) 

1    6000 

2

= −3.1

Digital PM = 54.7 – 3.1 = 51.6 degrees

Starting with

D( s) =

U (s) s+a = Ko ⇒ ( s + b )U ( s ) = K o ( s + a ) E ( s ) ⇒ u + bu = K o ( e + ae ) E ( s) s+b

Plug in an approximation for each derivative Or change k->k+1 & k-1->k to solve for u(k+1)

u (k ) − u (k − 1)  e( k ) − e(k − 1)  + bu (k ) = K o  + ae( k )  T T  

 1   Ko   1 + aT  u ( k + 1) =  u ( k ) − e ( k ) + 1 + bT   K o 1 + bT  e( k + 1) 1 + bT   

Or from eq. 3.7, the equation is: u ( k + 1) = [1 − bT ]u ( k ) − [ K o ( aT − 1) ] e(k ) + [ K o ] e(k + 1) [1-bT] = [1 – 1987/6000] = 0.6688 a*T-1 = 198.7/6000 – 1 = -0.9667 k*(a*T-1) = -1257

2 EECE 413, Fall, 2006


Prob. 3.6 - cont Bandwidth check: wbw ~ 1050 Hz = 167 rad/s @ -3dB, which is high.

Bode Diagram Gm = Inf dB (at Inf rad/sec) , Pm = 109 deg (at 737 rad/sec) 20

Magnitude (dB)

0 System: sysCL Frequency (rad/sec): 1.05e+003 Magnitude (dB): -2.98

-20 -40 -60 -80 0

Phase (deg)

-45 -90 -135 -180 1

10

2

10

3

10

4

10

5

10

Frequency (rad/sec)

% Prob_3_6.m % G = tf(1000,[1 0 0]); w = 2*pi*100; a = w/sqrt(10); b = w*sqrt(10); k = 1300; D = tf(k*[1 a],[1 b]); figure(1) subplot(2,2,[1 3]) margin(G),grid on subplot(2,2,[2 4]) margin(G),grid on,hold on margin(D*G),grid on,hold off figure(2) sysCL = feedback(D*G,1); % [mag,phase,w] = bode(sysCL); % loglog(w,mag(:)),grid on margin(sysCL),grid on 3

EECE 413, Fall, 2006


Prob. 3.6 - cont Note, if bandwidth is important should lower crossover frequency by factor of 1/1.67, ie., a2 = a/1.67 ~ 125 & b2 = b/1.67 = 1250. May find k=500 by iteration to get wbw ~ 630 rad/s. Bode Diagram Gm = Inf dB (at Inf rad/sec) , Pm = 54.9 deg (at 399 rad/sec) 150

Magnitude (dB)

100 50 0 -50

Phase (deg)

-100 -120

-150

-180 0

10

1

10

2

10

3

10

4

10

5

10

Frequency (rad/sec)

% Prob_3_6.m % G = tf(1000,[1 0 0]); w = 2*pi*100; a = w/sqrt(10); b = w*sqrt(10); k = 1300; D = tf(k*[1 a],[1 b]); figure(1) figure(3) margin(D*G),grid on,hold on a = 125; b = 1250; k = 500; D = tf(k*[1 a],[1 b]); margin(D*G),grid on,hold off 4

EECE 413, Fall, 2006


Prob 3.6 – Optimization Method function cf = optim_3_6(xin); % Prob_3_6 optimization % G = tf(1000,[1 0 0]); k = xin(1); a = xin(2); b = xin(3); D = tf(k*[1 a],[1 b]); [Gm,Pm,Wcg,Wcp] = margin(D*G); [mag,phase,w] = bode(D*G); i = find(mag >= 0.7); [y,i] = min(mag(i)); wbw = 2*pi*100; Pm = Pm - w(i)/6000/2; cf = abs(Pm - 50) + abs(wbw - w(i))/2; [xin, cf] save 3_6_param xin

PM = 50 check: PM ~ 50.1 – 3 ~ 47 Is a little low. Bode Diagram Gm = Inf dB (at Inf rad/sec) , Pm = 50.1 deg (at 481 rad/sec) 100

Magnitude (dB)

50

0

-50

Phase (deg)

-100 -120

-150

-180 1

10

2

3

10

k,a,b = [803.20696

4

10 222.20451

10

5

10

1776.6704], frequency (rad/sec)

D(s) = k

s+a s+b

EECE 413, Fall, 2006

Key points are that: 1) must start at good initialization  other methods may be used for initialization, 2) needs to restart occasionally to avoid local minimums or getting stuck, 3) won’t converge for wrong structure.

Lead gains 5


Prob 3.6 – Optimization Method - cont % Prob_3_6_main_optim.m % if 0 clear * w = 2*pi*100; a = w/sqrt(10); b = w*sqrt(10); k = 1300; xin = [k,a,b]; load 3_6_param xin = fminsearch('optim_3_6',xin); end if 1 clear * load 3_6_param k = xin(1); a = xin(2); b = xin(3); D = tf(k*[1 a],[1 b]); G = tf(1000,[1 0 0]); figure(1) margin(G),grid on,hold on margin(D*G),grid on,hold off xlabel(['freq rad/s, k,a,b = ',num2str(xin)])

Bandwidth check: 783 > 630, ďƒ a bit high Although, fminsearch based optimization is very fast, sometimes a number of revisits are necessary while adjusting cost function weights. Bode Diagram Gm = Inf dB (at Inf rad/sec) , Pm = 102 deg (at 580 rad/sec) 20

Magnitude (dB)

0 System: sysCL Frequency (rad/sec): 783 Magnitude (dB): -3.02

-20 -40 -60 -80 0

Phase (deg)

-45 -90 -135 -180 1

10

2

10

10

3

4

10

5

10

Frequency (rad/sec)

figure(2) sysCL = feedback(D*G,1); % [mag,phase,w] = bode(sysCL); % loglog(w,mag(:)),grid on margin(sysCL),grid on end

6

EECE 413, Fall, 2006


Problem 3.7 - cont Design feedback with lead compensation for the open-loop system: G ( s) = 12

D(s) k ( s + a) s+b

R(t)

s

G(s) 1 s2

D(s) found by trial & error.

The rise time should be <= 1 sec & the overshoot should be <= 15% @ 5 Hz sampling rate. Do continuous 1st, then discrete. Find difference equations. PM frequency near peak of phase plot. Bode Diagram Gm = Inf dB (at Inf rad/sec) , Pm = 75.2 deg (at 2.54 rad/sec) 150

Magnitude (dB)

100 50 0 -50

Phase (deg)

-100 -90

-120

-150

-180 -2

10

-1

10

0

10

10

1

2

10

3

10

Frequency (rad/sec)

% Prob_3_7.m % G = tf(1,[1 0 0]); a = 0.5; b = 40; k = 100; D = tf(k*[1 a],[1 b]); figure(1) margin(G),grid on,hold on margin(D*G),grid on,hold off figure(2) sysCL = feedback(D*G,1); step(sysCL,5),grid on xlabel(['time in, k,a,b = ',‌ num2str([k,a,b]),' time in'])

7 EECE 413, Fall, 2006


Problem 3.7 - cont All the specifications are met in continuous time: the rise time is <= 1 sec & the overshoot is <= 15%. Next step is sample at 5 Hz. Design now using zero order hold approximation:

Gh( s ) =

1.4

G(s) = 1.2

Amplitude

System: sysCL Time (sec): 1.52 Amplitude: 1.12

0.6

0.4

0

System: sysCL Time (sec): 0.0644 Amplitude: 0.102

0

0.5

1

1.5

2

time in, k,a,b = 100

2.5 0.5

2/T 10 = = s + 2 / T s + 2 / 1 s + 10 5

10 1 10 = s + 10 s 2 ( s + 10 ) s 2

0.8

0.2

1 5

With new plant model repeat design

Step Response

System: sysCL Time (sec): 0.642 1 Amplitude: 0.901

2/

3

3.5

4

4.5

5

40 time in (sec)

8 EECE 413, Fall, 2006


Problem 3.7 - cont % Prob_3_7.m % G = tf(1,[1 0 0]); a = 0.5; b = 40; k = 100; D = tf(k*[1 a],[1 b]); figure(1) margin(G),grid on,hold on margin(D*G),grid on,hold off

New plant model

G(s) =

10 1 10 = s + 10 s 2 ( s + 10 ) s 2

Slightly > 15% overshoot Step Response 1.4 System: sysCL Time (sec): 1.32 Amplitude: 1.16

1.2 System: sysCL Time (sec): 0.602 1 Amplitude: 0.903

Amplitude

figure(2) sysCL = feedback(D*G,1); step(sysCL,5),grid on xlabel(['time in, k,a,b = ',‌ num2str([k,a,b]),' time in']) G = tf(10,[1 10 0 0]); figure(3) sysCL = feedback(D*G,1); step(sysCL,5),grid on

Design now using zero order hold approximation:

0.8

0.6

0.4 System: sysCL Time (sec): 0.128 Amplitude: 0.103

0.2

0

0

0.5

EECE 413, Fall, 2006

1

1.5

2

9 2.5 Time (sec)

3

3.5

4

4.5

5


Prob 3.7 - cont Overshoot now less than 15%. Gains found by trial & error.

Step Response 1.4 System: sysCL Time (sec): 1.05 Amplitude: 1.14

1.2

% Prob_3_7.m G = tf(10,[1 10 0 0]); a = 0.5; b = 80; k = 250; D = tf(k*[1 a],[1 b]); figure(1) sysCL = feedback(D*G,1); step(sysCL,5),grid on

Amplitude

System: sysCL Time (sec): 0.502 1 Amplitude: 0.904

0.8

0.6

0.4 System: sysCL Time (sec): 0.105 Amplitude: 0.103

0.2

0

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

Time (sec)

10 EECE 413, Fall, 2006


Prob. 3.7 – lead compensator approach The rise time should be <= 1 sec & the overshoot should be <= 15% @ 5 Hz sampling rate. Do continuous 1st, then discrete. Find difference equations. 1 G ( s) = 2 s Determine parameters to satisfy requirements. τs + 1 Step 1: Find new open-loop crossover frequency from D ( s ) = K ,α < 1 desired ωn=ωmax, the point the phase lead is added. ατs + 1 Step 2: Evaluate the PM of KG(ω) at the desired cross over frequency ωn. Step 3: Allow for some extra PM (5 to 12 degrees), and determine the needed phase lead φmax 1 − sin φmax 1 Step 4: Compute α= ,τ =

1 + sin φmax

ωmax α

Step 5: Verify the design using matlab. Redo if needed.

Here parameters K, φmax and ωmax are to be determined from design specifications. tr ≅

x

1 .8 1.8 1.8 → ωn = ≥ ≥ 1.8 ≈ ωmax ωn tr 1

ζ = 0 .5 PM = 50

ζ ≥ 0.5 → PM = 100ζ

11 EECE 413, Fall, 2006


Prob. 3.7 – lead compensator approach - cont Bode Diagram Gm = 0 dB (at 1 rad/sec) , Pm = 0 deg (at 1 rad/sec) 40

From the margin plot φmax = PMdes + allowance – PM = 50+5-0 = 55

Magnitude (dB)

20

1 − sin φmax 1 α= ,τ = 1 + sin φmax ωmax α

0

-20

-40 -179

π 180 = 0.0994 α= π 1 + sin 55 180 1 1 τ= = = 1.762 ωmax α 1.8 0.0994 1 − sin 55

D( s) = K

-180

τs + 1 ,α < 1 ατs + 1

-180.5 -181 0

1

10

10

Bode Diagram Gm = Inf dB (at Inf rad/sec) , Pm = 55 deg (at 1.77 rad/sec)

Frequency (rad/sec)

G = tf(1,[1 0 0]); figure(1) margin(G),grid on,hold on figure(2) margin(G),grid on,hold on alph = 0.0994; tau = 1.762; k = 1; D = tf(k*[tau 1],[alph*tau 1]); margin(D*G),grid on,hold on

150 100 Magnitude (dB)

-1

10

50 0 -50 -100 -120

Phase (deg)

Phase (deg)

-179.5

-150

-180 -2

10

EECE 413, Fall, 2006

-1

10

1210

0

Frequency (rad/sec)

1

10

2

10


Prob. 3.7 – lead compensator approach - cont The rise time should be <= 1 sec & the overshoot should be <= 15% @ 5 Hz sampling rate. Overshoot is exceeded. Step Response

System: sysCL Time (sec): 1.74 Amplitude: 1.23

1.4

1.2

Amplitude

1

System: sysCL Time (sec): 0.799 Amplitude: 0.897

0.8

0.6

0.4 System: sysCL Time (sec): 0.163 Amplitude: 0.106

0.2

0

0

1

2

3 k,alph,tau = 1

4

5 0.0994

6

7

8

9

10

1.7621 time in (sec)

13 EECE 413, Fall, 2006


Prob. 3.7 – lead compensator approach - cont The rise time should be <= 1 sec & the overshoot should be <= 15% @ 5 Hz sampling rate. Overshoot is exceeded. This time see the effects of sampling at 5 Hz (~ 32%). For solution must iterate on lead parameters. Remember that overshoot related to damping coefficient  can increase damping coefficient to reduce overshoot.

System: sysCL Time (sec): 1.62 Amplitude: 1.32

1.4

1.2

Step Response

System: sysCL Time (sec): 1.72 Amplitude: 1.23

1

Amplitude

G = tf(1,[1 0 0]); figure(1) margin(G),grid on,hold on figure(2) margin(G),grid on,hold on alph = 0.0994; w = 1.8; tau = 1/sqrt(alph)/w; k = 1; D = tf(k*[tau 1],[alph*tau 1]); margin(D*G),grid on,hold on k = 1; D = tf(k*[tau 1],[alph*tau 1]); margin(D*G),grid on,hold off figure(3) sysCL = feedback(D*G,1); step(sysCL,10),grid on,hold on xlabel(['k,alph,tau = ',… num2str([k,alph,tau]),' time in']) G = tf(10,[1 10 0 0]); sysCL = feedback(D*G,1); step(sysCL,10),grid on,hold off

0.8

0.6

0.4

0.2

0

0

1

2

3 k,alph,tau = 1

4

5 0.0994

6

7

8

9

10

1.7621 time in (sec)

G(s) =

10 1 10 = 2 ( s + 10) s 2 s + 10 s

Digital plant approximation. Since is linear may be applied to lead or plant.

14 EECE 413, Fall, 2006


Prob. 3.7 – lead compensator approach - cont The rise time should be <= 1 sec & the overshoot should be <= 15% @ 5 Hz sampling rate. Specs are now met at 5 Hz.

5 Hz sampling rate Step Response 1.4 System: sysCL Time (sec): 1.29 Amplitude: 1.14

1.2

System: sysCL Time (sec): 1.72 Amplitude: 1.12

1

Amplitude

figure(4) alph = (1-sin(75*pi/180))/(1+sin(75*pi/180)); w = 3; tau = 1/sqrt(alph)/w; k = 1; D = tf(k*[tau 1],[alph*tau 1]); G = tf(1,[1 0 0]); sysCL = feedback(D*G,1); step(sysCL,10),grid on,hold on xlabel(['k,alph,tau = ',‌ num2str([k,alph,tau]),' time in']) G = tf(10,[1 10 0 0]); sysCL = feedback(D*G,1); step(sysCL,10),grid on,hold off

0.8

0.6

continuous

0.4

0.2

0

0

1

2

3 k,alph,tau = 1

4

5

0.017332

6

7

8

9

10

2.5319 time in (sec)

15 EECE 413, Fall, 2006


Approximate Analysis of Sampling Effect Example 3.2: Check using sample rates of 20 Hz & 40 Hz. sys1 = tf(70*[1 2],[1 10]); sysCL = feedback(sys1,1); damp(sysCL) T = 1/20; sys2 = tf(2/T,[1 2/T])*sys1; sysCL = feedback(sys2,1); damp(sysCL)

G ( s) =

1 s+2 , D( s ) = 70 s( s + 1) s + 10

‘damp’ generates eigenvalues & damping coefficients. PM ~ 100*ζ, therefore the PM may be estimated from ‘damp’. Also, ζ is related to overshoot as discussed before. We may determine how close digital performance is to continuous.

outputs Eigenvalue

Damping

-2.11e+000

1.00e+000

Eigenvalue

Damping

-2.11e+000

1.00e+000

Freq. (rad/s) 2.11e+000

Freq. (rad/s) 2.11e+000

EECE 413, Fall, 2006

16


Controller Tuning Guides 100

Relation of overshoot to ζ.

M p ≈ e −πζ

1−ζ

2

,0 ≤ ζ < 1

90 80 70

4.6 ζω n

60 Mp, %

Relation of settling time to ζ & ωn.

ts ≅

40

1.8 tr ≅ ωn

Relation of rise time to ωn.

50

30 20 10 0

Relation of phase margin to ζ.

ζ =

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

PM → PM = 100ζ 100

Use the above relationships to adjust the parameters below. If bandwidth is off, adjust ωmax or ωbw accordingly below. If settling time or rise time excessive increase ωmax or ωbw or PM. Note, that PM may be increased by changing from 10 to a larger number below.

α=

1 − sin φmax 1 ,τ = 1 + sin φmax ωmax α

a=

Adjust k so that ωmax is at crossover D( s) = K

ωbw , b = ωbw 10 10

Adjust k so that ωbw is at crossover.

τs + 1 ,α < 1 ατs + 1

D( s) = k

EECE 413, Fall, 2006

s+a s 17 +b

1


Another max phase lead method Governing equations Lead compensation is used to: 1. Increase gain 2. Increase phase margin 3. Increase bandwidth

φmax = 90 − 2 tan −1

s+a s+b

Example: Design lead to produce PM = 45 & tr < 1 sec G = zpk([],[0 -2 -6],24); margin(G)

Get lead ratio from governing equation.

a → b

G(s) =

24 s ( s + 2)( s + 6)

Bode Diagram Gm = 12 dB (at 3.46 rad/sec) , Pm = 38.1 deg (at 1.54 rad/sec) 100

tr ≅

1. 8 ωn

50 Magnitude (dB)

a 90 − φmax tan = → b 2 a 90 − φmax = tan 2 b 2 −1

D( s) = k

ωmax = ab

Lead exists when a < b.

φmax = 90 − 2 tan −1

Lead compensator

a b

0 -50 -100 -150 -90

a 90 − φmax 90 − 12 = tan 2 = tan 2 = tan 2 39 = 0.6558 b 2 2

-135 Phase (deg)

Note: PM = 38 < 45 + 5 & wn = 1.54 < 1.8*1; Must increase PM & wn  φmax = 50 – 38 = 12

-180 -225 -270 10

-2

EECE 413, Fall, 2006

-1

10

10

0

18

1

10

Frequency (rad/sec)

2

10

3

10


Lead example - cont ωmax = ab =

a 2 b b

ω max = 2 =

Since wn > 1.8 to meet tr, try wmax = 2. a = 0.6558 b

2 = 1.746, a = 0.6558 *1.746 = 1.145 0.6558

Bode Diagram Gm = 15.2 dB (at 4.04 rad/sec) , Pm = 56.6 deg (at 1.3 rad/sec)

G = zpk([],[0 -2 -6],24); a = 1.145; b = 1.746; k = 1; D = tf([1 a],[1 b]); figure(2) margin(G),hold on margin(D),hold on margin(D*G),hold off

100

Magnitude (dB)

50 0 -50 -100 -150 90

PM OK, but tr/bandwidth too low, so increase k.

0 Phase (deg)

φmax = 12

b=

a 2 b = 0.6558b 2 b

-90 -180 -270 -2

10

-1

10

EECE 413, Fall, 2006

0

10

19 10 1

Frequency (rad/sec)

2

10

3

10


Lead example - cont Rise time check: increase gain makes tr very close & it may be close enough. k = 1.2; D1 = tf(k*[1 a],[1 b]); step(feedback(D*G,1)),hold on step(feedback(D1*G,1)),hold off

Step Response 1.4

k = 1.2

k=1

1.2

Amplitude

System: untitled2 Time (sec): 1.15 1 Amplitude: 0.906 System: untitled1 Time (sec): 1.32 Amplitude: 0.907

0.8

0.6

0.4 System: untitled2 Time (sec): 0.353 Amplitude: 0.106

0.2

0

0

1

2

3

4 Time (sec)

EECE 413, Fall, 2006

5

20

6

7


PID Control Discretization discrete

continuous u (t ) = Ke(t ) K t u (t ) = ∫ e(η )dη Ti 0 u (t ) = KTd e (t )

u (k ) = Ke( k ) K u (k ) = u ( k − 1) + Te( k ) Ti u (k ) =

KTd [ e(k ) − e(k − 1)] T

Proportional Integral derivative

Combined transfer function D( s) =

  u( s) 1 = K 1 + + Td s  e( s )  Ti s 

  1 u = K  e + e + Td e   Ti 

Using Euler’s method we have:

 T Td   Td  Td    u (k ) = u (k − 1) + K 1 + + e(k ) − 1 + 2 e(k − 1) + e(k − 2) T  T   Ti T  

21 EECE 413, Fall, 2006


Chapter 3 Summary Digitization permits designer to convert continuous equations to a programmable form. x (k ) ≅

x(k + 1) − x(k ) T

Euler approximation for derivative

If sampling rate => 30xbandwidth the digital system approximates continuous. Therefore, continuous analyses will be applicable. If sampling rate [10 – 30]xbandwidth the digital system deviates from continuous. Therefore, approximations are needed in this bandwidth. A 1 st order analysis may be used by introducing a delay of T/2 into the system. The zero-pole linear transfer function Gh(s) is an approximation of a T/2 delay. The effects of sampling rate may be more accurately analyzed in the frequency response where the phase may be decreased by the equation.

D( s) =

  u (s) 1 = K 1 + + Td s  e( s )  Ti s 

Gh( s ) =

δφ = −

2/T s + 2/T

ωT 2

A continuous PID transfer function

 T T  T  u (k ) = u (k − 1) + K 1 + + d e(k ) − 1 + 2 d T   Ti T 

 Td  e ( k − 1 ) + e ( k − 2 )   T  

A digital PID transfer function implementation

For digital control systems with sampling rates < 30xbandwidth the design is often carried out in the discrete domain, eliminating approximation errors.

22 EECE 413, Fall, 2006


Discrete Stability Discrete stability requires that the closed-loop system characteristic equation roots be in the unit circle, i.e.., they be < 1.

Examples: check for stability u(k) = 0.9u(k-1) – 0.2u(k-2) is the characteristic equation, let u(k) = z k zk = 0.9zk-1 – 0.2zk-2 then multiply by z-k 1 = 0.9z-1 – 0.2z-2 then multiply by z2 z2 = 0.9z – 0.2  z2 – 0.9z + 0.2 = 0 is the characteristic equation. roots([1 -0.9 0.2])  ans = [ 0.5000 0.4000]  stable u(k) = 0.5u(k-1) – 0.3u(k-2) is the characteristic equation, let u(k) = z k zk = 0.5zk-1 – 0.3zk-2 then multiply by z-k 1 = 0.5z-1 – 0.3z-2 then multiply by z2 z2 = 0.5z – 0.3  z2 – 0.5z + 0.3 = 0 is the characteristic equation. roots([1 -0.5 0.3])  ans = [ 0.2500 + 0.4873i, 0.2500 - 0.4873i] abs(roots([1 -0.5 0.3]))  ans = [ 0.5477 0.5477]  stable u(k) = 1.6u(k-1) – u(k-2) is the characteristic equation, let u(k) = z k zk = 1.6zk-1 – zk-2 then multiply by z-k 1 = 1.6z-1 – z-2 then multiply by z2 z2 = 1.6z – 1  z2 – 1.6z + 1 = 0 is the characteristic equation. roots([1 -1.6 1])  ans = [ 0.8000 + 0.6000i, 0.8000 - 0.6000i] abs(roots([1 -1.6 1]))  ans = [ 1.0000 1.0000]  unstable u(k) = 0.8u(k-1) + 0.4u(k-2) is the characteristic equation, let u(k) = z k zk = 0.8zk-1 + 0.4zk-2 then multiply by z-k 1 = 0.8z-1 + 0.4z-2 then multiply by z2 z2 = 0.8z + 0.4  z2 – 0.8z - 0.4 = 0 is the characteristic equation. roots([1 -0.8 -0.4])  ans = [1.1483 -0.3483]]  unstable

EECE 413, Fall, 2006

23


Discrete Stability Discrete stability requires that the closed-loop system characteristic equation roots be in the unit circle, i.e.., they be < 1.

Problem 4.8 Use matlab to determine how many roots of the following are outside the unit circle. (a) z2 + 0.25 = 0 (b) z3 – 1.1z2 + 0.01z + 0.405 = 0 (c) z3 – 3.6z2 + 4z – 1.6 = 0 (a) pa = [1 0 0.25];abs(roots(pa)) ans = [0.5000 0.5000] All roots are inside the unit circle (b) pb = [1 -1.1 .01 .405];abs(roots(pb)) ans = [0.9 0.9 0.5] All roots are inside the unit circle (c) pc = [1 -3.6 4 -1.6];abs(roots(pc)) ans = [2 0.8944 0.8944] One root is outside the unit circle

24 EECE 413, Fall, 2006


Discrete Example 4.6 Show that the characteristic equation z 2 – 2r cos(θ)z + r2 has the roots z1,2 = rexp(+_jθ) Roots = [2r cos(θ) +- sqrt[(2r cos(θ))* (2r cos(θ)) – 4r2]]/2] = r cos(θ) +- r sqrt(cos2(θ) – 1) = r cos(θ) +- r sqrt(sin2(θ)) = r cos(θ) +- jr sin(θ) = r (cos(θ) +- j sin(θ)) = rexp(+_jθ)

Block Diagrams

H1(z)

Parallel blocks

H(z) = H1(z) + H2(z) H2(z)

Series blocks

H1(z)

H2(z)

H1(z)

Feedback Transfer Function

H(z) = H1(z) * H2(z)

H(z) = H1(z) / [1 - H1(z) H2(z)]

H2(z) H1(z)

H2(z)

H(z) = H1(z)H2(z) / [1 - H1(z) H2(z)]

25 EECE 413, Fall, 2006


Block Diagrams Recurrence or difference equation: uk = -a1uk-1 – a2uk-2 - … - anuk-n + b0ek + b1ek-1 + … bmek-m Taking the z-transform we have: U ( z) =

∑u z

k = −∞

−k

k

b0 + b1 z −1 +  + bm z − m H ( z) = 1 + a1 z −1 + a2 z − 2 +  an z − n

T 1 + z −1 U ( z) = E ( z) 2 1 − z −1 U ( z) T 1 + z −1 T z + 1 = H ( z) = = E( z) 2 1 − z −1 2 z − 1

If n>m we can write:

b0 z n + b1 z n −1 +  + bm z n − m b( z ) H ( z) = n = z + a1 z n −1 + a2 z n − 2 +  an a( z ) Trapezoidal rule block diagram

Trapezoidal rule uk = uk −1 +

T ( ek + ek −1 ) 2

ek

Z-1

ek-1

uk

T/2

26 EECE 413, Fall, 2006

uk-1

Z-1


Canonical Forms & Block Diagrams Control canonical form U ( z) = H ( z)E ( z) =

ξ=

In the 3rd order case below u, e, & ζ are time variables and z is an advance operator.

b( z ) E ( z ) = b( z )ξ , a( z )

(

)

e = z 3 + a1 z 2 + a2 z + a3 ξ ,

E ( z) , a ( z )ξ = E ( z ) a( z )

z 3ξ = e − a1 z 2ξ − a2 zξ − a3ξ ,

ξ ( k + 3) = e(k ) − a1ξ ( k + 2) − a2ξ ( k + 1) − a3ξ (k )

z 3ξ = ξ ( k + 3) ξ ( k + 3)

ξ ( k + 2)

Z-1

Z-1

ξ ( k + 1)

Delay operators

ξ(k)

Z-1

Step 1: create state variables from above equation(s) See figure 4.8 b & c, p. 86, for completion. In these figures the internal variables are x1, x2, & x3. These variables comprise the state of the system. Note that they are related: x 3(k+1) = x2(k), etc. The sum at the far left of the figure is:

x1 (k + 1) = −a1 x1 (k ) − a2 x2 (k ) − a3 x3 (k ) + e(k ) x1 (k + 1) = −a1 x1 (k ) − a2 x2 (k ) − a3 x3 (k ) + e(k ) x2 (k + 1) = x1 (k ) x3 (k + 1) = x2 (k )

EECE 413, Fall, 2006

27


Vector Matrix Notation for Control Canonical Form Vector-Matrix form

State equations x1 (k + 1) = − a1 x1 (k ) − a2 x2 (k ) − a3 x3 (k ) + e(k ) x2 (k + 1) = x1 (k )

x(k + 1) = Ac x(k ) + Bc e(k )

where  x1  − a1 x =  x2 , Ac =  1  x3   0

x3 (k + 1) = x2 (k )

The output equation is:

− a2 0 1

− a3  1 0 , Bc = 0 0 0 

Vector-Matrix form

u = (b1 − a1b0 ) x1 + (b2 − a2b0 ) x2 + (b3 − a3b0 ) x3 + b0 e

u = Cc x + Dc e

where

Cc = [ b1 − a1b0

b2 − a2b0

b3 − a3b0 ],

Dc = b0

Observer canonical form z 3u + a1 z 2u + a2 zu + a3u = b0 z 3e + b1 z 2 e + b2 ze + b3e Note that e(k) is the external input and u(k) is the output. We rewrite the above as

b3e − a3u = z 3u + a1 z 2u + a2 zu + a3u − b0 z 3e − b1 z 2 e − b2 ze

This is used to build the block diagrams of figure 4.9 on p. 88.

28 EECE 413, Fall, 2006


Observer Canonical Form Constructing the Vector-Matrix form we have:

x(k + 1) = Ao x(k ) + Bo e(k ) u (k ) = Co x(k ) + Do e(k )  − a1 1 0 Ao = − a2 0 1  − a3 0 0  b1 − b0 a1  Bo = b2 − b0 a2  b3 − b0 a3  Co = [1 0 0] Do = [ b0 ]

e(k)

z +1 z2 − z

Control & observer canonical forms are ‘direct’ canonical forms because the gains of the realizations are coefficients in the block diagrams.

A very useful form is the cascade canonical form which is constructed by placing multiple 1 st or 2nd order transfer functions in series. See the following example.

z 3 + 0.5 z 2 − 0.25 z + 0.25 ( z + 1) ( z 2 − 0.5 z + 0.25) H ( z) = 4 = 2 3 2 z − 2.6 z + 2.4 z − 0.8 z ( z − z )( z 2 − 1.6 z + 0.8)

z 2 − 0.5 z + 0.25 z 2 − 1.6 z + 0.81

u(k)

29 EECE 413, Fall, 2006


Discrete Models of Sampled Data Systems u(kT)

D/A

G(s)

y(t)

A/D

The unit impulse response of a plant is:

y(kT)

(1 − e ) G(ss) −Ts

(

)

G ( s)    G ( s)   −Ts G ( s )  G ( z ) = Z  1 − e −Ts = Z − Z    e  s s s      

Taking the z-transform we have:

Since the exponential term is exactly the delay of one period we have:

(

)

(

)

 G( s)   G ( s)  −1 G ( z ) = 1 − e −Ts Z   = 1− z Z    s   s 

Which is the unit impulse transfer function of a ZOH.

The D/A converter shown above is called a zero-order hold (ZOH). It accepts a sample at t = kT & holds its output constant at this value until the next sample is sent at t = kT + T. The output of the D/A is applied to the plant.

30 EECE 413, Fall, 2006


ZOH examples What is the discrete transfer function of G(s) = a/(s+a) preceded by a ZOH?

(

)

 G ( s)  G ( z ) = 1 − z −1 Z    s 

G (s) a 1 1 = = − s s( s + a ) s s + a

z z z (1 − e − aT )  G ( s)  Z − = = − aT ( z − 1) ( z − e −aT )  s  z −1 z − e

Using table look-ups we have:

(

G( z) = 1 − z

−1

)

(

)

(

)

( ) (

z 1 − e − aT z − 1 z 1 − e − aT 1 − e − aT = = ( z − 1) z − e −aT z ( z − 1) z − e − aT z − e − aT

(

)

(

) )

What is the discrete transfer function of G(s) = 1/s/s preceded by a ZOH?  G ( s)  G(s) 1 G ( z ) = (1 − z −1 ) Z   = 3  s  s s Using table look-ups we have:

(

G( z) = 1 − z

−1

)

2  G ( s )  T z ( z + 1) Z = 3  s  2 ( z − 1)

2 2  G ( s )  z − 1 T z ( z + 1) T ( z + 1) Z = = 3 s z 2 2 ( z − 1) 2 ( ) z − 1  

31 EECE 413, Fall, 2006


ZOH examples What is the discrete transfer function of G(s) = 1/s/s preceded by a ZOH, using the sample period T = 1? G(s) 1 = 3  G ( s)  −1 G ( z ) = (1 − z ) Z   s s s 

T = 1; numC = 1; denC = [1 0 0]; sysc = tf(numC,denC); sysd = c2d(sysc,T); [numd,dend,T] = tfdata(sysd);

numd = [0 0.5 0.5], dend = [1 -2 1] G(z) = 0.5 z + 0.5 ---------------z^2 - 2 z + 1

G ( z ) = 0. 5

z +1 ( z − 1) 2

What is the discrete transfer function of G(s) = 1/s/s preceded by a ZOH, using the sample period T = 1?

(

G( z) = 1 − z

−1

)

 G ( s)  Z   s 

G (s) = e

λ = lT-mT and l, m are integers. z − 1  G (s)  G ( z ) = l +1 Z   z  s 

If

a H (s) = s+a

− λs

mTs G ( s ) e − ( lT −mT ) s H ( s ) H ( s) − lTs e H ( s ), = =e s s s

z − 1  e mTs e mTs  z − 1 1 G ( z ) = l +1 Z  − = z s s + a z zl  

32 EECE 413, Fall, 2006

 z ze − amT  −   z − 1 z − e − amT  


ZOH Examples z − 1  e mTs e mTs  z − 1 1 G ( z ) = l +1 Z  − = z s + a z zl  s

[

 z ze − amT  −  − amT  z − 1 z − e  

]

z − 1  z z − e − aT − ( z − 1) e − amT  G( z) = l   ( z − 1) z − e −aT z  

(

)

(

) z ( zz −+ eα )

G ( z ) = 1 − e − amT

Zero position

l

− aT

e − amT − e − aT α= 1 − e − amT

For a = 1, T = 1, & λ = 1.5, we have: l = 2 & m = 0.5 &

G( z) =

z + 0.6025 z 2 ( z − 0.3679 )

Matlab code that generates the transfer functions: Td = 1.5; a = 1; T = 1; Sysc = tf(a,[1 a],’td’,Td); Sysd = c2d(Sysc,T);

G(s) = 1 exp(-1.5*s) * ----s+1

G(z) = 0.3935 z + 0.2387 z^(-1) * ----------------------z^2 - 0.3679 z

33 EECE 413, Fall, 2006


ZOH Examples – 4.9 h Compute using matlab the discrete transfer function for the sampling period T = [0.05,0.5], if the G(s) is:

K 3 3 ( s + 1) e sT / 2 (1 − s ) 3e −1.5Ts , , , , 2 , 2 , s s ( s + 3) ( s + 1)( s + 3) s 2 s s ( s + 1)( s + 3)

D/A

y(t)

G(s) Pole-Zero Map

Impulse Response

1

y(kT)

A/D

(

Step Response

0.06

16

Pole-Zero Map 14 0.05 0.6

0.04 10

0 -0.2

Amplitude

0.2 0.03

8

6 0.02

-0.4 4

0.5

0.8

0.45

0.6

0.4

0.4

0.35

0.2

0.3

Step Response 15

10

0 -0.2

Amplitude

T = 0.5  G(z) = 0.5K -------z-1

Imaginary Axis

12 0.4

Amplitude

T = 0.05  G(z) = 0.05K -------z-1

Imaginary Axis

K s

Impulse Response

1

Amplitude

0.8

)

 G ( s)  G ( z ) = 1 − z −1 Z    s 

0.25 0.2

5

-0.6 0.01

-0.4 2

-0.8

0

1

0

0

5

Real Axis

10

15

0

0

Time (sec)

5

10

15

-0.6

0.1

-0.8

0.05

Time (sec)

-1 -1 Pole-Zero Map

Impulse Response

1

Step Response

0.06

0.8

0.4 0.04

10

0.2

0

0.03

5

10

0

15

0

5

10

15

Time (sec)

0.02

Pole-Zero Map

Impulse Response

1

Step Response

0.7

15

0.8 0.6 0.6 0.5

0.4

10 Imaginary Axis

-0.2

0

Time (sec)

Amplitude

Amplitude

Imaginary Axis

s ( s + 3)

0.6

0

1

T = 0.5  G(z) = 0.241 z + 0.1474 -----------------------z^2 - 1.223 z + 0.2231

0.05

T = 0.05  G(z) = 0.003569 z + 0.003395 -----------------------------z^2 - 1.861 z + 0.8607 3

0 Real Axis

15

5

-0.4

0.2 Amplitude

-1 -1

0.15

0 -0.2

0.4

Amplitude

u(kT)

0.3

5 -0.4

-0.6 0.01

0.2

-0.6

-0.8

0.1 -0.8

-1 -1

0 Real Axis

1

0

0

5

10

Time (sec)

15

0

0

5

10

15

-1 -1

Time (sec)

0 Real Axis

34 EECE 413, Fall, 2006

1

0

0

5

10

Time (sec)

15

0

0

5

10

Time (sec)

15


ZOH Examples – 4.9 h Pole-Zero Map

Impulse Response

1

Step Response

0.03

1

Pole-Zero Map

Impulse Response

1 0.025

1

0.7

0.8

T = 0.5  G(z) = 0.2018 z + 0.1039 ------------------------------z^2 - 0.8297 z + 0.1353

0.02 0.2

0.6

-0.2

0.015

0.5

Imaginary Axis

0

0.4

0.01 -0.4

0.3

-0.6

0.2 0.1

-1 -1

0

0

1

0

Real Axis

5

10

0

15

0.8 0.25

0.4 0.2 0 -0.2

0.5 0.4 0.3 0.2

0.05 0

5

10

15

-0.8

0.1

Time (sec)

Impulse Response

0

0

1

0

5

Real Axis

Step Response

0.8

0.8

0.15

0.1

-1 -1 1

0.6

-0.6

Time (sec)

Pole-Zero Map

0.7

0.2

-0.4

0.005 -0.8

0.9 0.3

0.6

Amplitude

0.8

0.4

Amplitude

s

0.6

Amplitude

Imaginary Axis

T = 0.05  G(z) = 0.00351 z + 0.003284 -----------------------------( s + 1) z^2 - 1.812 z + 0.8187 2

Step Response

0.35

0.9

Amplitude

0.8

10

0

15

0

Time (sec)

5

10

15

Time (sec)

140

0.7

Pole-Zero Map

120

Impulse Response

1

Step Response

8

140

0.6 0.6

60

0.3

-0.4

( s + 1)( s + 3)

T = 0.5  G(z) = 0.625 z - 0.375 ---------------------z^2 - 2 z + 1

80

40 0.2

-0.6 -0.8

0.1

20

0

0

100

0.4 5

0.2 0 -0.2

80

Amplitude

0.4

Amplitude

-0.2

120

6

Imaginary Axis

0

Amplitude

0.2

7

0.6

0.5 Amplitude

Imaginary Axis

T = 0.05  G(z) = 0.05125 z - 0.04875 --------------------------3 z^2 - 2 z + 1

0.8

100

0.4

4

60

3

-0.4

40 2

-0.6 -1 -1

0

1

0

Real Axis

5

10

15

0

5

Time (sec)

10

15

20

1

-0.8

Time (sec)

-1 -1

0

0

1

0

5

Real Axis

Impulse Response

Pole-Zero Map

120

0.7

0.8

Imaginary Axis

Amplitude

60

0.3 40

120

100 6 80 5 Amplitude

80 0.5 Amplitude

Imaginary Axis

s2

0 -0.2

4

60

3 40

-0.4 -0.4

0.2

2

-0.6 -0.6

20

20

0.1

-0.8

1

-0.8 -1 -1

15

7

T = 0.5  G(z) = 0.125 z + 0.1250.6 ----------------------0.4 z^2 - 2 z + 1 0.2

0.6

-0.2

10

Step Response

8

100 0.6

0.4

5

Time (sec)

Impulse Response

1

T = 0.05  G(z) = 0.00125 z + 0.001250.4 --------------------------- 0.2 sT / 2 0 z^2 - 2 z + 1 e

0

Step Response

0.8

0.8

0

15

Amplitude

Pole-Zero Map 1

10

Time (sec)

0 Real Axis

1

0

0

5

10

Time (sec)

15

0

0

5

10

15

Time (sec)

35

-1 -1

0

Real Axis

EECE 413, Fall, 2006

1

0

0

5

10

Time (sec)

15

0

0

5

10

Time (sec)

15


ZOH Examples – 4.9 h Pole-Zero Map

Impulse Response

Step Response

0.7

0.8

100

Pole-Zero Map

Impulse Response

1 0.8

80

80

0.5

0.6

0.4

5

-0.2

Amplitude

0

0.3

40

0.2 20

-0.4

0.4 60 4

0.2 Amplitude

T = 0.5  G(z) = 0.2018 z + 0.1039 ------------------------z^2 - 2 z + 1

0.4

0.2

Imaginary Axis

60

Amplitude

Imaginary Axis

s

0 -0.2

2

1

0

-0.6 0

0

2

-0.1

0

5

Real Axis

10

-20

15

0

-0.8 0

5

Time (sec)

10

15

-1 -2

Time (sec)

0

2

-1

0

Real Axis

Impulse Response

10

-20

15

10

15

Step Response

0.35

1

0.8

0.9 0.3

0.9 0.6

0.025 0.6

0.8

0.8

0.25

0.4

0.7

0.7 Imaginary Axis

T = 0.5  G(z) = 0.2018 z + 0.1039 0 ------ ----------------------0.2 z^2 - 0.8297 z + 0.1353 -0.4

0.6 Amplitude

T = 0.05  G(z) = 0.00351 z + 0.003284 0 -----------------------------0.2 3e −1.5Ts z^2 - 1.812 z + 0.8187-0.4

Amplitude

0.2 0.015

0.2

0.5 0.4

0.01

0.6

0.2

Amplitude

0.02

Amplitude

0.4

Imaginary Axis

5

Time (sec)

1

0.8

0.15

0.5 0.4 0.3

0.1

0.3 -0.6

-0.6

0.2 0.05

0.2 0.005

-0.8

-0.8 -1 -1

0

Impulse Response

1

Step Response

0.03

5

Time (sec)

Pole-Zero Map Pole-Zero Map 1

( s + 1)( s + 3)

40

-0.4 0

-0.8

3

20

0.1 -0.6

-1 -2

100

6

0.6

T = 0.05  G(z) = -0.04875 z + 0.05125 ---------------------------(1 − s ) z^2 - 2 z + 1 2

Step Response

7

0.6

Amplitude

1

0.1

0.1 0 0 Real Axis

1

-1 -1

0 0

5

10

Time (sec)

15

0

5

10

0 Real Axis

15

Time (sec)

36 EECE 413, Fall, 2006

0 1

0 0

5

10

Time (sec)

15

0

5

10

Time (sec)

15


% Prob_4_9h.m % clear * i = 14; if i == 1,num = 1;den = [1 0];T = 0.05;end if i == 2,num = 1;den = [1 0];T = 0.5;end if i == 3,num = 3;den = [1 3 0];T = 0.05;end if i == 4,num = 3;den = [1 3 0];T = 0.5;end if i == 5,num = 3;den = [1 4 3];T = 0.05;end if i == 6,num = 3;den = [1 4 3];T = 0.5;end if i == 7,num = [1 1];den = [1 0 0];T = 0.05;end if i == 8,num = [1 1];den = [1 0 0];T = 0.5;end if i == 9,num = 1;den = [1 0 0];T = 0.05; sys = tf(num,den,'InputDelay',T/2); sysd = c2d(sys,T);end if i == 10,num = 1;den = [1 0 0];T = 0.5; sys = tf(num,den,'InputDelay',T/2); sysd = c2d(sys,T);end if i == 11,num = [-1 1];den = [1 0 0];T = 0.05;end if i == 12,num = [-1 1];den = [1 0 0];T = 0.5;end if i == 13,num = 3;den = [1 4 3];T = 0.05; sys = tf(num,den,'InputDelay',1.5*T); sysd = c2d(sys,T);end if i == 14,num = 3;den = [1 4 3];T = 0.5; sys = tf(num,den,'InputDelay',1.5*T); sysd = c2d(sys,T);end if i~=(9|10|13|14),[numd,dend] = tfc2tfd(num,den,T); sysd = tf(numd,dend,T),end figure(1) subplot(131) pzmap(sysd) subplot(132) impulse(sysd,'*:',0:T:15) subplot(133) step(sysd,'*:',0:T:15)

ZOH Examples – 4.9 h Matlab code: Note that 9, 10, 13, & 14 handle transport delays in addition to the sampling intervals. All the rest deal only with sampling intervals. eig(sys) may be used to calculate the system poles.

EECE 413, Fall, 2006

37


Discrete Models of State Space Systems x = Fx + Gu + G1w

x(k + 1) = Φx(k ) + Γu (k ) + Γ1w(k ) y = Hx(k )

y = Hx + Ju u(kT)

D/A

F,G,H 2

2

y(t) 3

A/D

y(kT) Z-transform gives us (with w = 0):

3

F T FT + +  = FTΨ 2! 3! T ∞ F kT k Fη Γ = ∫ e dηG =∑ TG = ΨTG k = 0 ( k + 1)! 0 Φ = e FT = I + FT +

Ψ≈I+

FT 2

 FT  FT  FT    I +   I +       3 N − 1 N     

Example Φ & Γ calculation. Φ = FTΨ Γ = ΨTG Ψ≈I+

FT 2

 FT I +  3 

 FT  FT     I +    N − 1 N    

Sysc = ss(F,G,H,J); Sysd = c2d(Sysc,T); [phi,gam,h,J] = ssdata(Sysd);

zI − Φ X ( z ) = ΓU ( z ), Y ( z ) = HX ( z ); Y ( z) −1 = H [ zI − Φ ] Γ U ( z) 0 1  0  F = , G =  1, H = [1 0] 0 0     1 0 0 1 T 1 T  FT F 2T 2 Ψ=I+ + + =  2  + 0 0  2 =  0 1 2! 3!       0 1  1 0 0 1 1 T  1 T  Φ = I + FTΨ =  2 =   + 0 0T   0 1     0 1  0 1   T  0  T 2  1 Γ = ΨTG =  2 T   =  2  0 1  1   T     

38 EECE 413, Fall, 2006


Algorithm for State Space Discretization Initialize → Ψ = I , for _ k = 1 : 11 FT Ψ=I+ Ψ, k end →

Sysc = ss(F,G,H,J); Sysd = c2d(Sysc,T); [phi,gam,h,J] = ssdata(Sysd);

Φ = I + FTΨ Γ = ΨTG

System poles & zeros

System poles may be obtained from lam = eig(phi). System zeros (transmission zeros) may be computed by zer = tzeros(sysD).

Nonlinear Models Most systems are nonlinear. To use the linear techniques one must linearize the models by partial differentiation as shown below. For a system described below we have:

x = f ( x, u ), y = h( x, u )

F = f , x ( x0 , u0 ) , G = f ,u ( x0 , u0 ) , H = h, x ( x0 , u0 ) , J = h,u ( x0 , u0 ) , where x = Fx + Gu , y = Hx + Ju then x(k + 1) = Φx(k ) + Γu (k ), y (k ) = Hx(k ) + Ju (k )

∂f ∂f , f ,u = , ∂x ∂u ∂h ∂h h, x = , h,u = ∂x ∂u f ,x =

39 EECE 413, Fall, 2006


Dynamic Response Pole-Zero Map

0.6

1.6

9

0.4

1.4

8 7 Amplitude

1.2 1 0.8 0.6

6

0.4

3

0.2

2

0

1

0.8

0.4

0.7

0.2

0.6

0 -0.2

0.3 0.2

-0.8

0.1

0

5

Real Axis

1

10

0

5

Time (sec)

-1 -1

10

0.4

2

Time (sec)

Pole-Zero Map

Impulse Response 1

0.8

0.8

0.6

0.6

0.4

0.4

0

1

Step Response

0

5

1

10

0

Time (sec)

5

10

Time (sec)

Impulse Response

1

1

0.8

0.9

0.6

0.8

0.4

0.7

0.2

0.6

Step Response

4.5

0.5

0 -0.2

3.5 Amplitude

0 -0.2

Imaginary Axis

0

Amplitude

Amplitude

Imaginary Axis

0.2

Amplitude

4

-0.2

0.5 0.4

-0.4

-0.6

-0.6

-0.4

0.3

-0.6

0.2

-0.8

0.1

3

2.5

0 -0.4

2 -0.5 -0.8 -1 -1

-0.8

0 Real Axis

1

0 -0.2

-1

0

5

10

Time (sec)

15

-1

0

5

10

Time (sec)

15

-1 -1

0 Real Axis

1

0

1.5

0

5

10

Time (sec)

15

1

0

5

10

Time (sec)

-1 -1

0 Real Axis

5

1.5

1

1.4

0.6

1.3

0.4

1.2

0.2

1.1

0

1

-0.2

0.9

-0.8

Pole-Zero Map

2

0.8

-0.6

z ( z − r cos θ ) , r = 0.8,θ = 0 2 2 z − 2r ( cosθ ) z + r

z ( z − r cos θ ) , r = 0.98,θ = 45 z − 2r ( cosθ ) z + r 2

0.2

0.2

-0.4 1.5

Real Axis

2

1

0

1.5

0.6

2.5

0.4

-0.6

Step Response

1

0.8 3

0.5

-0.4

Impulse Response

4

-0.8

0

0.6

5

-0.6

-1 -1

0.9

Pole-Zero Map 1

Amplitude

10

-0.4

0.8

Step Response 3.5

Imaginary Axis

11

0

1

Amplitude

2 1.8

-0.2

Impulse Response

1

Amplitude

1 0.8

0.2

z ( z − r cosθ ) , r = 0.7,θ = 45 2 z − 2r ( cosθ ) z + r 2

Step Response

Imaginary Axis

Impulse Response

Amplitude

Imaginary Axis

Pole-Zero Map

z z − 0.7

Amplitude

z z −1

15

-0.4

0.8 0

5

10

Time (sec)

15

0

5

10

15

Time (sec)

T = 0.5; for i = 1:5 if i==1,sysd = tf([1 0],[1 -1],T);end if i==2,sysd = tf([1 0],[1 -0.7],T);end if i==3, r=0.7;th=pi/180*45; sysd=tf([1 -r*cos(th) 0],[1 -2*r*cos(th) r*r],T); end if i==4, r=0.98;th=pi/180*45; sysd=tf([1 -r*cos(th) 0],[1 -2*r*cos(th) r*r],T); end if i==5, r=0.8;th=pi/180*0; sysd=tf([1 -r*cos(th) 0],[1 -2*r*cos(th) r*r],T); end figure(i) subplot(131) pzmap(sysd) subplot(132) impulse(sysd,'*:',0:T:15) subplot(133) step(sysd,'*:',0:T:15) end

40

EECE 413, Fall, 2006

1


Dynamic Response Pole-Zero Map Step Response 1

0.8

0.8

0.9

0.8

0.8

0.6

0.8

0.4

0.7

Step Response

0.5

-0.2

0.4

-0.4

0.3

0.2 0 -0.2

0.2 0

-0.4

-0.6

-0.6

-0.8

0.2

0 Real Axis

1

0

5

10

Time (sec)

15

0.1

0.7

0.6

0.5

0

5

10

Time (sec)

15

-1 -1

0.2 0 -0.2

1

-0.8

Real Axis

0.7

0.6

0

-0.4

0.5

-0.6

0.4

0

5

10

15

0

Time (sec)

5

10

Time (sec)

15

-1 -1

0 Real Axis

if i==6, r=0.8;th=pi/180*180; sysd=tf([1 -r*cos(th) 0],[1 -2*r*cos(th) r*r],T); end if i==7, r=0.8;th=pi/180*90; sysd=tf([1 -r*cos(th) 0],[1 -2*r*cos(th) r*r],T); end if i==8, r=0.8;th=pi/180*135; sysd=tf([1 -r*cos(th) 0],[1 -2*r*cos(th) r*r],T); end

41 EECE 413, Fall, 2006

0.4

-0.4

-0.8 0

0.2

-0.2

-0.6

-0.8 -0.8

0.8 0.4

-0.4

-0.6

0.9

0.6

-0.2

-0.4

0.8

0.4

Amplitude

0.6

1

0.6 0.8

Amplitude

0

Imaginary Axis

Amplitude

Amplitude

-0.2

0.2

Step Response

1

0.8

0.4

0.2

Impulse Response

1

0.6

0.4

0

Pole-Zero Map

1

0.9

0.4

Imaginary Axis

1

0.6

0.6

-1 -1

Impulse Response

1

Amplitude

Impulse Response 1

2

Imaginary Axis

Pole-Zero Map 1

z ( z − r cosθ ) , r = 0.8,θ = 135 2 z − 2r ( cos θ ) z + r

z ( z − r cosθ ) , r = 0.8,θ = 90 2 z − 2r ( cosθ ) z + r 2

Amplitude

z ( z − r cos θ ) , r = 0.8,θ = 180 2 z − 2r ( cos θ ) z + r 2

1

-0.6

0

5

10

Time (sec)

15

0

5

10

Time (sec)

15


Timez-plane Domain Link

s-plane

z = re jθ , where

s = −ζω n + jωn 1 − ζ 2

r = e −ζω nT = e − aT ,

s = − a + jb

θ = ωnT 1 − ζ 2 = bT

Θ - Normalized signal frequency in radians/second 1 0.6π/T

0.9 0.8

0.5π/T

0.10.3 /T π

0.7π/T

0.2 0.3 0.8π/T

0.2π/T

0.4

0.5

0.5

0.4 0.3

ζ

0.4π/T

0.7 0.6

axis([-1 1 0 1]),zgrid('new')

0.6 0.7 0.9π/T

0.1π/T

0.8

0.2

0.9

0.1 0 -1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

42 EECE 413, Fall, 2006


Prob 4.19 For a 2nd order system with damping ratio 0.5 and poles at an angle in the z-plane of 30 degrees, what % overshoot to a step would you expect if the system had a zero at z2 = 0.6? jθ z 2 = r cos θ = 0.6

z = re , where

r = e −ζω nT = e − aT ,

0.6 cos θ r = e −ζωnT = e − aT , r=

θ = ωnT 1 − ζ 2

θ = ωnT 1 − ζ 2 = bT

43 EECE 413, Fall, 2006


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.