0% found this document useful (0 votes)
30 views5 pages

Fuzzy Logic Controller For An Inverted Pendulum System

This paper presents the design of a fuzzy logic controller for stabilizing an inverted pendulum system, detailing the derivation of a fuzzy control algorithm and comparing its performance with conventional control methods. The fuzzy controller simplifies the control process by using linguistic variables and heuristic rules, requiring only the sensing of pole angle and cart position. Simulation results demonstrate the effectiveness of the fuzzy logic controller in maintaining stability under various conditions, highlighting its advantages over traditional control techniques.

Uploaded by

Nguyen Thu Ha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views5 pages

Fuzzy Logic Controller For An Inverted Pendulum System

This paper presents the design of a fuzzy logic controller for stabilizing an inverted pendulum system, detailing the derivation of a fuzzy control algorithm and comparing its performance with conventional control methods. The fuzzy controller simplifies the control process by using linguistic variables and heuristic rules, requiring only the sensing of pole angle and cart position. Simulation results demonstrate the effectiveness of the fuzzy logic controller in maintaining stability under various conditions, highlighting its advantages over traditional control techniques.

Uploaded by

Nguyen Thu Ha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

I097 IEEE Internntional Confcrcncc on Intelligent I’roccssing Systcins Octtrbcr 28 - 3 I. I3ci.jing.

Cliiii;~

Fiuzzy Logic Controller for An Inverted Pendulum System


Chen Wei Ji Fang Lei Lei Kam Kin
Faculty of Science and Technology, University of Macau
P.O. BOX 3001, Macau
In this paper we present a case of using fuzzy logic for the
Abstract - The design of a fuzzy logic controller for an derivation of a practical control scheme for stabilizing an
inverted pendulum system is described in this paper. A brief inverted pendulum. We begin with a brief review of the
review of basics of fuzzy logic controller and its relationship to basics of fuzzy logic controllers. Then, we describe in detail
conventional controller is first given. Then, the derivation of a the derivation of a fuzzy control scheme. The fuzzy
fuzzy control algorithm for an inverted pendulum is described controller requires only sensing of pole angular and cart
in detail. The proposed fuzzy control is evaluated by position, and its implementation is relatively simple.
simulations. Basic performances of fuzzy logic control (FLC) Computation simulations are used to verify the feasibility of
and conventional control are compared. Finally, general ideas the proposed fuzzy control. Basic performances of FLC and
for designing fuzzy logic controllers and descriptions of
(dis)advantages of FLC for industrial automation are
conventional control are compared. Finally, general ideas for
presented. designing fuzzy logic controllers and descriptions of
(dis)advantages of FLC for industrial automation are
presented in this paper.
I. INTRODUCTION
11. BASICS OF FUZZY LOGIC CONTROLLER
The inverted pendulum is an intriguing subject from the
control polnt of view due to their intrinsic nonlinearity. The FLC is one of the most successful applications of fuzzy set
problem is to balance: a pole on a mobile platform that can theory, introduced by Zadeh in 1965 [I]. Its major features
move in only two directions, td the left or to the right. This are the use of linguistic vanables rather than numerical
control problem is fundamentally the same as those involved variables. Linguisfic variables, defined as variables whose
in rocket or missile propulsion. Common control approaches values are sentences in natural language (such as small and
such as Proportional-Integral-Derivative (PID) control and large), may be represented byfuzzy sets.
Linear Quadratic control (LQ) require a good knowledge of A fuzzy set is an extension of a crisp set where an element
the system and accurate tuning in order to obtain desired can only belong to a set (full membership) or not belong at
performances. However, it is often impossible to specify an all (no membership). Fuzzy sets allow partial membership
accurate mathematical model of the process, or the which means that an element may partially belong to more
description with differential equations is extremely complex. than one set.
In order to .obtain control surface, the inverted pendulum A fuzzy set A is characterized by a membership function p,
dynamcs should be locally linearized. Moreover, application that assigns to each object in a given class a grade of
of these control techniques to a two or three stage inverted membership to the set. Of course, the grade of membership
pendulum may result in a very critical design of control can range from 0 (no membership) to 1 (full membership);
parameters and difficult stabilization. we therefore write
A complete different approach is offered by the fuzzy logic
control (FLC) which does not require a precise mathematical PA: x [o, 11 (1)
modeling of the system nor complex computations [l]. This
control technique relies on the human capability to which means that the fuzzy set A belongs to a universal set X
understand the system’s behavior and i s based on qualitative (usually called universe of discourse) defied in a specific
control rules. Thus, control design is simple since it is only problem. A fuzzy set A is called afuzzy singbton when there
based on linguistic niles of the type: “lfthe pole angle is zero is only one element xo with pA(x,,) = 1, while all of the other
and the angular velocity is zero, then the applied force is elements have a membership grade which equals to zero.
zero,” and so on. This approach relies on the basic physical This approach allows characterization of the system
properties of the systems, and it is potentially able to extend behavior through simple relations cfuzzy rules) between
control capability even to those operating conditions where linguistic variables. Usually, fuzzy rules are expressed in the
linear control techniques fail, i.e., large-signal dynamics and form of fuzzy conditional statements R, of the type
large parameter variations. Since fuzzy control is based on
heuristic rules, application of nonlinear control laws to face R, : if x is small THEN y is large (2)
the nonlinear nature of inverted pendulum is easy. The FLC
approach is general in the sense that almost the same control where x and y are fuzzy variables, and small and large are
rules can be applied to a two stage inverted pendulum. labels of fuzzy set. If there are n rules, the rule set is
0-7803-4253-4/97/$10.00 0 1997 IEEE

- 185 -
I

il

- 186 -
V. DERIVATION OF FUZZY LOGIC CONTROLLER Fuzzy Logic Controller
FOP. INVERTED PENDULUM

The basic scheme of a fuzzy controller is shown in Fig. 3.


The inverted pendulum is represented by a “black box” from
which we only extract the terminals corresponding to extemal
force F applied to the cart, pole angle 0 and cart position x.
As we can see only two state variables are sensed; the pole
angle 0 and cart posirion x.
In the proposed fuzzy controller we use four input
variables: pole angle 0, cart position x, pole angular velocity
w and cart velocity v. For ease of implementation, the last
two are computed om line, and digital filters are adopted to
minimize the noises. The controller output variable is the
terminal voltage of Servo Motor which exerts a force F on Inverted F Servo
the cart. Fuzzy sets must be defined for each input and output Pendulum < Motor
variable. As s h o h i n Fig. 4,five hzzy subsets [PB (Positive
Big), PS (Positive Small), Z (Zero), NS(Negative Small), and
NE3 (Negative Big)] have been chosen for input variables 8
and w, while only three fuzzy subsets [P (Positive), Z (Zero),
and N (Negative Big)] have been selected for input variables
x and v since main ]purpose is to keep the pole upright. For
the output variable V, seven fuzzy singletons have been used
(PB, PM, PS, Z, NS, NM, and NE3) in order to reduce
computation time. As shown in Fig. 4, triangular shapes have
been adopted for the membership functions; the value of each
input and output variable is normalized in [-I, 11 by using
.
suitable scale factors. The force F is computed according to
(9).
The derivation of the fuzzy control rules is heuristic in
nature and based on the following theoretical criteria [6]:

1. The expected pole angle and angular velocity are zero. -0.7 -0.3 03 07
If 0 is positive and w is positive, then F is PM
If 0 is positive and w is zero, then F is PS
If 0 is positive and w is negative, then F is Z
If 8 is negative and 0) is positive, then F is Z
If 0 is negative and 63 is zero, then F is NS
If 0 is negative and LO is negative, then F is NM
If 0 is zero and w is ]positive,then F is PS
If 8 is zero and w is negative, then F is NS
2. The expected cart position and velocity are zero.
Fig. 4 Membership functions for 8, w, x ,v and V
If x is zero and v is positive, then F is PM
If x is zero and v is negative, then F is NM The inference result of each rule consists of two parts, the
If x positibn is posibive and v is positive, then F is PB compatibility (weighting factor), w,, of the individual rule,
If x is negative and 11 is negative, then F is NB and the output terminal voltage, V,, according to the rule. The
defuzzified (center of gravity) output terminal voltage V can
According to these criteria, 22 actual rules are derived to therefore be found as
keep the pole upright aqd make the cart remain at the center
of the track. A sample of the rules aie as follows: If 8 is NE3
and w is PM then V is NM; If 8 is Z and w is PB then V is
PB; If 0 is Z and w is Z and x is N and v is P then V is PS; If where N is the maximum number of effective rules.
8 is Z and w is PS aiidx is N and v is P then V is PM.

i
- 187 -
. ,. . ...... _.
.... .. . . .. .

.... - .....
time (sec)

(4

. , . ....... . .... . ...... . . .. . __ .....

ortant notes fo

ntradictions between IU

For the purpose of generality, the universe o


and the stability of the system, is introducing nonlinear

- 188 -
scaling factors or, altematively, tuning the peaks of the 0.1 I

membership functions om ...............:................;................:................

006 ..............;................ :................;................


VI. SIMULATED RESULTS

Control operation was verified by simulation. As we can 002 ........... -...:...:..............................................


see in Fig. 5, the controller with the same fuzzy rules can ........................................
successfully keep the pole upright under different initial
.......i................ i................
conditions. Poles with different length and mass have been
tested. .........................................
I

VII. FURTHER REMARKS

In the design of a linear contioller, one should do the


following steps after selecting the sensors [7]: 1) Modeling -
Build a mathematical model describing the process; 2)
Linearization - Linearize the model; 3) Solving equations -
Make a trial design based on optimal control or other criteria;
4) Simulation - Simulate the design. If not satisfied, go to
step 1).
For a fuzzy logic controller, the steps are: 1) Analysis -
Analyze the process; 2) Acquisition of rules - Acquire control
rules from experience. operators. 3) Simulation - Simulate the I” [sec)
fuzzy controller, If not satisfied, go to step 1). (b)
For the processes that are difficult to model but have Fig 6 Simulation results for an Optimal Controller. (a)l = 0.22m, m =
straightforward control rules, the fuzzy logic controllers are 0.28Kg. 8, = 0.lrad. @) I = 0.4m, m=0.3SKg, Bo= O.lnd.
easy to design and implement. Since the fuzzy controllers are
designed directly from the properties of the process, the VIII.CONCLUSION
development time will be shorter than for conventional
controllers. We proposed in this paper a very simple fuzzy controller
For example, in the designing of a controller for an for the inverted pendulum. Fuzzy control and expert-system-
lnverted pendulum, the real nonlinear dynamics should be based control seem to provide an easy solution to this
locally linearized, and a PID or state-feedback controller is problem. We have presented the derivation of the fuzzy
designed for the system. Simulation results have been shown linguistic rules and verified its function by computer
m Fig. 6 for an optimal controller with reduced-order state simulations. As compared to conventional controllers, it
observer for the simplified model [SI. The performance of provides unproved performance. Further work will be
conventional controllers depends heavily on the operating pursued in stabilizing one stage and two stage inverted
parameters of the system. For example, if the length and mass pendulum.
of the pendulum cbanges, the performance is unacceptable.
However, fuzzy conirollers are more robust. REFERENCE
Since fuzzy controllers are designed according to
experience, they are more transparent than conventional [I] L. A. Zadeh, “Outline of a new approach of the analysis of complex
system and decision processes,” IEEE Trans. Syst., Man, Cybern., vol.
controllers. Because of transparency, maintenance and SMCJ, no. 1, pp. 28-44, 1963.
upgrading are easy. One way of looking at FLC is to [ZIMamdani, E. H. and Assilian, S., “An Experiment in Linguistic Synthesis
summarize where and where not this technology is applied with a Fuzzy Controller, ” International Journal of Man-Machine
successfully. The employment of FLC is commendable for studies 7,pp. 1-13, 1975.
[3] T. J. ROSS, Fuzzy Logic with Engineering Applications, McGraw-Hill,
very complex processes, when there is no simple Inc., 1991.
mathematical model; for highly nonlinear processes; if the [4] R. R. Yager, et al., Essentials of Fuzzy Modeling and Control, New
processing of (linguistically formulated) expert knowledge is York Wiley, 1992.
to be formed. The employment of FLC is not so good an idea [SI M.J.PATYRA, et al, Fuzzy Logic Implementation and Applications,
Chichester: Wiley, 1996.
if conventional control theory yields a satisfying result; an [6] F. Smith, “ A Comparative Study of Inference Methods for Fuzzy logic
easily solvable anti adequate mathematical model already Control,” Dept. of Artificial Intelligence, University of Edinburgh, 1996.
exists; if high speed is required and fuzzy control rules may [7] Aptronix FuzzyNet, htrp://www.aptronix.com/fuuzzynet, 1997.
be extensive; value output for fuzzy logic control does not [8]B.Shahian, et al., Control System Design Using MATLABa, New Jersey:
approach final position asymptotically. It oscillates by Prentice Hall, 1993.
nature.

- 189 -

You might also like