You are on page 1of 7

IAICT 2014, Bali 28-30 August 2014

Balancing System of Tray on Waiter Robbot using


Complementaary Filter and Fuzzy Loogic
Thifan Anjar Permadi Junartho Halomoan Sugondo Hadiyoso
Faculty of Electrical Engineering Faculty of Electrical Engineering Telkkom Applied Science School
Telkom University Telkom University Telkom University
Bandung, Indonesia Bandung, Indonesia Bandung, Indonesia
thifan.anjar@gmail.com junartho@telkomuniversity.ac.id sugonndo@telkomuniversity.ac.id

Abstract— The emergence of waiter robotss forces humans to To keep the balanced positioon of tray, system must read tilt
develop it to be more sophisticated. One of paart which should be value of tray properly and it will
w be processed by controller.
developed is balancing system of tray that is i carried by waiter But there is problem in reaading value of accelerometer
robot, because the movement of robot can affeect tilt of tray which because it produces noise.. To solve this problem,
causes spilling of foods or drinks from the tray. This study is
complementary filter is used to reduce noise of reading the
done for make a system that can keep balanccing position of tray
that is carried by waiter robot. Tray balaancing system work accelerometer value. System allso has fast response to return
based on tilt of the tray that is detected usingg accelerometer and tray position to balanced positioon. To support it, system needs
gyroscope sensor which is filtered by comp plementary filter to a controller, and fuzzy logic iss the controller method that is
reduce noise on reading data of sensors. AfterA that, the main used.
control device which uses Arduino Uno R3 which w is programed This paper is organized as foollows: Section 2 describes the
with compiler software of Arduino (Arduin no IDE) will return basic theory that support the system which is used in this
balancing position of tray using two motor seervos that will move study; Section 3 details the design
d of the system, such as
tray on two different axes. Fuzzy logic is used as controller in this general system design, hardw ware design, software design,
system to control the direction and angle of trray movement. This
complementary filter and fuzzzy logic design; Section 4
study success to make a complementary filtter that can reduce
noise of reading sensor accelerometer an nd gyroscope with presents the experimental results,
r followed by some
coefficient filter (K) 0.8 and sampling time 100 ms. This study also concluding remarks in Section 5.5
provides balancing system of tray with baalance tolerance of
17.565o and -15.532o for x-angle (pitch) movvement and 14.613o II. BASIC
C THEORY
and -13.392o for y-angle (roll) movement.
A. Accelerometer[7]
Accelerometer is sensor that is used to measure
Keywords— Balancing tray, Waiter Robot, coomplementary
acceleration force. When thinkking about accelerometer, it is
filter, fuzzy logic, accelerometer, gyroscope
often useful to image a box inn shape of a cube with a ball
I. INTRODUCTION inside it. Figure 1 is represent of a ball on vacuum condition
(no gravitation), so that the ball just drift in the middle of the
Today, many restaurants try to present technologies on their
box.
services because new research showss that restaurant
technology plays part in dining decisions [1]. To support it,
study about various innovation technologies of restaurant
services has been widely reported. For example,
e using of
mobile robot [2], wireless call system [3], menu
m recommender
[4], self-service restaurant ordering system m [5], and waiter
robot [6].
This paper discusses about waiter robot technology
t because
someday most waiters of fast food restaurantr will be
terminated and replaced by waiter robots, which are having
Fig.1 Flying ball into a no-gravitational cube
fast service. It encourages people to developp waiter robot to be
more sophisticated. In performing its task, waiter robot must
keep balancing position of tray that is carried
c in order to Symbol on the wall of thhe cube is representing of 3
deliver food properly. But, problems will happen
h when robot dimensional axes (axes Y+ (waall Y+) is removed to show ball
body experiences changing of tilt whichh caused by many inside the cube). Imagine that each wall very sensitive with
factor like walking; ascending and descendding the ladder; or pressure. If cube is placed in gravitational
g condition, the ball
unbalanced of the position of its arm. Beecause of that, this falls down and wall Z- detects a force and acceleration of Z
paper focuses on balancing system of tray ono waiter robot. axis become to 1g. This conditioon is displayed by figure 2.

978-1-4799-4909-0/14/$31.00 ©2014 IEEE 15


IAICT 2014, Bali 28-30 August 2014

disc's high rate of spin and mooment of inertia. The device's


orientation remains nearly fixeed, regardless of the mounting
platform's motion, because moounting the device in a gimbal
minimizes external torque. Figgure 5 shows construction of
gyroscope sensor.

Fig.2 Ball in gravitational cubee

If the cube is tilted, there are more wallls that detect force
and acceleration which detected is changedd. This condition is
shown in figure 3. Fig.5 Construction of
o gyroscope sensor

Gyroscope that is used in thhis research is L3G4200D from


STMicroelectronics, Inc [10].

C. Complementary Filter
Actually, accelerometer can already be used to measure tilt
of the object. But, when measuuring a movement object, there
is noise on value of tilt that is measured. Therefore, value of
tilt that measured by accelerom meter must be filtered by low
pass filter to reduce noise.
Fig.3 Position of ball on gravitational tiilted-cube To make smoother signal value of tilt, gyroscope can be
Figure 4 is representation of figure 3 iff it is displayed in added to this measuring becausee gyroscope can measure angle
Cartesian diagram. changes with integrating value of its angle speed and then it
will be combined with value of o accelerometer that has been
filtered. But, gyroscope has drrift effect (not coming back to
zero rate value when rotation iss stopped) when it is used for a
prolonged period. To solve thiss problem, value of gyroscope
must be filtered with high pass filter because it just used to
improve accuracy of tilt value when
w object is moving.
Complementary filter can be used to combine value of both
sensor (accelerometer and gyrosscope). The design principle of
the complementary filter is baseed on multi-sensor information
Fig.4 Cartesian diagram of acceleration that is deteccted based on figure 3 fusion technology, which is coonstituted by the accelerometer
and gyroscope [11]. Figurre 6 is representation of
Based on figure 4, Rx is value of acceleraation of X axes, Rz complementary filter diagram block [12].
is acceleration of Z axes and R is resultaant of gravitational
acceleration. Tilt angle (ao) can be measuredd with formula 1.
ோ௫
ܽ ൌ ‫ି݊ܽݐ‬ଵ (1)
ோ௭

Accelerometer that is used in this reseearch is ADXL345


from Analog Device Inc [8]. This sensor can be accessible
with I2C or SPI communication protocol.
Fig.6 Diagram block of complementary filter

B. Gyroscope [9]
If complementary filter is i applied on programming
Gyroscope is one of IMU (Inertial Meassurement Unit) that language, formula 2 [12] can bee used.
is used to measure angle speed of object rotary movement.
Mechanically, a gyroscope is a spinning wheel or disc in S1 = K(S2 + ωt) + g(1-K) (2)
which the axle is free to assume any orientaation. Although this
orientation does not remain fixed, it changees in response to an With:
external torque much less and in a differennt direction than it K = Filter coefficient.
would with the large angular momentum associated
a with the t = Sampling time (basedd on sampling time of sensors).

16
IAICT 2014, Bali 28-30 August 2014

S1 = Result of complementary filter calculation. used to control speed of servos movement in restoring
S2 = Result of complementary filter calculation before. balanced position of unbalanced tray.
ω = Output angle speed of gyroscope. Flowchart on figure 9 shows general work process of
g = Output angle of accelerometer. system.

D. Fuzzy Logic
Fuzzy logic is one of artificial intelligent controller system
that is opponent with crisp logic. Crisp logic only knows two
logics, that is true or false, but in fuzzy logic, between true
and false there are values that is determined by membership
degree which has tendency level of true and false. Fuzzy logic
has 4 part of its operational that is represented on figure 7.

Fig.7 Diagram block of fuzzy logic Fig.9 Diagram block of fuzzy logic

Based on figure 7, first process of fuzzy logic is


fuzzification. Fuzzification is process to convert crisp value to B. Hardware Design
membership function for determine membership degree of Device has two servo motors that are used to control tilt of
each linguistics. Results of fuzzification are type of linguistics tray on two different axes. Device also provides a box that
of each membership function of input and its membership used to insert human arm as simulator of system as if human
degree. Then, its result is used by inference machine to hand is a robot arm. Tray that is used in device has a
mapping the input space to output space based on fuzzy rules. measurement of 15x15 centimetres that is made from acrylic.
Finally, result of inference machine are calculated in process Design of the device is shown in Figure 10.
of defuzzification to produce final output of fuzzy logic using
any method, like sugeno, mamdani, tsukamoto, etc.

III. SYSTEM DESIGN


A. General Description of System
System that is designed and realized works based on block
diagram that is shown in figure 8.

Fig.10 Physically form of device

Device uses 11.1 V 1450 mAh LiPo Battery that is used as


power supply of device. Device has electronics circuit that
consist of ADXL345 IC as accelerometer sensor, L3G4200D
IC as gyroscope sensor which both of them use I2C protocol
Fig.8 Diagram block of fuzzy logic communication with Arduino Uno R3 to reading sensor value
from both sensors. Arduino Uno R3 is also used to process
Based on figure 8, system that has been designed and complementary filter and fuzzy logic.
implemented has two input, those are tilt angle which is read Device uses two Dynamixel AX-12 servos [13] that are
by accelerometer and angle speed which is read by gyroscope. used to control tilt of tray on two axes based on speed and
Because value of accelerometer measurement has noise, direction from result of fuzzy logic. Dynamixel AX-12 servo
complementary filter can be used to reduce that noise with is a digital servo motor that isn’t controlled with PWM like
adding gyroscope value that has been integrated to angle value analog servo motor, but it uses data communication with its
to make smoother signal. Signal without noise from self-protocol. To support it, interfacing between Arduino Uno
complementary filter becomes an input of fuzzy logic that is with Dynamixel AX-12 servo needs 74LS241 IC as buffer

17
IAICT 2014, Bali 28-30 August 2014

because data transmission speed from servo up to 1 Mbps, but


maximum speed of Arduino to receive data only 115200 bps.
Figure 11 shows interfacing of components on electronics
circuit of device.

Fig.11 Interfacing of component on electronics circuit

Fig.13 Flowchart of complementary filter


C. Software design
Software that is made is a system program which is
designed with Arduino IDE (Integrated Development E. Design of Fuzzy Logic
Environment) software with C language programming. Figure System uses fuzzy logic with weight average sugeno
12 shows flowchart of main program of system. method. Fuzzification process uses two inputs; those are tilt
value that has been filtered by complementary filter which is
converted to linguistic variable of Negative, Balance, and
Positive and delta error (difference between present tilt value
and before) which is converted to linguistic variable of Left,
Normal, and Right; and one outputs; that is moving speed of
servo which is converted to linguistic variable of NH
(Negative High), NM (Negative Medium), NL (Negative Low),
Z (Zero), PL (Positive Low), PM (Positive Medium), and PH
(Positive High). Figure 14 and 15 show membership function
of both inputs and figure 16 shows membership of output.
Graphs are drawn with not linear value on horizontal axes
because the range values are too high.

Fig.14 Membership function of tilt input


Fig.12 Flowchart of System Program

D. Design of Complementary Filter


Complementary filter that is designed become a procedure
on main program. It works with read data from accelerometer
sensor and gyroscope sensor, and then they are calculated with
formula 2 which its filter coefficient (K) and sampling time
(dt) have been determined. Flowchart on figure 13 shows Fig.15 Membership function of delta error
work process of complementary filter that is designed.

18
IAICT 2014, Bali 28-30 August 2014

Fig.16 Membership function of speed output

For fuzzy inference process, system uses “MAX” method.


To mapping inputs to output, system uses fuzzy rule that is Fig.18 Signal output from direct testing of complementary filter
shown in table 1.
TABLE I Testing of complementary filter shows that the greater of
FUZZY RULES filter coefficient value that is used makes output signal
Fuzzy Rules Left Normal Right become smoother, but update time will be longer and the
damping will be bigger. It also shows that quality of output
Negative PH PM PL signals from simulation and directly aren’t different.
Balance PL Z NL According to testings of complementary filter, system uses
filter coefficient (K) 0.8 and sampling time (dt) because it
Positive NL NM NH
produces smooth signal and has time sampling that isn’t too
long.
IV. RESULTS B. Testing and Analysis of System Performance
A. Testing and Analysis of Complementary Filter Testing of system performance is done with apply fuzzy
Complementary filter is used to reduce noise from reading logic in the system directly with changing tilt of the arm with
sensor value of accelerometer. Testing of complementary movement to 4 direction. Then, the result with form of graph
filter is done with two ways; those are testing with Matlab will be analysed. Figure 19 shows the illustration of
simulation and testing directly from device. movement direction to testing the device.
Testing with Matlab simulation is done with capture data of
accelerometer and gyroscope from random tilt movement of
tray. Data which has been captured is calculated with formula
of complementary filter (formula 2) with changing filter
coefficient (K) to be analysed its effect with output signal.
Figure 17 shows result of output signal from testing
complementary filter for original accelerometer data using
matlab simulation with changing filter coefficient from 0.4 to (a) (b)
0.98 with sampling time (dt) of 10ms.

(c) (d)
Fig.19 Direction of movement to (a) X+, (b) X-, (c) Y+, (d) Y-
Fig.17 Effect of filter coefficient changing with output of complementary
filter from testing of Matlab simulation Actually, testing want be done with observe the difference
of speed and real graph between tilt of arm and tray. But,
The next testing after testing with Matlab simulation is because of limit of device, testing just be done with observe
testing directly to device with using complementary filter the maximum tolerance when device is moved 90o to 4
calculation on arduino program with using filter coefficient direction that shown in figure 19 using speed of between 6 to
which produces best output signal according to matlab 8 deg/s with various mass of load as object of the tray.
simulation. Filter coefficient that is used for this direct testing Maximum tolerance is state of maximum tilt that is still
is 0.8 and sampling time (dt) 10ms. The result is shown in considered has balance state by the system. Graph of tilt of
figure 18. tray when it is moved to 4 directions that is shown in figure 19

19
IAICT 2014, Bali 28-30 August 2014

are shown in figure 20 for X+ movement, figure 21 for X- System has been able to return tray position almost to
movement, figure 22 for Y+ movement and figure 23 for Y- balanced position, but system performance still bad because
movement. tolerance of balanced position too big which caused by
linguistic value of “Balance” in membership function of “Tilt
Value” too wide, so system consider tilt still in balanced
position if tilt of the tray still on the interval linguistic value of
“Balance” in membership function of “Tilt Value”.
Testing of system performance shows that the maximum
tolerance are 17,565o and -15,5325o for X-Axes movement
and 14,613o and -13,932o for Y-Axes movement those are
obtained from table II for X-Axes and table III for Y-Axes.
But, maximum value of testing with 200 grams load isn’t
included in Y-Axes table because at that moment, motor servo
can’t take up the tray and motor servo detects overload
condition, so motor servo shuts down. It is happened because
Fig.20 Tilt of tray on X+ movement
the distance between the mass centre of the load and the
spindle of motor servo that makes movement at Y-Axes is too
long, and torque of motor servo can’t handle it. So, system can
perform same performance with mass of load is under 200
grams
TABLE II
TOLERANCE OF MOVEMENT IN X-AXES
Tolerance (o)
Load
Maximum Minimum
No Load 17,4 -14.63
50 grams 16.61 -14.33
100 grams 15.44 -14.99

Fig.21 Tilt of tray on X- movement 150 grams 16.10 -15.47


200 grams 26.42 -20.41
Average 17.565 -15.5325

TABLE III
TOLERANCE OF MOVEMENT IN Y-AXES
Tolerance (o)
Load
Maximum Minimum
No Load 20,4 -25,85
50 grams 18.03 -15.74
Fig.22 Tilt of tray on Y+ movement 100 grams 13.33 -13.58
150 grams 12.48 -12.40
200 grams - -14.01
Average 14.613 -13.932

But, on other testing, except testing that is realized above, if


the interval linguistic value of “Balance” is changed to be
tighter, the ripple will be bigger and can’t stop to ripple
because when tray is placed almost balanced position, motor
servo still has high speed and the result of fuzzy logic in that
position hasn’t executed. It makes the tray pass the balanced
Fig.23 Tilt of tray on Y- movement position to unbalanced position again.

20
IAICT 2014, Bali 28-30 August 2014

V. CONCLUSIONS [14] Juang Hau-Shiue, Lum Kai-Yew, “Design and control of a two-wheel
self-balancing robot using the arduino microcontroller board,” in 2013
The result and testing of system have the conclusion as 10th IEEE International Conference on Control and Automation
follow. (ICCA), Hangzhou, China, June 12-14, 2013, pp. 635-639.
1. Complementary filter that has been realized with
coefficient filter (K) of 0.8 and sampling time (dt) of
10ms can reduce noise of reading value of sensor, but
time update is increase.
2. Fuzzy logic that has been realized can return the tray
almost to balanced position, but the performance still
not good because the maximum tolerance still 17,565o
and -15,5325o for X-Axes movement and 14,613o and
-13,932o for Y-Axes movement.
3. System can be used with load that has mass under 200
grams.

REFERENCES
[1] National Restaurant Association (2014, May 14). New research shows
restaurant technology plays part in dining decisions. [Online].
Available: http://www.restaurant.org/News-Research/News/New-
research-shows-restaurant-technology-plays-par
[2] Tzou Jyh-Hwa, Wu-Feng, Su Kuo, L, “The development of the
restaurant service mobile robot with a Laser positioning system,” in
Control Conference, 2008. CCC 2008. 27th Chinese, Kunming, China,
July 16-18, 2008, pp. 662 – 666.
[3] Zhu Bing, Xu-yan Zhou, Tan Bin, Peng Xu-Ge, “Research and design
of restaurant service in wireless call system,” in Artificial Intelligence
and Education (ICAIE), 2010 International Conference, Hangzhou,
China, Oct 29-30, 2010, pp.437-440.
[4] Tan-Hsu Tan, Ching-Su Chang, Yung-Fu Chen, “Developing an
Intelligent e-Restaurant With a Menu Recommender for Customer-
Centric Service,” in Systems, Man, and Cybernetics, Part C:
Applications and Reviews, IEEE Transactions, vol. 42, Sept, 2012,
pp.775-787.
[5] Noor, M.Z.H.; Rahman, A.A.A.; Saaid, M.F.; Ali, M.S.A.M.; Zolkapli,
M., “The development of Self-Service Restaurant Ordering System
(SROS),” in Control and System Graduate Research Colloquium
(ICSGRC), 2012 IEEE, Shah Alam, Selangor, July 16-17, 2012, pp.
348 – 353.
[6] Franklin, D.F.; Kahn, R.E.; Swain, M.J.; Firby, R.J., “Happy patrons
make better tippers: creating a robot waiter using Perseus and the
Animate Agent architecture,” in Automatic Face and Gesture
Recognition, 1996., Proceedings of the Second International
Conference, Killington, VT, Oct 14-16, 1996, pp. 253 – 258.
[7] Baluta, Sergiu (2009, Dec). A Guide to Using IMU (Accelerometer and
Gyroscope Devices) in Embedded Applications. [Online].
Available: http://www.starlino.com/imu_guide.html
[8] Analog Device Inc (2009). 3-Axis, ±2 g/±4 g/±8 g/±16 g Digital
Accelerometer ADXL345 Datasheet. [Online].
Available: http://www.analog.com/static/imported-files/data_sheets/
ADXL345.pdf
[9] Wikipedia (2014, May). Gyroscope. [Online].
Available: http://en.wikipedia.org/wiki/Gyroscope
[10] STMicroelectronics, Inc (2010). L3G4200D MEMS motion sensor:
ultra-stable three-axis digital output gyroscope Datasheet. [Online].
Available: https://www.pololu.com/file/download/L3G4200D.pdf?
file_id=0J491
[11] Li Hui-qin, Li Jian-wei, Han Jian-hai, “Design and application of real-
time attitude estimation system for unstable object,” in Proceedings of
the IEEE International Conference on Automation and Logistics,
Zhengzhou, China, August 2012, pp.596-600.
[12] Colton, Shane (Jun, 2007). The Balance Filter, A Simple Solution for
Integrating Accelerometer and Gyroscope Measurement for a
Balancing Platform. Submitted as Chief Delphi white paper. [Online].
Available: http://www.chiefdelphi.com/media/papers/download/2059
[13] Robotis (2006). Dynamixel AX-12 User’s Manual. [Online].
Available: http://www.crustcrawler.com/products/bioloid/docs/
AX-12.pdf

21

You might also like