You are on page 1of 5

Control System Engineering Lab

EEE 4706
Lab Report 5

Submitted by:
Name: Shadman Shahriar Mahmud
Student ID: 152436
Section: B
Department: EEE
The parameters that have been selected for the DC motor system:
Jm=12
Dm=10
Ea=100;
Kb=2;
Kt/Ra=5
num=5/12;
den=[1 5/3 0];
%num and den has been calculated from the
parameter values
this code is for the verification of the tuning
performed

The circuit diagram is as follows:


After tuning the following curve has been obtained:

This is to be verified now via the following MATLAB code:

num=5/12;
den=[1 5/3 0];
motor_sys=tf(num,den);
while(1)
Kp = input('Enter Kp= ');
Ki = input('Enter Ki= ');
Kd = input('Enter Kd= ');
K = pid(Kp,Ki,Kd);
sys= feedback(K*motor_sys,1);
y=step(sys);
data_motor=stepinfo(sys)
OS=data_motor.Overshoot;
Rt=data_motor.RiseTime;
Ts=data_motor.SettlingTime;
len=length(y);
dev=1-y(len);
if OS < 5 && Rt < 1 && Ts < 5 && dev < 0.01
disp('The PID has been designed
successfully.')
break
else
disp('PID needs to be redesigned.')
end
end

Putting values Kp= 24.6265; Ki= 7.8712; Kd= 13.0073 into the code we
get the following output:
The curve is as follows:

The curve obtained conforms with the one obtained via tuning. So the
MATLAB tuning operation and coding both are consistent with respect
to each other.

You might also like