Professional Documents
Culture Documents
Spring – 2022
Homework:
Table-1: Effects of each of controllers Kp, Kd, and Ki on a closed-loop system
RISE TIME OVERSHOOT SETTLING TIME SETTLING TIME
Kp Decrease Increase Small Change Decrease
Ki Decrease Increase Increase Eliminate
Kd Small Change Decrease Decrease Small Change
To verify the table, we will use a simple mass, spring, and damper problem (shown in Fig-1)
1
which transfer function, T.F.=
𝑀𝑆 2 +𝑏𝑆+𝑘
num = 1;
M = 1; b = 10; k = 20;
den = [M b k];
[numC denC] = cloop(num,den);
figure(1)
step(numC,denC);
title('response of the system in the closed
loop')
Kp = 300;
den = [M b k];
num = Kp;
[numC denC] = cloop(num,den);
figure(2)
step(numC,denC);
title('response with a differential term')
num = 1;
M = 1; b = 10; k = 20;
den = [M b k];
[numC denC] = cloop(num,den);
figure(1)
step(numC,denC);
title('response of the system in the closed
loop')
Ki = 50;
den = [M b k 0];
num = Ki;
[numC denC] = cloop(num,den);
figure(2)
step(numC,denC);
title('response with a differential term')
For Kd,
Code:
num = 1;
M = 1; b = 10; k = 20;
den = [M b k];
[numC denC] = cloop(num,den);
figure(1)
step(numC,denC);
title('response of the system in the closed
loop')
Kd = 2;
l=b+k;
den = [M l];
num = Kd;
[numC denC] = cloop(num,den);
figure(2)
step(numC,denC);
title('response with a differential term')
• When a pole is inserted in a system, the order of the system is increased. The steady state
error depends on the open loop transfer function. We know the SS error is
𝑠𝑅(𝑠)
𝑒𝑠𝑠 = lim
𝑠→0 1+𝐺(𝑠)𝐻(𝑠)
1. To use a PID controller for the DC motor system, we defined the T.F in lab-4 as
0.516
T. F=
0.000621𝑠3 +0.0571𝑠2 +0.6526𝑠
Using trial and error, we find out the value of Kd, Ki and Kp to fulfill the requirement.
Kd = 3.327
Kp = 36.9243
Ki = 70.9137
Code:
clc;
clear all;
close all;
%%
a = 0.000621;
b = 0.0571;
c = 0.6526;
Kd = 3.327*0.516;
Kp = 36.9243*0.516;
Ki = 70.9137*0.516;
num = [Kd Kp Ki];
den = [a b c 0 0];
[numC denC] = cloop(num,den);
figure
step(numC,denC);
title('response with a PID controller')
2. When we add a Ki term, it means we add an integrator which mean we add a pole in the origin.
The steady-state error depends on the system type also. The magnitude of the error depends on
the system gain and will be never zero. From this, it can be seen that if a control system includes
an integrator 1/s, then the steady-state error to a step reference will be zero. Because, we
increase the system type of the given system and extra gain value help to reach out the actual
value which eliminate the steady-state error and for step response, the open loop gain will be
infinity which make the steady-state error zero.