Nonlinear Servo Adaptive Fuzzy Tracking Rubén Garrido1, Dora Calderón1, Alberto Soria1, 1
CINVESTAV-IPN, Departamento de Control Automático, Av. IPN 2508, San Pedro Zacatenco, México DF 07360, MEXICO
[email protected]
Abstract. An algorithm for tracking time-varying references for a nonlinear second order uncertain servo is proposed. Uncertainties in nonlinear functions associated to the state and uncertainties on the servo gain are counteracted using a desired adaptive fuzzy compensator plus a linear Proportional Derivative controller and feedforward compensation. A depart from existing approaches is the fact that the proposed algorithm is not based on switching terms and as consequence chattering is avoided. Stability is proved using the second Lyapunov Method and performance is evaluated through experiments in a laboratory prototype.
1 Introduction Control system design has been traditionally tackled using mathematical models describing the dynamic behaviour of the plant to be controlled. The models should be simple enough but at the same time they should retain the basic characteristics of the system. As a matter of fact, in real life situations most of the parameters and structure of the system are unknown due to system and environment changes and to modelling errors. To face the above problems, there exist several techniques, in particular, intelligent technology as Fuzzy Logic (FL) for designing control systems. These controllers have replaced classic algorithms as proportional derivative (PD) and proportional integral derivative (PID) in several applications because of their simplicity and the ease to implement. An important issue is to study how to design controllers based in both, classic and fuzzy approaches. The advantage of this approach would be to exploit the best features of both techniques, indeed, robustness and ease to tune of PD and PID controllers and the ability to approximate nonlinear function using FL. In the case of nonlinear servomechanisms several controllers combining linear and fuzzy compensation have been proposed [1], [2], [3], [4], [5], [6]. In [1] the authors present a PD plus adaptive fuzzy controller where the later compensates the effect of nonlinear mechanical friction. Boundedness of the consequences estimates is obtained using a gradient algorithm plus projection. Theoretical stability and numerical simulation results are provided and a bound on the norm of the consequences must be explicitly provided. A PID controller with gain tuning provided by a fuzzy system is presented in [2]. Experimental results using step responses are provided but an stability analysis is not provided. A non adaptive PD plus fuzzy compensation is presented in [3]. A nonlinear tracking differentiator is
employed for trajectory generation and for obtaining velocity estimates from position measurements. Unfortunately closed loop stability is not undertaken but experimental results are presented using step-like references. In reference [4] an adaptive fuzzy sliding mode controller is applied to a spring-mass mechanism. A sliding signal feeds a fuzzy system and its consequences are updated using the sliding variable. Only eight fuzzy rules are employed and the experiments show a good behaviour in spite of high frequency disturbances. Another interesting work is presented in [5] where the authors employ The Popov criterion for studying stability of the fuzzy system, however, the effect on closed loop stability of the adaptation mechanism for the fuzzy system is not studied. The approach is evaluated through experiments. Reference [6] describes a self-learning fuzzy logic controller. This control law contains a learning algorithm designed using a sensitivity approach. Unfortunately, stability of the closed loop system was not undertaken. In the case of the adaptive fuzzy controllers described above, an advantage with respect to classic adaptive controllers [0] is the fact that the linearity in the parameters of the nonlinear functions to be compensated is not required then relaxing the a priori knowledge, moreover, they have a linear part, a PD controllers thus allowing to shape the closed loop response in a similar way than in linear servo, indeed, the proportional action sets the closed loop bandwidth and the derivative action injects damping. Another feature of the controllers reviewed above is the fact that they do not explicitly seek to counteract the uncertainties associated to the servo gain, indeed, the gain multiplying the control signal. As it will be shown later, this gain depends on the servo inertia, a parameter which may not be exactly known. Moreover, the membership functions are fed using the current position and velocity measurements which may me contaminated by noise. Reference [9] is the only work found where uncertainty of a nonlinear function multiplying the control variable is taken explicitly into account in the adaptive fuzzy approximation, however, since control problem was set as a regulation problem around the origin, control signal depends only on the state and then the membership rules of the adaptive fuzzy approximation depends only on the state and the possibility of an algebraic loop is avoided. In the case of the trajectory tracking problem the control signal and therefore the membership functions will depend on both, the state and the tracking error and the procedure indicated in [9] does not longer apply. In this paper a novel adaptive fuzzy controller is proposed for trajectory tracking of time-varying references for nonlinear servo systems.. The controller is composed of a linear part, namely a PD plus feed-forward controller and an adaptive fuzzy uncertainty estimator which compensates the effects of both, nonlinear terms depending on the servo position and velocity and uncertainty on the servo gain. Switching terms able to produce chattering are completely avoided. Stability of the closed loop system is studied through the Lyapunov method and performance of the proposed approach is evaluated through experiments in a laboratory prototype. The paper is organized as follows. The model of the nonlinear servo is presented in Section 2. The proposed control law and closed loop stability study are presented in section 3. Experimental results are presented in section 4. The paper ends with some concluding remarks.
2 The Nonlinear Servomechanism Model We assume that the DC motor is modeled by the following second order differential equation J x + h ( x, x ) = τ .
(1)
Where x , x and x are the servo angular position, velocity and acceleration, h( x, x ) is a nonlinear term and τ the input torque. Signals x and x are assumed available from measurements and torque input is supposed proportional to the control signal, i.e. τ = ku . This last assumption is reasonable for motors controlled by amplifiers configured in current mode. Rewriting model (1) yields
x = bu − f ( x, x ).
(2)
Where b = k / J , f ( x, x ) = h( x, x ) / J . Position error and its time derivatives are defined as e = r − x; e = r − x ; e = r − x .
(3)
Where r is the desired time-varying position. From (2) and (3) the following error dynamics is obtained e = r − bu + f ( x, x ).
(4)
Assume that a nominal value bn > 0 of b > 0 is known, then, adding and subtracting bn u in (4) yields e = r − bnom u + g ( x, x, u ).
(5)
Where g ( x, x, u ) = f ( x, x ) − bu + bnom u contains uncertainties associated to h( x, x ) , k and J .
3 Adaptive Fuzzy Control Law The problem undertaken in this work is to propose a control law for tracking timevarying references through a nonlinear servomechanism in such a way that uniform ultimate boundedness is obtained. If nonlinear function g ( x, x, u ) is known, then the following control law u=
1 ⎡ k p e + kd e + r + g ( x, x, u ) ⎤⎦ . bn ⎣
(6)
Would yield a stable linear closed loop system, however, since g ( x, x, u ) is unknown, then, an estimate gˆ( x, x, u ) should be used. A fuzzy system is employed for obtaining such an estimate. It is therefore assumed that function g ( x, x, u ) may be
approximated by a fuzzy system where approximation is built up using a Gaussian fuzzyfier, a minimum inference engine and a center average defuzzifier [8] g ( x , x , u ) = wT σ ( x , x , u ) + ς .
(7)
M
(8)
Where
σ ( x, x, u ) =
∑ μ ( x, x , u ) m =1 M
∑ μ ( x, x , u ) m =1
wT = [ w1
w2
m
.
m
wm
wM ].
(9)
Quantity ς is the approximation error and the ideal vector of consequences w is assumed constant. Fuzzy rules are defined as follows IF x IS Ai A N D x IS B j A N D u IS Cuk T H E N g ( x, x, u ) IS G m .
Where i = 1,…, a , j = 1,…, b , k = 1,…, c and m = 1,…, abc . Ai , B j , C k and G m are fuzzy sets; μ Ai ( x ) , μ Bj ( x ) , μCk and μm ( x, x, u ) are their corresponding membership
functions with μm ( x, x , u ) = min( μ Ai ( x ), μ Bj ( x ), μCk (u )) . The Gaussian fuzzifiers are defined by
⎡ 1⎛ z−c ⎣ 2⎝ σ
μS ( z ) = e xp ⎢ − ⎜
⎞⎤ ⎟ ⎥ ; S = A, B, C ; ⎠⎦
= i, j, k .
(10)
The following bounds are assumed
σ (⋅, ⋅, ⋅) ≤ kσ ; w ≤ η ; ς ≤ kς
(11)
Then, the estimate of g ( x, x, u ) is defined as
gˆ ( r, r, u f ) = wˆ T σ ( r, r, u f ) .
(12)
Which allows to rewrite (6) as u=
1 ⎡ k p e + kd e + r + wˆ T σ ( r, r, u f bn ⎣
) ⎤⎦ .
(13)
Estimate wˆ will be obtained through an on-line algorithm proposed in the next section, moreover, u f is a filtered version of control signal u u f = − k1u f + k 2sat ( u ) .
(14)
⎧ umax ⎪ sa t ( u ) = ⎨ u ⎪ −u ⎩ ma x
u > umax
(15)
−uma x ≤ u ≤ umax . u < −uma x
uma x is the maximum allowable value for control signal u . Note that r and r replace feedback signals x and x respectively. The rationale behind this substitution is the fact that feedback signals may be contaminated by noise whereas the reference signals are noise-free since they are produced by a trajectory generator. In this way less noise is injected to the closed loop system and better performance could be espected. Substituting (13) into (5) yields
e = − k pe − kd e − wˆ Tσ (r, r, u f ) + wTσ ( x, x, u) + ς .
(16)
Adding and subtracting w T σ ( r , r , u f ) in the above equations produces e = −k p e − kd e − wT σ ( r , r, u f )
(17)
+ wT ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ + ς .
Where is the error between the estimated and the ideal vector of consequences is defined as w = wˆ − w . It is imperative to remark that since w is constant then w = wˆ . Stability analysis is undertaken using the following Lyapunov function candidate
V=
1 μ 1 1 1 2 ⎡⎣ k p + μ kd ⎤⎦ e 2 + 2 wT w + e² + ee + uf kw 2k w 2k w 2k w 2k w
(18)
The above equation is rewritten as follows
V=
2 1⎡ 1 1 2 ( e + μ e ) + ( k p + μ kd − μ 2 ) e2 ⎤⎦ + 2 wT w + u 2f ⎣ 2 2k w 2k w
(19)
Consequently, positive definiteness of (18) is guaranteed as long as kd > μ . The time derivative of (18) is
V=
1 μ μ 1 1 1 ee + ee + e 2 + ⎡⎣ k p + μ kd ⎤⎦ ee + 2 wT w + u f u f kw kw kw kw kw kw
(20)
Substituting e and u f in (14) and (17) gives V =− + +
1 1 1 kd e 2 − ewT σ ( r, r, u f ) + ewT ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ kw kw kw
μk μ 1 μ μ eς − p e 2 − ewT σ ( r, r, u f ) + ewT ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ + eς kw kw kw kw kw μ kw
e2 +
1 T k k w w − 1 u 2f + 2 u f sat ( u ) k w2 kw kw
(21)
Which is written alternatively as (22) ⎛ k − μ ⎞ 2 μk p 2 1 ⎡ 1 1 μ μ V = −⎜ d e + eς + eς + wT ⎢ − eσ ( r, r, u f ) + 2 w − eσ ( r, r, ⎟e − kw kw kw kw kw ⎝ kw ⎠ ⎣ kw 1 μ + wT ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ e + wT ⎡⎣σ ( x, x, u ) − σ ( r, r , u f ) ⎤⎦ e kw kw −
k1 2 k2 u f + u f sat ( u ) kw kw
At this point it is convenient to define kd − μ = k wγ d , k p = k wγ p , and k1 = k wγ 1 , Substituting the above into (22) allows to obtain V = −γ d e 2 − μγ p e 2 + +
⎡ 1 ⎤ 1 μ 1 μ eς + eς + wT ⎢ − eσ ( r, r, u f ) + 2 w − eσ ( r, r, u f ) ⎥ kw kw kw kw ⎣ kw ⎦
(23)
1 T μ w ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ e + wT ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ e kw kw
−γ 1u 2f +
k2 u f sat ( u ) . kw
The consequences are updated according to the following update law wˆ = k wσ ( r, r , u f ) [ e + μ e ] − k w β e wˆ .
(24)
This is subsequently substituted into (23) V = −γ d e2 − μγ p e2 + +
1 μ β eς + eς − e wT wˆ kw kw kw
(25)
1 T μ w ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ e + wT ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ e kw kw
−γ 1u 2f +
k2 u f sat ( u ) . kw
Where the fact that w = wˆ was considered. Using(11), (15) and wˆ = w + w allows to obtain the following bounds
wT wˆ = wT ( w − w ) ≤ − w −
β kw
e wT wˆ ≤ −
(w
−η )
(26)
2
β
βη 1 ⎞ ⎛ e ⎜ w − η⎟ + e 2 ⎠ 4k w kw ⎝
k2 k u f sat ( u ) ≤ 2 umax u f kw kw
μ
μ
μ
wT ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ e + eς ≤ ⎡⎣ 2kση + kς ⎤⎦ e kw kw kw 1 T 1 1 w ⎡⎣σ ( x, x, u ) − σ ( r, r, u f ) ⎤⎦ e + eς ≤ ⎡⎣ 2kση + kς ⎤⎦ e kw kw kw
Using the above bounds allows to upperbound V in (25) as follows 2
β
1 ⎞ 1 ⎛ e ⎜ w − η ⎟ + ⎡⎣ 2kση + kς ⎤⎦ e 2 ⎠ kw kw ⎝ 1 ⎡ βη ⎤ k + ⎢ μ ⎡⎣ 2kση + kς ⎤⎦ + e − γ 1u 2f + 2 umax u f . ⎥ 4 ⎦ kw ⎣ kw
V ≤ −γ d e 2 − μγ p e 2 −
(27)
Define
z
⎡ e ⎢ ⎢ e ⎢ ⎣⎢ u f
⎤ ⎥ ⎥; A ⎥ ⎦⎥
⎡ μγ p ⎢ 0 ⎢ ⎣⎢ 0
0
γd 0
0⎤ 0 ⎥; B ⎥ γ 1 ⎦⎥
βη ⎤ ⎤ ⎡⎡ ⎢ ⎢ μ ⎣⎡ 2kση + kς ⎦⎤ + 4 ⎥ ⎥ ⎦⎥ ⎢⎣ 2kση + kς ⎢ ⎥ ⎢ ⎥ k2umax ⎢ ⎥ ⎢⎣ ⎥⎦
(28)
Substituting the terms defined in (28) into (27) allows to obtain the following bound for V
V = − z T Az +
1 T β ⎛ 1 ⎞ B z− e ⎜ w − η⎟ kw kw ⎝ 2 ⎠
β ⎛ 1 1 ⎞ B z − e ⎜ w − η⎟ ≤ −λmin ( A ) z + kw kw ⎝ 2 ⎠ 2
(29)
2
2
Then, V ≤ 0 as long as z ∈ Ω where Ω is defined as
B ⎪⎧ ⎪⎫ Ω = ⎨z z ≥ ⎬ k wλmin ( A) ⎪⎭ ⎪⎩
(30)
Then, uniform ultimate stability is obtained [10] and region Ω may be set arbitrarily small by increasing the adaptation gain k w or k p and k d .
4 Experimental results The proposed approach was evaluated through experiments with a laboratory prototype. The setup consists of DC brush motor controlled through a Copley Controls power amplifier, model 413, configured in current mode. Angular position of the motor is measured using a BEI optical encoder with a resolution of 2500 pulses per turn. Data acquisition is performed through a MultiQ 3 card from Quanser Consulting endowed with inputs for optical encoders. The electronics associated to these inputs multiply by 4 the encoder resolution. Angular position is scaled down by a factor of 10,000 corresponding to one motor shaft turn. The card has 12 bit digital to analog converters with an output voltage range of ±5volts. Algorithms were coded using MatLab/Simulink software and real-time control was performed using the Wincon software from Quanser Consulting. Sampling time was1 ms . The servo employed for the experiments is modelled according to (2)with f ( x, x ) = −6.97 x − 12sin( x ); b = 28
(31)
Two experiments were conducted. In the first case the control law is a proportional derivative controller with feedforward and uncertainty compensation which was called the baseline controller u=
Function
f (⋅, ⋅)
1 [ k ( r − x ) + k D ( r − x ) + r − f ( r, r )] b P
and gain b
(32)
are given in (31), controller gains were set
to k P = 1950 , k D = 17 . Reference r and its time derivatives r and r were generated through a linear filter r + 3ωn rR + 3ωn2 r + ωn3r = s (t )
(33)
With ωn = 1 0 0 and fed by the sinusoid s(t ) = 0.25sin(2π ft ) where f = 1 hz . A velocity estimate of x is computed through position x filtered by a high pass filter. Figures 1 and 2 show respectively the tracking error and voltage signal. In the second experiment control law (13), (14) was tested. Adaptation parameters were set to k w = 9 0 0 , μ = 2 and β = 1 . It is worth remarking that the same proportional and derivative gains used in the first experiment were employed in this experiment. Figures 3 and 4 correspond to the tracking error and the control voltage for the proposed adaptive fuzzy controller. Note that similar performance was obtained using both control laws; however, the proposed adaptive controller requires less a priori knowledge about the servo. Note that control signal for the adaptive controller is slightly noisier than control signal corresponding to the baseline controller. This may be due to the fact that a relatively high adaptation gain was employed.
Fig. 1. Position error using proportional derivative controller with feedforward and uncertainty compensation
Fig. 2. Control voltage using proportional derivative controller with feedforward and uncertainty compensation
Fig. 3. Position error using adaptive fuzzy controller
Fig. 4. Control voltage using adaptive fuzzy controller
5 Conclusions A novel adaptive fuzzy controller is proposed in this work. A key feature is the fact that no switching terms commonly employed for avoiding consequences estimates drift is not employed. Uncertainties depending on position and velocity as well as uncertainties associated to the servo gain are estimated using a fuzzy system. Closed loop stability is assed through the Lyapunov method and experiments were conducte in order to evaluate real-time performance.
References 1. Y. Wang, T. Chai. Compensating modeling and control for friction using adaptive fuzzy system. IEEE Conference on Decision and Control, December 14-17, 2004, Atlantis, Bahamas. 2. P. Vas, A.F. Stronach, M. Neuroth. Design and DSP implementation of fuzzy controllers for servodrives. Electrical Engineering, Vol. 79, pp 265-276, 1996. 3. Y.X. Su, S.X. Yang, D. Sun, B.Y. Duan. A simple hybrid PD controller. Mechatronics, vol 14, pp 877-890, 2004. 4. S.J. Huang, K.S. Huang. An Adaptive fuzzy sliding-mode controller for servomechanism disturbance rejection. IEEE Trans. On Industrial Electronics, vol. 48, No. 4, pp 845, 852, 2001. 5. S. Jee, Y. Koren, Adaptive fuzzy logic controller for feed drives of a CNC machine tool. Mechatronics, vol. 14, pp 299-326, 2004 6. Z. Kovačic, S. Bogdan, M, Balenovič. A Model Reference & Sensitivity Model-based Selflearning Fuzzy Logic Controller as a solution for Control of Nonlinear Servo Systems. IEEE Trans. on Energy Conversion, vol. 14, no. 4, pp 1479-1484, 1999. 7. B. Yao M. Almajed, M. Tomizuka High-performance robust motion control of machine tools: An adaptive robust control approach and comparative experiments, IEEE/ASME Trans. On Mechatronics, Vol. 2, 2 pp. 63-76 1997. 8. L.X. Wang. A Course in Fuzzy Systems and Control. Upper Saddle River, USA: Prentice Hall, 1997. 9. E. Kim. A fuzzy disturbance observer and its applications to control. IEEE Trans. on Fuzzy Sets and Systems, vol. 10, no.1, pp 77-84, 2002. 10. H. K. Khalil. Nonlinear Systems. Third Edition, Prentice-Hall, New Jersey, pp. 168-174, 2002.