Lab Experiment # 10: Demonstration of Ziegler-Nichols Method For Tuning of PID Controller in Matlab Objective
Lab Experiment # 10: Demonstration of Ziegler-Nichols Method For Tuning of PID Controller in Matlab Objective
Apparatus:
Computer having Matlab software
Theory:
Background:
PID controllers are used more than 95% of the closed loop industrial processes.
PID controller is widely used due to its simplicity and robustness.
Frequently faced the task of adjusting the controlling parameters to obtain desired
behavior.
The Ziegler–Nichols tuning method is a heuristic method of tuning a PID controller. It was
developed by John G. Ziegler and Nathaniel B. Nichols. It is performed by setting the I (integral)
and D(derivative) gains to zero. The "P" (proportional) gain, Kp is then increased (from zero)
until it reaches the ultimate gain Kpo, at which the output of the control loop oscillates with a
constant amplitude. Kpo and the oscillation period To are used to set the P, I, and D gains
depending on the type of controller used:
Z–N tuning creates “quarter wave decay". This is an acceptable result for some purposes, but not
optimal for all applications.
"The Ziegler-Nichols tuning rule is meant to give PID loops best disturbance rejection.
Z–N yields an aggressive gain and overshoot – some applications wish to instead minimize or
eliminate overshoot, and for these Z–N is inappropriate.
For the tune of PID controller first of all find Kpo by applying Routh’s Hurwitz method on the
characteristic equation then put this value of Kpo in the auxiliary equation to find the “ώo”.
Using “ώo” find the time of oscillation by applying following formula: To = 2π/ώo
Ziegler-Nichols (ZN) method:
The Ziegler-Nichols rule is a heuristic PID tuning rule that attempts to produce good values
for the three PID gain parameters:
Kp - the controller path gain
Ti - the controller's integrator time constant
Td - the controller's derivative time constant
Given two measured feedback loop parameters derived from measurements:
Period Tu of the oscillation frequency at the stability limit
Gain margin Ku for loop stability
Goal is to achieve good regulation (disturbance rejection).
ZN Tuning Method:
Integral and derivative gains are set to zero and proportional gain is increased until the
system starts to oscillate.
This tuning rule is meant to give PID loops best disturbance rejection.
Give the good set of initial parameters easily and quickly.
Gain Estimator Chart:
Controller parameters for the ZN frequency response method which gives controller
parameters in terms of critical gain ‘KcrKpo’ and critical period ‘Pcr To’ will further
help to compute the starting parameters of PID controller.
Controller Kp Ti Ki Td Kd
P 0.5Kpo - - - -
Task Code
Lab Tasks
Q1:
Design PID Controller using Ziegler Nichols closed loop method using MATLAB?
Plant: G(s) = 64/ [ s3 + 14s2 + 56s + 64 ]
Code:
clc;
close all;
clear all;
sys = tf([64],[1 14 56 64])
for kp0=1:0.01:30
g = 784 - 64*(1 + kp0);
if g==0
break;
end
end
g1=[1 14 56 64+64*kp0];
d=roots(g1);
d1 = imag(d);
d2 = length(d1);
g1=[1 14 56 64+64*kp0];
d=roots(g1);
d1 = imag(d);
d2 = length(d1);
for i=1:d2
w0 =d1(i);
if w0>0
break;
end
end
T0 = 2*pi/w0;
fprintf(' kp0 w0 T0\n')
fprintf('%3f %16.5f %16.5f\n\n',kp0,w0,T0);
disp('Proportional Controller kp')
kp = kp0*0.5;
fprintf('%3f \n\n',kp);
sys1=tf([kp],[1]);
sys2 = series(sys,sys1);
sys3=feedback(sys2,[1])
disp('Proportional_Integral Controller')
fprintf(' kp1 Ti ki\n')
kp1 = 0.4*kp0;Ti = 0.83*T0;ki = kp1/Ti;
fprintf('%3f %16.5f %16.5f\n\n',kp1,ki,Ti);
sys4=tf([kp1 ki],[1 0]);
sys5 = series(sys,sys4);
sys6=feedback(sys5,[1])
disp('Proportional_Integral_Derivative (PID)
Controller')
fprintf(' kp2 Ti1 Td kd ki1\n')
kp2 = 0.6*kp0;Ti1 = 0.5*T0;Td = 0.125*T0;kd
= kp2*Td;
fprintf('%3f %16.5f %16.5f %16.5f
%16.5f\n\n',kp2,Ti1,Td,kd,ki);
sys7=tf([kd kp2 ki],[1 0]);
sys8 = series(sys,sys7);
sys9=feedback(sys8,[1])
step(sys)
hold on
step(sys3)
hold on
step(sys6)
hold on
step(sys9)
Output:
Q2: Design PID Controller using Ziegler Nichols closed loop method using MATLAB?
Plant:
G(s) = 1/ (s + 1)3
Output:
Comments:
PID controllers are used more than 95% of the closed loop industrial processes.
PID controller is widely used due to its simplicity and robustness.
Frequently faced the task of adjusting the controlling parameters to obtain desired behavior.
The Ziegler–Nichols tuning creates a "quarter wave decay". This is an acceptable result for
some purposes, but not optimal for all applications.
This tuning rule is meant to give PID loops best disturbance rejection.
Give the good set of initial parameters easily and quickly.
Conclusion:
The Ziegler-Nichols rule is a heuristic PID tuning rule that attempts to produce good values for
the three PID gain parameters: Kp - the controller path gain. Ti - the controller's integrator time
constant. Td - the controller's derivative time constant. In this paper, PID controller is designed
using Traditional
The Ziegler-Nichols tuning rule is meant to give PID loops best disturbance rejection.
Z–N yields an aggressive gain and overshoot – some applications wish to instead minimize or
eliminate overshoot, and for these Z–N is inappropriate.
It is performed by setting the I (integral) and D(derivative) gains to zero. The "P" (proportional)
gain, Kp is then increased (from zero) until it reaches the ultimate gain Kpo, at which the output
of the control loop oscillates with a constant amplitude. Kpo and the oscillation period To are
used to set the P, I, and D gains depending on the type of controller used: