Anda di halaman 1dari 10

IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 45, NO.

2, APRIL 1998

297

Robust Adaptive Sliding-Mode Control Using Fuzzy Modeling for an Inverted-Pendulum System
Chaio-Shiung Chen and Wen-Liang Chen
Abstract In this paper, a new robust adaptive control architecture is proposed for operation of an inverted-pendulum mechanical system. The architecture employs a fuzzy system to adaptively compensate for the plant nonlinearities and forces the inverted pendulum to track a prescribed reference model. When matching with the model occurs, the pendulum will be stabilized at an upright position and the cart should return to its zero position. The control scheme has a sliding control input to compensate for the modeling errors of the fuzzy system. The gain of the sliding input is automatically adjusted to a necessary level to ensure the stability of the overall system. Global asymptotic stability of the algorithm is established via Lyapunovs stability theorem. Experiments on an inverted-pendulum system are given to show the effectiveness of the proposed control structure. Index Terms Fuzzy system, inverted-pendulum system, Lyapunovs stability theorem, reference model, robust adaptive control, sliding control.

I. INTRODUCTION

TABILIZATION of an inverted-pendulum system is a complex and nonlinear problem. It has been extensively studied by numerous researchers , . An understanding of how to control such a system will allow us to easily solve the other related control problems, such as single-link exible manipulators  and stabilization of a rocket booster by its own thrust vector. A practical problem with regard to control of an inverted pendulum on a cart is designing a controller to swing the inverted pendulum up from a pendant position, achieve inverted stabilization, and simultaneously position the cart. This seemingly simple nonlinear control problem is surprisingly difcult to solve in a systematic fashion. This problem arises because there are two degrees of freedom, i.e., the pendulum angle and the cart position, but only one controls force. Further, when the pendulum has a large inclination, the strong nonlinearity makes it difcult to treat this problem using linear theory. Many authors have investigated such a problem. Matsuura  used two kinds of fuzzy tables, one for stabilizing the inverted pendulum and the other for positioning the cart location. Lin and Sheu  proposed a hybrid control method to operate a pendulumcart system, where fuzzy control is used to swing up the inverted pendulum and linear state feedback control is used to stabilize the pendulum near its upright position. Furuta et al. ,  employed linear servo theory to stabilize a double and a triple inverted pendulum
Manuscript received February 27, 1996; revised August 12, 1997. The authors are with the Department of Power Mechanical Engineering, National Tsing Hua University, Hsinchu, 30043 Taiwan, R.O.C. Publisher Item Identier S 0278-0046(98)01569-X.

298

IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 45, NO. 2, APRIL 1998

Assume that and where and are coefcients of friction. Rearranging (2) and (3), we have (4) (5) where

(6)
Fig. 1. The inverted-pendulum system.

adaptively. Using this estimated bound, a sliding control input is calculated, such that the tracking error is forced to a predetermined boundary, and the boundedness of all signals of the closed-loop system is guaranteed in the sense of Lyapunov. The proposed scheme is also robust to the variation of the parameters of the inverted-pendulum system and even a bounded external disturbance. Finally, we demonstrate the effectiveness of our scheme via experiments on an invertedpendulum mechanical system. This paper is organized as follows. In Section II, the mathematical representation for an inverted system is derived. In Section III, a detailed design of the control system is proposed. In Section IV, the experimental results are given to illustrate the performance of the developed scheme. Finally, the conclusions of the paper are given in Section V. II. SYSTEM MODELS The inverted-pendulum system is a rigid pendulum hinged on a cart, so that the pendulum is driven to rotate around the pivot by advance and retreat of the cart, as shown in Fig. 1. To get the dynamic equations of the inverted-pendulum system, we apply Lagranges formulations as follows. First, the Lagrange scale function is

(7) and as has an unknown upper bound (8) From (4) and (5), we see that the inverted-pendulum system includes two dynamic equations; (4) is the dynamic transition from the control force to the angle of the pendulum and (5) is the dynamic relation between the position of the cart and the angle of the pendulum In the following section, we will present a robust adaptive control architecture for the system (4) to force the angle of the pendulum to follow a prescribed stable reference model, the inputs of which are the position and velocity of the cart and the output is the desired angle of the pendulum. When matching with the model occurs, the overall system is equivalent to the reference model and the system (5). Then, the inverted pendulum can be stabilized at an upright position and the cart will return to its zero position. A detailed description will be given in the next section. III. CONTROL SYSTEM DESIGN In this section, we rst specify a reference model to stabilize the system (5) and then present a robust adaptive fuzzy architecture to force the system (4) to follow this reference model. We also propose two simple control rules to swing up the pendulum from the pendant position to the upward position. A. The Reference Model Let us linearize the system (5) around thus obtain the following linear model: We (9) If the where and and the neglected uncertainties in the parameters high-order terms are considered, the linear model can be represented as (10) and where Choose a reference model as for (11)

(1) is the mass of where is the acceleration due to gravity, is the mass of the pendulum, and is the half the cart, length of the pendulum. Lagranges formulations are

where is the applied force, is the friction of the cart on a track, is the friction of the pendulum on the pivot, and represents a uniformly bounded disturbance (i.e., for all due to the measurement noise and noises in the power source. We thus obtain (2) (3)

CHEN AND CHEN: ROBUST ADAPTIVE SLIDING-MODE CONTROL USING FUZZY MODELING

299

in which and are real numbers, and and are chosen such that the polynomial is strictly Hurwitz. If is forced to follow the trajectory combining (10) and (11) we have an equivalent linear dynamic system as follows:

The inequality

where

denote the Forbenius norm, or, equivalently, (19)

(12) The characteristic polynomial of this linear system is Remarks: 1) The quantity is the stability margin to allow the largest variation of parameters and around nominal vales and Based on the we can iteratively modify the vector by adjusting the parameters of the reference model in the form of (11) to increase the stability margin for the equivalent linear system (12). is determined by the 2) The stability margin radius of the stability hypersphere. This quantity can be calculated according to the method in . B. Fuzzy Logic System Let us dene the tracking error as The error equation can be derived by subtracting (4) from (11) as

(13) From (13), it is shown that the poles of (12) can be assigned and arbitrarily through choosing the parameters If we write the coefcients of this polynomial in vector form by separating the parameters of the plant and the parameters of the reference model, we have (14) where is the plant parameter vector

(20) (15) and satisfy (19). The feedback control where law for (20) can be obtained only while and are well known. However, because of exibility in the pendulum and uncertainties in the parameters and and are not exactly known. Thus, we will employ fuzzy logic systems to approximate them. From (4) and (7), we see that the system (4) has two In order for (4) to be uncontrollable points at controllable, we assume that the pendulum is in the upward In this region, the control gain is region, i.e., nite and positive. We further assumed that we can determine the bound: (21) (17) denotes the nominal characteristic where Let vector for a given and denote the radius of the stability hypersphere centered in the space so that in (13) with at is strictly Hurwitz polynomial for Hence, from (17), the robust all stability is achieved if Now, dene the unknown nonlinear function and consider a fuzzy system, as shown in Fig. 2. The fuzzy rule base consists of rules in the following form: IF and and is is near THEN is near (22)

in (15) represents the coefcients of the Note that decharacteristic polynomial (13). Let note the nominal parameter vector of the plant and a perturbation. Then, (16) denes the perturbation of yields Substituting (16) into (14)

(18)

where are the input fuzzy sets characterized by fuzzy membership functions and near and near are fuzzy singletons with centers and respectively. If singleton fuzzier, product inference, and center-average defuzzier are used, the input and output

300

relation of the fuzzy system is obtained in  as

Fig. 3. The block diagram of the control structure.

(23) where parameter vectors, and and dened by and are are called fuzzy basic functions

(24)

Fig. 4. Denition of the angle of the pendulum.

Let us dene the optimal approximation parameters in the fuzzy system as follows:

and

(a)

(25) where is a compact set of fuzzy input vector in all rules. In the compact set we have the following upper approximation error bounds: and (26) where and are unknown real numbers.
(b) Fig. 5. The direction of applied force for swinging up the pendulum. (a) Driving the cart from right to left. (b) Driving the cart from left to right.

where C. Robust Adaptive Fuzzy Control Law Next, we dene the error metric as and

(27)

From (8) and (26), we have (29)

denes a hyperplane in on which The equation the tracking error decays exponentially to zero. Using the error equation (20), the time derivative of the error metric can be obtained as (28)

In order to avoid the chattering where of the controller on the switching hyperplane, a boundary of width is incorporated into the error metric by dening as  (30) where is a saturation function.

CHEN AND CHEN: ROBUST ADAPTIVE SLIDING-MODE CONTROL USING FUZZY MODELING

301

TABLE II POLE LOCATIONS AND STABILITY MARGINS FOR DIFFERENT NOMINAL CUTOFF FREQUENCIES w0

From (28), an adaptive control law can be synthesized by

(31) is a positive constant feedback gain, and where is a sliding control gain, which is the estimated linear bound in (29), i.e., of (32) and are the estimates of and respectively. where Substituting the control law (31) into (28), and then using (23), yields
Fig. 8. The initial fuzzy rules for g 01 (1 ; 2 ).

(33) and An adaptive mechanism where for the parameters of the fuzzy system and the sliding control gain is chosen as

where are positive adaptive gains. The control architecture is shown in Fig. 3. By the adaptive mechanism in (34), we have the following results. Theorem 1: Consider the system (4) with the adaptive is given by (32), and control law (31), where and are given by (23). Let the and be adjusted by the adaptive mechanism (34). Then, all states in the adaptive system will remain bounded, and the tracking errors asymptotically converge to a neighborhood of zero. Proof: Consider the Lyapunov function

(35) (34)

302

IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 45, NO. 2, APRIL 1998

(a)

(b)

(c)

(d)

(e) Fig. 9.
_ (t); x(t); x The dynamic responses of (t);  _ (t), and control voltage with initial conditions _ (0) = 0; x(0) = 0:3 m; x  (0) = 0;  _ (0) = 0.

CHEN AND CHEN: ROBUST ADAPTIVE SLIDING-MODE CONTROL USING FUZZY MODELING

303

where function then

and From (30), the has the following properties: 1) if , and 2) if then and Therefore, for For the time derivative of can be easily derived by the use of (21), (29), and (32)(34) as

D. Swing Up the Inverted Pendulum To utilize the proposed adaptive control law, the pendulum must be rstly swung up from the pendant position to the upward position. Let us dene the angle of the pendulum, as shown in Fig. 4. Since the cart can only move within a limited length, we must try to swing the pendulum up by driving the cart on the rail back and forth. This is similar to a human playing on a swing. Based on physical intuition, the two algorithms to swing up the pendulum are summarized below, and the direction of the applied force on the cart is shown in Fig. 5. 1) Driving the cart from right to left is summarized as follows: and apply positive voltage and apply negative voltage cart is stopped; to drive the cart to left; or on the cart until the

2) Driving the cart from left to right is summarized as follows: and apply negative voltage to right; and or apply positive voltage cart is stopped; to drive the cart

Hence, if and are bounded at they remain bounded for all Since is uniformly bounded, if the initial values of and are bounded, then they are also bounded for all Thus, as is is bounded, as well. Since is a positive bounded, monotonically decreasing function, the limit is well dened and

is the traveling length

that is, It can easily be shown that every term in is bounded. Thus, by Babalats (33) is bounded, hence, lemma, as This means that the inequality is obtained asymptotically and, thus, implies that tracking errors are ultimately bounded within designated intervals . Remarks: 1) The sliding control gain actually reects the component of modeling error and external disturbance. If fuzzy modeling is poor, it will automatically adjust to a necessary level to ensure the stability of the overall system. 2) One should choose small to ensure the requirement of tracking accuracy. However, a small might produce a boundary layer so thin that it risks exciting highfrequency dynamics. Therefore, we must make a tradeoff between the desired tracking error tolerance and the discontinuity of the control input.

When the pendulum is swung up to the upward position, the adaptive control law is switched to stabilize the inverted pendulum. Since the power of the dc motor and the length of the rail are limited, the switching conditions, i.e., velocity and angle of the pendulum, are not too large. If the current states of the pendulum satisfy the predetermined switching conditions, then the control stage is changed to the adaptive control law; otherwise, it remains in the swing-up stage. IV. EXPERIMENT In this section, we illustrate the effectiveness of the proposed control scheme by an experiment. The experimental setup is shown in Fig. 6, and its actual fabricated system parameters are presented in Table I. The system consists of a cart moving along a limited-length rail, a pendulum hinged on the cart, so as to rotate in a vertical plane, and a cart-driving device that contains a dc motor, a servo amplier, and a pulley-belt transmission system. Two photo encoders are used to detect the angle of the pendulum and the position of the cart. In order to obtain the velocities of the pendulum and the cart, numerical differentiation is used. The main control algorithm is

304

(a)

(b)

(c)

(d)

(e) Fig. 10.

_ (t); x(t); x The dynamic responses of (t);  _ (t), and control voltage with initial conditions  (0) =

0180 , _(0) = 0; x(0) = 0; x _ (0) = 0.

CHEN AND CHEN: ROBUST ADAPTIVE SLIDING-MODE CONTROL USING FUZZY MODELING

305

implemented with a 100-Hz sampling rate via an IBM PC with an Intel i486DX-33 microprocessor. The PC is interfaced to the current servo amplier and the sensors through a custom card containing two decoders and a one-channel D/A converter for one channel analog output. The proposed algorithm is written in C language . and the First, we determine the swing-up voltage If the swing-up voltage is traveling length of the cart set large, then the required time to swing up the pendulum to the upward position becomes short. However, it will induce the larger velocity when the pendulum is near the upward position. limits the movement distance of On the other hand, the the cart with respect to its zero position to ensure that the cart moves within the length of the rail. Therefore, the suitable and are chosen to be within 2.03.5 V values of and within 0.050.1 m. From experiments, it is is known that it takes about 4.5 s to swing up the pendulum to the upward position and change to the adaptive control law when and 0.08 m for If is chosen we select 3.1 V for less than 1.8 V, the pendulum cannot be swung up to the upward position. Further, when the pendulum is pumped to the upward position, the adaptive control law takes over from the swing-up stage. The switching conditions are chosen as and s Next, we choose the parameters of the reference model in to robustify (11). In order to have a larger stability margin the equivalent linear dynamic system (12), we specify a series of the poles and the stability margin for different nominal , as shown in Table II, based on the cutoff frequencies Bessel prototype method . From Table II, we see that a causes a faster dynamic response, but a smaller larger stability margin. By a tradeoff between the convergent rate of dynamic response and the stability margin, the poles are and for the nominal chosen as cutoff frequencies at rad/s, where The values of associated parameters are as follows: , and The fuzzy system used for both approximations and are described in (23). The fuzzy rule base is in and we dene ve fuzzy sets the form of (22). For with triangular membership functions to cover the fuzzy input region. By inspecting (6) and (7), we quantify the observation and as shown in into 25 initial fuzzy rules for Figs. 7 and 8. The parameters of the adaptive fuzzy control law are selected as follows: and , and the desired error tolerance is set to 10, which is experimentally determined so that the control input is smooth. The initial and are chosen to be zero. values of the estimates Two cases are presented in the experiment. Fig. 9 shows and control the dynamic responses of voltage with the initial condition m and The proposed adaptive control scheme is directly used to drive the cart to return to its zero position and simultaneously stabilize the inverted pendulum. Fig. 10 shows and control the dynamic responses of and voltage with the initial condition

The pendulum is rst swung up from a pendulum position to an upward position, and then, the proposed adaptive control scheme is switched to stabilize the inverted pendulum. From Figs. 9 and 10, it can be seen that the proposed control law can successfully stabilize the pendulum at the upright position and regulate the position of the cart to a neighborhood of zero. The position of cart is bounded within 0.008 m and the angle of the pendulum within 0.4 . The results demonstrate the usefulness of the proposed controller in handling the unstable nonlinear system with unknown uncertainties. V. CONCLUSION In this paper, the development and implementation of a robust adaptive control architecture to operate the invertedpendulum system has been presented. The architecture employs a fuzzy system to adaptively compensate for the plant nonlinearities and forces the angle of the inverted pendulum to follow a prescribed reference model. When matching with the model occurs, the overall control system is equivalent to a stable dynamic system, such that the inverted pendulum is stabilized at the upright position and the cart is positioned at zero. The bounds of the fuzzy modeling error are estimated adaptively using an estimation algorithm and the global asymptotic stability of the algorithm is established in the Lyapunov sense, with tracking errors bounded in the predetermined tolerance. Finally, experimental results have veried the effectiveness of the proposed control scheme. Although only the inverted-pendulum system has been studied in this paper, the proposed control scheme can also be used to address the conventional problem of a class of nonlinear control systems. REFERENCES
 J. Ackermann, Robust Control: Systems with Uncertain Physical Parameters. London, U.K.: Springer, 1993.  C. W. Anderson, Learning to control an inverted pendulum using neural networks, IEEE Contr. Syst. Mag., vol. 9, pp. 3137, Apr. 1989.  G. F. Franklin, J. D. Powell, and A. Emami-Naeini, Feedback Control of Dynamic Systems. Reading, MA: Addison-Wesley, 1986.  J. Hao and J. Vandewalle, A rule-base controller for inverted pendulum systems, Int. J. Contr., vol. 4, no. 1, pp. 5564, 1993.  C. E Lin and Y. R. Sheu, A hybrid-control approach for pendulum-car control, IEEE Trans. Ind. Electron., vol. 39, pp. 208214, June 1992.  K. Matsuura, Fuzzy control of upswing and stabilization of inverted pole including control of cart position, Jpn. J. Fuzzy Theory Syst., vol. 5, no. 2, pp. 239253, 1993.  S. Mori, H. Nishihara, and K. Furuta, Control of unstable mechanical system control of pendulum, Int. J. Contr., vol. 23, no. 5, pp. 673692, 1976.  R. M. Sanner and J.-J. E. Slotine, Gaussian networks for direct adaptive control, IEEE Trans. Neural Networks, vol. 3, pp. 837863, Nov. 1992.  L. X. Wang, Adaptive Fuzzy Systems and Control: Design and Stability Analysis. Englewood Cliffs, NJ: Prentice-Hall, 1994.  T. Yamakawa, Stabilization of an inverted pendulum by a high-speed fuzzy logic controller hardware system, Fuzzy Sets Syst., vol. 32, no. 2, pp. 161180, 1989.  K. S. Yeung and Y. P. Chen, Sliding mode controller design of a single link exible manipulator under gravity, Int. J. Contr., vol. 52, no. 1, pp. 101117, July 1990.  M. Sugeno and T. Yasukawa, A fuzzy logic based approach to qualitative modeling, IEEE Trans. Fuzzy Syst., vol. 1, pp. 731, Feb. 1993.  L. X. Wang, Stable adaptive fuzzy control of nonlinear systems, IEEE Trans. Fuzzy Syst., vol. 1, pp. 146155, May 1993.

306

IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 45, NO. 2, APRIL 1998

 L. X. Wang and J. M. Mendel, Fuzzy basis function, universal approximation, and orthogonal least square learning, IEEE Trans. Neural Networks, vol. 3, pp. 807814, Sept. 1992.  J.-J. E. Slotine and W. Li, Applied Nonlinear Control. Englewood Cliffs, NJ: Prentice-Hall, 1991.  K. Furuta, H. Kajiwara, and K. Kosuge, Digital control of a double inverted pendulum on an inclined rail, Int. J. Contr., vol. 32, no. 5, pp. 907924, 1980.  K. Furuta, T. Ochiai, and N. Ono, Attitude control of a triple inverted pendulum, Int. J. Contr., vol. 39, no. 6, pp. 13511365, 1984.  H. Meier, Z. Farwig, and H. Unbehauen, Discrete computer control of a triple-inverted pendulum, Optimal Contr. Applicat. Methods, vol. 11, no. 2, pp. 157171, Apr.June 1990.  D. Whitley, S. Dominic, R. Das, and C. W. Aderson, Genetic reinforcement learning for neurocontrol problems, Mach. Learn., vol. 13, no. 2/3, pp. 259284, Nov./Dec. 1993.  F. Bouslama and A. Ichikawa, Application of neural networks to fuzzy control, Neural Networks, vol. 6, no. 6, pp. 791799, 1993.  H. Gomi and M. Kawato, Neural network control for a closed-loop system using feedback-error-learning, Neural Networks, vol. 6, no. 7, pp. 933946, 1993.

Wen-Liang Chen received the B.S. degree from National Cheng Kung University, Tainan, Taiwan, R.O.C., in 1967, the M.S. degree from National Taiwan University, Taipei, Taiwan, R.O.C., in 1970, and the Ph.D. degree from National Cheng Kung University in 1977, all in electrical engineering. In 1977, he joined the Department of Power Mechanical Engineering, National Tsing Hua University, Hsinchu, Taiwan, R.O.C., where he was the Department Chairman from 1988 to 1991, and is currently a Professor. His research interests are in the areas of stability theory and fuzzy control and its application in servo systems.

Chaio-Shiung Chen was born in Taiwan, R.O.C., in 1964. He received the B.S., M.S., and Ph.D. degrees in mechanical engineering from National Tsing Hua University, Hsinchu, Taiwan, R.O.C., in 1986, 1988, and 1996, respectively. His areas of research interest are nonlinear control, fuzzy control, and intelligent control.