Sensitivity-Based Self-learning Fuzzy Logic ... - advantech greece

0 downloads 0 Views 395KB Size Report
CONTROLLER IN SIMATIC ENVIRONMENT. The proposed self-learning fuzzy controller has been implemented as a super-block in Simatic® library (Figure. 2).
7

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ &RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

Sensitivity-based Self-learning Fuzzy Logic Controller as a PLC Super Block 1

S. Bogdan1, Z. Kovačić1, D. Krapinec2 University of Zagreb, Faculty of EE&C, Dept. of Control and Computer Engineering, Zagreb, Croatia 2 Končar d.d, Zagreb, Croatia

Abstract - In this article, implementation of a self-learning fuzzy logic controller (SLFLC) in a form of PLC super block is described. The SLFLC contains a learning algorithm that utilizes a second-order reference model and a sensitivity model related to the fuzzy controller parameters. The effectiveness of the PLC super block has been tested by experiment in the position control loop of an electronically commutated servo system in the presence of a gravity-dependent shaft load. The experimental results have proved that the SLFLC implemented in PLC provides desired closed-loop behavior.

I.

INTRODUCTION

Numerous successful applications of fuzzy control in industry have given this branch of intelligent control so many credits and respect in the control community that a nowadays control engineer cannot neglect fuzzy control as a potential solution of problems encountered during control system design. As any other control technique, besides many advantages, fuzzy control has some drawbacks too. For example, a heuristic design of a fuzzy logic controller (FLC) can be seen as a big advantage but in the same time it may be seen as a burden on the designer requiring a hard work on a controller optimization with a realistic possibility of making errors. Specialized development tools can make the designer`s life easier, but the controller optimization still remains a demanding job. The idea of automated FLC optimization or selforganization was first announced and elaborated by the group of prof. E.H. Mamdani [1] and since then, many researchers have attempted to improve the performance of self-organizing mechanisms and establish a more systematic method for designing and tuning the fuzzy controller. Some of them have used neural nets [2, 3], and some of them preferred usage of a reference model [4, 5]. Self-organizing fuzzy logic controllers have been successfully applied to various control processes such as a pH-neutralization, inverted pendulum, robot drives, induction motor and many others [6-9]. The fuzzy model reference control is inspired by the concept of conventional model reference adaptive control [10, 11]. In fuzzy model reference adaptive control (FMRAC) schemes responses of controlled system variables are compared with responses of accompanying reference model variables and then the consequent model

tracking errors are used as inputs to an adaptation mechanism which either may further perform a parameter [12, 13], or signal adaptation [14, 15]. The design of both types of FMRAC schemes requires certain knowledge of system dynamics. In fuzzy model reference learning control (FMRLC) schemes, the model tracking error is fed into a learning mechanism, which establishes an organized iterative way of changing the core of the FLC. To make a distinction between iterative learning and iterative adaptation control schemes, it must be emphasized that the proper work of fuzzy learning schemes does not depend on a mathematical model of a control process, although any knowledge about the control process may be helpful, especially with the determination of the reference model function or with the estimation of normalizing scaling factors of the FLC (related to the estimated dimensions of the universes of discourse). The self-learning fuzzy logic controller (SLFLC) which utilizes a sensitivity model and a 2nd-order reference model has been effectively introduced for control of nonlinear control systems. In order to determine a sensitivity function, a function describing a dependence of two variables (or variables and parameters) must be differentiable. There is a class of fuzzy controllers widely used in practical applications, usually called the singleton fuzzy controllers, which can be organized to assume an analytical and differentiable form. This article presents implementation of SLFLC in a form of a PLC super block. The algorithm used for selflearning is described in details in [16]. II.

SELF-LEARNING FUZZY LOGIC CONTROLLER

In fuzzy model reference learning control (FMRLC) scheme, shown in Figure1, model tracking error eM is fed into a learning mechanism which establishes an organized iterative way of changing the core of the fuzzy controller. To make a distinction between iterative learning and iterative adaptation control schemes it must be emphasized that the proper work of fuzzy learning schemes does not depend on a mathematical model of a control process, though any knowledge about the control process may be helpful, especially with the determination

7

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ &RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

of the reference model function or with the estimation of normalizing scaling factors of the fuzzy controller (related to the estimated dimensions of the universes of discourse). Self-learning mechanism yM

REFERENCE MODEL LEARNING ALGORITHM ur FUZZY CONTROLLER

u

There are several ways to define system output sensitivity functions. Since the self-organization process is a real-time process, it is convenient to determine a sensitivity function vector in the time domain. Let us suppose that the solution of system (1) for nominal parameters has a form:

eM

y f 0 = y f (u, t , λ 0 )

(3)

+ -

CONTROLLED SYSTEM

yf

Figure 1. A structure of a model reference self-learning fuzzy control system.

A sensitivity-based self-learning fuzzy logic control (SLFLC) scheme is thought for control of a class of unknown time-varying nonlinear high-order SISO control processes described by (5-40). The fuzzy controller to be organized by on-line learning is a PD-type TakagiSugeno zero-order fuzzy controller. A self-organizing fuzzy controller will be designed for an inherently stable linearizable nonlinear SISO control object, which has time-varying parameters. Such a process is given by a set of equations:

x&1 = x2 .... x&n = f ( x, λ , t ) + b ( t ) u + d (t )

For changed parameter values, system (1) has a solution: y f = y f (u, t , λ ) (4) Under assumption that yf is a continuous function of parameter vector λ, equation (4) can be rewritten in the form of a Taylor series around nominal solution yf0:

yf = yf 0 +

∂y f ∂λ

Δλ + λ0

2 1 ∂ yf 2 ∂λ 2

Δλ 2 + ....

(5)

λ0

For small parameter variations around nominal values, high-order Taylor series components can be neglected, and in that case (5) assumes a linear form: yf ≈ yf 0 +

∂y f ∂λ

Δλ

(6)

λ0

Relation (6) can be rewritten as: (1)

y f = x1 where: x - state vector, f - unknown nonlinear function, b > 0 - unknown process gain, u - control input, d – measurement noise, yf - output, λ - parameter vector. From the sensitivity theory point of view the system of equations (1) can be viewed as a description of influence of the parameter vector λ on the state vector x. If initial state variables values x(t0)=x0, the system structure and the input signal remain unchanged, then the changes of parameter vector Δλ will be reflected in the changes of state vector Δx. The relation between Δx and Δλ for small parameter variations around nominal parameter values vector λ0 is as follows: ⎡ ∂x ⎤ (2) Δx ≈ S ( λ 0 ) Δλ = ⎢ Sij = i ⎥ Δλ ∂λ j ⎥ ⎢ λ 0 ⎦ ⎣ where S is the sensitivity function matrix, and Sij is an element of matrix S.

Δy f = y f − y f 0 ≈

∂y f ∂λ

Δλ = ηλ Δλ

(7)

λ0

where ηλ is the system output sensitivity function vector of the following form: ⎡ ∂y f ηλ = ⎢ ⎣ ∂λ1

∂y f ∂λ2

...

∂y f ⎤ ⎥ ∂λv ⎦ λ

(8) 0

Vector ηλ represents a gradient of the system output with respect to system parameter variations. Although the self-learning method presented herein uses vector ηλ , the method is essentially different from well-known gradientbased optimization methods. Gradient-based selforganizing methods calculate and set up a new parameter vector in each control interval. The method described here calculates a new parameter vector in the moments when sensitivity functions in (8) reach their maximum and then sets a new vector up before a new change of the reference input ur takes place.

7      

3 U R F H H G L Q J V  R I  W K H    W K  0 H G L W H U U D Q H D Q  & R Q I H U H Q F H  R Q & R Q W U R O   $ X W R P D W L R Q   - X O \                 $ W K H Q V    * U H H F H

Vector ηλ will retain the same form also for discrete control systems providing that control interval Td is kept constant. This fact is important for the design of a digital self-organizing fuzzy controller, as we may use vector which has been found for the corresponding continuous control system. In general, parameter vector λ contains controller parameters λc and process parameters λp. If the response of a nominal system (3) is viewed as a predefined (desired) system response, and the response (4) as an actual system response, then by means of equation (7) we can search for values of vector Δλc components which would compensate for variations of λp and gradually push Δyf towards zero. III.

SYNTHESIS OF A SELF-LEARNING FUZZY ALGORITHM

The structure of a self-learning fuzzy controller may vary depending on the type of process. The structure described in this paper contains a PD-type fuzzy controller (in order to establish steady-state accuracy and to cancel disturbance effects, an integral element can also be added). Let us consider the self-organization of a controller with the following structure:

u (k ) = ∑ Aiϕi ⎡⎣ e ( k ) , Δy f ( k ) ⎤⎦

input sets, cie and cidy, and widths of input sets, wie and wiΔy. The crisp output of the fuzzy controller used in the SLFLC scheme is computed according to the center of gravity principle. How much the i-th fuzzy control rule will contribute to a crisp controller output depends on the degree of contribution described with the fuzzy basis function: μi ⎡e ( k ) , Δy f ( k ) ⎤⎦ ϕi ⎡⎣e ( k ) , Δy f ( k ) ⎤⎦ = r ⎣ (12) ⎡ ⎤ e k y k μ , Δ ( ) ( ) ∑ j⎣ f ⎦ j =1

whose form is also differentiable. Sensitivity functions can be very useful to express how much influence some variable or parameter has on the focused variable. In this sense, sensitivity functions represent information about interactions between causes and consequences which may be very useful for planning interventions in the system. Having this concept in mind, a total differential of the system output with respect to small variations of fuzzy controller parameters is determined by n

Δy f ( k , λ ) =

(9)

∑η

λci

(k )

i

The change of error Δe ( k ) , usually applied in fuzzy

λci

Δλci

where ηλci (k ) , i=1,…n, are system output sensitivity

controllers, is replaced by the change of system output Δy f ( k ) . The reason why Δy f ( k ) is preferred to Δe ( k )

functions related to fuzzy controller parameters:

is in its more convenient response to stepwise changes of the reference input. A sensitivity model of a fuzzy controlled system can be built only if fuzzification and defuzzification operations have a form that allows a fuzzy input-output mapping function to assume an analytical and differentiable form. In this sense, the inference engine will utilize a product operator:

ηλ (k ) =

μ j ⎡⎣e ( k ) , Δy f ( k ) ⎤⎦ = μke ⎡⎣e ( k ) ⎤⎦ ⋅ μl

⎡⎣ Δy f ( k ) ⎤⎦ j = 1, 2,...., r k = 1, 2,...., p l = 1, 2,...., q Δy f

(10) and input membership functions will also have a differentiable form: −

μ ( x) = e e k

Δy f

( x − cke )2 2

( )

2 wke



, μ

Δy f l

( x) = e

( x − cl 2

)2

( ) Δy wl f

2

(11)

where cij is the centre of a membership function μij, and wij is the width of a membership function μij. Accordingly, controller parameter vector λc contains following parameters: output singletons Ai, centers of

(13)

∂y f ( k , λ ) ∂λci

ci

=

∂y f ( k , λ ) ∂u ( k ) ∂u ( k )

∂λci

= Gp

∂u ( k ) ∂λci

(14) where Gp is the process transfer function. It may be seen that sensitivity functions related to controller parameters λci depend on generally unknown dynamic characteristics of the control process Gp. Since the exact model of the control process (1) is unknown (only a static process gain is directly identifiable), some approximation, denoted as Gpa, must be used. Among many possible linear process approximations, the one determined by the reference model dynamics could be assumed to be a reasonable choice. Then Gpa = GM. Referring to controller function (9), system parameter variations will be compensated only by modifying the fuzzy output singletons Ai, i.e. λ c = [ A1 A2 ... Ar ] , T

which gives:

η A (k ) = i

∂y f ( k , λ ) ∂Ai

=

∂y f ( k , λ ) ∂u ( k ) ∂u ( k )

∂Ai

= GM

∂u ( k ) ∂Ai

7

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ &RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

∂u ( k ) ∂Ai



=

∂Ai

// frequency of ur stepwise changes

{Γ ⎡⎣e ( k ) , Δy ( k ) , λ ⎤⎦}

FLCparam.TLPOLA:REAL

f

= ϕi ⎡⎣e ( k ) , Δy f ( k )⎤⎦

Finally, the sensitivity functions attain a form:

η A (k ) = aM 1 ⋅η A (k −1) + aM 2 ⋅η A (k − 2) + i

i

i

(15)

+bM 1 ⋅ϕ A (k −1) + bM 1 ⋅ϕ A (k − 2) i

i

where aM1, aM2, bM1 and bM2 are parameters of the second order reference model. The given change of system output Δyf(k) in (13) coincides in the model reference control concept with model tracking error eM(k). Therefore, r

eM ( k ) = ∑η Ai ( k ) ΔAi

(16)

i =1

Since tracking error eM ( k ) is known in every control interval, equation (16) converts into a learning algorithm of the form: ΔAκj ( k ) =

eMκ ( k ) −

r

∑ η κ ( k ) ⋅ ΔAκ

i =1, i ≠ j

Ai

i

η Aκ ( k )

,

(17)

j

where κ denotes the current learning iteration (i.e. the current run of the system). The meaning of this is that singletons Aj are changed only once during each run of the system. A new run of the system starts with a new change of ur(k) (for learning purpose input signal should comprise set of stepwise changes around a set point). It must be noted, that approximate equality in (6) is intentionally replaced by normal equality in (16) and (17). IV.

IMPLEMEMNTATION OF A SELF-LEARNING FUZZY CONTROLLER IN SIMATIC ENVIRONMENT

The proposed self-learning fuzzy controller has been implemented as a super-block in Simatic® library (Figure 2). The algorithm is coded in Pascal-like language. The controller parameters and initial values are defined in Data Block FLCparam type STRUCT: //output singletons FLCparam.A:ARRAY[1..5,1..5] OF REAL

//centers of input sets FLCparam.Ce:ARRAY[1..5] OF REAL FLCparam.Cdd:ARRAY[1..5] OF REAL

// widths of input sets FLCparam.We:ARRAY[1..5] OF REAL FLCparam.Wdd:ARRAY[1..5] OF REAL

// amplitude of ur stepwise changes FLCparam.AMPL:REAL

Figure 2. Self-learning fuzzy controller as a super-block in Simatic® library.

SLFLC super-block has the following inputs and outputs: ENABLE → 1 = enable execution of the block, RESET → 1 = complete reset of the controller, LEARNING → 1= activate learning, Tm → time of the ref. mdl. overshot, [s], OVERSHOT → ref. mdl. overshot, [%], Td → sampling interval, [s], SP → set point, [c.u.], PV → process value, [c.u.], Ke → input scaling factor (variable e), Kdy → input scaling factor (variable dy), Ks → safety factor (learning speed), MinErr → learning threshold value, Kpr → feedforward gain, StaticProcess → 1 = static process, MinEta → min. η (ηAi < min. η - ΔAi is not calculated), alpha → α-cut of fuzzy basis function (φi < α – influence of Ai is neglected),

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ

7

&RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

HL → SLFLC output high limit, LL → SLFLC output low limit, MAN_ON → 1 = manual control mode, MAN_STEP → manual inc/dec value, MAN_INC → 1 = increase controller output, MAN_DEC → 1 = decrease controller output, OUT → controller output, SP_OUT → set point (propagated input), [c.u.], PV_OUT → process value (propagated input), [c.u.], E_OUT → process value deviation, [c.u.], dy_OUT → difference of process value, [c.u./Td], Ym → reference model output, [c.u.], LEARNINGDONE → learning is finished, LEARN_ITERATION → number of learning iterations, IN_HL → 1 = controller output in high limit, IN_LL → 1 = controller output in low limit.

The proposed SLFLC super-block has been tested by a series of experiments. A nonlinear position loop of a chopper-fed dc servo drive has been used as a control process. The rated parameter values of the servo drive were: Km=0.27 Nm/A, Ke=16.38 V/Krpm, Pn=393 W, Ra=1.45 Ω, JT=0.3E-4 kgm2, N=1.6 (gear ratio). Initially, all singletons have been set to 0. SLFLC parameters used in the first experiment were: OVERSHOT = 25%, Tm = 2s, Td = 0.1s, alpha = 0.01, Ke = 1, Kdy = 6.5, Ks = 30, MinErr = 0.003, Kpr = 0.05, MinEta = 0.15. Figure 3 shows the reference model (green line) and the measured position (red line) responses obtained after two runs of the system (one in each direction) at the beginning of learning, while Figure 4 presents results after the end of learning. It may be seen that process follows the reference model very closely and the maximum tracking error value is kept below 5% while the steady-state system error is kept at zero as required. Figures 5 and 6 show the controller output at the beginning and at the end of learning, respectively. At the beginning of learning the controller output is equal to zero since the fuzzy rule table is empty. Once learning is finished the controller output has retained a very acceptable nonoscillatory form. More experiments with changed reference model parameters, OVERSHOT = 2 % and Tm = 1.2 s, have indicated that the choice of reference model parameters is not a critical issue, since it has not influenced much the convergence of the learning process, as shown in Figures 7 and 8. The system remains stable and controller output (Figures 9 and 10) forces the process value to reach the set point.

Figure 3. The reference model (green line) and the measured position responses (red line) obtained at the beginning of learning (σm=25%, tm=2s).

Figure 4. The reference model (green line) and the measured position responses (red line) obtained at the end of learning (σm=25%, tm=2s).

Figure 5. The controller output obtained at the beginning of learning (σm=25%, tm=2s).

Figure 6. The controller output obtained at the end of learning (σm=25%, tm=2s).

Figure 7. The reference model (green line) and the measured position responses (red line) obtained at the beginning of learning (σm=2%, tm=1.2s).

7

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ &RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

References

Figure 8. The reference model (green line) and the measured position responses (red line) obtained at the end of learning (σm=2%, tm=1.2s).

Figure 9. The controller output obtained at the beginning of learning (σm=2%, tm=1.2s).

Figure 10. The controller output obtained at the end of learning (σm=2%, tm=1.2s).

V.

CONSLUSIONS

The article presents a sensitivity-based self-learning fuzzy logic control (SLFLC) scheme. Learning starts from a blank fuzzy rule-table, and continues after each run of the system by adding new centroid increments to fuzzy output subsets of the activated fuzzy control rules. A learning law is based on the use of a reference model and a sensitivity model built with respect to the fuzzy controller parameters. Thanks to the selection of analytical and differentiable fuzzification and defuzzification operators, the learning law assumes an analytical form. This enables a completely automated modification of the fuzzy control surface without any need for designer`s engagement in the setup of learning mechanism. The proposed method has been implemented as a super-block in Simatic® library. Experimental results obtained in the nonlinear position control loop of a dc servo motor drive have confirmed convergence of learning and effective control without steady state errors and with very close following of the reference model response. Due to a marked simplicity, the proposed SLFLC scheme could be recommended for many practical nonlinear control applications.

1. T.J. Procyk and E.H. Mamdani, "A Linguistic SelfOrganizing Process Controller", Automatica, vol. 15, pp. 15-30, 1979. 2. H.R. Berenji and P. Khedkar, “Learning and Tuning Fuzzy Logic Controllers through Reinforcements”, IEEE Trans. Neural Networks”, vol. 3, Sep. 1992. 3. R. Jang, “Self-learning fuzzy controllers based on temporal back propagation”, IEEE Trans. Neural Networks”, vol. 3, pp. 714-723, Sep. 1992. 4. Z. Kovačić, S. Bogdan, P. Crnošija, "Design and Stability of Self-Organizing Fuzzy Control of High-Order Systems", Proc. of the 10th IEEE ISIC, Monterey, pp. 389-394, 1995. 5. P.J.King, K.J. Burnham and D.J.G. James, “A Model Reference Self-Organizing Fuzzy Logic Controller”, Control and Computers, Vol. 23, No. 1, 1995. 6. T. Jespersen, “Self-organizing Fuzzy Logic Control of a pH-neutralization Process”, Rapport no. 8102, Technical University of Denmark, Lyngby, March1981. 7. S. Shao, "Fuzzy Self-Organizing Controller and its Application for Dynamic Processes", Fuzzy sets and systems, vol. 26, pp. 151-164, 1988. 8. K. Sugiyama, “Rule-based Self-organizing Controller”, Fuzzy Computing (M.M. Gupta and T. Jamakawa Editors), Elsevier , pp. 341-353, 1988. 9. Y.N. Lee, T.W. Kim, I.H. Suh and K.G. Kim, “Design of a Self-Organizing Fuzzy Plus PD Controller Using the LookUp Tables”, in Proceedings of the 1992 IEEE/RSJ Intl. Conf. Intelligent Robots and Systems, pp. 775-781, Raleigh, 1992. 10. J.T. Spooner and K.M. Passino, “Stable Adaptive Control Using Fuzzy Systems and Neural Networks”, IEEE Trans. on Fuzzy Systems, Vol. 4, No. 3, Aug. 1996. 11. L.X. Wang, “Stable Adaptive Fuzzy Controllers with Application to Inverted Pendulum Tracking”, IEEE Trans. on Systems, Man and Cybernetics, Part B: Cybernetics, Vol.26, No. 5, Oct. 1996. 12. Z. Kovačić and S. Bogdan, “Model Reference Adaptive Control of High-order Systems”, An International Journal for Engineering Applications of Artificial Intelligence (Pergamon Press), Vol. 7, No. 5, pp. 501-511, 1994. 13. Z. Kovačić Z, S. Bogdan, H. Vikalo, “Design and Parameter Adaptation of a Fuzzy Controller", Proceedings of the 6th International Fuzzy Systems Association World Congress IFSA '95, pp. 389-392, Sao Paolo, Brazil, 1995. 14. Z. Kovačić, S. Bogdan, P. Crnošija, “Fuzzy rule-based model reference adaptive control of permanent magnet synchronous motor drive”, Proceedings of the 19th Annual Conference of the IEEE Industrial Electronics Society, vol. 1, pp. 207-212, Lahaina-Maui, Hawaii, USA, 1993. 15. Z. Kovačić and S. Bogdan, “Servo Application of a Model Reference-Based Adaptive Fuzzy Control”, Proc. of the 11th IEEE International Symposium on Intelligent Control, pp. 49-54, Dearborn, USA, 1996. 16. Kovacic Z., Balenovic M. and Bogdan S., “Sensitivitybased Self-learning Fuzzy Logic Control for a Servo System”, The IEEE Control Systems Magazine, Vol. 18, No.3, 41-51, June, 1998.

Suggest Documents