Home / Softwares Tips & Tricks / MATLAB /  Zeigler-Nichols Rule explained with example

 Zeigler-Nichols Rule explained with example

This article will help to understand Zeigler-Nichols Rule. This rule applicable to PID controllers is explained with example. How it can be implemented in MATLAB and how to analyze it.


The Zeigler-Nichols is a heuristic approach for tuning the parameters of PID controller gain parameters:

  1. Kp – the controller path gain
  2. Ti – the controller’s integrator time constant
  3. Td – the controller’s derivative time constant

Given two measured feedback loop parameters derived from measurements:

  1. The period T0 of the oscillation frequency at the stability limit.
  2. The gain margin Kp0 for loop stability.

The main goal is to achieve good regulation in the system for rejecting the disturbance produced in the system.

When to use the Zeigler-Nichols

Tuning rules work well when the controller required is analog, system is linear, monotonic and a response that is dominated by a single-pole exponential “lag”.

Actual plants are unlikely to have a perfect first-order lag characteristic. Higher-order poles will introduce an extra phase shift, phase shift matters a lot to loop stability. You can’t depend upon the single “lag” pole to match both the amplitude roll-off and phase shift accurately.

So the ZN model presumes an additional fictional phase adjustment that does not distort the assumed magnitude roll-off. At the stability margin there is a 180 degree phase shift around the feedback loop which is the Nyquist’s stability criteria. A first order lag can contribute no more than 90 degrees of that phase shift.

To summarize, then, the Ziegler-Nichols rule assumes that the system has a transfer function of the following form:

= (Ke^-sT)/ (a+s)

The model matches the system response at frequencies 0 and at the stability limit.

How do you measure response parameters?

Given the magnitude and phase open-loop response curves of the plant, you can fit the assumed model in the following manner.

  1. The ratio of output level to input level at low frequencies determines the gain parameter K of the model.
  2. Observe the frequency F0 at which the phase passes through -pi radians (-180 degrees). The inverse of this frequency is the period of the oscillation, T0.
  3. Observe the plant gain Kc that occurs at the critical oscillation frequency Fu. The inverse of this is the gain marginK0.


The given transfer function is:

Gp = 1/s(s+11.6+5.8i)(s+11.6-5.8i)

Zeigler-Nichols Compensation



den=conv([1 0],conv([1 11.6+5.8i],[1 11.6-5.8i]));


rlocus(num,den) %frequency response of the system

T0=(2*pi)/13;  % Measuring the period T0 at the stability limit

Kp0=3900;      % Measuring the gain margin Kp0 for loop stability

Ti=0.5*T0;     % Calculating the tuning parameters





numgc=kp*[Td*Ti Ti 1]; %Numerator of PID transfer function 

dengc=[Ti 0];          %denominator of PID transfer function

gc=tf(numgc,dengc);    % PID controller’s transfer function



t=gf/(1+gf);           %Closed loop transfer  function



 Root Locus

Ziegler-Nichols root locus

Values Calculated

>> Kp0

Kp0 =        3900

>> Td

Td =    0.0604

>> T0

T0 =    0.4833

>> Ti

Ti =    0.2417

>> kp

kp =        2340

>> kd

kd =  141.3717

>> ki

ki =  9.6830e+003

Step Response

step response

Simulink Simulation

Block diagram

application of Ziegler-Nichols block diagram

After Tuning:

Zeigler-Nichols rule application



About Syed Noman ud din

Syed Noman ud din is an Electrical Engineer and working in Industry from last 3 years. He writes technical articles for electrical and electronic engineers. He has also published several research publications in renowned international journals.

Check Also

Block diagram-Modelling of overcurrent relay in Simulink MATLAB

Modeling of overcurrent relay in Simulink MATLAB

This article discusses the modeling of overcurrent relay in simulink MATLAB. Which Blocks are used for …

Leave a Reply

Your email address will not be published. Required fields are marked *