Adaptive Fuzzy Control of DC motors R. Garrido1, D. Calderón and A. Soria
Abstract − In this work we propose a proportional plus adaptive fuzzy compensation applied to control the speed of a DC motor. The approach is based on Lyapunov theory and it is compared against a standard proportional integral controller. Experimental results are shown to validate the proposed approach.
I. INTRODUCTION DC servomotors are widely used in robotics and in CNC machines. In most cases these motors are employed in position servo loops. However, in several applications as in CNC machines controlling the speed of a DC motor is also important. Standard Proportional Integral (PI) controllers are used for speed control of Direct Current (DC) motors when the desired speed is a constant value. Even if these controllers perform well in this case, for time-varying references it may suffer from poor performance. In order to overcome this problem several techniques have been proposed. Linear robust and adaptive techniques have been employed successfully to solve the above problem [6], however, stability of the closed loop system was evaluated only using experimental results, moreover, a potential problem with the estimation algorithm may arrive since the authors employ a standard Least Squares which has fading gain and it does not have a mechanism to avoid parameter drift. Intelligent techniques such as Neural Networks and Fuzzy logic have been proposed for speed control of servo drives [1], [3], [4], [5], [7]. The aforementioned papers show interesting results from a simulation and experimental results, indeed, they show that using intelligent techniques it is possible to successfully control the speed of a DC motor in spite of parameters changes and nonlinear phenomena, for example nonlinear friction [4], However, no rigorous stability proofs are presented to theoretically validate the proposed approaches. In this work, a novel adaptive fuzzy controller for speed control of DC motors is proposed. The consequences of the fuzzy rules are updated on-line.
A nonlinear model of the motor is assumed and the only a priori information about the motor parameters is the nominal value of the input gain. Stability of the closed loop system is assessed using Lyapunov Stability theory. Experimental results are given to validate the proposed approach which is compared against a classic PI controller. The paper is organized as follows. The model of the servomechanism analyzed in this work is given in section II. The proposed control law is designed in section III. Experimental results are presented in section IV. The paper ends with some concluding remarks in section V. II. FIRST ORDER NONLINEAR DC MOTOR MODEL We assume that the DC motor is modeled by the following first order differential equation
Jx + h ( x ) = τ
where x : Angular velocity h( x ) : Non linear term depending on x J : Inertia τ :Applied Torque
Function h ( x ) models nonlinear friction phenomena. We suppose that the velocity x is available from measurements and that a lineal relationship exists among the torque applied to the servo and the control voltage, i.e, τ = ku Then, (1) may be written as
x =
h ( x) k u− J J
By defining
b= R. G., D. C. and A. S. Author is with Depto. de Control Automático, CINVESTAV-IPN. A.P. 14-740. 07360, México D.F. (corresponding author to provide phone: (52) 55 50613812; fax: (52) 55 50613982; email: garrido@ ctrl.cinvestav.mx, dcalderon@ ctrl.cinvestav.mx, soria@ ctrl.cinvestav.mx).
(1)
k h( x ) , f ( x) = J J
(2)
and using equation (2), we obtain
x = bu − f ( x)
Substituting equation (9) into equation (8), we obtain in closed loop (3)
Velocity error is defined as
e=r−x
(4)
where r is a time-varying continuous reference and the error time derivative is
e = r − x
Note that the control law (9) cancel out the term
g ( x, u ) , so that the system in closed loop (10) is
linear. We can rewrite (10) in the form
e = −k p e.
(5) and stability follows for
Substituting equation (3) into equation (5) yields
e = r − [bu − f ( x)] = r − [bu + f ( x) ± bnomu ]
⎛ bnom ⎡⎣ k p e + r − g ( x, u ) ⎤⎦ ⎞ ⎟ − g ( x, u ) (10) e = r − ⎜ ⎜ ⎟ bnom ⎝ ⎠
(6)
g ( x, u f ) of g ( x, u ) using a Takagi-Sugeno scheme [8]. The nonlinear term is approximate by
where bnom is an estimate of b which is assumed to be known. Define
g ( x, u ) = wT σ ( x, u ) + ς ; | ς | < kς ; w 2 < η .
(7)
then, substituting equation (7) into equation (6) yields
e = r − bnomu − g ( x, u )
kp > 0 .
Second case: Adaptive fuzzy control law In this case the control law employs an approximation
= r − [bnomu + f ( x) − bu + bnomu ]
g ( x, u ) = f ( x) − bu + bnomu
(11)
(8)
where
ς
is the approximation error, kς and
approximation of the nonlinear term g ( x, u ) using
(13)
η
are
upper bounds for the approximation error and the consequences. The error in the consequences and its time derivative are given by
w = w − wˆ w = − wˆ
III. THE ADAPTIVE FUZZY CONTROL LAW. The problem we tackle is stated as follows: To design a control strategy such that the position error e = r − x and the states of the closed loop system be uniformly ultimately bounded. The solution of the above problem is based on the
(12)
(14)
and the control law is defined as
u=
1
⎡ k p e + r − gˆ ( x, u f ) ⎤⎦ bnom ⎣
(15)
Fuzzy Logic techniques. This section is divided into two parts related to the way in which the nonlinear term is compensated:
Note that if u is employed to estimate g ( x, u )
1.- Control law with exact compensation. The nonlinear
control law (15) is implemented.
term g ( x, u ) is exactly known.
instead of u f then an algebraic loop appears when The approximation
2.- Adaptive fuzzy control law. The nonlinear term
g ( x, u f ) of g ( x, u ) is given by
g ( x, u ) is completely unknown.
M
First case: Exact compensation. Let the control law for the case when the nonlinear
term g ( x, u ) is known be :
u=
1
⎡ k p e + r − g ( x, u ) ⎤⎦ bnom ⎣
gˆ ( x, u f ) =
∑ μ ( x, u ) wˆ m =1 M
f
m
∑ μ ( x, u ) m =1
(9)
m
m
f
where M is the number of rules,
μm ( x, u f ) are
the
ˆ are the consequences of membership functions and w the rules. It is important to emphasize that the consequences are upgraded on-line and initialized at zero and
⎡ wˆ1 ⎤ ⎢ wˆ ⎥ ⎢ 2⎥ ⎢ # ⎥ wˆ = ⎢ ⎥ ⎢ wˆ m ⎥ ⎢ # ⎥ ⎢ ⎥ ⎢⎣ wˆ M ⎥⎦
σ ( x, u f ) =
= − k p e − wˆ T σ ( x, u f ) + w T σ ( x, u ) + ς = − k p e + ( wT − wˆ T ) σ ( x, u f ) + w T ⎡⎣σ ( x, u ) − σ ( x, u f ) ⎤⎦ + ς Using equation (14) we finally obtain
e = −k p e + w T σ ( x, u f )
+ w T ⎣⎡σ ( x, u ) − σ ( x, u f ) ⎦⎤ + ς
M
∑ μ ( x, u ) m
f
gˆ ( x, u ) = wˆ T σ ( x, u f )
u f = − k1u f + k2bnomu
(20)
For stability analysis purposes we will use the following Lyapunov function candidate
1 1 1 V = e² + kw−1w T w + u 2f . 2 2 2k1k2 (21) The time derivative of (21) is
1 V = ee + kw−1w T w + u f u f k1k2 (16)
where u f is a filtered version of u and it is defined as (17)
where k1 and k 2 are positive constants. Using (15), it is possible to write (17) as
u f = − k1u f + k2 k p e + k2 r + k2 wˆ T σ ( x, u f ) (18) On the other hand, substituting equation (16) into equation (15) we obtain
bnom
e = − k p e − wˆ T σ ( x, u f ) + wT σ ( x, u ) + ς
± w T σ ( x, u f )
⎡ μ1 ( x1 , u f ) ⎤ ⎢ ⎥ ⎢ μ2 ( x2 , u f ) ⎥ ⎢ ⎥ # ⎢ ⎥ μ ( x, u f ) = ⎢ ⎥ ⎢ μm ( xm , u f ) ⎥ ⎢ ⎥ # ⎢ ⎥ ⎢⎢ μ M ( xm , u f ) ⎥⎥ ⎣ ⎦
1
g ( x, u ) , yields
μ ( x, u f ) m =1
u=
Reordering terms and using approximation (12) of
⎡ k p e + r + wˆ T σ ( x, u f ) ⎤ ⎣ ⎦
(19)
Substituting equation (19) into equation (8) we obtain
e = r − ⎡⎣ k p e + r + wˆ T σ ( x, u f ) ⎤⎦ + g ( x, u )
substituting e given in equation (20) and
u f given in
equation (18) yields
V = −k p e² + ew T σ ( x, u f ) + ewT ⎡⎣σ ( x, u ) − σ ( x, u f ) ⎤⎦ kp 1 1 + eς + k w−1w T w − u 2f + eu f + u f r k2 k1 k1 +
1 u f wˆ T σ ( x, u f ) k1
reordering terms, we obtain
k 1 1 1 V = −k p e² − u 2f + p eu f + u f r + u f wˆ T σ ( x, u f ) k2 k1 k1 k1 +eς + ewT ⎡⎣σ ( x, u ) − σ ( x, u f ) ⎤⎦ + w T eσ ( x, u ) + k −1w
(
f
w
)
( 22)
Let us consider the following update law
− w = wˆ = kweσ ( x, u f ) − β kw e wˆ
(23)
Substituting (23) into (22) yields
2
(24)
⎞ k2 kσ 1 ⎛ 1 ⎞ 1 ⎛ V = − k p ⎜ e − u f ⎟ − w ⎟ ⎜uf − k1 ⎠ 2k2 ⎝ k1 2 ⎝ ⎠ 1 ⎛ 1 1 ⎞ − kp ⎜ − 2 ⎟ u 2f 2 ⎜⎝ 2k2 k p k1 ⎟⎠ k k2 ⎞ 2 1⎛ − ⎜ β e − 2 2σ ⎟ w k1 ⎠ 2⎝
(25)
1 − β e w ( w − 2η ) 2 ⎡ ⎤ 1 2k u f ⎢ u f − 2 ( kr + kση ) ⎥ − k1 4k2 ⎣ ⎦ ⎡ ⎤ 1 2 − k p e ⎢ e − ( kε + 2k w kσ ) ⎥ kp 2 ⎣⎢ ⎦⎥
k 1 1 V = −k p e² − u 2f + p eu f + u f r k2 k1 k1 +k2u f wˆ T σ ( x, u f ) + eς
+ewT ⎡⎣σ ( x, u ) − σ ( x, u f ) ⎤⎦ + β e w T wˆ Let us consider the following upperbounds
r ≤ kr
σ ( x,*) ≤ kσ ; w ≤ η w T wˆ = w T ( w − w ) ≤ − w
( w − η ) .
we then have
1 k u f r ≤ r u f (26) k1 k1 1 1 u f wˆ Tσ ( x, u f ) ≤ u f ( wT − w T ) σ ( x, u f ) k1 k1 ≤
kσ k u f w + σ η u f k1 k1
(27)
(28) Using the triangle inequality we obtain
σ ( x, u ) − σ ( x, u f ) ≤ σ ( x, u ) + σ ( x, u f ) ≤ 2kσ ewT ⎡⎣σ ( x, u ) − σ ( x, u f ) ⎤⎦ ≤ 2kση e
(29)
Substituting the upper bounds defined in (26), (27), (28), (29) into equation (24) we have
1 V ≤ − k p e² − u 2f − β e w k2 +
kp k1
eu f +
kσ u f w k1
⎛k k ⎞ + βη e w + ⎜ r + σ η ⎟ u f ⎝ k1 k1 ⎠ + ( kε + 2kση ) e
2
(30)
2
Where V ≤ 0 , if
k12 > 2k p k2 w > 2η uf >
ς e ≤ kε e
then
Making some manipulations the time derivative the Lypaunov function (30) can be written in the following way
4k2 ( kr + kση ) k1
⎡2 k2 kσ2 ⎤ e > min ⎢ ( kε + 2η kσ ) , ⎥ β k12 ⎦⎥ ⎣⎢ k p We then conclude that the system (20) is uniform ultimate bounded [2] if the above conditions are fulfilled. IV. EXPERIMENTAL RESULTS In this section we illustrate the proposed algorithm through experiments. The setup consists of a DC motor coupled to a inertial load through a timing belt. (see figure 1). The motor is controlled using an electronic PWM amplifier. Speed was measured using an optical encoder coupled to a frequency to voltage converter. In this way both devices act like a tachogenerator. The algorithms were executed in the Matlab/simulink environment coupled with the Wincon program from Quanser Consulting. Data acquisition was performed using a Multi-Q 3 card also from Quanser Consulting. The sampling period was 1ms.
Fig. 4. Velocity Error for PI Control Fig. 1 The laboratory prototype The reference signal employed for both controllers was a sine wave plus a constant term of a 51 rad/s with an amplitude of 71.4 rad/s and with a frequency of 0.1Hz. The gains employed were kp=7.2, kI=4.01 for the case of classic control PI (see figures 2-5). The results were compared against the proposed algorithm. In this last case the gains are kp= 5.31, kw=5, β=0.0075, bnom=0.35 (see Figures 6-9)
Fig. 5. Quadratic Error For PI Control
Fig. 2. Velocity Response using PI Control
Fig. 6. Output Response using the proposed Fuzzy Adaptive Control
Fig. 3. Control Signal using PI Control
V. CONCLUSION In this paper we presented an adaptive fuzzy controller applied to the speed control of a DC motor. A proportional controller fuzzy logic-based compensation is employed for speed control of a DC motor. The approach is based on Lyapunov stability theory and it is compared against a PI controller. Experimental results were shown to validate the proposed approach.
Fig. 7. Control Signal using the proposed Fuzzy Adaptive Control
Fig. 8. Velocity Error For Fuzzy Adaptive Control
Fig. 9. Quadratic Error For Fuzzy Adaptive Control The experimental results show that the proposed control law out performs the PI controller, however, the control signal exhibits less high frequency components in the case of the PI controller.
REFERENCES [1]. Ahmed Rubaai, Raj. Kotaru. “Online identification and control of a DC motor using learning adaptation of neural networks”, IEEE Transactions on Industry Applications. Vol. 36, No. 3. 2000. [2]. Corless M. , Leitmann G., “Continuous State Feedback Guaranteeing Uniform Ultimate Boundedness for Uncertain Dynamic Systems”, IEEE Trans. Automat. Contr., vol. 26, 5, pp. 1139-1144, 1981. [3]. Faa-Jeng Lin, Chih-Hong Lin and Po-Hung “Shen,Self-Constructing Fuzzy Neural Network Speed Controller for PermanentMagnet Synchronous Motor Drive”, IEEE Trans. on Fuzzy Systems, vol. 9, No. 5, pp. 751-759, 2001. [4]. Jason T. Teeter, Mo-yuen Chow, James J. Bricley Jr. “A novel fuzzy friction compensation approach to improve the performance of a DC motor control system”, IEEE Trans. on Industrial Electronics. Vol. 43, no. 1. 1996. [5]. K.B. Lee. “Disturbance observer that uses radial basis function neural networks for the low speed control of a servo motor” IEE Proceedings-Control Theory Appl. Vol. 152, No. 2. 2005. [6]. Kiyoshi Ohishi, Toshimasa Miyazaki, Yoshihiro Nakamura. “High performance ultralow speed servo system based on doubly coprime factorization and instantaneous observer”, IEEE/ASME Trans. on Mechatronics. Vol. 1, No. 1. 1996. [7]. M. Azizur Rahman, M. Ashraful Hoque. “Online self-tuning ANN-based speed control of a PM DC motor”. IEEE/ASME Trans. on Mechatronics. Vol. 2, No. 3. 1997. [8]. Sugeno M., Industrial applications of fuzzy control, Elsevier Science, 1985.