Objectives:
1. To create mathematical model with Root-locus in MATLAB.
2. To analyze of Bode plot using MATLAB.
Example-1. Consider an open loop system which has a transfer function of
Design a feed-back controller for the system by using the root locus method. Design criteria are 5%
overshoot and 1 second rise time.
num = [1 7];
den = [1 40 475 1500 0];
sys = tf(num,den);
rlocus(sys)
axis([-22 3 -15 15])
Now %os = 5% = 0.05
1 sec
So, damping ratio,
And, natural frequency
zeta=0.7;
Wn=1.8;
sgrid(zeta, Wn)
[k, poles] = rlocfind(sys)
Select a point in the graphics window
selected_point = -3.1315 + 3.0650i
k = 669.7617
poles = 4×1 complex
-23.1558 + 0.0000i
-10.6533 + 0.0000i
-3.0955 + 3.0698i
-3.0955 - 3.0698i
sys_cl = feedback(k*sys, 1)
sys_cl =
669.8 s + 4688
--------------------------------------
s^4 + 40 s^3 + 475 s^2 + 2170 s + 4688
Continuous-time transfer function.
Model Properties
step(sys_cl)
info = stepinfo(sys_cl);
disp(info);
RiseTime: 0.4549
TransientTime: 1.3687
SettlingTime: 1.3687
SettlingMin: 0.9081
SettlingMax: 1.0507
Overshoot: 5.0666
Undershoot: 0
Peak: 1.0507
PeakTime: 0.9856
A Real-time Example: Cruise Control Problem Using Root Locus Method
The open-loop transfer function for this problem is
where ,
m=1000
b=50
U(s)=10
Y(s)=velocity output
The design criteria are:
Rise time < 5 sec
Overshoot < 10%
Steady state error < 2%
m=1000;
b=50;
u=10;
num=[1];
den=[m b];
cruise=tf(num,den);
rlocus(cruise)
axis([-0.6 0 -0.6 0.6]);
Now %os = 10% = 0.1
5 sec
So, damping ratio ,
And, natural frequency
zeta=0.6;
Wn=0.36;
sgrid(zeta, Wn)
[Kp, poles]=rlocfind(cruise)
Select a point in the graphics window
selected_point = -0.4017 + 0.0037i
Kp = 351.6784
poles = -0.4017
sys_cl=feedback(Kp*cruise,1);
t=0:0.1:20;
step(u*sys_cl,t)
axis ([0 20 0 10])
info = stepinfo(sys_cl);
disp(info);
RiseTime: 5.4696
TransientTime: 9.7393
SettlingTime: 9.7393
SettlingMin: 0.7919
SettlingMax: 0.8749
Overshoot: 0
Undershoot: 0
Peak: 0.8749
PeakTime: 18.2291
Here the rise time and the overshoot criteria have been met for a optimum value of Kp ; but, a steady-state
error of more than 10% remains. For that lag controller is needed. The transfer function for lag controller is
Open loop transfer function:
Closed loop transfer function:
Zo=0.3;
Po=0.03;
contr=tf([1 Zo],[1 Po]);
rlocus(contr*cruise);
axis([-0.6 0 -0.4 0.4])
sgrid(0.6,0.36);
[Kp, poles]=rlocfind(contr*cruise);
Select a point in the graphics window
selected_point = -0.4002 - 0.0000i
sys_cl=feedback(Kp*contr*cruise,1);
t=0:0.1:20;
step(u*sys_cl,t)
axis ([0 20 0 12])
info = stepinfo(sys_cl);
disp(info);
RiseTime: 1.2364
TransientTime: 8.2988
SettlingTime: 8.2988
SettlingMin: 0.8988
SettlingMax: 1.0842
Overshoot: 8.8356
Undershoot: 0
Peak: 1.0842
PeakTime: 3.3117
Now, all the design criteria are met.
Home Task - 1:
The dynamic equations and the open-loop transfer function of the DC Motor are:
Where,
moment of inertia of the rotor
damping ratio of the mechanical system (b) =
electromotive force constant (K=Ke=Kt) = (0.01 + 0.210826sssss) Nm/amp
electric resistance (R) = 1 ohm
electric inductance (L) = (0.5 + 2108026) H
input (V): Source Voltage
output (theta): position of shaft
The rotor and shaft are assumed to be rigid
With a 1 rad/sec step input, the design criteria are:
Settling time < 2 seconds
Overshoot < 5%
Steady-stage error < 1%
Design controller satisfying all design requirements using the Root-locus method.
J = (0.01 + 2108026)*power(10,-6);
b = (0.1 + 2108026)*power(10,-6);
K = (0.01 + 0.2108026);
R = 1;
L = (0.5 + 2108026);
u = 1;
num = K;
den = [(J*L) ((J*R) + (L*b)) ((b*R) + K^2)];
motor = tf(num, den)
motor =
0.2208
---------------------------------
4.444e06 s^2 + 4.444e06 s + 2.157
Continuous-time transfer function.
Model Properties
rlocus(motor)
axis([-15 0 -10 10]);
Now %os = 5% = 0.05
2 sec
So, damping ratio ,
And, natural frequency
zeta = 0.69;
wn = 2.857;
sgrid(zeta,wn)
[Kp, poles]=rlocfind(motor);
Select a point in the graphics window
selected_point = -0.5154 + 0.3096i
motor_cl=feedback(Kp*motor,1);
t=0:0.1:20;
step(u*motor_cl,t);
axis ([0 20 0 1.5]);
info = stepinfo(motor_cl);
disp(info);
RiseTime: 4.5379
TransientTime: 7.1310
SettlingTime: 7.1310
SettlingMin: 0.9012
SettlingMax: 1.0062
Overshoot: 0.6241
Undershoot: 0
Peak: 1.0062
PeakTime: 10.1314
Here the rise time and the overshoot criteria have been met for a optimum value of Kp ; but, a steady-state
error of more than 1% remains, lets use a PID controller and set Ki = 100 , Kd = 100 for lessening ss error
Ki = 100;
Kd = 50;
contr = tf([Kd Kp Ki],[1 0]);
rlocus(contr*motor);
axis([-0.6 0 -0.4 0.4])
sgrid(0.6,0.36);
[Kp, poles]=rlocfind(contr*motor);
Select a point in the graphics window
selected_point = -0.0334 + 0.0099i
sys_cl = feedback(contr*motor,1);
t = 0:0.01:10;
step(sys_cl,t)
info = stepinfo(sys_cl);
disp(info);
RiseTime: 4.5376
TransientTime: 7.1297
SettlingTime: 7.1297
SettlingMin: 0.9012
SettlingMax: 1.0063
Overshoot: 0.6281
Undershoot: 0
Peak: 1.0063
PeakTime: 10.1315
Now, all the design criteria are met.