Adaptive quasi-optimal gains tuning of PI-fuzzy controllers

6
Adaptive Quasi-Optimal Gains Tuning of PI-Fuzzy Controllers Catarina Lucena *† Luis Palma * Alberto Cardoso Paulo Gil *† * Departamento de Engenharia Electrot´ ecnica, Faculdade de Ciˆ encias e Tecnologia, Universidade Nova de Lisboa Email: [email protected], [email protected], [email protected] CISUC, Department of Informatics Engineering, University of Coimbra, Portugal Email: [email protected], [email protected] Abstract—This paper proposes a new methodology for tuning the scaling factors, or gains, of fuzzy proportional-integral controllers, where the closed loop system performance is explicitly taken into account. The tuning problem is formulated as an online constrained non-linear optimization problem using a linear model structure to capture the system’s dynamics. The model parameters are updated online using the most recent information collected from the plant. In the case of stringent sampling times the optimization routine is prematurely stopped before a local minimum is reached and the obtained gains subsequently provided to the controller. Experimental results from a testbed illustrate the relevance of the proposed tuning technique. I. I NTRODUCTION Standard Proportional-Integral-Derivative (PID) control techniques are still in these days largely used in the process industry, mainly due to its recognized simplicity, not only in terms of the underlying supporting theory, in the case of linear systems, but also owing to available straightforward tuning methods. However, in the case of nonlinear systems it is difficult to get a satisfied closed loop performance over extended operating regimes by using nonadaptive classical linear controllers [1]. In what Fuzzy Logic Control (FLC) techniques are con- cerned, they are inherently nonlinear approaches since they incorporate three main sources of nonlinearities, namely, the rule base, the inference engine and the fuzzification and defuzzification modules. Since the first application [2] This control paradigm based on fuzzy logic [3] has proven to be successful in controlling many nonlinear systems and it has been suggested as an alternative approach to conventional control techniques [4], [5], [6]. Not only FLC is more robust than conventional controllers, but also its performance is less sensitive to parametric variations of systems [7] or to un- measured disturbances. On the other hand, recent applications of FLC methodologies have shown great potential in the context of complex ill-defined systems that can effectively be controlled by a skilled operator without the explicit knowledge of the underlying system dynamics [8]. Nevertheless the great potential of fuzzy control techniques in a wide range of applications, finding a good setting for a particular controller, by choosing appropriate linguistic vari- ables, membership functions, rules and scaling factors, and subsequently tune it remains a challenging subject due to the lack of a systematic framework. Furthermore, another open issue in the context of fuzzy control design refers to how to explicitly reflect in the tuning stage the concept of closed loop performance. This would lead to an improved fuzzy control system behavior over extended operation regimes, while enabling a balance between the tracking error, energy consumption and actuators wearing. The present paper proposes a new conceptual approach for tuning PI-fuzzy scaling factors by online solving a nonlinear optimization problem subject to a set of explicit constraints on scaling factors, control actions and outputs. The system’s dynamics is here captured by using a linear model structure, whose parameters are updated online. One of the main advan- tages of the proposed approach are the explicit incorporation of a closed loop performance criterion in the gains computation and the controller ability to cope with changing dynamics and non-modeled disturbances. Additionally, this approach not only makes straightforward the tuning procedure, avoiding the ever cumbersome and subjective trial-and-error based heuristics approaches, but also promotes a more efficient and rational usage of resources, including energy, and ultimately contributing to sounding improvements in terms of overall efficiency and longevity of control systems. II. FUZZY LOGIC CONTROL SYSTEMS Fuzzy Logic can be defined as a theory of vagueness and uncertainties. This theory provides an approximate, yet effective, mean of describing the behavior of systems, which can be too complex and/or ill-defined to enable a precise mathematical analysis or an analytical description under the form of a quantitative model [9]. The basic structure of a FLC system (Fig. 1) consists of four conceptual components, namely, the knowledge base, the fuzzification module, the inference engine and the de- fuzzification module. The knowledge base system contains all the knowledge required for the fuzzy control system [10], specifically, the fuzzy control rule base, i.e. the procedural part of the knowledge, and the data base, comprising facts, terms and concepts. Regarding the inference engine, it is a reasoning mechanism that performs inference procedures upon the fuzzy control rules and given conditions, in order to derive control actions. The Finally, the fuzzification module defines a mapping from a real-value space to a fuzzy space, while the defuzzification module implements a mapping from a fuzzy INES 2012 • IEEE 16th International Conference on Intelligent Engineering Systems • June 13–15, 2012, Lisbon, Portugal – 399 – 978-1-4673-2695-7/12/$31.00 ©2012 IEEE

Transcript of Adaptive quasi-optimal gains tuning of PI-fuzzy controllers

Adaptive Quasi-Optimal Gains Tuning of PI-FuzzyControllers

Catarina Lucena∗† Luis Palma ∗ Alberto Cardoso† Paulo Gil∗†∗ Departamento de Engenharia Electrotecnica, Faculdade de Ciencias e Tecnologia, Universidade Nova de Lisboa

Email: [email protected], [email protected], [email protected]† CISUC, Department of Informatics Engineering, University of Coimbra, Portugal

Email: [email protected], [email protected]

Abstract—This paper proposes a new methodology for tuningthe scaling factors, or gains, of fuzzy proportional-integralcontrollers, where the closed loop system performance is explicitlytaken into account. The tuning problem is formulated as anonline constrained non-linear optimization problem using a linearmodel structure to capture the system’s dynamics. The modelparameters are updated online using the most recent informationcollected from the plant. In the case of stringent samplingtimes the optimization routine is prematurely stopped before alocal minimum is reached and the obtained gains subsequentlyprovided to the controller. Experimental results from a testbedillustrate the relevance of the proposed tuning technique.

I. INTRODUCTION

Standard Proportional-Integral-Derivative (PID) controltechniques are still in these days largely used in the processindustry, mainly due to its recognized simplicity, not onlyin terms of the underlying supporting theory, in the case oflinear systems, but also owing to available straightforwardtuning methods. However, in the case of nonlinear systemsit is difficult to get a satisfied closed loop performance overextended operating regimes by using nonadaptive classicallinear controllers [1].

In what Fuzzy Logic Control (FLC) techniques are con-cerned, they are inherently nonlinear approaches since theyincorporate three main sources of nonlinearities, namely, therule base, the inference engine and the fuzzification anddefuzzification modules. Since the first application [2] Thiscontrol paradigm based on fuzzy logic [3] has proven to besuccessful in controlling many nonlinear systems and it hasbeen suggested as an alternative approach to conventionalcontrol techniques [4], [5], [6]. Not only FLC is more robustthan conventional controllers, but also its performance is lesssensitive to parametric variations of systems [7] or to un-measured disturbances. On the other hand, recent applicationsof FLC methodologies have shown great potential in thecontext of complex ill-defined systems that can effectively becontrolled by a skilled operator without the explicit knowledgeof the underlying system dynamics [8].

Nevertheless the great potential of fuzzy control techniquesin a wide range of applications, finding a good setting for aparticular controller, by choosing appropriate linguistic vari-ables, membership functions, rules and scaling factors, andsubsequently tune it remains a challenging subject due to thelack of a systematic framework. Furthermore, another open

issue in the context of fuzzy control design refers to how toexplicitly reflect in the tuning stage the concept of closedloop performance. This would lead to an improved fuzzycontrol system behavior over extended operation regimes,while enabling a balance between the tracking error, energyconsumption and actuators wearing.

The present paper proposes a new conceptual approach fortuning PI-fuzzy scaling factors by online solving a nonlinearoptimization problem subject to a set of explicit constraintson scaling factors, control actions and outputs. The system’sdynamics is here captured by using a linear model structure,whose parameters are updated online. One of the main advan-tages of the proposed approach are the explicit incorporation ofa closed loop performance criterion in the gains computationand the controller ability to cope with changing dynamicsand non-modeled disturbances. Additionally, this approach notonly makes straightforward the tuning procedure, avoidingthe ever cumbersome and subjective trial-and-error basedheuristics approaches, but also promotes a more efficient andrational usage of resources, including energy, and ultimatelycontributing to sounding improvements in terms of overallefficiency and longevity of control systems.

II. FUZZY LOGIC CONTROL SYSTEMS

Fuzzy Logic can be defined as a theory of vaguenessand uncertainties. This theory provides an approximate, yeteffective, mean of describing the behavior of systems, whichcan be too complex and/or ill-defined to enable a precisemathematical analysis or an analytical description under theform of a quantitative model [9].

The basic structure of a FLC system (Fig. 1) consists offour conceptual components, namely, the knowledge base,the fuzzification module, the inference engine and the de-fuzzification module. The knowledge base system containsall the knowledge required for the fuzzy control system [10],specifically, the fuzzy control rule base, i.e. the proceduralpart of the knowledge, and the data base, comprising facts,terms and concepts. Regarding the inference engine, it is areasoning mechanism that performs inference procedures uponthe fuzzy control rules and given conditions, in order to derivecontrol actions. The Finally, the fuzzification module definesa mapping from a real-value space to a fuzzy space, while thedefuzzification module implements a mapping from a fuzzy

INES 2012 • IEEE 16th International Conference on Intelligent Engineering Systems • June 13–15, 2012, Lisbon, Portugal

– 399 –978-1-4673-2695-7/12/$31.00 ©2012 IEEE

Fig. 1. General structure of a Mamdani-type Fuzzy Logic System.

space defined over an output universe of discourse to a real-valued space [4].

A. PI-Fuzzy Controller Architecture

With no loss of generality let consider a two-dimension PI-fuzzy controller structure, in which error e (1) and change inerror ∆e (2) are selected as input words, while the output fromthe fuzzy logic system is chosen as the increment of controlaction.

e(k) = r(k)− y(k) (1)

∆e = e(k)− e(k − 1) (2)

with k the current discrete time, y the system output and r thereference signal. Fig. 2 shows the PI-Fuzzy controller structure

Fig. 2. PI-Fuzzy Logic Control schematics.

where the scaling factors Ke, K∆e and K∆u are explicitlyrepresented, along with the normalized error e, change in error∆e and the denormalized increment of control action ∆u,which are given by:

e(k) = Ke.e(k) (3)

∆e = K∆e.∆e(k) (4)

∆u = K∆u.∆u (5)

with ∆u the normalized increment of control action.

B. Optimal Tuning of Scaling Factors

Optimization methods are classified according to the typeof the search space A ⊆ Rn and objective functions. Thesimplest method is the linear programming, which concernsthe case where the objective function L(·) to be minimized islinear and the restriction space A is defined using only linearequality and inequality constraints [11]. However, in general,

the cost function and/or the constraints contain nonlinearities,leading to a nonlinear programming problem for whichmultiple minima may exist owing to the nonconvexity of theoptimization problem.

This work considers the following optimization problem inwhich the performance index is described by a single objectivefunction subject to a set of constraints:

minVK≡ min

K

Np∑k=1

Lk(e(k), u(k − 1),K) (6)

subject to:y(k)− g(k) = 0φ(y(k), u(k),K) = 0ψ(y(k), u(k),K) ≤ 0

(7)

where V ∈ R+ is the objective function to be minimized,Np ∈ N+ the prediction horizon, y ∈ Rp the output vector,u ∈ Rm the control trajectory, K ∈ Rq the vector of scalingfactors, g(·) the nonlinear system dynamics model, φ(·) andψ(·) functions defining equality and inequality constraints.

In what the optimization of PI-Fuzzy controller gains isconcerned it is here carried out using the MATLAB functionfmincon() available in the Optimization Toolbox. The algorithmrelies on the Hessian of the Lagrangian (8) and uses a meritfunction in the search for optimized gains. In each iterationthe Hessian matrix is calculated based on a quasi-Newtonapproximation.

52xxL(x, λ) = 52f(x) +

∑λi52 ci(x) +

∑λi52 ceqi(x)

(8)with f the objective function, c the nonlinear inequalityconstraint vector, ceq the nonlinear equality constraint vectorand λi the Lagrange multipliers.

C. Online gains tuning

Generally, the constrained nonlinear optimization problemassociated with gains tuning is a computationally demandingproblem. In the case of mild or stringent sampling frequenciesit might happen that the specified sampling interval is exceededby the optimization routine. For this reason, in the presentwork the underlying optimization problem is implemented

C. Lucena et al. • Adaptive Quasi-Optimal Gains Tuning of PI-Fuzzy Controllers

– 400 –

under the distributed computation paradigm.

The architecture of the PI-Fuzzy controller is composed oftwo threads, the main thread (Fig. 3), where the communica-tion with the plant is carried out, and the optimization thread(Fig. 4), devoted to optimal gains tuning. The communicationbetween the threads is done using the TCP/IP protocol, asum-ing the optimization cycle acting as a server. The main threadis periodically sending the updated ARX model, together withpast input and current output data to the optimization thread,which provides the optimized gains as soon as the optimizationprocess execution is concluded. In case the optimized gains arenot available, the previous gains will be retained, in order tonot compromising the control cycle in terms of sampling time.

1) ARX Parameter Estimation: Consider a linear discrete-time SISO system expressed under the form of a ARX modelof the form:

A(q−1)y(k) = q−dB(q−1)u(k) + e(k) (9)

where y(k) and u(k) are the output and input sequences,respectively. A(q−1) and B(b−1) are the polynomials in theback shift operator q−1 expressed as

A(q−1) = 1 + a1q−1 + ...+ anq

−n (10)

B(q−1) = b0 + b1q−1 + ...+ amq

−m, b0 6= 0 (11)

with d a pure time delay. newlineThe corresponding predictor can be expressed in the regres-

sion vector form as:

y(k + d) = θϕT (k) (12)

where θ, ϕ ∈ Rn+m+d are defined by

θ =[a0 a1 ... an−1 b0 ... bm+d−1

]T(13)

ϕ(k) = [y(k) ... y(k − n+ 1) u(k) ...

u(k −m− d+ 1) ]T(14)

In the proposed approach θ is update recursively accordingto the recursive least square method:

P (k) =P (k − 1

λ

ϕ(k)ϕ(k)TP (k − 1)

λ+ ϕ(k)TP (k − 1)ϕ(k)(15)

e(k) = y(k)− y(k) (16)

θ = θ(k − 1) + P (k)ϕ(k)e(k) (17)

where P (k) is the covariance matrix.

III. EXPERIMENTS ON A TESTBED

This section presents experimental results collected on theFeedback R© Process Trainer PCT 37-100. The experimentsaim to compare the performance of a PI-fuzzy control sys-tem, where the gains are obtained according to the proposedmethodology, against a PI-fuzzy control system for which thescaling factors are tuned based on the classical PI-controlcontrol approach technique[12].

Fig. 3. Main thread of the controller cycle.

A. Process Trainer PCT 37-100The Process Trainer PCT 37-100 shown in Fig. 5 comprises

a variable-speed axial fan, regulated via a potentiometer that

INES 2012 • IEEE 16th International Conference on Intelligent Engineering Systems • June 13–15, 2012, Lisbon, Portugal

– 401 –

Fig. 4. Optimization thread.

circulates an airstream along a polypropylene tube. The airflowrate is heated by means of a heating element controlled by athyristor circuit. A thermistor detector is incorporated in thesetup to sensing the temperature at the insertion point.

The experiments concern the control of the airstream tem-perature by manipulating the input voltage (the control vari-able) to the heater grid. The default fan speed was adjusted toposition 5, while the sampling period was set as 0.1 second.

B. PI-Fuzzy Controller Design

The PI-fuzzy controller comprises two inputs, namely, thecontrol error and the change in error, and one output, underthe form of control action increment (see Fig. 2).

Regarding the normalized universe of discourse for eand ∆e they were chosen to be

[−1.5 , 1.5

]and par-

titioned into seven fuzzy sets, namely, {NB,NM,NS,ZE, PS, PM,PB} (NB, Negative Big; NM , NegativeMedium; NS, Negative Small; ZE, Zero; PS, Positive Small;PM , Positive Medium; PB, Positive Big). For the fuzzy

Fig. 5. Feedback R© Process Trainer PCT 37-100.

TABLE IFORMAT OF THE RULE BASE[13].

e ∆e NB NM NS ZE PS PM PBNB NB NB NB NB NM NS ZENM NB NB NB NM NS ZE PSNS NB NB NM NS ZE PS PMZE NB NM NS ZE PS PM PBPS NM NS ZE PS PM PB PBPM NP ZE PS PM PB PB PBPB ZE PS PM PB PB PB PB

controller output, ∆u, the corresponding universe of discoursewas defined in the range

[−1.0 , 1.0

], and assuming a

partitioned similarly to those considered for e and ∆e.The fuzzy inference is the Mamdani-type inference (18),

while the controller output is generated by the CentroidDefuzzification technique.

The membership function for e and ∆e are presented inFig. 6 and the membership function for ∆u are in Fig. 7.

µe/∆e(e,∆e) = min(µA(e), µB(∆e)) (18)

with µ the membership value. Concerning the rule base usedin this work it comprises forty-nine rules, as shown in TableI.

Fig. 6. Membership functions of e and ∆e.

C. Gains tuning based on the classical PID tuning approach

The first experiment was carried out using a fuzzy controllerwhere its gains were tuned based on the classical controllers

C. Lucena et al. • Adaptive Quasi-Optimal Gains Tuning of PI-Fuzzy Controllers

– 402 –

Fig. 7. Membership functions of ∆u.

tuning approach [12]. According to this approach, the scalingfactors of a PI-Fuzzy controller are given by:

K∆uPI= KT

M

Ti; (19)

KePI=

1

M; (20)

K∆ePI=TiM

; (21)

with T the sampling time, Ti the PI controller time constant,K the PI controller gain and M the universe range.

The output of the PI-FLC is given by:

∆u(k) = K∆uPID{F{K∆ePI

∆e(k)+KePIe(k)}}+u(k−1)

(22)Fig. 8 shows the closed loop response and input signals for

the PI-FLC with the gains K∆uPI= 1, 3860,KePI

= 0, 6667and K∆ePI

= 0, 2525 were computed by using theconventional tuning approach.

As can be inferred from this figure, the closed loop systemresponse is rather oscillatory as a result of an aggressivecontroller modus operandi, whose behavior is reflected in thecontrol signal signal variance.

0 10 20 30 40 50 60 7030

35

40

45

Tem

per

atu

re [

Cº]

Time [s]

Output

Reference

0 10 20 30 40 50 60 700

1

2

3

4

5

Inp

ut

[V]

Time [s]

Fig. 8. SISO system controlled with a conventional based PI-Fuzzy controller.

D. Online optimal gains tuning

This section focuses on the incorporation of a PI-Fuzzycontroller for temperature control, where the gains were com-puted by solving an online nonlinear constrained optimizationproblem and assuming the system dynamics described by anARX model. Its parameters are recursively updated using themost recent input/output data collected from the plant. Theundelying optimization problem can be written as follows:

minK

{∑NP

k=0

[y(k)− r(k)

]2+ 0.8

[u(k)− u(k − 1)

]2}(23)

subject to the system dynamics and to

0 ≤ y(k) ≤ 60, k = 1, ..., NP (24)

0 ≤ u(k) ≤ 5, k = 0, ..., NP − 1 (25)

Ke ≥ 0 (26)

K∆e ≥ 0 (27)

K∆u ≥ 0 (28)

with K = [Ke K∆e K∆u]T the vector of gains and u(k)given according to,

u(k) = u(k − 1) +K∆u ×∆u(k) (29)

Fig. 9 shows the closed loop system response while in 10 areplotted the PI-Fuzzy controller scaling factors over time. Ascan be inferred, the proposed approach provides a smoothercontrol system behavior in terms of output and control actions,while allowing the invaluable adaptiveness of the controller.

In order to comparatively assess the controllers’ perfor-mance two metrics were considered, namely, the root meansquared of error (RMSE) given according to (30) and the rootmean squared of control action increment (RMSI) given by(31). Table II presents the corresponding metrics, corroborat-ing the outperformance of the proposed approach.

RMSE =

√√√√∑Nk=1

[y(k)− r(k)

]T [y(k)− r(k)

]∑Nk=1 r(k)T r(k)

(30)

RMSI =

√[u(k)− u(k − 1)

]T [u(k)− u(k − 1)

]N

(31)

TABLE IIPERFORMANCE METRICS FOR THE THREE-TANK SYSTEM.

Controller RMSE RMSIConventional based PI-Fuzzy controller 0, 0937 0, 0095

Online Optimal PI-Fuzzy controller 0, 0861 0, 0044

INES 2012 • IEEE 16th International Conference on Intelligent Engineering Systems • June 13–15, 2012, Lisbon, Portugal

– 403 –

0 100 200 300 400 500 600 70030

35

40

45

Tem

per

atu

re [

Cº]

Time [s]

Output

Reference

0 100 200 300 400 500 600 7000

1

2

3

4

5

Input

[V]

Time [s]

Fig. 9. Optimal PI-Fuzzy controller response.

0 10 20 30 40 50 60 700

0.2

0.4

0.6

0.8

Ke

0 10 20 30 40 50 60 700

0.5

1

K∆ e

0 10 20 30 40 50 60 700

1

2

3

K∆ u

Time [s]

Fig. 10. Optimal PI-Fuzzy controller gains over time.

IV. CONCLUSIONS

This paper addressed the problem of tuning the gains ofProportional plus Integral Fuzzy Controllers. The proposedapproach takes into account the closed loop control system

performance and is formulated in terms of a constrained non-linear optimization problem. Results collected from a testbeddemonstrate the effectiveness and pertinence of the proposedmethodology, not only in terms of easing the automatingprocess of tuning, but also by providing invaluable optimalityand adaptiveness features to fuzzy logic controllers, whichdecisively contributes to enhance the control system resilienceto changing dynamics and unmodeled disturbances.

REFERENCES

[1] L. A. Zadeh, “Outline of a new approach to the analysis of complexsystems and decision processes,” no. 1, pp. 28–44, 1973.

[2] E. H. Mamdani, “Application of fuzzy algorithms for control of simpledynamic plant,” Proceedings of the Institution of Electrical Engineers,vol. 121, no. 12, pp. 1585–1588, 1974.

[3] L. Zadeh, “Fuzzy sets*,” Information and control, vol. 8, no. 3, pp. 338–353, 1965.

[4] G. Feng, “A survey on analysis and design of model-based fuzzy controlsystems,” vol. 14, no. 5, pp. 676–697, 2006.

[5] R.-E. Precup and H. Hellendoorn, “A survey on industrial applicationsof fuzzy control,” Computers in Industry, vol. 62, no. 3, pp. 213 – 226,2011.

[6] Michio and Sugeno, “An introductory survey of fuzzy control,” Infor-mation Sciences, vol. 36, no. 2, pp. 59 – 83, 1985.

[7] H. O. Wang, K. Tanaka, and M. F. Griffin, “An approach to fuzzy controlof nonlinear systems: stability and design issues,” vol. 4, no. 1, pp. 14–23, 1996.

[8] C. C. Lee, “Fuzzy logic in control systems: fuzzy logic controller. i,”vol. 20, pp. 404–418, 1990.

[9] R. Miikkulainen, B. D. Bryant, R. Cornelius, I. V. Karpov, K. O. Stanley,and C. H. Yong, “Computational intelligence in games,” 2006.

[10] J. A. Bernard, “Use of a rule-based system for process control,” vol. 8,no. 5, pp. 3–13, 1988.

[11] A. Schrijver, Theory of linear and integer programming. New York, NY,USA: John Wiley & Sons, Inc., 1986.

[12] P. Pivonka, “Comparative analysis of fuzzy pi/pd/pid controller basedon classical pid controller approach,” in Fuzzy Systems, 2002. FUZZ-IEEE’02. Proceedings of the 2002 IEEE International Conference on,vol. 1, pp. 541 –546, 2002.

[13] H.-X. Li and H. B. Gatland, “Conventional fuzzy control and itsenhancement,” vol. 26, no. 5, pp. 791–797, 1996.

C. Lucena et al. • Adaptive Quasi-Optimal Gains Tuning of PI-Fuzzy Controllers

– 404 –