Sei sulla pagina 1di 6

Proceedings of the 1999 EEE

International Symposium on Computer Aided Control System Design


TuM1-1 2:OO Kohala Coast-Islandof Hawai'i, Hawai'i, USA August 22-27, 1999
Automatic PID Tuning: An Application of Unfalsified'Control *
Myungsoo Jun and Michael G. Safonovt
Dept. of Electrical Engineering - Systems
University of Southern California
Los Angeles, CA 90089-2563, USA

Key Words: Adaptive control, self-tuning control, unfalsified control, PID control, controller identification.

Abstract minimization of quadratic performance objectives in the


In this paper, we give detailed procedures for using time domain. However, it may be difficult to apply these
unfalsified control theory for real-time PID controller pa- methods for the automatic tuning of PID parameters to
rameter tuning and adaptation. Related to the candidate- more complex systems because the rules are based, either
elimination algorithms of machine learning, our PID tun- implicitly or explicitly, on identifying approximate plant
ing technique does not need a plant model and makes PID models. In this paper we describe a method based on un-
gain selection possible by just using observed data. Sim- falsified control theory for tuning PID parameters adap-
ulation results are included. tively based on input-output data only, that is, without a
plant model.
1. INTRODUCTION
Traditional controller synthesis theories contain many 2. UNFALSIFIED CONTROL THEORY
assumptions about the plant. However, some assumptions Further details about unfalsified control theory are de-
which are made to simplify modeling procedure restrict scribed in [6] and [7]. The formal definition of unfalsifica-
applicability and some are so unrealistic that they make tion and falsification is as follows:
designs based on those assumptions unreliable. Modeling
Definition 1 [6] A controller is said to be falsified by
techniques such as [3, 81 were proposed to improve tradi-
measurement information if this information is sufficient
tional modeling methods. However, these new modeling
techniques still have some assumptions ahout the plant.
to deduce that the performance specification ( r ,y, U ) E
With unfalsified control theory [6, 71, you can design Tapee Vr E R would be violated if that controller were
in the feedback loop. Otherwise, the controller is said to
a controller that is consistent with a performance objec-
be unfalsified.
tive and measured past data without plant models or as-
sumptions on the plant. The theory works by eliminat- With the above definition of unfalsification and fal-
ing or pruning hypotheses that are not consistent with sification we can state the following theorem in order to
evolving experimental data. The hypotheses in question solve unfalsified control problem. Let the symbol K de-
assert that members of a class of candidate controllers note the set of triples ( T , y, U) that satisfy the equations
can meet prescribed closed-loop performance goals. The that define the behavior of controller. Denote by P d n t a the
theory is related to certain artificial intelligence concepts, set of triples ( T , y, U) consistent with past measurements
such as list-then-eliminate and candidate-elimination al- of ( u , Y )- cf. [6].
gorithms of machine learning theory [4]. In this paper, we
use the unfalsified control theory to adaptively tune PID Theorem 1 [6] A control law K is unfalsified by mea-
controller gains. surement information set P d a t a iJ and only $ f o r each
There are several methods for tuning PID gains. One triple ( T O ,yo, U O ) E P d o t o n K, there ezists at least one pair
of the most widely used methods for tuning PID gains (211, y1) such that
manually is the Ziegler-Nichols method [9]. Astrom et
al. [l]proposed a procedure for automatic tuning of regu- (To1 Y i , U i ) E Pdota n Kfl Tspee (1)
lators of the PID type to specifications on phase and am- Fictitious reference signals occupy an important po-
plitude margin. Nishikawa et al. [5] proposed a method sition in unfalsified control theory. Given measurements
for determination of the control parameters based on the of plant input-output signals U , y, there may correspond
*Research supported in part by AFOSR Grant F49620-981-0026. for each candidate controller, say Ki, one or more ficti-
'Corresponding authors; email mjunObode.usc.edu, msa- tious reference signals i ; i ( t ) . The Fils are hypothetical sig-
fonovOusc.edu; fax +1-213-740-4449. nals that would have exactly reproduced the measured

0-7803-5500-8/99 $10.00 0 1999 IEEE 328


candidate controller

Controller

Figure 2: Generating the i-th fictitious reference signal


i;j (t).

means that, given past values of u(t) and y ( t ) , there is a


unique fictitious reference signal i;j ( t ) assoGiated with each
controller Kj. The signal r ' j ( t ) can be reliably computed
in real-time by filtering the measurement data ( u , y ) via
the following expression (obtained by rearranging Eq. (2)
K DS with appropriate substitutions):
ES+ 1
S

J
r'.' - + Skpi + kIi (U+ S Y ) . (3)

A bank of such filters (one for each i E I) may be used to


Figure 1: PID controller configuration with approximated
generate the fictitious reference signals r ' j ( t ) in real-time
derivative term
- see Fig. 2. One filter is required for each candidate
controller Kj (i.e., for each distinct triple of candidate PID
data (U,y ) if the candidate controller Kj had been in the gains ( k ~ , , k ~ , , k ~ , ) [ .
feedback loop during the entire time period over which We denote by [Ai,Bj, ej,
D j ] a state-space realization

the measured data (U,y) was collected. Because the data of filter associated with the i-th cacdidate_controller trans-
(U,y ) may have been collected with a controller other than fer function K i , (i € I). That is, [A;,&, Cj, bi]is a state-
Kj in the feedback loop, the fictitious reference signal r'; is space realization of the system in Fig. 2 with the values
in general not the same as the actual reference signal ~ ( t ) . of (kp,,kl,,k ~ , associated
) with the i-th controller Ki in-
A candidate controller Kj is called causally-left-invertible serted. The state vector is represented by Z i ( t ) .
if a unique values for its fictitious reference signal r'j(t) is
determined by past values of the open-loop data ~ ( t and ) 4. CONTROLLER PARAMETER
y(t). Further details about fictitious reference signals can ADAPTATION
be found in [7]. The main difference between unfalsified control and
other adaptive methods is that one can adjust controller
3. PID CONTROLLER parameters in unfalsified control based on measured data
PID control is used commonly in industrial and alone without any assumptions about the plant. Our algo-
aerospace applications. It is its simplicity and perfor- rithm for tuning PID gains uses only measured past data
mance characteristics that make PID popular. The ideal in adapting its gains. While, in principle, the unfalsified
PID controller can be expressed as U = ( k p + k I / s ) ( r - y ) - control theory allows for the set K to be an arbitrary sub-
SkDy, where k p , kI and kD are non-negative real numbers set of R" where n is the number of controller parameters
called the proportional gain, integral gain, and derivative to be adjusted, we discretize candidate controller set K
gain, respectively. The integral part makes steady-state so that it has only a finite number of elements in order to
tracking of step commands robust and the proportional simplify computations.
and derivative part affect stability and transient behav- At each time T ,the performance specification set TJpee
ior. consists of the set of triples ( T , y , U) satisfying an integral
The ideal PID controller has an improper transfer performance inequality of the form
function. It is hard to exactly implement the derivative
part. Thus, an approximated derivative $& is used in
realization where E is a small number. A PID controller
A
~ ( t=) - p + 1'Tspec(T(t), y ( t ) ,U(t))dt 5 0, vt E 10, TI
(4)
kI SkD where p 2 0 and Tspec(., -,.) are chosen by the designer.
U = (kP + s)(T -Y)- - &S+ 1
Y By Theorem 1, the i-th candidate PID controller K;
is unfalsified at time T by plant data ~ ( t )y(t), , (t E [O,T])
with approximated derivative term is shown in Fig. 1. if, and only if,
Standard PID controllers have gains k p > 0, IEI 2 0 ,
kD 3 0. They are always causally left invertible, which J ( i , t ) _< 0, vt E [O, T]
329
where c) if J ( i , k A t ) > 0 , then delete the controller in-
der element i from I (since Ki has been falsified
J ( i , t )5 -P + J,’ T s p e c ( ~ iY( (t t)),,u(t))dt, V t E [O,
71,
by the measured data up to time k a t ) ; else con-
tinue.
(5) \ - I

u ( t ) , y ( t ) , (t E [O,T]) is measured past plant data, and 3. I f the set I is empty, then terminate algorithm;
?i(t)denotes the fictitious reference signal for the i-th con- else, set the current controller to K;(k), i ( k ) =
troller Kj - see Fig. 2. argmin{J(i, k a t ) , i E I} and increment time (k t
Discretizing time, we may recursively compute each +
k l ) , go to step 1 and repeat.
of the fictitious. reference signals ? i ( k A t ) and its corre-
sponding cost J ( i , k A t ) at each time 7 = k a t . We use If the set I becomes the empty set, the algorithm ter-
MATLAB function c2d.m to discretize the fictitious refer- minates because all controllers in K are falsified. In this
ence signal generating systems depicted in Fig. 2. Eq. (5) case we have to either relax the performance specification
is discretized as or augment the set K with additional controller candi-
dates.
In general, many candidate controllers will be falsified
and discarded even before they are ever inserted into the
feedback loop. Consequently, the algorithm often con-
verges quite quickly. The current controller K;(kAt) re-
mains in the loop so long as it remains unfalsified by the
past data. If at some time k A t the current controller be-
comes falsified by new data ( u ( k A t ) y, ( k A t ) ) , then the
algorithm switches to a new controller K; which we chose
to be the one that has the largest index ; ( k A t ) among the
as yet unfalsified controller candidates Ki in K.
when p = 0.
The adaptation algorithm is as follows and detailed 5. SIMULATION
calculation procedure is described in Section 5. In this section we describe a simulation of PID con-
troller parameter adaptation using unfalsified control the-
ory. The simulation shown was conducted with no distur-
Algorithm 1 (Controller Unfalsification Procedure) bance, no noise and zero-initial conditions, though this is
INITIAL SETTING: not essential.
A The performance specification set Tspecis taken to be
a finite set K of m controller candidates Ki, i E I = the set of ( r ,y , U ) E x Lze x L2e, which for all T 2 0
{I, ..., m}. satisfy the inequality
., .)
performance functional Tspec(., llw1 * ( r - Y)Il; + lb2 * .I13 - 2 7 I11.114 +P (8)
sampling time At. where 11f113 = If(t)12dt, and * denotes the convolu-
tion operator. Design parameters are U (a constant rep-
the values of E, p and u(see Eq.(9). resenting the r.m.s. effects of noise on the cost), and
initial time k = 0. the signals wl and w2 are weighting filters. Therefore,
Tspec(@), Y(t), u(t)) is
initial consistency criterion J ( i ,0) = 0, i = 1 , . . m. e ,

T’pec(r(t),~ ( t ) , ~ (=t ) )
initial controller Km . +
Iwl * ( r ( t )- ?@))I2 Iw2 * u(t)12- u2 - Ir(t)12 (9)
PROCEDURE (at each time r = k a t ) : The simulation is conducted as follows: At each sam-
pling time T = k a t , the data u ( k A t ) and y ( k A t ) are
1. Measure u(lcAt) and y ( k A t ) .
measured. Then, the controller unfalsification procedure
2. For each i E I, (Algorithm 1 ) is invoked to determine which, if any, previ-
ously unfalsified controllers are now falsified based on the
a) calculate i i ( ( k + 1)At) and ? i ( k A t ) using a consistency test
MATLAB c2d.m discretized approximation of J ( i ,k A t ) I0. (10)
Fig. 2, The consistency criterion J”(i,’kAt)is computed based on
b) calculate j ( i ,k a t ) using Eq. (7), and the discrete-time approximation (7) and MATLAB c2d .m
330
04
02

'0 2 4 6 8 10 12 14 16 16 20
. : V I
'0 2 4 6 8 10 12 14 16 18 20

f lT----7
30, 1

="K 0

-lo\
-20 0 2 4 6 8 10 12 14 16 18 20
-
p -5

-10 -

lima (ue)

Figure 3: Plots of signals y(t) and u ( t ) when the states Figure 4: Simulation results showing good transient re-
of the controller are not reset at switching time. Poor sponse with correctly reset controller states
transients with spikes can occur if we fail to properly reset

! !
controller states at switching time.

discrete-time approximations of the ? i ( t ) system of Fig. 2


s
and of the filters wl and 202.
i 0 2 4 6 8 10 12 14 16 18 20
When the current controller is among those falsified by
the most recent data, the algorithm switches t o a new con-
troller. At each such switching time, the control algorithm
p 20
resets the states of the integrator term (kp, 4- %) and the
approximate differentiator term s,
thereby preventing '0 2 4 6 8 10 12 14 16 18 20

! !
any discontinuity in either of their respective output sig-
nals, say u p ~ ( tand
) u ~ ( t )This
. assures that the control
signal u ( t ) = u p ~ ( t-) u ~ ( t is) smooth, avoiding abrupt t o 2
changes or high peaks that might otherwise result from d 0 2 4 6 8 Time10(Mc) 12 14 16 16 20

switches in ( k p , k ~ or
) kD, respectively. If we do not reset
the states of the controller at switching time but maintain
them as were before switching, we can see undesirable high Figure 5: Simulation results showing the changes in con-
peaks in the signal u ( t ) and higher overshoot in the signal troller gains
y(t) from the Fig. 3. Therefore, it is important to reset
controller states at switching time in such a way as to
prevent this. The simulation was carried out using Sirnulink. The
The following were used in the simulation: results are as shown in Fig. 4 and Fig. 5, and the Simulink
252 2s 10
model used in simulation is in Fig. 6. The figure shows
unknown plant P(S) = (s-l)(s+t~tloo) two times at which gain switching occurs. The values of
0.01 k p and I(I switch at the first switch time, and at the
wl(s) = w2(s) = 1,2(~+1)3 second switch all three gains k p , kr and kD change. At
step reference signal r ( t ) = 1, Vt 2 0 each switching time, the current controller is falsified and
a new, as yet unfalsified controller is switched into the
all initial conditions at time 0 are zero close loop. The final values of the controller parameters
are k p = 80, kI = 50 and kD = 0.5. The final number of
sampling time At is 0.05 second
unfalsified elements of the set K is 12.
the value of E = 0.01
no noise (a = 0) and zero initial conditions ( p = 0).
6. DISCUSSION
While the simulation shown in Fig. 4 was conducted
KD = {0.6,0.5}, K p = {5,10,25,80,110}, KI = assuming no noise (a = 0) and zero initial conditions
{2,50,100}. Thus, the number of candidate con- ( p = 0), the algorithm is actually fairly robust to noise
trollers in K is 30. and initial state perturbations. However, if the noise or

331
TO worlcspeq
.

I I ........ _.. .
, ,?
., r._ .? .... :.;f-.
I
I

. ,...
~
..................................
I
p;!...;?
,A.;’t: ,:;
i’, ‘\.,,.,.:. ..,...,.
I //

Figure 6: Simulink model used in simulation

initial conditions are very large, then it may sometimes systems, to nonlinear time-varying plants as well as to
be necessary to use non-zero values for p and/or c in the high-order linear time-invariant plants.
performance specification (8). Irrespective of how complicated the plant may be, the
If a plant is slowly time-varying or subject to occa- PID controllers themselves are not very complicated and
sional abrupt changes, the far past data may not contain we can easily compute the unfalsified controller param-
much information about current plant. In such cases, ei- eters at each time via the recursive procedure described
ther an exponential forgetting factor or a finite-memory in Section 4. A limitation of our procedure is that the
data-window should be introduced. set K of unfalsified controllers may shrink to a null set
While the simulation only shows the result for the case if there are no PID controllers in K that are capable of
in which a step command r ( t ) is the input, the algorithm meeting the performance specification (4).But when this
also works when for inputs other than a step signal. It is is not the case, convergence of the algorithm is typically
important only that the input have sufficient strength and rapid and sure-footed. Our experience with simulations
spectral breadth to allow candidate controllers Ki to be re- has been that convergence is usually so rapid that satis-
liably ordered by the performance specification functional factory transient response is obtained on the first try even
J ( i ,t). with no prior knowledge of the plant.

7. CONCLUSION References
In this paper, we described in detail how to adaptively [l] Astrom, K. J . , and T. Hagglund, “Automatic tuning
tune the parameters of a PID controller in real-time using of simple regulators with specifications on phase and
unfalsified control theory. An advantage of this approach amplitude margins,” Autornatica, v01.20, pp.645-651,
is that no plant model is required. We need only real-time 1984.
measurements of input-output data ( U ,y) from the plant.
Thus we may apply this method to distributed parameter [2] Franklin, G. F., D. J. Powell and M. L. Workman,
332
Digital Control of Dynamic Systems, 3rd ed, Reading,
MA: Addison-Wesley, 1997.
[3] Kosut, R. L., M. K . Lau and S. P. Boyd, “Identifi-
cation of systems with parametric and nonparamet-
ric uncertainty,’’ Proc. 1990 American Control ConJ,
San Diego, CA, May 1990.
[4] Mitchell, T . M., Machine Learning, New York, NY:
McGraw-Hill, 1997.
[5] Nishikawa, Y., N. Sannomiya, T. Ohta and H.
Tanaka, “A methods for auto-tuning of PID control
parameters,” Automatica, v01.20, pp.321-332, 1984.
[6] Safonov, M. G., and T . C. Tsao, “The unfalsified
control concept and learning,” IEEE Trans. Automat.
Contr., vol. 42, no. 6., pp. 843-847, Jun. 1997.
[7] Tsao, T . C., “Set theoretic adaptor systems,” Ph.D.
dissertation, Univ. of Southern California, May 1994.
[8] Younce, R. C., and C. E. Rohrs, “Identification with
nonparametric uncertainty,” Proc. IEEE ConJ on
Decision and Control, Honolulu, HI, Dec. 1990.
[9] Ziegler, J. G., and N. B. Nichols, “Optimum set-
ting for automatic controllers,” Trans. ASME, vo1.64,
pp.759-768, 1942.

333

Potrebbero piacerti anche