Fuzzy Logic Control of Ball and Beam System PDF
Fuzzy Logic Control of Ball and Beam System PDF
net/publication/224161560
CITATIONS READS
28 3,369
4 authors:
Some of the authors of this publication are also working on these related projects:
Control and Optimization of the MIMO system using Metamodeling Technique View project
All content following this page was uploaded by Muhammad Amjad on 09 May 2014.
Z.Shareef
M. Amjad, KashifM.I., S.S Abdullah,
Faculty of Electrical Engineering, Pakistan Institute of Engineering and Applied Sciences
Universiti Teknologi Malaysia. (PlEAS).
Skudai, Johor Bahru, Malaysia. Rawalpindi, Pakistan
[email protected], [email protected] zeeshan [email protected]
Abstract-Fuzzy logic controller (FLC) is an attractive qualitatively, inexactly, or uncertainly [3]. It does not require
alternative to existing classical or modern controllers for any system modeling or complex mathematical equations
designing the challenging Non-linear control systems as it
governing the relationship between inputs and outputs. Fuzzy
provides a heuristically method by If-Then Rules which
rules are very easy to learn and use, even by non-experts. It
resembles human intelligence. This paper presents the design and
typically takes only a few rules to describe systems that may
analysis of a FLC for the outer loop and a PD controller for the
inner loop of a ball and beam system. Additionally, a classical
require several lines of conventional software code, which
PID controller based on ITAE equations for the beam position is reduces the design complexity [4]. PID control requires the
also designed to compare the performance of both types of model of the system for the determination of the parameters of
controllers. Results reveal that FLC found to give better PID controller using control theory and finally the
transient and steady state results compare to classical PID. development of an algorithm for the controller. Whereas in
case of fuzzy logic the system behavior is characterized using
Keywords-Fu� logic controller, PID, ball and beam, MATLAB,
human knowledge which directly leads to the design of control
ITAE.
algorithm on the basis of fuzzy rules. These rules are in terms
of the relationship of inputs to their corresponding outputs,
I. INTRODUCTION
and precisely determine the controller parameters. Any
An important set of existing systems of process industries adjustment or debugging only requires modification in these
are unstable by nature and essentially require feedback control fuzzy rules instead of the redesigning the controller. Hence
for effective and safe performance [1]. However, a vital control technique based on fuzzy logic not only simplifies the
problem arises in the study of such real, unstable systems is design, but also reduces the monotonous task of solving
that they cannot be brought into the laboratory for analyses. complex mathematical equations for nonlinear systems. As a
Due to its simplistic design and dynamic characteristics, ball result, fuzzy logic controller delivers a better performance in
balancing beam seems to be an ideal model for complex, non cases where the conventional controller does not cope well
linear control methods. with the non-linearity of a process under control [5]. In fuzzy
The ball and beam system is known to be the benchmark for control we focus on gaining an intuitive understanding of how
both classical and modem control techniques. This system is to best control the process, then we load this information
widely used because of its simplicity to understand as a system directly into the fuzzy controller.
and provides the opportunity to analyze the control techniques. This paper describes an implementation of FLC. The design
The control task is to automatically adjust the position of the procedure utilizes MA TLAB® Fuzzy Logic toolbox and is
ball on beam by changing the control input i.e. angle of the implemented using SIMULINK® version 7.1. One of the great
beam. This is a complex task because the ball does not stay in advantages of the Fuzzy Logic toolbox is the ability to take
one place on the beam but moves all the way with an fuzzy systems directly into SIMULINK® and test them out in a
acceleration that is proportional to the tilt of the beam. This simulation environment [6]. Although the authors have no
system is an open loop unstable as the system output (ball experience of controlling the ball and beam system before, a
position) is unbounded to a bounded input (beam angle). somewhat better controller is designed based on the simple
Therefore, a feedback control must be employed to maintain fuzzy rules. The triangUlar membership functions are used,
the ball in a desired position on the beam. and the centroid method is used for defuzzification. A classical
Although PID control is a proficient technique for the PID controller has been also designed in MATLAB® for the
handling of non-linear systems but modeling these systems is system studied here, which will be used as a comparison to the
often troublesome and sometimes impossible using the laws of FLC designed. The remainder of the paper is organized as
physics. Therefore, using a classical controller is not suitable follows. In Section II, we have presented a mathematical
for nonlinear control application [2]. Alternatively, Fuzzy modeling of the ball and beam system. Section III discusses a
Logic Control are useful when the processes are too complex design scheme of PID controller and Section IV describes the
for analysis by conventional quantitative techniques or when design of FLC. In Section V, a comparison has been made
the available sources of information are interpreted between PID and FLC based on simulation results. Finally in
Desired
Position (7)
A. Mathematical Model of the Ball and Beam Where 'a' is the angular displacement of the ball and (a') is
The system diagram given in Fig. 1 shows that there are the diameter of the ball used and (g) is gravity [7].
three main components are involved in the system which
includes moments and forces acting on them, the motor, the
B. Mathematical Model of Motor
beam, and the ball. To simplify the design, the motor shaft and
beam are considered to be the rigid body (i-e the stiffness Based on the motor parameters, Km=O. 7Irevlsecivolts, T =
across the transmission to be near the plane of ball contact, 0.014 sec, J=1. 4x 10.6 Kg_m2, motor model can be written as
and there is no skidding). The sum of forces at the point of
intersection can be written as 8(s) 0.7
Gm (s) = = __ _ __ (8)
LF = mg sin <l> - Fr = m x (1) lines) s(0.014s+1)
b
Where the subscript b denotes forces acting on the ball, m C. Overall Model of Ball and Beam System
is the mass of the ball, g is gravity, Fr is the rolling constraint Based on the ball and beam specification of a = J . 5 cm
forces on the ball and x is the position of the ball along the (Radius of the ball), a' =9. 4227cm (for 271:), an overall model
beam. By geometry, the position can be defined as of the system can be written as
0.7
(2) G (s) = 4 (9)
0.0234s +1.713s3 +1.1991s2
x=a'a
T
'
Where a is the angular displacement of the ball, and a is
the distance between the axis of rotation of the ball and point
of contact of the ball with the beam. The torque balance of the III. DESIGN METHODOLOGY OF PID CONTROLLER
ball, T is also a product of the rolling constraint force as Fig. 2 shows the block diagram of the whole system. It
b
consists of two loops: (1) Inner motor control loop (2) outer
ball and beam loop. The design strategy is to first stabilize the
inner loop followed by an outer loop control.
2
J = -rna 2 (4)
b 5
Where J is the moment of inertial of the ball, and
b
radius of the ball.
The torque balance is given by
a is the
i
Figure 2. Block Diagram of Ball and Beam System
V3-490
2010 2nd International Conference on Education Technology and Comp.uter (ICETC)
There are number of techniques to design the PID controller These values were obtained by observing the corresponding
which involves Zigler and Nichols, SISO Tool, ITAE values of e, L1e and control input u in the conventional system
Equations, root locus, frequency reponse etc. In our design, we using the classical PID controller. Figures 3 and 4 show the
have used the ITAE equations for the PD and PID gains membership functions used for the input and output variables.
computation. The performance index ITAE provides the best
selectivity of the performance indices; that is, the minimum NL NM NS Z PS PM PrL___
value of the integral is readily discernible as the system
parameters are varied [8]. The general form of the
performance integral is
S+OJn
s2 +I.4mn +OJr? 2
s6 +3.25liJnS5 +6.60%2s4 +8.60%3� +7.45% 4; +3.95%5s+%6 The Inference Mechanism provides the mechanism for
invoking or referring to the rule base such that the appropriate
For a damping ratio of c; = 0.6, the PD controller of the rules are fired. Using trial and error approach, the best
motor and PID controller for the outer loop can be seen in (10) inference mechanism to use in this case seems to be the min
max method.
and (11) respectively.
5s2 +6s+0.2 The rule base used in the design is given in Table I. The
GBall(Controller)(S) (11) rule base follows closely the rules that were suggested in [3].
S
= -----
The main advantage for using the ITAE equation method TABLE I. FUZZY RULE BASE
for the calculation of gain is that there is no requirement for
�
any graph or chart like the root locus and the bode plot. These
equations can easily be used for the gains calculation of up to PL PM PS Z NS NM NL
6th order characteristics equation. After calculating the gains
from the ITAE equations we require the little bit tuning of the NL Z NS NM NL NL NL NL
gains.
NM PS Z NS NM NL NL NL
• e =[-1,1] PM PL PL PL PM PS Z NS
• iJe=[- I, I]
• V=[- 2, +2] PL PL PL PL PL PM PS Z
V3-491
20iO 2nd international Conference on Education Technology and Computer (ICETC)
C. Defuzzification
10 ,---,---,----,---,,-
I I I I
, , , , 'I ' , ,
I I I I
8 � - - .J ___1___ .1 _ _I ___ L _ .J _ _ 1 _ _ _ 1. __I __ _
The defuzzification technique used was also found using
• I
ID
_ _ _ _
P
trial and error. The defuzzification technique in this case that
J : � ___: � .� � I: � :
4
_ . !:C
__ _
. ...
gave the least integral square error was the Centre of Gravity 6
_ __
_ _
__ . ___ _____ _
approach.
- - -1- - -I - - - - -I --
- - -t - - 1"
- - - t- - -t
- - -1 - - - 1" -
D. Scalingfactor
Here the controller was tuned using input and output scaling o - - -I
"F
···· ,
••••••• ,
factors to improve the performance of the system. The output
scaling factor was needed to ensure that the control input u to -2 lv, v···�·
the ball and beam is enough to move the beam accordingly in
order to maintain its position. The scaling factors that were used
are listed in Table II. Time(Sec)
Scaling
Value used
factors 1.2 - _ .1 ___1___ L __ .J ___ L __ .1 ___1___ L __ .J __
0.6
Fig.5 and 6 show the error and control input for both type of
controller. A response of ball position for both type of controller is 0.4 - - -1- - - f, - --,1 --
shown in Fig. 7. Fig. 8 shows the classical PID controller Simulink
block diagram of the system. Whereas Fig.9 depicts the FLC 0.2 - - _ 1- __ .!... __ J __
, , ,
Simulink diagram of the system
Time(Sec)
1 �
. •• .••
� j -, -
I
_
-
I
__
I
.L - - -' - - -
I I
v. COMPARISON
,
I_
1... L. !....... ..... .! ... .... ... L ••••.••••••L ... ......I••••••.••.••
.�. I
o
__ _
1 _ "'···· •• ..
VI. CONCLUSION
.2
� 0L---L---�--� 3,---4L--- �
5--�6--��--L8--�9--�10 An attempt to control the position of a ball in a ball and
Time(Sec) beam system using fuzzy logic has been proposed. From the
simulation results, it has been shown that the fuzzy controller
can stabilize the system efficiently Also, the performance
Figure 5. Error Response for 80th Controllers during the transient period of the fuzzy system is better in the
sense that less overshoot was obtained. Moreover, the fuzzy
controller provides a zero steady state error.
V3-492
20iO 2nd international Conference on Education Technology, and Computer (ICETC)
[3] C.C. Lee, Fuzzy logic in control systems: fuzzy logic controller -Part I
A CKNOWLEDGMENT and II", IEEE Trans. System Man Cybemet. SMC-20, pp. 404-435,
1990.
The authors would like to thank The Islamia University of
[4] http://www.aptronix.com/fide/whyfuzzy.html.
Bahawalpur Pakistan and Universiti Teknologi Malaysia for
[5] Von Altrock, "Fuzzy Logic and NeuroFuzzy Applications Explained",
providing the facilities to allow the conduct of this research.
Prentice Hall pp 82, 1995.
[6] Fuzzy Logic Toolbox For Use with MATLAB, The Mathworks Inc.,
version 2, Natick, MA, 2006.
REFERENCES
[7] Evencio A. Rosales, A Ball-on-Beam Project Kit, Department Of
Mechanical Engineering, Massachusetts Institute of Technology, June
[I] Peter Well stead, "Ball and Beam I: Basics", http://www.control 2004
systemsprinciples.co. uk/whitepaperslball-and-beam I. [8] Francis H. Raven. Automatic Control Engineering, 5th ed, McGraw-Hili
[2] Cihan Karakuzu, Sllkl iiztiirk ," A Comparison of Fuzzy, Neuro and Inc.
Classical Control Techniques Based on an Experimental Application", [9] D' Azzo, John J and Houpis, C. H. (1995). Linear Control System
University ofQuafaquaz, No. 6, pp I89-I98,July 2000. Analysis and Design: Conventional and Modem, 4th ed., McGraw-Hili
Inc.
m---v-�€JI----I�I �
7
OO 4 S+1
Step SS Motor Controller Motor
Controller
V3-493