ECE 4760: Final Project

Self-balancing Robot

Desmond Caulley (dc686

Nadav Nehoran (

Sherry Zhao (

"A self-balancing two-wheeled robot utilizing an IMU and PID control for stability"

Project Sound Bite

A quick look at the range of mobile robots in existance reveals an enormous diversity in shape, form, and modes of mobility. However, one thing that most of them have in common is that they are passively balanced (i.e. their bodies are constantly in a state of stable equilibrium). While this is perfectly logical in most cases, there are certain applications, such as Segways and humanoid robots, that take advantage of an unstable-equilibrium, inverted pendulum design to enhance their capabilities. While their self-balancing mechanisms may increase the complexity of their design, the benefits, which include greater maneuverability and stability, outweigh the costs.

The two-wheeled design of the self-balancing Segway Personal Transporter significantly increases its maneuverability, because it reduces the turn radius to zero. The vehicle can rotate in place to instantly change its direction of motion and precisely navigate tight spaces that a three or four-wheeled robot cannot. Additionally, while a passively balanced, stable-equilibrium system may tip over the instant it is put off balance, an actively balancing, unstable-equilibrium system like the Segway can take actions to recover if its balance is temporarily disturbed. This stability-enhancing behavior directly mimics the natural behavior of a human that avoids a fall by taking a step in the direction of motion.

To demonstrate the benefits of such a design, we built an upright, self-balancing, two-wheeled robot utilizing an IMU and a PID feedback control loop to maintain stability. This report contains a thorough discussion of our project, including details about the mechanics, electronics, software, and everything else that went into designing, building, and testing our self-balancing robot.



Figure 1: CAD model (left) and the final product (right)

Video: Our final product demo

Dual H-Bridge Motor Drivers

We used two motors that were connected to a dual H-bridge motor driver. We decided to buy this H-bridge device instead of building one because this device is convenient, reliable, and a more compact than what we could have built. The motor driver comes with a heat sink which was very important considering the large current draw of the motors, and the large amount of excess heat.

Figure 11: LN298N motor driver board with heat sink


In order to power our robot, we needed a powere source that could supply 12V and sufficient current to power 2 motors, each of which can require as much as 1.5A at maximum load. Therefore, we started with a 12V 3A wall power adapter that we got from Ebay. The problem was that this power adapter seemed to shut down when the motors jittered or suddenly switched direction at maximum speed. This may have been due to current spike above 3A or voltage spikes eminating from the motors when they switch direction. Because of this, we decided to stop using that power adapter, and switch to a variable power supply in the lab, which can supply much higher current. This fixed our problem, and the motors never shut off again, so this is how we demoed our robot, as can be seen in the video above. We also considered running our robot off of 10 rechargeable NiMH AA batteries in series to produce 12V, but we were not able to test that prior to our demo.