Create a two-wheeled, self-balancing robot using Raspberry Pi 2 Model B with GPIO and I2C interfaces and Java 8 in part I
of this new series by Jose Cruz. To control the robot's movement and balance, he uses three modules: a sensor that contains a three-axis gyroscope and an accelerometer, a pulse width modulation (PWM) servo driver, and a motor driver. These modules create a feedback control loop that balances the robot and automatically corrects its position.
As Cruz explains, balancing a robot is an example of the classic inverted pendulum problem, in which a large mass is placed at the end of a pole. He provides an explanation of the mathematics that make this solution possible, and then he shows how to create the necessary Java ME 8 classes for controlling the robot. To learn more, read the article