Homework 1

Page 1

EE413, Homework 1 D( s) = K p + K d s G(s) =

50 s2

Generate a PD controller for the double integrator plant: Tune the system to the time domain specifications: ts = 10 sec & Mp <= 22%. Iterate to match them as closely as possible. Solve using pole placement. Verify using step responses. What is the steady state error?

D( s) =

k p s + ki s

2 2 s+3 , G ( s) = , G ( s) = 2 s+5 s −5 s+5 Generate a PI controller for the following plants: Tune the system to the time domain specifications: ts = 10 sec & Mp <= 22%. Iterate to match them as closely as possible. Solve using pole placement. Verify using step responses. Calculate an appropriate sampling rate. What are the steady state errors of the systems?

T=

1 30 * ωn

G(s) =


D( s) = K p + K d s G(s) =

50 s2

Generate a PD controller for the double integrator plant: Tune the system to the time domain specifications: ts = 10 sec & Mp <= 22%. Iterate to match them as closely as possible. Solve using pole placement. Verify using step responses. step response, kp = 0.0086367, kd = 0.0184, z = 0.7, wn = 0.65714

System: sys1 Time (sec): 3.4 Amplitude: 1.21

1

System: sys1 Time (sec): 7.63 Amplitude: 1.01

0.5

0 0

2

4

6

8

10

12

Time (sec)

10 magnitude in dB

% hmwk1.m clear * b = 50; g1 = tf(b,[1 0 0]); z = 0.7; wn = 4.6/10/z;% wn = 0.9; kd = 2*z*wn/b; kp = wn*wn/b; d1 = tf([kd kp],[1]); sys1 = d1*g1; sys1 = sys1/(1 + sys1); figure(1) subplot(211) step(sys1,12);grid on title(['step response, kp = ',num2str(kp),... ', kd = ',num2str(kd),', z = ',num2str(z),... ', wn = ',num2str(wn)]) subplot(212) [mag,phase,w] = bode(sys1); semilogx(w,20*log10([mag(:),ones(length(w),1)*0.7])),grid on ylabel('magnitude in dB') xlabel('frequency in rad/sec')

Amplitude

1.5

0 -10 -20 -30 -1 10

0

10 frequency in rad/sec

1

10


G(s) =

2 s+5

Generate a PI controller for the plant: Tune the system to the time domain specifications: ts = 10 sec & Mp <= 22%. Iterate to match them as closely as possible. Solve using pole placement. Verify using step responses. Calculate an appropriate sampling rate. What are the steady state errors of the systems?

step response, kp =0.7, ki =1.75, z =0.7, wn =0.65714

Amplitude

1

0.5

0 0

2

4

6

8

10

12

Time (sec)

0 magnitude in dB

b = 2; a = 5; g2 = tf(b,[1 a]); kp = (2*z*wn - a)/b;kp = .7; ki = wn*wn/b;ki = 1.75; d2 = tf([kp ki],[1 0]); sys2 = d2*g2; sys2 = sys2/(1 + sys2); figure(2) subplot(211) step(sys2,12);grid on title(['step response, kp = ',num2str(kp),... ', ki = ',num2str(ki),', z = ',num2str(z),... ', wn = ',num2str(wn)]) subplot(212) [mag,phase,w] = bode(sys2); semilogx(w,20*log10([mag(:),ones(length(w),1)*0.7])),grid on ylabel('magnitude in dB') xlabel('frequency in rad/sec')

-10 -20 -30 -40 -2 10

-1

10

0

10 frequency in rad/sec

1

10

2

10


G ( s) =

2 s −5

Generate a PI controller for the plant: Tune the system to the time domain specifications: ts = 10 sec & Mp <= 22%. Iterate to match them as closely as possible. Solve using pole placement. Verify using step responses. Calculate an appropriate sampling rate. What are the steady state errors of the systems?

step response, kp =0.7, ki =1.75, z =0.7, wn =0.65714

Amplitude

1

0.5

0 0

2

4

6

8

10

12

Time (sec)

0 magnitude in dB

b = 2; a = 5; g2 = tf(b,[1 a]); kp = (2*z*wn - a)/b;kp = .7; ki = wn*wn/b;ki = 1.75; d2 = tf([kp ki],[1 0]); sys2 = d2*g2; sys2 = sys2/(1 + sys2); figure(2) subplot(211) step(sys2,12);grid on title(['step response, kp = ',num2str(kp),... ', ki = ',num2str(ki),', z = ',num2str(z),... ', wn = ',num2str(wn)]) subplot(212) [mag,phase,w] = bode(sys2); semilogx(w,20*log10([mag(:),ones(length(w),1)*0.7])),grid on ylabel('magnitude in dB') xlabel('frequency in rad/sec')

-10 -20 -30 -40 -2 10

-1

10

0

10 frequency in rad/sec

1

10

2

10


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.