homework #2 solution instructor: dr. tarek a. tutunji homew… · dr. tarek tutunji page 4 1.5 4.5...

13
Control Systems HW#2 Dr. Tarek Tutunji Page 1 Control Systems Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji QUESTION 1 Consider the open-loop system: a. Design a PD controller with the specifications: a rise time < 0.3 sec, overshoot < 10% and steady state error < 2%. The controller D(s) will be implemented in the feed-forward path as shown below Type I system and therefore the ess is for ramp input, ess = 1/kv. Therefore, kv = 1/0.02 kv = 50 100 50 ) 2 ( lim ) ( ) ( lim 0 0 p p D s v s v K s s K s K s k s G s sD k The closed-loop transfer function, p D p D K s K s K s K s G s D s G s D s R s Y 10 10 2 ( 10 ) ( ) ( 1 ) ( ) ( ) ( ) ( 2 Now comparing the above equation with the standard 2 nd order systems: 2 2 2 2 n n n s s We get, (n)^2 = 10Kp n = 31.6 Checking the system’s requirements, n > 1.8 / tr. Then, tr = 1.8 / 31.6 = 0.0569 which satisfies the requirement Next, = 0.6 (1 Mp) = 0.6(1-0.1) = 0.54 Then, 2 n = 2 + 10 KD KD = 3.2 b. Verify results using MATLAB >> kd=3.2;kp=100; >> sysCL=tf([10*kd 10*kp],[1 2+10*kd 10*kp]) >> step(sysCL) 2 10 s s s G

Upload: others

Post on 04-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 1

Control Systems

Homework #2 SOLUTION

Instructor: Dr. Tarek A. Tutunji

QUESTION 1 Consider the open-loop system:

a. Design a PD controller with the specifications: a rise time < 0.3 sec, overshoot < 10% and steady state error < 2%.

The controller D(s) will be implemented in the feed-forward path as shown below

Type I system and therefore the ess is for ramp input, ess = 1/kv. Therefore, kv = 1/0.02 kv = 50

10050)2(

lim

)()(lim

0

0

ppD

sv

sv

Kss

KsKsk

sGssDk

The closed-loop transfer function,

pD

pD

KsKs

KsK

sGsD

sGsD

sR

sY

10102

(10

)()(1

)()(

)(

)(

2

Now comparing the above equation with the standard 2nd order systems: 22

2

2 nn

n

ss

We get, (n)^2 = 10Kp n = 31.6

Checking the system’s requirements, n > 1.8 / tr. Then, tr = 1.8 / 31.6 = 0.0569 which satisfies the requirement

Next, = 0.6 (1 – Mp) = 0.6(1-0.1) = 0.54

Then, 2 n = 2 + 10 KD KD = 3.2

b. Verify results using MATLAB

>> kd=3.2;kp=100;

>> sysCL=tf([10*kd 10*kp],[1 2+10*kd 10*kp])

>> step(sysCL)

2

10

sssG

Page 2: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 2

Although the rise time is within specs, the overshoot here is 26% which is above specifications.

The reason is that the equations used are approximated for standard 2nd

order systems and our system does not have the

standard numerator form.

So, let’s increase KD to 10 and try again

>> kd=10;kp=100;

>> sysCL=tf([10*kd 10*kp],[1 2+10*kd 10*kp]); step(sysCL)

Now it passes the requirements. So final design Kp = 100 and Kd = 10

Step Response

Time (sec)

Am

plit

ude

0 0.05 0.1 0.15 0.2 0.25 0.3 0.350

0.2

0.4

0.6

0.8

1

1.2

1.4

System: sysCL

Peak amplitude: 1.26

Overshoot (%): 26

At time (sec): 0.078System: sysCL

Rise Time (sec): 0.0307

Step Response

Time (sec)

Am

plit

ude

0 0.05 0.1 0.15 0.2 0.250

0.2

0.4

0.6

0.8

1

1.2

1.4

System: sysCL

Peak amplitude: 1.05

Overshoot (%): 5.39

At time (sec): 0.0558

Page 3: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 3

QUESTION 2:

Design a PI controller with the following specifications: zero steady-state error to a step input, steady-state

error due to a ramp input of less than 25% of the input magnitude, percent overshoot less than 5% to a step

input, settling time less than 1.5 seconds to a step input.

The system is shown in figure below

The open-loop system is Type I and therefore steady-state error for step input will be zero. The steady-state

error for ramp input is provided next

644

)8)(2(

1lim

425.0

0

IpD

sv

v

Ksss

KsKsk

kess

Choose KI = 64

Therefore, we have identified one of the controller’s parameters. Now, all we need is to calculate the

appropriate kp

Ip

Ip

KsKss

KsK

sR

sY

sGsD

sGsD

sR

sY

1610)(

)(

)()(1

)()(

)(

)(

23

The transient specifications are: percent overshoot less than 5% and settling time less than 1.5 seconds. For a

typical 2nd

order system,

099

1

05.0ln

)1/exp(

22

2

2

pM

Then, choose > 0.68

Page 4: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 4

5.15.4

n

st

Then, choose n > 2.04

This is a 3rd order equation. One way to simplify the problem is choosing an appropriate Kp so that the transfer function

becomes a 2nd order (i.e. cause a pole-zero cancellation). Here, we have two choices: zero at -8 or zero at -2.

p

IIp

K

KsKsK 0 . Since KI = 64, then

pKs

64

If s = -8, then Kp = 8. Therefore the open-loop transfer function becomes

)2(

8

)8)(2(

648)()(

sssss

ssGsD

The closed-loop transfer function becomes

82

8

)(

)(

2

sssR

sY

Here, we can find n = 2.8 and = 0.35 (too small). Therefore, this choice does not work

Let us try to set zero at s = -2. Then Kp = 32 and open-loop transfer function becomes

)8(

32

)8)(2(

)2(32)()(

sssss

ssGsD

The closed-loop transfer functions become

328

32

)(

)(

2

sssR

sY

n = 5.66 and = 0.70 and those values fall within the required specifications. Therefore Kp = 32

Page 5: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 5

MATLAB Result

>> sys=tf(32,[1 8 32]); step(sys)

Settling time = 1.05 seconds

Overshoot = 4.2%

Rise time = 0.38 seconds

Steady-state value (for step input) = 1

Now, to verify results using Root Locus in MATLAB

Use the open-loop transfer function

>> sys=tf(1,[1 8 0])

Transfer function:

1

---------

s^2 + 8 s

>> rlocus(sys)

>> grid

>> axis{[-8 0 -6 6])

Step Response

Time (sec)

Am

plit

ude

0 0.5 1 1.50

0.2

0.4

0.6

0.8

1

1.2

1.4

Page 6: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 6

Vary K until n = 5.66 and = 0.70. As shown in figure next, at Gain (K) = 31.5 the natural frequency is 5.61 and

damping ratio is 0.713 VOILA!

Root Locus

Real Axis

Imagin

ary

Axis

-8 -7 -6 -5 -4 -3 -2 -1-6

-4

-2

0

2

4

60.250.340.440.560.660.78

0.89

0.97

0.250.340.440.560.660.78

0.89

0.97

12345678

System: sysOL

Gain: 31.5

Pole: -4 + 3.93i

Damping: 0.713

Overshoot (%): 4.09

Frequency (rad/sec): 5.61

Page 7: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 7

QUESTION 3 Consider the open-loop system

a. Find the resonant peak, resonant frequency, and BW of the closed-loop system

>> G=tf(0.5,[1 1 1 0]); GCLoop=feedback(G,1); bode(GCLoop); grid;

From MATLAB results shown above, resonant peak = 3.84 dB at resonant frequency of 0.793 rad/sec

BW = 1.1 rad/sec (frequency when magnitude is -3dB)

b. Sketch (by hand) the Bode plot

System has poles at s = 0 and s = -0.5 +/- 0.866j. Therefore the pole frequencies are at =0 and =1

The system will have an asymptote of -20dB/decade at =0 and an asymptote at -40dB/decade at =1

(pole conjugates)

10-2

10-1

100

101

102

-270

-180

-90

0

Phase (

deg)

Bode Diagram

Frequency (rad/sec)

-150

-100

-50

0

50

System: GCLoop

Peak gain (dB): 3.84

At frequency (rad/sec): 0.793

Magnitu

de (

dB

)

Page 8: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 8

c. Plot (using MATLAB) the Bode plot

MATLAB

>> G=tf(0.5,[1 1 1 0])

Transfer function:

0.5

-------------

s^3 + s^2 + s

>> bode(G);grid

Page 9: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 9

d. Find the PM and GM

From the bode plots: Gain Margin (GM)= 6.02 dB and Phase Margin (PM) = 50.3

Bode Diagram

Frequency (rad/sec)

10-2

10-1

100

101

102

-270

-225

-180

-135

-90

Phase (

deg)

System: G

Phase Margin (deg): 50.3

Delay Margin (sec): 1.55

At frequency (rad/sec): 0.565

Closed Loop Stable? Yes

-150

-100

-50

0

50

System: G

Gain Margin (dB): 6.02

At frequency (rad/sec): 1

Closed Loop Stable? Yes

Magnitu

de (

dB

)

Page 10: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 10

QUESTION 4: Consider the plant model:

a. Sketch the root locus by hand

There are four loci because P=4

The root loci start from open-loop pole locations, which are s = 0, -1, -3, -4

Because there are no zeros, all the roots end at infinity

Angles of asymptotes are: 45, 135, 225, and 315 using the equation i = (1+2k) / (4-0)

The point of intersection of asymptotes with the real axis: x= (-1-3-4-0) / (4-0) => x = -2

To find the breakaway points we must first calculating the characteristic equations:

s4 + 8s

3 + 19s

2 + 12s + K = 0 K = -s

4 - 8s

3 - 19s

2 - 12s

dK/ds = s3 + 6s

2 + 9.5s + 3 = 0 roots are: s1 = -0.424, s2 = -2.0 and s3 = -3.576

S2 cannot exist because there are no root locus in this section as the number of poles to the right is even.

Therefore, there are two breakaway points (between 0 & -1 and -3 & -4)

The imaginary axis intersection can be found by substituting s=j in the characteristic equation and

solving for .

(j)4 + 8(j)

3 + 19(j)

2 + 12j + K = 0

4 - 8j

3 - 19

2 + 12j + K = 0

We can take the imaginary part of the equation => - 8j3 + 12j = 0 => rad/sec

After all this information, it can be sketched by hand

b. Plot the root locus using MATLAB

>> z=[]; p=[0;-1;-3;-4];

>> sys = zpk(z,p,1)

>> rlocus(sys);grid

)4)31

ssss

KsG

Page 11: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 11

c. Find the damping ratio and natural frequency of the closed-loop system when the gain, K = 2.

Using MATLAB, vary K until it reaches 2.

For the two poles closest to the imaginary axis, = 0, and n = 0.273 (dominant pole).

This gives ts = 4.6/0.273 = 16.8 sec and tr = 1.8/0.273 = 6.59 sec

For the two poles further from the imaginary axis, = 0 and n =3.73

d. For part c, calculate the transient parameters and verify results using step response

>> z=[]; p=[0;-1;-3;-4]; sys = zpk(z,p,1)

>> sysCL=feedback(2*sys,1);

>> step(sysCL)

Root Locus

Real Axis

Imagin

ary

Axis

-10 -5 0 5-8

-6

-4

-2

0

2

4

6

8

0.160.320.480.620.74

0.85

0.93

0.98

0.160.320.480.620.74

0.85

0.93

0.98

246810

Page 12: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 12

Let us see how the step response behaves:

Rise Time = 9.56 sec

Settling time = 17.56 sec

Too LARGE.

e. Design a compensator to get rise time < 2 seconds, setting time < 6 seconds and overshoot < 5%

Using SISOTOOL in MATLAB, we can find an appropriate compensator: )126.0()( 2 sssD

Zero locations at -1.92 +/- 0.38j

Let us test the results in MATLAB

>> z=[]; p=[0;-1;-3;-4]; sys = zpk(z,p,1)

>> D = tf([0.26 1 1],1)

>> rlocus(sys*D);grid

Using MATLAB, vary Gain. An appropriate result is for K = 10.

Step Response

Time (sec)

Am

plit

ude

0 5 10 15 20 250

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Page 13: Homework #2 SOLUTION Instructor: Dr. Tarek A. Tutunji Homew… · Dr. Tarek Tutunji Page 4 1.5 4.5 n ts Then, choose n > 2.04 This is a 3rd order equation. One way to simplify the

Control Systems HW#2 Dr. Tarek Tutunji Page 13

f. Verify results using step response

>> sysCMP=series(sys,10*D);sysCL=feedback(sysCMP,1);step(sysCL)

Rise time = 2.09; Settling time = 5.68; Overshoot = 3.18%

Ok, almost! The rise time is a bit higher than specs. But, it is getting late and I have other stuff to do!

Root Locus

Real Axis

Imagin

ary

Axis

-4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0-10

-8

-6

-4

-2

0

2

4

6

8

100.0350.070.1150.160.230.32

0.48

0.75

0.0350.070.1150.160.230.32

0.48

0.75

2

4

6

8

10

2

4

6

8

10

System: sysCMP

Gain: 10

Pole: -0.717 + 0.612i

Damping: 0.761

Overshoot (%): 2.51

Frequency (rad/sec): 0.943

Step Response

Time (sec)

Am

plit

ude

0 1 2 3 4 5 6 7 80

0.2

0.4

0.6

0.8

1

1.2

1.4