Sei sulla pagina 1di 15

1

CODE:
num = [1 1] ;
den = poly([0 -2 -3 -4]) ;
G = tf(num,den);
rlocus(G)

System is marginally stable for k = 141 As the value of roots is purely imaginary
at that point.

LCS LAB 08 Ali IJAZ 15-EE-144


2

CODE:
numg = [1 1];
deng = poly([0 -2 -3 -4] );
G = tf(numg,deng) ;
H = 1 ;
T = feedback (G,H);
rlocus(T)

The value of gain for which the closed-loop transfer function will have a pole on
the real axis at -0.5 is 12.4.

LCS LAB 08 Ali IJAZ 15-EE-144


3

Part a
CODE:
numg = poly([-10 -20]);
deng = poly([10.0000+10.0000i 10.0000-10.0000i -30]);
G = tf(numg,deng);
H= 1; figure ; rlocus(G)
figure ; T = feedback(G,H) ; rlocus(T)

The system is stable for k>23.9.

LCS LAB 08 Ali IJAZ 15-EE-144


4

Part b
For the same code used in part a just locate zeta = 0.707.

K=80.9 yields a damping ratio of 0.707.

LCS LAB 08 Ali IJAZ 15-EE-144


5

Part c

Same code, locate zeta =1.

Assume critical damping is where poles are just real and zeta=1, at that point
gain is 14100.

LCS LAB 08 Ali IJAZ 15-EE-144


6

CODE:
J = 3.2284e-6;
b = 3.5077e-6;
K = 0.0274;
R = 4;
L = 2.75e-6;
s = tf('s') ;
G = K/(s*((J*s+b)*(L*s+R)+K^2));
subplot(211)
step(G)
title('Before feedback')
T = feedback(G,1)
subplot(212)
step(T)
title('After feedback')
damp(T)

LCS LAB 08 Ali IJAZ 15-EE-144


7

Before feedback system was unstable. Unity feedback was attached and closed
loop step response was observed. Now system is stable.
Requirement of overshoot time is fulfilled, for settling time poles of closed loop
transfer function are observed using damp command. Result of command
window is on next page.

LCS LAB 08 Ali IJAZ 15-EE-144


8

This pole is so much faster that its effect on


response is minimum as compared to the
other 2 poles.

Therefore, the damping (z= 0.643) and the natural frequency (wn = 46.1) of the
complex conjugate poles will affect the response of the closed-loop system.

Let’s a design a PID Controller to meet the requirements given in question.


Step 1: PROPORTIONAL CONTROL:
First use proportional controller with different values of kp.
CODE:
%PID DESIGN (Cont. with the previous code)
Kp = 1 ;
for i = 1:3
C(:,:,i) = pid(Kp);
Kp = Kp + 10;
end
SYS = feedback(C*G,1);
figure
step(SYS(:,:,1), SYS(:,:,2), SYS(:,:,3))
legend('Kp = 1', 'Kp = 11', 'Kp = 21')

LCS LAB 08 Ali IJAZ 15-EE-144


9

Now consider the system response to a step disturbance.


CODE:
%Response with Disturbance (Cont. with the previous code)
dist = feedback(G,C);
figure
step(dist(:,:,1), dist(:,:,2), dist(:,:,3))
legend('Kp = 1', 'Kp = 11','Kp = 21')

The
larger the value of Kp the smaller the steady-state error is due to the disturbance, but
it never reaches zero. Adding an integral term will eliminate the steady state error.

Step 2: PI CONTROL:
Set Kp = 21 and test for different ranges of Ki.

CODE:
%Step response (Cont. with the previous code)
Ki = 100;
for i = 1:5
C(:,:,i) = pid(21,Ki);
Ki = Ki + 200;
end
cl = feedback(C*G,1);
t = 0:0.001:0.4;
step(cl(:,:,1), cl(:,:,2), cl(:,:,3), t)
title('step response’)
legend('Ki = 100', 'Ki = 300', 'Ki = 500')

LCS LAB 08 Ali IJAZ 15-EE-144


10

Now check for step disturbance:


dist = feedback(G,C);
figure
step(dist(:,:,1), dist(:,:,2), dist(:,:,3), t)
legend('Ki = 100', 'Ki = 300', 'Ki = 500')

With the use of integrator steady state error to step disturbance is reduced to 0.
the larger the value of Ki_is employed, the faster the error decays to zero. Let ki = 500.

LCS LAB 08 Ali IJAZ 15-EE-144


11

Step 3: PID CONTROL:


Kd ranging from 0.05 to 0.25.

Response to step disturbance is


Amplitude

With Kp = 21

Ki=500
Kd = 0.15
We get

LCS LAB 08 Ali IJAZ 15-EE-144


12

RiseTime: 0.0046

SettlingTime: 0.0338

SettlingMin: 0.9103

SettlingMax: 1.1212 Design requirements are fulfilled.


Overshoot: 12.1175

Undershoot: 0

Peak: 1.1212

PeakTime: 0.0122

Model Reduction:
neglect the pole at -1.45e6 because this pole is very fast and and its effect on
response is minimum as described earlier.
CODE:
%Reduction
poles = pole(G);
Greduced = minreal(G*(s/max(abs(poles)) + 1))
pole(Greduced)

Root Locus of reduced model is

LCS LAB 08 Ali IJAZ 15-EE-144


13

The root locus of actual transfer function is

Use an integrator in the reduced model and the root locus of reduced model is now:
C = 1/s;
rlocus(Greduced*C)
Imaginary Axis (seconds -1)

LCS LAB 08 Ali IJAZ 15-EE-144


14

LCS LAB 08 Ali IJAZ 15-EE-144


15

CODE:

LCS LAB 08 Ali IJAZ 15-EE-144

Potrebbero piacerti anche