Adaptive Nonlinear Model Predictive Control for a Real-World Labyrinth Game

Johannes Gaber, Thomas Bi, Raffaello D'Andrea

This research paper from the Institute for Dynamic Systems and Control at ETH Zurich presents a sophisticated control strategy for a classic childhood challenge: the BRIO labyrinth game. By combining nonlinear optimization with real-world disturbance learning, the authors demonstrate how to navigate a steel ball through a "minefield" of holes and walls using a two-tiered Model Predictive Control (MPC) architecture.

TL;DR

Researchers developed a two-layer Nonlinear Model Predictive Control (NMPC) system that solves the real-world labyrinth game by splitting the task into a "strategic" path planner and a "tactical" real-time tracker. By learning a digital map of the board's physical imperfections and using "superellipses" to model obstacles, the system achieves a 28% full-completion rate, significantly outperforming standard linear controllers.

What Problem Does This Paper Address?

The labyrinth game is a nightmare for classical control theory. To succeed, a player must tilt a wooden board to roll a marble from start to finish while avoiding dozens of holes.

The challenges are three-fold:

  1. Non-convexity: The walls and holes create "no-go" zones that make the optimization space extremely complex.
  2. Nonlinear Dynamics: The ball’s behavior changes drastically when it hits a wall, and the mechanical tilting mechanism (driven by strings and springs) introduces lag and slippage.
  3. Physical Imperfections: Real-world boards are rarely perfectly flat; they have "pores" in the wood and uneven surfaces that introduce unpredictable accelerations.

While Reinforcement Learning (RL) has solved this game before, it often requires massive amounts of data. This paper investigates whether a model-based approach—which uses physics equations and optimization—can handle these real-world messiness factors.

Methods

The authors proposed a hierarchical control structure to balance computational complexity with real-time responsiveness:

  • High-Level (HL) Solver: This is the "brain." It looks at the entire board, including all walls and holes, and calculates an optimal path. Because solving this non-convex problem is computationally heavy, it runs at a lower frequency (~10 Hz).
  • Low-Level (LL) Solver: This is the "reflex." It receives the path from the HL solver and focuses purely on tracking it at a high frequency (55 Hz). It ignores the obstacles to save time, assuming the HL solver has already provided a safe route.
  • Superellipse Constraints: To help the math "understand" walls, the authors modeled them as superellipses ($x^4 + y^4 = 1$). This provides a smooth mathematical gradient that encourages the solver to "slide" around corners rather than getting stuck.
  • Disturbance Compensation: The system uses a Luenberger observer to detect deviations in real-time. More impressively, it performs "iterative learning"—running the ball across the board to create a high-resolution Angle Map of the board's surface irregularities, which is then used for feed-forward compensation.

Datasets

The study did not use external datasets. Instead, it utilized a custom physical setup:

  • A standard BRIO Labyrinth.
  • Two Dynamixel MX-12W motors for tilting.
  • A top-down camera providing RGB images at 55 Hz.
  • Evaluation was based on 25 test runs for each controller type (PID, Linear MPC, and the proposed Nonlinear MPC).

Key Insights and Ideas

  • The Power of the Hierarchy: You don't need to solve the "hard" obstacle avoidance problem 55 times a second. By decoupling path planning from path tracking, the system achieves the benefits of complex nonlinear optimization in a real-time robotic application.
  • Mathematical "Smoothing": Using an exponent of $f=4$ for the wall constraints (superellipses) was a clever trick. It makes the walls "soft" enough for the optimizer to find a path around them, whereas a perfectly rectangular constraint often causes solvers to fail or stall.
  • Mapping the "Invisible": The board's tilt isn't just what the motors do; it's also the warp of the wood. Learning this "static disturbance" as a map (the Angle Map) proved crucial for precision.

Key Results

The researchers compared their Adaptive Nonlinear MPC against a cascaded PID controller and a Linear MPC:

Metric PID Linear MPC Nonlinear MPC (Proposed)
Full Completion Rate 0.0% 12.0% 28.0%
Average Distance Covered 12.6% 46.3% 64.4%
Average Completion Time N/A 81.0s 58.0s

The Nonlinear MPC was not only more successful but also significantly faster, as its "global" view allowed for more aggressive and efficient trajectories.

Limitations and Future Work

  • Wall Physics: Currently, the controller treats walls as obstacles to be avoided at all costs. It does not understand the physics of "bouncing." The authors suggest that future versions could actually exploit collisions to redirect the ball, much like an expert human player might.
  • Mechanical Model: The current model uses a simplified linear approximation for the string-and-spring tilting mechanism. Modeling the actual spring dynamics could reduce the control lag further.
  • Success Rate: While 28% is a major improvement over classical methods, it still falls short of the most advanced Reinforcement Learning agents or world-record-holding humans.

Summary updated

BibTeX
@inproceedings{gaber2024adaptive,
  author = {Johannes Gaber and Thomas Bi and Raffaello D'Andrea},
  title = {{Adaptive Nonlinear Model Predictive Control for a Real-World Labyrinth Game}},
  booktitle = {CDC},
  year = {2024},
  doi = {10.1109/cdc56724.2024.10886880},
}
Figure