You are on page 1of 2

A Simple PID Controller with Adaptive Parameter in a dsPIC; Case of Study

João Chaínho, Pedro Pereira, Silviano Rafael1 and A.J. Pires1


1
LabSEI - Escola Superior de Tecnologia de Setúbal
Instituto Politécnico de Setúbal/Campus do IPS, Estefanilha,
2914-508 Setúbal, Portugal
Telef:+351 265 790 000, e-mail: srafael@est.ips.pt

Abstract
2. PID Contro lle r
The main goal of this work consists in the development and
implementation of a discrete PID controller with fast response
and parameters adaptation capability, in an automatic way. This The used discrete PID controller is characterized by the
controller is based on a classic PID where a parameters following equation (1).
adaptation algorithm was associated in order to control a t e( t) − e( t−1)
process. This PID do not require any kind of adjustment or u( t ) = K p ( t ) e(t ) + K i (t )Ts ∑ e k + K d (1)
calibration from the operator,. For the parameters adaptation k =0 Ts
one fuzzy system with a Sugeno inference mechanism was
chosen and some simplification of this system algorithm was Where e(t) is the error of the system response in the t
implemented. These simplifications had the goal of decreasing instant , Ts is the signal sampling period and Kp , Ki and Kd
the processing time and the controller response (250µs), in are the proportional, integral and derivative controller
order to control fast processes without losing stability. The gains, respectively.
developed algorithm was implemented in a recent dsPIC30F. This algorithm, associated with the error calculation, is
of very fast execution, however its parameters should be
Keywords : PID Controller, Adaptive Parameter, Fuzzy previously and appropriately adjusted.
logic system, control systems.
Actually, there are various calculation and parameters
1. Introduction adjustment methods for PID controllers (Kp , Ki and Kd ).
From static parameters adjustment methods, like Ziegler –
Nichols and Kitamori methods, to methods where the
The PID controller is much used in the control loops of
parameters are dynamic, depending on the system
industrial processes. Its parameters are need to be adjusted
response, as, for example, the ones based on Fuzzy Logic
in function of the control process and remain unchanged
systems [2, 3], Neural Network systems or Neuro-Fuzzy
during its regular activity.
systems. The disadvantage of these last ones is the fact of
The start up of the PID controller requires a not always needing too many processing resources, being therefore
simple work in the parameters adjustment, besides the usually slower.
existence of some methodologies, described in [1].
Despite the helpful of these methodologies in calculating
the approached parameters values, is however necessary 3. Adaptation Algorithm
an observation period to survey with greater certainty the
controller performance, which requires, in some cases, a The considered adaptation algorithm intends to have the
substantial time amount. This is interpreted as a advantage of simplicity and to be implemented with few
disadvantage or a difficulty in the controller start-up hardware resources and simultaneously to obtain a
service reduced implementation time (processing cycle time). The
Other more complex cases exist due to their question related with the processing time is very important
particularities, where there are small procedures changes because it limits the quickness of the control signal, the
that compromise the PID controller performance. These quickness of the controller parameters adaptation and
situations are observed by the trends maps analyzed by consequently it limits the set performance and behaviour
the process operators, occurring the necessity of a in the reference signal tracking.
controller parameters readjustment. The reason is difficult The adaptation algorithm is inspired in a Sugeno fuzzy
to define or explain, being, most of the time, from diverse system to which were applied some simplification.
procedures aspects. The select and activation system of the adaptation
This work presents a proposal that contributes to reduce expressions can be represented as in figure 1 and it is
or even to prevent the already referred problems. The characterized by the error percentage universe of
imposed requirements are: fast response, do not need any discourse and by 4 rectangular membership functions
type of previous adjustment and universality of distributed like in figure 1.
communication with the sensors, automates (PLC) or
scada systems (DCS).
Figure 1: Distribution and type of membership functions

The membership functions n ={1, 4} activate expression


Figure 3: Environment of MPLAB IDE development
(2) when the error percentage is lower than -4 or greater
than 4, actualizing the Kp parameter value. 5. Experimental Results
K p ( t) = K p ( t−1) + ϑ .e( t) .µ n (2)
In figure 4 it is observed the tracking of a rectangular
The membership functions n ={2, 3} activate expression reference signal function between 20% and 80% of the
(3) when the error percentage is in the interval ]-4, -1 ] or [ maximum process value and the response when the
1, 4[, actualizing the Ki parameter value. system is of first order (a) and second order (b).
K i (t ) = K i (t −1) + ϑ.e(t ) .µ n (3)

In expressions (2) and (3) ϑ represents the adaptation


factor, e(t) the error value in the instant t and µn the
activation of the adaptation function of the membership
function n.

4. Implementation (a) (b)


Figure 4: Tracking of a rectangular reference signal with
The described system was implemented in connection process of (a) first order (b) second order
to a PLC due to control loop requirement in terms of the The Kp and Ki adaptation depends on the evolution of
response speed, substituting the PID developed in the PLC the error value and the adaptation factor value (in figure 4
as in figure 2. the adaptation factor value is always the same).
More results and its discussion will be presented in the
final paper.
6. Conclus ions

The main advantage of the presented system is that it


does not need any kind of adjustment or PID calibration.
It has the advantage of the adaptive systems, quickly
compensating the disturbances that can appear in the
system control functioning.
One limitation appears in the third order process systems ,
and is in phase of study and implementation.
The applications are the most diverse in the industry due
to its simplicity, use of usual electrical measures and
having fast start up application and use.

Figure 2: Blocks diagram of the system REFERENCES


[1] Aström K.J., Hägglund T., “PID Controllers – Theory, Design and
The control system connected to the PLC was made by Tunning”, Instrument Society of América,67 Alexandre
Drive,POBox 12277,Research Triangle Park, North Carolina
two analogical signals, the PLC reference signal and the 27709,USA, 1955.
control system output signal, and two binary signals that [2] J.H. Kim and S.J. Oh, “ A fuzzy PID controller for nonlinear and
represent the set functioning status. uncertain system”, in Soft Computing, 4,Springler Verlag, 2000,
The controller was developed in integrated MPLABR pp. 123-129.
IDE software allowing the programming and debugging [3] Pauli Viljama and Heikki Koivo, “Fuzzy logic in PID gain
scheduling” Third European Congress on Fuzzy and Intelligent
functions, presented in figure 3. Technologies EUFIT'95. Aachen, Germany, August 28 - 31,
ELITE-foundation, vol. 2, pp. 927-931

You might also like