Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

PID Tuning Methods-Automation Study With MathCad-A

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

PID Tuning Methods

An Automatic PID Tuning Study with MathCad

Neil Kuyvenhoven
Calvin College
ENGR. 315
December 19, 2002

Abstract disturbances that ideally will include any


unsuspected disturbances in the physical
There are several methods for tuning a PID system being modeled.
controller. This paper takes a qualitative look
at three common methods, with comparisons PID systems are very unique to each
of accuracy and effectiveness. These three application. As one set of settings may be
methods include a guided Trial and Error ideal for one system these same settings can
method, the Ziegler-Nichols method, and the throw another system horribly off. For this
Cohen-Coon method. For an exceptionally reason, multiple methods for tuning the PID
responsive system the Trial and Error method coefficients have been made. As some
is often used after the Ziegler-Nichols or methods are better than others for given
Cohen-Coon so as to enhance the rough applications, each method has its advantages
results of these two methods. Using these and disadvantages. This paper will outline and
methods in cooperation will result in a finely compare the three methods known as Trial
tuned control system. A study is completed and Error, Ziegler-Nichols, and Cohen-Coon.
using MathCad to implement automating PID
tuning. Due to the nature of MathCad, the PID Basics
process is not fully automated due to some
limitations of MathCad, rather the process Before explaining the methods for tuning PID
solves the solution for manually inputting control systems, the effects of changing the
PID coefficients, much like a MatLab process. different components must be examined. For
the analysis, the system in figure one will be
Introduction used, here the plant is shown to be G(S). PID
controllers consist of three components; the
Models will never emulate their actual proportional, integral, and derivative controls.
physical counterpart perfectly because the
mathematical formulae applied is completely
predictable; whereas, the physical system
being modeled will change over time and due
to unaccounted for disturbances. Control
systems, specifically PID control systems
attempt to reduce the error due to unknown
disturbances by designing for typical Figure 1 System with a PID controller
Each of these components has very distinct controller will result in drastically different
effects on the system. Table one outlines the effects on the the different types of
effects of the PID components on a particular controllers. This difference is most significant
system. Though there is no set standard for on the derivative control in the series and
the way a PID controller is set up, there is parallel controllers. With the series
however three main types. These include the controller, the derivative control is operating
ideal, parallel and series controllers. These on the partially fixed error as it has already
types can be seen in figure 1.5 along with gone through the proportional and integral
there corresponding frequency domain control. The is juxtaposed by the parallel
equations as equations one, two and three. controller where the parameters are order
independent. The effect of the derivative
control is not amplified by proportional
control which results in a less fine tuned
system. The series system begins by
amplifying the error which promotes a faster
response from the integral and derivative
control. The ideal system creates a sensitive
response in the proportional control as small
changes have big effects on the integral and
derivative portions separately. This is
different from the series model due to the lack
of direct interaction between the integral and
series control.

This paper uses the parallel PID control model


for analysis.

To increase the rise time of the system, the


proportional, integral, and derivative
components are tweaked so as to improve the
Figure 2 Ideal, series, and parallel PID
rise time, steady state error, and overshoot
configurations
respectively. Despite the fact that changing
one component effects all the characteristics
Eq. 1 as seen in table one, the system can still be
brought to stability with the three
components together; although sometimes
fewer than all three are needed.
Eq. 2
Table 1 Effects of PID
Rise Time Steady State Overshoot
Eq. 3
Proportional Decrease Decrease Increase
Integral Decrease Eliminate Increase
The difference between these types of PID Derivative None None Decrease
controllers is only seen when attempting to
tune them. The outcome can be made similar
with different values, but as is realized from
the equations, one set of parameters for the
Method 1: Trial and Error Method 2: Ziegler-Nichols

The Trail and Error method requires a closed The Ziegler Nichols method takes two
loop system, it steps through the system from approaches depending on the system at hand.
proportional to integral to derivative. This First, with the closed method or begins in
method is a divide and conquer approach, first much the same way as the Trial and Error
it puts the system into a rough solution from method as a steady oscillation is desired with
which small tweaks are performed to perfect only a proportional influence present. The
the response. To begin, each coefficient of the proportional value at which the oscillations
PID controller is set to zero. The proportional become constant is coined the term 'ultimate
component is now considered by increasing gain'. The period of oscillations at the
its value until a steady oscillation is obtained ultimate gain is termed 'ultimate period'. The
as in figure two. Scaling the current ultimate gain can be found in an simpler way
proportional value down by a factor of two with the root locus of the open loop transfer
will give the resulting proportional value. function. The ultimate gain and ultimate
Applying this proportional value will dismiss period as noted in figure 2, are applied to the
the steady oscillations. Next the integral Ziegler-Nichols formulae as noted in table 2.
coefficient is increased until steady This method works provided the closed loop
oscillations are again obtained. The present transfer function is known and there is an
value of the integral coefficient is scaled up by ultimate gain, the point where the root locus
a factor of three and applied to the integral as value has zero for the real portion.
the final value. This once again sets
oscillations off, which brings up the Table 2 Tuning parameters for Ziegler
derivative control, this value is increased until Nichols closed loop ultimate gain method
for a final time the oscillations are at a KP KI KD
constant period and amplitude. The P 0.5*Ku
coefficient of the derivative is then scaled PI 0.45*Ku 1.2/Tu
down by a factor of three and applied as the PID 0.6*Ku 2/Tu Tu/8
final value for the derivative control. The
resulting output may still have some noise
associated with it, this must now be tuned by The second Ziegler-Nichols method applies to
hand with small educated tweak of the the open loop transfer function. It is simpler
different coefficients. to calculate because the guess work is taken
out as opposed to the closed loop method
where the accuracy of 'steady oscillations'
becomes an estimation at best. The tuning
parameters for the Ziegler-Nichols open loop
method is shown in table three.

Table 3 Tuning parameters for Ziegler-


Nichols open loop ultimate gain method

KP TI TD
Figure 2 Steady oscillation illustrating P 1/(RL)
the ultimate period PI 0.9/(RL) 3L
PID 1.2/(RL) 2L 0.5L
as seen in figure three and applied to the
Ziegler-Nichols open loop formulae as found
in table three. The outcome of the two
Ziegler-Nichols method is a system with a
fairly clean response, work still must be done
tweaking the system as the Ziegler-Nichols
method will only give rough estimates.

Cohen-Coon

The Cohen-Coon method is a more complex


version of the Ziegler-Nichols method. Using
the same process to come up with the input
values from figure three. The difference
comes with the fact that the rise time is
required. This method is more sensitive than
the Ziegler-Nichols as it is limited to one type
of open loop response. Table four displays the
formulae for the Cohen-Coon method. By the
formulae given in table four, it is obvious that
this system is designed with different
objectives than Ziegler-Nichols

Table 4 Tuning parameters for


Cohen-Coon method

Figure 3 Two possible outputs for the


Ziegler-Nichols open loop analsys.

To apply the Ziegler-Nichol open loop


method, the output is monitored as a sharp
step is applied to the input. The response is
monitored for a response similar to that of
figure three, which gives two of the three
possible responses for an open loop system.
The third being an oscillatory system; which
requires the closed approach method rather
than the open loop approach of the Ziegler-
Nichols methods. For this reason it is not Method Comparison
included in the figure. The second diagram in
figure two illustrates a stable system which as The methods described thus far are by no
the name suggests, settles to a given steady means the only way to tune a PID controller,
state. The last plot in the figure is an unstable though, the specific methods described above
system which approaches infinity due to a are well known and accepted for their
step applied to the input. simplicity and ease of use even though they
will not work with every system. Every
With the response captured, values are found
method has its advantages and disadvantages;. which is set by the user. The user would input
depending on the system at hand, one method the plant function and the set point
may be preferable over another but by no disturbance in the frequency domain and
means is it the only option. have MathCad find a best fit solution with
these inputs. The theory behind the
The Trial and Error method is very common application is simple, calculate the transfer
not only in educational settings due to the function of the system with the input plant
intuition and clarity it provides with what the and disturbance and plot the output from the
PID components are doing. Often after using time domain. Using the time domain
a method such as the Ziegler-Nichols or function, the overshoot, rise time settling
Cohen-Coon some manual tweaking is time, and steady state error are calculated.
favourable to get the system tuned specifically These values are compared against the users
for the system at hand, whether it be more inputs depending on the outcome, the
robust to handle large disturbances or keenly program will increment one of the PID
sensitive to respond instantaneously to small coefficients and recalculate the worksheet.
annoyances introduced to the system. This iterative process would ideally give the
values of the PID components to satisfy the
The Ziegler-Nichols and Cohen-Coon method criteria outlined by the user if the solution
are systems keyed towards speed rather than exists.
robustness as they are both design with a 25%
damping factor meaning the oscillations will The objectives of the MathCad program have
decrease by a factor of four every period. The been altered due to the capabilities of
settling time from these systems can vary MathCad. Using the programming tools with
depending on the initial overshoot. The functions such as H(s) gives multiple errors as
Ziegler-Nichols method is designed around these functions cannot be assigned as is
the point of critical damping, where the root required with the programming tools. The
locus gives a purely imaginary pole. This result is a worksheet acts much in the same
system works best with 2nd order systems, way as MatLab Simulink. After inputing the
beyond this the oscillations could give more plant function, the user is required to alter the
than on solution for the ultimate gain. controller parameters manually as the
Methods such as Integral of Time Weighted worksheet updates the new values on the fly.
Absolute Error (ITAE) or Internal Model This worksheet along with a root locus or
Control (IMC). Can be found to do a more Nyquist plot will allow the user to easily tune
precise job. The standard for PID has not been a PID control system with the methods
set, as the western world welcomes fuzzy described in this paper.
logic more and more systems are leaning this
way. MathCad Code

MathCad Study The MathCad code for the worksheet is


shown below, the end result makes only the
The methods thus far have only provided plant and the input visible along with the
solutions that are classified as satisfactory output plot with the characteristics.
depending on the system. The intent of the
MathCad study was initially to develop a
program that would automatically find a set
of results that meet the overshoot, rise time,
settling time, and steady state error criteria
Parallel PID Control Factored numerator
without any scalar
User Input z

Plant
partialNumF( s) :=

=
i
(s Z )
0
i

1
H( s) :=
2 Numerator's scalar
s + 10 s + 20

Num( s , Kp , Ki , Kd )
Input disturbance scaleNumF( s) :=
partialNumFr( s)
1
F( s ) :=
s Factored numerator

Begin Calculations NumF( s) := scaleNumF( s) partialNumF( s)

PID Controller
2 Factored denominator
Kp s + Kd s + Ki without any scalar
G( s , Kp , Ki , Kd ) :=
s p

Closed Loop Transfer function


partialDen F( s) :=

=
i
(s P )
0
i

F( s) G( s , Kp , Ki , Kd ) H( s)
T( s , Kp , Ki , Kd ) :=
1 + G( s , Kp , Ki , Kd ) H( s ) Denominator's scalar

Den( s , Kp , Ki , Kd )
scaleDenF( s ) :=
Numerator of Closed loop partialDen F( s)

Num( s , Kp , Ki , Kd ) := numer( T( s , Kp , Ki , Kd ) )
Factored denominator

Denominator of Closed loop (


DenF( s) := scaleDenF( s) partialDen F( s) )
Den( s , Kp , Ki , Kd ) := denom( T( s , Kp , Ki , Kd ) )
Factored Transfer function
NumF( s)
Zeros of closed loop
TFactor( s) :=
DenF( s)
Z := solve( Num( s , Kp , Ki , Kd ) , s )

Poles of closed loop Time domain transfer funciton


float , 4
P := ( solve( Den( s , Kp , Ki , Kd ) , s) )
(
h( t) := invlaplace TFactor( s) , s , t ) complex
Size of Pole and Zero matricies
p := rows( P) 1
z := rows( Z) 1
SETTLING TIME
@ 90%
SS := 1
Given
Given
x ( q) SS < SS .02 x ( q) = SS .9
x ( q) SS > SS .02 x ( q) > 0
T90% := Find( q)
Ts := Find( q)
Tr := T90% T10%

RISE TIME
PERCENT OVERSHOOT
Time for response to go from
d
10% of steady state to 90% of X ( t) := x ( t)
steady state dt
Given
@ 10%
X ( q) = 0
Given q>0
x ( q) = SS .1
Tovershoot := Find( q)
x ( q) > 0
T10% := Find( q)
PO :=
(
x Tovershoot SS )
SS

.
References

Control Tutorials for Matlab. University of


Michigan, 1996.
<http://www.krellinst.org/UCES/archive/cl
asses/control/PID/PID.html>

Dorf, Richard, Bishop, Robert. Modern


Control Systems, Prentice Hall, 2000.

Examining the Fundamentals of PID


Control,
<http://www.geocities.com/chemforum/pi
dcontrol.htm>

Example Problem of PID,


<www.phys.ntnu.no/brukdef/undervisning/si
f4037/Lecturenotes/Example%20Problem%2
0of%20PID.doc>

Hubertus, Dr. Comparison of PID Control


Algorithms (all Controllers are not
Created Equal),Expertune Inc. 1999.
<http://www.expertune.com/artCE87.h
tml>

Lee, Jay. PID Controller Tunning, Part II


Reaction Curve Method, Georgia Inst.
Technology. 2001.
<http://dot.che.gatech.edu/Information/res
earch/issicl/che4400/files/lecturenote/lectu
re6b_2.pdf>

Lelic, Muhiden, PID Controllers in the


Nineties, Corning Inc. 1999.
<http://www.ece.rutgers.edu/~gajic/IEEET
alk.pdf>

Park, S. PID Controller Tuning to Obtain


Desired Closed-Loop Responses for Single
Input, Single Output Systems, Advanced
Institute of Science and Technology.
<http://www.cwru.edu/cse/eche/people/fac
ulty/brosilow/papers/pidcontrol.pdf>

Smith, L. C. Fundamentals of Control


Theory, Chemical Engineering,1979.

You might also like