Beruflich Dokumente
Kultur Dokumente
Abstract
Fuzzy logic is a paradigm for an alternative design
technique, which can be applied in both linear and non linear
systems for embedded control. It is a problem-solving control
system methodology that can be built into anything from small,
embedded controller and hand-held products to large
computerized process control systems.
This paper proposes and analyses methods to control
a ball balancing system using fuzzy logic. It is a nonlinear
dynamic system which is quite difficult to control using
conventional methods. It has delayed feedback associated with
control actions; however, control system based on fuzzy logic
requires less mathematical derivation in design and has a high
noise tolerance. Image of the ball taken from an Audio/Video
(AV) camera is processed to determine the coordinates of its
centre. This input data is fed into the 68HCS12
microcontroller, which has the most efficient implementation of
fuzzy logic instruction sets. Built-in PWM channels, A to D
converters, 32kb flash memory and in-system programming
make this controller ideal for the system considered. The
controller processes this input using the fuzzy logic rule base
and sends consequent signals to the servo motor controlling
the beam motion.
Keywords: Ball on beam; 68HCS12; fuzzy logic; digital image
processing; non-linear control theory.
1. INTRODUCTION
An important set of contemporary industrial processes
and systems are unstable by nature and essentially require
feedback control for effective and safe performance [1].
However the crucial problem that exits in the study of such
real, unstable systems is that they cannot be brought into the
laboratory for analyses. Due to its simplistic design and
relevant, dynamic characteristics, ball balancing beam has
become an ideal model for complex, non-linear control
methods.
Although PID control is an efficient technique for the
handling of non-linear systems but modeling these systems is
often troublesome and sometimes impossible using the laws of
physics. Therefore, using a classical controller is not suitable
for nonlinear control application [2].
2241
Ball
Beam
Lever
Arm
Gear
(m + )r + mg sin mr ( )
J
R2
=0
(1)
R (s )
mgd
1
=
Y (s )
J
s2
L 2 + m
R
Time (sec)
Defuzzify
y(t)
r(t)
FUZZY LOGIC
e(t)
Fuzzy
Inference
System
Ball &
Beam
System
2242
Video Image
AV Camera
In-system
programming
PC
Ball &
Beam
System
Ball
coordinate
(serial data)
68HCS12
controller
PWM
5. 68HCS12 MICROCONTROLLER
The 68HCS12 is a high-speed processing unit. It is the
first controller that has a separate instruction set to specifically
cope with fuzzy logic, making it highly suitable for the fuzzy
control of the ball balancing beam. Full 16-bit data paths
support efficient arithmetic operation and quick math
execution. It runs on a 16MHz crystal thus executing
instructions faster. 1024 Bytes of RAM and 4096 Bytes of
EEPROM make this controller much more suitable in
comparison to conventionally used controllers. Its on-chip
memory mapping allows expansion to over 5 MB of address
space. Independently clocked on board UARTs can be driven
at speeds up to 38400 enabling faster drive of serial port, which
makes it ideal in dealing with the unstable response of the ball.
5.1. Fuzzy Logic Implementation
The 68HCS12 controller includes instructions that
perform specific fuzzy logic tasks. Its compatibility with Clanguage assists in the development of effective fuzzy logic
programs. The fuzzy inference kernel requires less code space
and executes much faster than a comparable kernel performed
on any other microcontroller. To perform complex instructions
it computes functions including addition, subtraction,
multiplication and comparisons. The MEM instruction receives
and calculates the first fuzzy error input on a membership
function in 625 ns at 8MHz. This result is automatically stored
and the instruction updates two pointers so that the next input,
i.e., error derivative, is evaluated without executing any other
instructions between labels of a system input.
NL
-80 -60
NM
NS
ZO
-40 -20 0
PS
PM
20 40
PL
60
80
NL
NS
NL
NL
NL
NS
NL
ZO
Ball
Image
ZO
PS
PL
NL
NM
NS
NL
NL
NS
NS
NM
NS
ZO
PS
PS
PS
PM
PM
PM
PM
PL
PL
PM
PL
PL
PL
PL
Phase B
D=
2243
100
(4)
u (k ) u (k 1)
u (k ) =
t
(5)
5.4. Results
Ball and the beam is a highly unstable system that
requires rapid processing and intelligent algorithm. The
implementation of the designed rule base not only enabled an
intelligent and compact programming for quick response but
also gave a flexible means to design and redesign the control
model upon testing. Using the least possible mathematical
calculations the controller was able to map the input
parameters on to the rule base and suggest an appropriate
output.
The 25MHz bus speed of 68HCS12, in addition to
intelligent fuzzy programming, supported quick execution of
the algorithm. The microcontroller proved to be efficient in the
control of such unstable systems as considered.
6. CONCLUSIONS
While PID is an effective technique to implement
control methodology, however it is often very complicated and
time consuming. Fuzzy logic, on the other hand, provides a
good alternative for a robust and cost-effective servo-controller
for non-linear control where no extra sensors are required and
is hence likely to be the more efficient. Execution of inference
process is based on the membership functions and IF/THEN
rules which result in simpler implementation, and consequently
low design costs. This enables design of complex nonlinear
control functions without the use of mathematical computation.
Although the efficiency of fuzzy controller is similar
in most respects to conventional controllers: But the significant
difference is evident in work time, where the fuzzy control is
faster. Moreover, during the debugging the system can be
rectified by altering rules, instead of redesigning the controller.
It does not require any re-modeling or complex equations
describing the relationship between inputs and outputs. Hence,
fuzzy logic has proved to be reliable substitute to design of
control systems.
7. REFERENCES
[1] Peter Wellstead, Ball and Beam 1: Basics, http://www.control-systemsprinciples.co.uk/whitepapers/ball-and-beam1.
[2] Cihan Karakuzu, Stk ztrk , A Comparison of Fuzzy, Neuro and
Classical Control Techniques Based on an Experimental Application,
University of Quafaquaz, No. 6, pp 189-198,July 2000.
2244