You are on page 1of 8

Course Code and Title:

EEE 402: Control Systems

Semester and Year:

Spring – 2022

Experiment Number and Name:

Experiment-5: Study of PID controller.

Name of Student and ID: Instructor:

Md. Abu Shayem Md. Rafiul Abdussami


ID: 2019-1-80-021 Senior Lecturer, EEE
Date of Submission: Date of Performance:

8 May, 2022 7 April, 2022


• Objective:
The main objective of this experiment is to familiarize with controller using MATLAB. Also,
design a PID controller of system to show how it works on a system.

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 +𝑏𝑆+𝑘

Here, M = 1Kg, b = 10 Ns/m, k = 20N/m and F = 1N.

Fig-1: A simple mass, spring, and damper system.


For Kp,
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')
Kp = 300;
den = [M b k];
num = Kp;
[numC denC] = cloop(num,den);
figure(2)
step(numC,denC);
title('response with a differential term')

Fig-2: Step response for closed loop and Kp.


Form this figure we see that rise time is decrease, overshoot is increase, small change in settling
time and SS error is decrease. Which is follow the table above.
For Ki,

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')

Fig-3: Step response for closed loop and Ki.


Form this figure we see that rise time is decrease, overshoot is increase, increase in settling time
and SS error is eliminated. Which is follow the table above.

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')

Fig-4: Step response for closed loop and Kd.


Form this figure we see that rise time is decrease, no change in overshoot, settling time is
decrease and small change in SS error. Which is nearly follow the table above.

• 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+𝐺(𝑠)𝐻(𝑠)

Here, G(s)H(s) the open loop transfer function.


When we add a pole to the system it increases the gain value of the open loop transfer function
which will reduce the SS error. If we add pole in the origin like add a pure integrator as Ki term,
that will increase system order as well as types of the system. We know that if we increase type
of the system it will increase the gain value of the open loop transfer function almost infinity and
make the system with zero SS error. In root locus point of view, if we add pole in left half of s
plane, root locus shift towards right half of the s plane. Which make the system more oscillatory,
decrease the range of operating value of the gain ‘K’ and decrease system stability but make the
system to reach actual value easily which means reduce the SS error.

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')

Fig-5: Step response using PID controller.


Now, we use Simulink to perfume the same task.

Fig-6: Simulink block diagram.

Fig-7: Step response from the Simulink.


• At first, we use auto tune to get desired value. But it doesn’t fulfill the requirements. So, we
set the previously calculated value of the gain and get same result.

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.

You might also like