A two-wheeled balancing robot is a real-world example of an inverted pendulum, where the heavy body is above the wheel axle instead of hanging below it. This arrangement is naturally unstable because even a small tilt causes gravity to create a torque that makes the robot fall farther. The robot stays upright by constantly sensing its tilt and driving its wheels to move the base back under its center of mass.
This same idea appears in self-balancing scooters, robotic platforms, and control systems labs.
Understanding Robotics: Inverted Pendulum Balancing
The key idea is the position of the center of mass relative to the wheel contact points. If that point lies directly above the support point, the robot can remain upright. If it moves forward or backward, gravity pulls the body downward and the wheels must reposition the support point.
The motors do not push the body upright directly. They create horizontal acceleration at the ground through wheel motion. When a robot leans forward, it normally needs to roll forward to catch its falling mass.
Friction between the tires and floor is essential. On a slippery floor, the wheels can spin without producing enough force, so even a well designed controller can fail.
A balancing robot needs a reliable estimate of its tilt. An accelerometer can sense the direction of gravity while the robot is nearly still. During a quick wheel movement, however, it senses both gravity and the robot's acceleration.
This can make the reported tilt briefly wrong. A gyroscope measures how quickly the body rotates, which is useful during motion, but small measurement errors build up over time. Control systems commonly blend the two sensor readings.
The accelerometer corrects long term drift, while the gyroscope supplies fast short term motion information. This is an early example of sensor fusion, a method used in phones, drones, game controllers, and vehicle navigation.
The controller must be tuned to the physical robot. A response based only on tilt can be too slow or can overshoot. The robot then rolls past upright, leans the other way, and begins a repeated wobble.
Information about rotation speed helps the controller apply braking before the body swings too far. This acts like damping in a spring system. Too little response lets the robot fall.
Too much response produces rapid shaking, noisy motors, and wasted battery power. Real motors have limits on torque and speed. Battery voltage drops as the battery empties.
Gears have backlash, tires deform, and sensor readings contain noise. These details explain why a controller that works in a computer simulation may need adjustment on a real machine.
Balancing works only within a limited range. If the body begins with a large tilt, the wheels may not have enough room, speed, or grip to move underneath it. A robot can balance in place yet still fail when pushed hard, driven over a bump, or placed on a slope.
Designers often set a safe tilt limit and shut off the motors after a fall to protect gears and batteries. Students learning this topic should separate the physical model from the control program. First identify the body angle, rotation speed, wheel position, and wheel speed.
Then observe how each measured value changes after a small push. Recording sensor data and motor commands makes hidden delays and oscillations visible. The same habit helps when studying cruise control, drone stabilization, and many other feedback systems.
Key Facts
- For small angles, gravitational torque on the body is approximately τ = m g L θ.
- An inverted pendulum is unstable because a small tilt produces a torque in the same direction as the fall.
- Tilt angle θ and angular velocity ω are often measured using an IMU with accelerometers and gyroscopes.
- A common feedback law is u = Kp θ + Kd ω, where u is the motor command.
- Wheel acceleration shifts the contact point so the robot can move its base under the center of mass.
- Stable balancing requires fast sensing, fast computation, and motor response faster than the falling motion.
Vocabulary
- Inverted pendulum
- A pendulum with its mass above the pivot point, making the upright position unstable without active control.
- Center of mass
- The average position of an object's mass, where gravity can be treated as acting on the whole object.
- IMU
- An inertial measurement unit that uses sensors such as accelerometers and gyroscopes to estimate motion and orientation.
- Feedback control
- A control method that uses measured error, such as tilt angle, to decide how to change the system's input.
- Motor torque
- The turning effect produced by a motor that causes the wheels to rotate and accelerate the robot.
Common Mistakes to Avoid
- Treating the upright robot as naturally stable is wrong because the center of mass is above the axle, so gravity amplifies small tilts instead of correcting them.
- Using only tilt angle and ignoring angular velocity is wrong because the controller also needs to know how fast the robot is falling to avoid late or excessive corrections.
- Driving the wheels opposite the needed direction is wrong because the base must move under the center of mass, not simply away from the tilt.
- Assuming stronger motors always fix balance is wrong because slow sensors, delayed computation, or poor feedback tuning can still make the robot oscillate or fall.
Practice Questions
- 1 A balancing robot has mass 2.0 kg, center of mass 0.25 m above the axle, and tilt angle 0.10 rad. Using τ = m g L θ with g = 9.8 m/s², find the approximate gravitational torque.
- 2 A controller uses u = Kp θ + Kd ω with Kp = 18, Kd = 3, θ = 0.050 rad, and ω = 0.40 rad/s. Calculate the motor command u.
- 3 A robot is leaning forward and beginning to fall forward. Explain which direction the wheels should accelerate and why this helps restore balance.