# Control Theory-Lab

CONTROL THEORY

Name: Dilesha Herath

ID.No. st20000297

Date: 23/04/2013

Exercise

Consider the following plant.

G( s)

(a) Determine the stability of this plant.

1 ( s 1) 2

>> numerator = [0 0 1]; denominator = [1 -2 1]; >> [z p k] = tf2zp(numerator,denominator) z = Empty matrix: 0-by-1

p = 1 1

k = 1 >> x1=1; x2=-2; x3=1; x4=0; >> alpha1=(x1/x2); y1=(x3-alpha1*x4); alpha2=(x2/y1); >> if alpha1>0 else if alpha2>0 disp('the system is stable') else disp('the system is not stable') alpha1, alpha2 end 1

ASIAN INSTITUTE OF TECHNOLOGY

CONTROL THEORY

end the system is not stable alpha1 = -0.5000

alpha2 = -2

(b) Assume that PID controller, K (s) K P K I / s K D s , is selected to compensate the requirement of system stability and zero steady state error to unit step input, use the Routh-Hurwitz test to show that a cascade of PID controller with the original plant and unity negative feedback configuration can meet the requirements. Remember that the system must be stabilized first before the consideration of steady state error.

>> Kd=1; Kp=1; Kc=1; >> alpha1=(x1/x2); y1=(x3-alpha1*x4); y2=0; alpha2=(x2/y1); z1=(x4-alpha2*y2); alpha3=y1/z1; >> if alpha1> Kd=25; Kp=25; Kc=25; >> alpha1=(x1/x2); y1=(x3-alpha1*x4); y2=0; alpha2=(x2/y1); z1=(x4-alpha2*y2); alpha3=y1/z1; >> if alpha1>numerator = [Kd Kp Ki]; denominator = [1 (Kd-2) (Kp+1) Ki]; >> t=[0:0.1:10]; y=step(numerator, denominator, t); plot(t,y)

>> roots(num) ans = -0.5000 + 0.8660i -0.5000 - 0.8660i The system is unstable. >> Kd=25; Kp=25; Kc=25; >>numerator = [Kd Kp Ki]; denominator = [1 (Kd-2) (Kp+1) Ki]; 4

ASIAN INSTITUTE OF TECHNOLOGY

CONTROL THEORY

>> t=[0:0.1:10]; y=step(numerator, denominator, t); plot(t,y)

>> roots(num) ans = -0.5000 + 0.8660i -0.5000 - 0.8660i

The system is perfect but the output is not perfect.

>> Kd=100; Kp=50; Kc=50; >>numerator = [Kd Kp Ki]; denominator = [1 (Kd-2) (Kp+1) Ki]; >>...

Please join StudyMode to read the full document