Self-Balancing Robot
User Guide
17
www.terasic.com
July 12, 2018
Figure 1- 13 The tilted angle of the self-balance Robot
There is an error in the angles calculated by the above two methods. When the accelerometer reads
the angle, the acquired value error will increase when the outside is disturbed. Use the gyroscope's
angular speed to integrate the acquired angle, due to the integral calculation will accumulate the
error, and increase with time, the error will become bigger and bigger. If you use the angle with
larger error to balance the system, it will be very difficult to stabilize the robot. Therefore, so a
method on Angle error correction is required.
It is common to use Kalman Filter as a method, which adopts the data fusion of two sensors (gyro
and accelerometer) to get a more precise angle.
Figure 1- 14
shows the comparison of the original tilt Angle (blue) and the Angle (orange) by
Kalman Filter. From the figure, you can see that the change in angle is large different for unfiltered
angle (blue). By working with these data, the balance of the car body could not be stable. However,
the varying amplitude for the orange Angle after filtering is significantly reduced.