You are on page 1of 8

Name: Sabarivelan S Registration Number: 20BEI0059

Course: EEE3001-Control System Lab Date: March 16, 2022

EXPERIMENT-5

Aim of the experiment:


Performance evaluation of P, PI, PD, and PID controllers.

Software used:
MATLAB

Problem statements:
2

Theoretical solution:

2
3

MATLAB Code:
clc
clear all
G=tf(1, [1 10 20]);
C=1;H=1;
Tf=feedback(C*G,H);
t=0:0.01:5;
y=step(Tf,t);
stepinfo(y)
steady_state_error=1-dcgain(Tf)
plot(t,y,'b','linewidth',1.5)
hold on
Kp=500;
%Kp=50;
%Kp=1000;
C1=pid(Kp,0,0);%P controller
Tf1=feedback(C1*G,H);
y1=step(Tf1,t);
plot(t,y1,'r','linewidth',1.3)
legend('Without controller','With controller Kp')
stepinfo(y1)
steady_state_error_1=1-dcgain(Tf1)
xlabel('Time')
title('Step response')
ylabel('Amplitude')
hold off

figure();
Kd=10;Ki=0;%PD controller
C2=pid(Kp,Ki,Kd)
Tf2=feedback(C2*G,H);
y2=step(Tf2,t);
plot(t,y2,'linewidth',1.5)
stepinfo(y2)
hold on

Kp = 30;Ki = 70;Kd=0;%PI controller


C3=pid(Kp,Ki,Kd)
Tf3=feedback(C3*G,H);
y3=step(Tf3,t);
plot(t,y3,'linewidth',1.5)
stepinfo(y3)

3
4

steady_state_error_2=abs(1-y3(end))

Kp = 400;Ki = 400;Kd=50;%PID controller


C4=pid(Kp,Ki,Kd)
Tf4=feedback(C4*G,H);
y4=step(Tf4,t);
plot(t,y4,'g','linewidth',1.5)
stepinfo(y4)
steady_state_error_3=abs(1-y4(end))
legend('PD controller','PI controller','PID
controller')
hold off
xlabel('Time')
ylabel('Amplitude')
title('Step response')

Simulation results:
3(i).

4
5

The rise time decreased from 83.2956 to 5.3856, also the steady state error decreased from
0.9524 to 0.0385. For the increasing value of Kp the transient response in the step response
oscillates. And the overshoot value increases.

3(ii)

The overshoot and setting time value is low in PD controller, while compared to P controller.

5
6

3(iii)

The steady state error is too low while compared to P, PD controller.

6
7

3(iv)

7
8

Result:
Increase in Kp decreases steady state error, also it reduces the rise time. In PD controller the
overshoot remains. PI and PID controller eliminate the steady state error, But the overshoot
remains in PI. Also PI controller reduces the rise time little. The settling time is minimum in
PD controller.

Conclusion:
Therefore, the plot for P PD PI PID is obtained using MATLAB software.

You might also like