PI Controller
PI Controller
Home
Introduction
Products
(View more Control information)
Applications
Data Acquisition A recent opinion piece published in the trade magazine Control Engineering proposed that the
Ziegler-Nichols tuning rule would serve as the basis for a coming new generation of PID
Case Studies
technology: "Improved performance, ease of use, low cost, and training will put Ziegler and Nichols in the
Control driver's seat..." [1] Well, maybe so, but it seems to us that Ziegler-Nichols tuning is a very limited technology
DSP that is unlikely to be successful in that role. The rest of this article will explain why, exploring how to use the
rule and where things can go wrong.
Software
Techniques
The time-honored Ziegler-Nichols tuning rule [2,3] ("Z-N rule"), as introduced in Related Product
Integrated Systems the 1940s, had a large impact in making PID feedback controls acceptable to
control engineers. PID was known, but applied only reluctantly because of
Documents
stability concerns. With the Ziegler-Nichols rule, engineers nally had a
Support practical and systematic way of tuning PID loops for improved performance.
Never mind that the rule was based on science ction. After taking just a few
Contact Us basic measurements of actual system response, the tuning rule con dently
recommends the PID gains to use. If results are what really matter, the results Use Data Acquisition Processor
Company
are... well, let's not talk about performance just yet. (DAP) boards to control and
Search monitor many channels with a
Tuning rules simplify or perhaps over-simplify the PID loop tuning problem to single device
the point that it can be solved with slide-rule technology. (Anybody remember
the slide-rule?) Maybe that's not the best we can do today, but a weak alternative that is available can look a
lot better than a good alternative that is not. That is why the Ziegler-Nichols Rule is still going strong today.
The Ziegler-Nichols rule is a heuristic PID tuning rule that attempts to produce good values for the three PID
gain parameters:
Tuning rules work quite well when you have an analog controller, a system that is linear, monotonic, and
sluggish, and a response that is dominated by a single-pole exponential "lag" or something that acts a lot like
one.
Actual plants are unlikely to have a perfect rst-order lag characteristic, but this approximation is reasonable
to describe the frequency response rolloff in a majority of cases. Higher-order poles will introduce an extra
phase shift, however. Even if they don't affect the shape of the gain rolloff much, the phase shift matters a lot
to loop stability. You can't depend upon a single "lag" pole to match both the amplitude rolloff and the phase
shift accurately.
So the Ziegler-Nichols model presumes an additional ctional phase adjustment that does not distort the
assumed magnitude rolloff. At the stability margin, there is a 180 degree phase shift around the feedback loop
(Nyquist's stability criterion). A rst order lag can contribute no more than 90 degrees of that phase shift. The
rest of the observed phase shift must be covered by the arti cial phase adjustment. The phase adjustment is
presumed to be a straight line between zero and the critical frequency where 180 degrees of phase shift
occurs. A "straight line" phase shift corresponds to a pure time delay. Is this consistent with the actual phase
shifts? Well, probably not, so hope for the best.
To summarize, then, the Ziegler-Nichols rule assumes that the system has a transfer function of the following
form:
http://www.mstarlabs.com/control/znrule.html 1/4
9/5/2018 Ziegler-Nichols Tuning Rules for PID
The model matches the system response at frequencies 0 and at the stability limit, and everything else is
more or less made up in between. If the actual system is linear, monotonic, and sluggish, it doesn't make
much difference that the model is fake, and results are good enough. If the actual system does not match the
assumed model adequately, then sorry, you're on your own.
You don't need to determine all of the model parameters to apply Z-N tuning, but if you wanted to do so, here
is how you could measure them.
Perform a frequency response test on the system, to determine the gain magnitude and the phase shift as a
function of frequency. You can take your system o ine, attach a signal source, and attach a data acquisition
system to measure input and output data sets. Or, if you are smarter about it, you can measure your system
response online [5] while the PID loop is operating.
Given the magnitude and phase open-loop response curves of the plant, you can t 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 Fu at which the phase passes through -pi radians (-180 degrees). The inverse of
this frequency is the period of the oscillation, Tu.
3. Observe the plant gain Kc that occurs at the critical oscillation frequency Fu. The inverse of this is the
gain margin Ku.
4. Apply the frequency Fu to the plant rst order lag terms to solve for the model's a term.
5. Evaluate the phase shift of the lag stage by substituting Fu into the rst-order lag model.
6. The rest of the 180 degrees of phase shift are assigned to the pure time delay term.
In practice, you don't need to construct the complete model, and you can stop after completing step 3 above.
Use the values of Ku and Tu to determine values of PID gain setting according to the following tuning rule
table. [4]
Why are there multiple rules? Well, remember, all of these are just heuristics. Some people nd the transient
overshoot levels of the classic Z-N rule excessive and will accept a slightly longer transient interval in
exchange for smoother settling. Some people nd that the Z-N classic rule doesn't quite achieve the
disturbance rejection goals that were the original objective. Pick the rule that you think works best for you.
This might be an ad-hoc solution, but it is an ad-hoc solution that can be applied systematically.
A Tuning Example
http://www.mstarlabs.com/control/znrule.html 2/4
9/5/2018 Ziegler-Nichols Tuning Rules for PID
The following illustration shows plotted data of the system's open loop frequency response, gain and phase,
as captured by an automated online test performed by the PIDZMON command, [5] described in another note on
this site. The green lines and the magenta line have been superimposed on the screen capture image.
Choosing the classical Ziegler-Nichols tuning rule, we would then determine that the PID gains should be
Garbage-in, garbage out. If you believe (or hope) that the tuning rule assumptions are good, but they are
not, anything could happen.
Limited applicability. Even if you are not fooled when the assumptions do not apply, there might not be
much you can do about it.
Inconsistent design goals. The Ziegler-Nichols tuning rule is meant to give your PID loops best
disturbance rejection performance. This setting typically does not give very good command tracking
performance. It is easy to pick a tuning rule that is poor for the application, and you might not realize it.
Overly aggressive gains. Tunings based on a continuous system analysis can produce erratic behaviors
with a discrete controller. When the pure delay parameter is small, the critical frequency can be too close
to the Nyquist limit, in a range where a zero-order hold results in choppy signals.
Dependence on non-reality. The ability of the model to predict good tunings is highly dependent on the
unrealistic pure time delay assumption, which can perform rather badly, for example, when phase shift
results from a complex pole pair.
These problems and others have prompted other tuning strategies. There is no arguing with success, but
success is not guaranteed, so you have to be careful.
Conclusions
Tuning rules such as the Z-N rule and its variants are embedded into well established, very convenient
generalized controller products. All have the same advantages and disadvantages: If the rule works, great! Use
it. If it doesn't work... then what are you going to do?
Unfortunately, we cannot recommend the Z-N rule or related tuning rules strongly. The idea is straightforward
but the application is tricky. Ordinarily, you need to test your system o ine and instrument it for special
response tests. DAP-based controls can perform the tests online and deliver the response curves [5],
maintaining control and never missing a tick. While this adds no new fundamental capabilities, at least it
represents a shift from a manual o ine measurement process to an automated online one. This seems to be
http://www.mstarlabs.com/control/znrule.html 3/4
9/5/2018 Ziegler-Nichols Tuning Rules for PID
what the Control Engineering article praises as the ultimate in technology. While we can consider the Ziegler-
Nichols rule helpful, there are more robust alternatives available today. You can test the method using your
DAP system. Download the free command code and nd out for yourself.
1. "Getting in tune with Ziegler-Nichols," Thomas R. Kurfess, PhD, in the Academic Viewpoint
column, Control Engineering magazine, Feb 2007 issue, p. 28, http://www.controleng.com/.
2. The classic original paper: "Optimum settings for automatic controllers," J. B. Ziegler and N.
B. Nichols, ASME Transactions, v64 (1942), pp. 759-768.
3. A more recent survey that covers the Ziegler-Nichols and Kappa-Tau tuning rules: "Automatic
Tuning of PID Controllers," Karl J. Åström & Tore Hägglund, Chapter 52, The Control
Handbook, IEEE/CRC Press, 1995, William S. Levine ed.
4. Selected from the tuning rules listed in the paper "Rule-Based Autotuning Based on
Frequency Domain Identi cation," Anthony S. McCormack and Keith R. Godfrey, IEEE
Transactions on Control Systems Technology, vol 6 no 1, January 1998.
5. For more information about obtaining frequency response curves automatically, see the
article A Self-Testing PID Loop on this site.
http://www.mstarlabs.com/control/znrule.html 4/4