Sample Code and Models
Run each of the models below and explain the code function andyour findings for each system, do they agree/disagree with what youunderstand and why ??
Matlab Code
% Winter 2018 Control Engineering
% Lab No.3 - Root Locus problems
% Mark Clarke
clear
s = tf('s')
K = 1150; %Proportional Controller Gain, May need to bealtered?
% Enter Model 1
% This is a model of a simple 2nd order withno zeros
g1 = 1/((s+2)*(s+4));
h1 = feedback(K*g1,1);
figure(1)
rlocus(g1) % Plot the root locus of system g1
figure(2)
step (h1,5)% plot the step response of system h1
% Enter Model 2
% This is a model of a simple 2nd order withone zeros
g2 = (s+3)/((s+2)*(s+4));
h2 = feedback(K*g2,1);
figure(1)
rlocus(g2) % Plot the root locus of system g2
figure(2)
step (h2,5)% plot the step response of system h2
% Enter Model 3
g3 = 1/((s*(s^2 + 15*s + 60)));
h3 = feedback(K*g3,1);
g4 = 1/((s+1)*(s^2 + 15*s + 60));
h4 = feedback(K*g4,1);
figure(1)
rlocus(g3)Â Â % run the root locus on the g3 an g4above
figure(2)
step(h3,10) % run the step response on the h3 an h4 above
PART 2 Findings and Conclusion