Noise Reduction on the Tilt Sensor for the Humanoid Robot Balancing System Using Complementary Filter

The aim of the research is to present the design of a system which is capable for noise reduction on the reading of the tilt sensor data used in a balancing system on humanoid robots. Humanoid robot is a robot that has body construction like a human. Humanoid robots can make a movement by walking with both legs. In order to walk properly, humanoid robot needs to have a proper balancing system. The humanoid robot balancing system consists of tilt sensors, either an accelerometer or a gyroscope sensor, main processing unit and actuator in the form of servo motors on each robot’s joint. The tilt sensor is used to detect tilt angle of the robot body. When sensor gives information about the robot is in a position of tilt angle that will cause the robot to fall, the main processor will send commands to the actuators to do the balancing action so the robot will go to a balancing position. Unfortunately, the tilt angle reading value obtained from tilt sensor, still contain noise. That noise makes the reading of the tilt angle of the robot body to be inaccurate. Therefore, a filtering method is required to reduce the noise. In this research, complementary filter is used to overcome this problem. From the test result, the complementary filter is able to reduce noise on the tilt sensor data value reading. The optimum filtering result was obtained with the use of filter coefficient of 0.96 and sampling time of 50ms, where the average tilt angle error value is 0.775° on the x-axis and 0.691° on the y-axis. In another test, the robot is able to perform a balancing action based on the output of the complementary filter. So the robot was always able to maintain its position on balanced condition.


Introduction
Robotics technology is receiving an increasing attention from researchers nowadays, especially in the field of humanoid robot.There are several research topics that are widely developed in the field of humanoid robot, one of which is the topic of the balancing system on humanoid robot [1].Humanoid robot is a robot that has body construction resembling human body.This robot is capable to perform movements like a human [2].With the capabilities possessed by humanoid robots, more human jobs will be replaced by the presence of humanoid robots in the future.This happens because the robot has the ability to do heavy, repetitive, and dangerous work [3].
The basic capability of humanoid robots in doing a job is to make a movement [4].Because the humanoid robot has a construction like human body, the humanoid robot can make a movement by walking with both legs.The humanoid robot legs are composed of several servo motors.The ability to walk from humanoid robot is inseparable from the robot's ability to maintain the balance of its body to remain stable and not easy to fall down while walking.In the human balance system, the body's balance while walking is arranged by the complex interaction between the sensory and musculoskeletal systems which are then processed by the brain [5].The balancing system on humanoid robot can be detected by using a tilt sensor that provides the data of a tilt angle of the robot body.The data is then processed by the main processor on the robot, so the robot can determine the action needed to balance its body.
Research on the balancing system on humanoid robot has been performed by Bazylev [6].In this research, the balance of humanoid robots is detected through changes in the tilt angle of the robot body by using accelerometer and gyroscope sensor.Data from both sensors are used to provide the decision making for humanoid robot movement to balance the body.It is implemented using PID (Proportional Integral Derivative) controller method.The problem in this research is the input of the system, which is the raw data from accelerometer and gyroscope sensor, still contains noise.By that cause, the accuracy level of the tilt angle of the robot generated by the accelerometer and gyroscope sensor is not optimal.Therefore, a filtering method is required to reduce the noise in the data from accelerometer and gyroscope sensors.
One of the filtering methods that can be used to reduce noise from the sensors is complementary filter.This method has been performed by Permadi [7] in his research for reducing the noise of accelerometer data which is used as input data to balance the tray position on the waiter robot.In other research that has been performed by Oh [8], complementary filter was used to accurately determine the tilt angle which is implemented in the balance control of a single-line play robot (SLPR) that runs on the rope.In this research, we implemented the complementary filter method to reduce noise on accelerometer and gyroscope sensors.The output of both sensors will be used as an input to the system for controlling balance of humanoid robots.
The remaining of this paper is organized as follows.Section 2 describes the humanoid robot design, control hardware, robot's tilt angle detection, complementary filter method and the implementation of the robot balancing action.In Section 3, the experimental result and discussion are described.Finally, Section 4 contains the conclusion.

Proposed method
The main objective of this research is to design a system that can reduce noise on the tilt sensor, before being used as a system input to control the balance of humanoid robots.

Humanoid robot design
The humanoid robot used in this research is a modification of Robotis Bioloid Premium Robot Kit [9].This humanoid robot is designed based on the physical form of the human.It has a head, a body, two arms, and two legs.This robot has 2-DOF (Degree of Freedom) for head tracking, 3-DOF on each arm, and 6-DOF on each leg.The humanoid robot feet soles are designed in a rectangular shape with the aim to provide greater contact between the robot foot and the surface it passes, so the humanoid robot has a better balance.Actuators in each robot joint are using a Dynamixel AX-12 servo motor [10].This servo motor has a torque up to 15kgf.cm and a resolution of 0.29°.The overall body of the robot has a high of 55cm with a weight of 3.3kg.The design of humanoid robot in this research is shown in Figure 1.

Control hardware
The main controller in this research is a Raspberry Pi 3. Raspberry Pi 3 received input in the form of a tilt angle of the robot obtained from the accelerometer and gyroscope sensors that is integrated on the MPU-6050 module.The tilt angle data are then filtered using complementary filter which is done in Raspberry Pi 3. The result from complementary filter is used to determine the balancing action that must be performed by robot.The balancing action motion commands are sent to the CM-510 which acts as the controller of all servo motors on the robot.CM-510 will define the commands obtained from Raspberry Pi 3 and then send control signals to all servo motor to perform balancing action in accordance with the tilt angle of the robot.The block diagram of the control hardware is shown in Figure 2.

Robot's tilt angle detection
As described in the previous section, the tilt angle detection in this research uses the MPU-6050 sensor module.MPU-6050 module is a motion processing unit that has 3-axis Micro-Electromechanical Systems (MEMS) accelerometer and 3-axis MEMS gyroscope on a single chip.In accelerometer sensor, this sensor is able to detect the tilt angle along the x, y and z axis.The gyroscope sensor is able to detect the rotational velocity along the x, y, and z axis.Because the MPU-6050 module has 16-bit ADC resolution, the output of the accelerometer and gyroscope sensors is already in the form of digital data.This module communicates with a microcontroller or microcomputer using Inter Integrated Circuit (I2C) communication.
The design of sensor placement in this research is shown in Figure 3.In this figure it is shown that the MPU-6050 module was placed horizontally inside the body of the humanoid robot.This placement is arranged in such a way, according to the location of the center of gravity of the humanoid robot.Expected by the placement of the sensor, the MPU-6050 module is able to provide the tilt angle data of the humanoid robot in accordance with the tilt angle at its equilibrium point.

Filtering noise using complementary filter method
The use of the complementary filter method in this research aims to obtain accurate tilt angle values.This filtering is necessary because the tilt angle reading on the MPU-6050 contains noise.The complementary filter method has several advantages compared with other filtering methods, such as the Kalman filter.In its application, the complementary filter is more practical than the Kalman filter because computational process of the complementary filter is not as complex as Kalman filter.The complementary filter does not require too many variables for the calculation [11].
The block diagram of the complementary filter is shown in Figure 4.It can be seen that the input of the complementary filter is the tilt angle data of the accelerometer sensor and rotational velocity data of the gyroscope sensor.Data from both sensors must be converted in the form of tilt angle values before being processed using complementary filter.The accelerometer sensor has a slow response to high frequency, so the output of the accelerometer is filtered using a low pass filter.The gyroscope has a problem on drift effect, so the output of the gyroscope is filtered using a high pass filter.
The equation of the complementary filter is given in Equation 1.
where A 1 : filtered tilt angle values (n) A 2 : filtered tilt angle values (n-1) α : filter coefficient ω : rotational velocity values of the gyroscope g : tilt angle values of the accelerometer t : sampling time

Implementation of robot balancing action
The flowchart of the humanoid robot movement is shown in Figure 5.The initial input of this system is a range of tilt angles that are categorized as a safe tilt angles for humanoid robots.After determining the range value, the robot is given a command to walk straight in accordance with the walking motion that has been declared before.While the robot is walking, the MPU-6050 transmits the change of the robot tilt angle data serially via I2C to the Raspberry Pi.In Raspberry Pi, this data is processed by the complementary filter method.If the filtered tilt angle values of the complementary filter are still in a safe range, the robot will still walk straight.However, if the filtered tilt angle is outside the predetermined range, then the robot will perform a balancing action to the upright its position.After the robot successfully performs a balancing action, the robot will walk straight again.

Result and discussion
Testing in this research divided into two stages.In the first test, it conducted a comparison between the calculation of the tilt angle of humanoid robot from the raw accelerometer and gyroscope data with the processed data using a complementary filter method.This test was  1 and Table 2, it can be seen that the complementary filter method is able to reduce the noise from the accelerometer and gyroscope data.From the three filter coefficient tested, all of which have a smaller error value compared to data that does not use the complementary filter.The optimum result was obtained with the use of filter coefficient value of 0.96, where an average tilt angle error of 0.775° was obtained on the x-axis and 0.691° on the y-axis.
The second test aims to observe the response of the humanoid robot in performing the balancing action.This test was done by giving the walking motion to the robot on a bumpy road surface.Before testing, the safe tilt angle range in each robot position must be declared first.Where the safe tilt angle range for the right position of the robot is 0° to 5°, the left position is 0° to -5°, the front position is 0° to 25° and the rear position is 0° to -15°.If the tilt angle of humanoid robot is still within the safe range, then the robot will still walk straight.However, if the tilt angle of humanoid robot is outside the safe range, the robot will perform a balancing action to the upright position.The result of the robot balancing action testing is shown in Table 3.
From the test result shown in Table 3, it can be seen that when the system detects a safe tilt angle, the robot still walk straight.When the system detects an unsafe tilt angle in one of the robot positions, the robot will balance its body by returning to an upright position.The test is performed 10 times and humanoid robot is always able to be in a balanced position.

Conclusion
In this research, noise reduction of tilt angle data from accelerometer and gyroscope sensor on humanoid robot using complementary filter has been presented.Noise on the tilt sensor output needs to be minimized in order to get an accurate tilt angle value.That value is used to know the tilt position of humanoid robot, so it can determine an appropriate action to balance the robot body.
From the test result, the complementary filter method gives a more accurate result of tilt angle value.The optimum result was obtained when the filter coefficient value is 0.96 and the sampling time is 50ms.In this test, an error value of 0.775° on the x-axis and 0.691° on the y-axis is obtained.In another test, the humanoid robot was able to perform a balancing action based on tilt angle data from the complementary filter output, so that the humanoid robot is always in a balanced position.For further development, PID control methods can be implemented to obtain more accurate balancing action. ,

Figure 2 .
Figure 2. Block diagram of the balancing system on humanoid robot.

Figure 4 .
Figure 4. Block diagram of the complementary filter.

Figure 5 .
Figure 5. Flowchart of the humanoid robot motion.

Table 1 .
Complementary filter testing result on the x-axis.

Table 2 .
Complementary filter testing result on the y-axis.The tilt angle values analyzed in this test was the angle values on two axes, x-axis and y-axis.The change of the tilt angle in the x-axis is represented by the change in the right and left position of the robot body.The change of the tilt angle in the y-axis is represented by the change in the front and rear position of the robot body.In the test, a complementary filter is given the sampling time (t) value of 50ms, while the filter coefficient (α) values is tested using three different values, which is 0.95, 0.96 and 0.97.The test aims to determine the accuracy of the complementary filter in noise reduction to provide accurate robot tilt angle values.The result of the complementary filter tested with several filter coefficient values on the x-axis are shown in Table1.While the test result on the y-axis are shown in Table2.From the test result shown in Table

Table 3 .
Robot balancing action testing result.