LAB 12 CNC
LAB 12 CNC
Experiment No 12:
Calibrate the real-time DC servo motor system by analyzing
the performance parameter of PID controller
OBJECTIVE
Design P, I, PI, PD, PID controller to calibrate the DC servo motor system.
THEORY
A proportional-integral-derivative controller (PID controller) is a control
loop feedback mechanism (controller) widely used in industrial control systems. A PID
controller calculates an error value as the difference between a measured process variable
and a desired set point. The controller attempts to minimize the error by adjusting the
process through use of a manipulated variable
Figure 1
[ ]
t
1 de (t )
u(t )=K P e( t)+ ∫
Tl 0
❑ e (t)dt+ T D
dt
1
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
G(s)=
U (s)
E(s) (
=K P 1+
1
Tls )
+T D s
G(s)=
U (s)
E(s) (
=K 1+ P
1
T s
+T s
l
) D
U (s) K K s 2 + K p s+ K I
G(s)= =K P+ I + K D s= D
E(s) s s
Figure 2
coefficient. Seen from the standpoint of root locus, formula (2.10) is equivalent to adding
a pole located at base point and two null points with variable location to the system.
5
Let assume the plant transfer function in above system is .
( s+1)( s+2)(s+3)
GRAPH:
PI:
Figure 3
2
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
PD:
Figure 4
PID:
Figure 5
3
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
MATLAB CODE:
clear
num=[5];
den=[1 6 11 6];
sys_ol=tf(num,den)
roots=zpk(sys_ol)
sys_cl=feedback(sys_ol,1)
% Design of PI controller..........................................
[Gc_PI, info_PI]=pidtune(sys_ol,'PI')
sys_clf=feedback(sys_ol*Gc_PI,1)
step(sys_cl,sys_clf)
% Design of PD controller..........................................
[Gc_PD, info_PD]=pidtune(sys_ol,'PD')
sys_clf=feedback(sys_ol*Gc_PD,1)
step(sys_cl,sys_clf)
% Design of PID controller..........................................
[Gc_PID, info_PID]=pidtune(sys_ol,'PID')
sys_clf=feedback(sys_ol*Gc_PID,1)
step(sys_cl,sys_clf))
4
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
Lab Tasks
Q1: Open loop transfer function of DC Servo motor is
1
G0 (s)=
( 0.052 S+1)(0.12 S +1)
Show the close loop transfer function of DC servo motor by executing the Matlab
command when unit step input is applied. Record percentage overshoot, settling time,
peak time, and rise time.
Q2: Show the following tasks by executing the Matlab / Simulink commands.
1. Implement proportional and integral controller separately with Dc servo motor close
loop transfer function to yield closed-loop response with overshoot less than 10%,
settling time less than 1.5sec and static error 0. Investigate the K P and KI value to
achieve the desired results for real time DC servo system.
2. Implement PI, PD and PID Controller separately to the Dc servo close loop transfer
function to yield a closed-loop response with overshoot less than 5%, settling time
less than 1.5sec and static error 0.
5
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
Q 1) Matlab Code
6
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
Q 2) Matlab Code
clc
clear all
sysa=tf([1],[0.052 1])
sysb=tf([1],[0.12 1])
sysc=series(sysa,sysb)
sysd=feedback(sysc,1)
pidTuner
P controller
7
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
I Controller
8
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
PI Controller
9
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
PD Controller
10
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
PID Controller
11
Department of Mechanical Engineering, Air University A&AC Kamra
Control Engineering Lab
Conclusion
12
Department of Mechanical Engineering, Air University A&AC Kamra