Learning Ball-balancing Robot Through Deep Reinforcement Learning

Yifan Zhou, Jianghao Lin, Shuai Wang, Chong Zhang · OpenReview

TL;DR

This paper introduces a compound controller for ball-balancing robots (ballbots) that blends conventional model-based feedback control with Deep Reinforcement Learning (DRL). By superposing a DRL agent onto a linear feedback loop, the robot successfully learns to recover from large, highly non-linear tilting angles where traditional physics models break down due to unpredictable contacts, slipping, and collisions.

What Problem Does This Paper Address?

Ball-balancing robots, or ballbots, are dynamically stable robots that balance on a single spherical wheel. This design makes them exceptionally agile and omnidirectional, but it also makes their underlying dynamics highly non-linear and unstable.

Traditional model-based feedback controllers (like LQR or pole-placement) excel at keeping a ballbot balanced near its upright equilibrium point. However, these controllers rely on simplifying assumptions: rigid body contacts, no-slip conditions, and pure viscous friction. If the robot experiences a large initial tilt angle, these assumptions fall apart. The center of mass moves outside the supporting triangle formed by the actuating wheels, leading to wheel separation, structural collisions, and complex dynamic friction that are nearly impossible to model accurately.

While pure reinforcement learning (RL) can handle unmodelable environments, training an RL agent from scratch on an inherently unstable robot typically causes catastrophic falls and severe sample inefficiency. The authors address this challenge by combining the stability of classical control with the adaptability of DRL to solve a high-angle balance recovery task.

Methods

The authors propose a compound controller architecture that splits the control problem into modelable and unmodelable parts:

  1. Conventional Feedback Controller: The authors derive a simplified 2D planar mathematical model of the ballbot using Euler-Lagrange equations, decoupling the system into identical sagittal and coronal planes. This model is linearized around the upright equilibrium point to design a standard state-feedback controller ($u = -Kx$), which reliably handles stabilization near the equilibrium point.
  2. Deep Reinforcement Learning Layer: To handle the unmodelable dynamics at large tilt angles, a Deep Deterministic Policy Gradient (DDPG) agent is superposed onto the classical control loop.
The compound control structure combining state feedback and DDPG.

The state vector provided to the DRL agent consists of the body angle ($\phi$), angular velocity ($\dot{\phi}$), and the overall robot attitude ($z$). The action space defines target velocities for the virtual wheels, which are then translated to the physical motors. The reward function directly penalizes the deviation of the tilt angle ($\beta$) from the vertical axis: $$rt = -||\beta|| + c$$

By superposing the DRL output onto the state feedback loop, the DDPG agent acts as a residual modifier, injecting aggressive corrective actions only when the classical controller struggles.

Datasets

Not discussed in the paper. (The work relies entirely on online reinforcement learning within a physics simulation environment rather than static datasets).

Key Insights and Ideas

  • The "Kicking" Phenomenon: When recovering from extreme tilt angles where classical control fails, the DRL agent discovers an emergent, highly dynamic strategy: it rapidly reverses motor directions to "kick" the ball back underneath its center of mass. This highly non-linear behavior is effective but virtually impossible to derive using standard linear control frameworks.
  • Exploiting Physical Symmetries: The system's recovery capability depends heavily on the direction of the tilt relative to the three omniwheels (spaced at 120°). When the robot tilts directly toward a single wheel ($\alpha = 90^\circ, 210^\circ, 330^\circ$), recovery is physically constrained because only one wheel maintains effective contact. Conversely, tilting between wheels ($\alpha = 30^\circ, 150^\circ, 270^\circ$) engages two wheels simultaneously, giving the robot two degrees of freedom to maneuver and achieve a much higher recovery angle ($12^\circ \sim 13^\circ$).
  • RL as a Safety Extension: Instead of replacing classical control, using RL as a superposed layer ensures stability near equilibrium while safely extending the operational envelope into unmodelable state spaces.

Key Results

The framework was validated using CoppeliaSim 4.1.0, simulating a ballbot without any physical constraints like a ball arrester or protective skirt.

The ballbot simulation environment setup in CoppeliaSim.
  • Expanded Recovery Area: The compound controller significantly increased the "recovery area"—the set of initial tilt angles ($\beta$) and directions ($\alpha$) from which the robot can successfully stabilize—compared to the conventional controller alone.
The recovery area of the conventional controller.
  • Quantitative Edge: In a direct comparison at an initial tilt angle of $\beta = 7.5^\circ$ and direction $\alpha = 210^\circ$, the conventional controller failed, causing the robot to tip over. Under the exact same conditions, the compound controller successfully stabilized the robot within 1.25 seconds by executing rapid motor adjustments.

Limitations and Future Work

  • Physical Constraints Remain: DRL cannot overcome the hard physical limits of the hardware; recovery remains severely limited in tilt directions where wheel contact is completely lost.
  • The Sim-to-Real Gap: This study was conducted entirely in simulation. Transitioning this compound controller to a physical robot will introduce real-world sensor noise, actuator delays, and potential hardware damage from aggressive actions like the "kicking" maneuver.
  • Future Directions: The authors suggest that future work should focus on deploying this framework on physical platforms and optimizing action smoothing to protect the robot's motors and wheels from excessive wear.

Summary updated

BibTeX
@misc{zhou2022learning,
  author = {Yifan Zhou and Jianghao Lin and Shuai Wang and Chong Zhang},
  title = {{Learning Ball-balancing Robot Through Deep Reinforcement Learning}},
  year = {2022},
  eprint = {2208.10142},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.10142},
}
Figure