Safe-Ballbot: Tilt-Consistent MPC with Control Barrier Functions for Ballbot Navigation
Authors: Duc Cuong Vu, Tung Lam Nguyen
Organizations: School of Electrical and Electronic Engineering, Nanyang Technological University, Singapore · Motion Control and Applied Robotics Laboratory (MoCAR), School of Electrical and Electronic Engineering, Hanoi University of Science and Technology, Hanoi, Vietnam
Ball-balancing robots (ballbots) must lean to accelerate, and the lean is limited by the wheel torques and by safety. Planners that use the full robot model are expensive, while planners that ignore the balance dynamics produce references that cannot be followed. This paper presents a two-layer navigation scheme for a three-omni-wheel ballbot. The upper layer is a model predictive controller on a jerk model of the ball position, with discrete-time control barrier functions for static, moving, rotating and concave obstacles. The lower layer is a hierarchical sliding mode controller with an extended state observer and a robust exponential control barrier function on the tilt (HSMC-ESO-ECBF). The layers are linked by an acceleration bound derived in closed form from the largest steady tilt that the barrier function admits, so that the plan never asks for a lean the tracker refuses. For obstacles whose motion is only predicted, the obstacles are inflated by conformal prediction radii that bound the prediction error with a prescribed probability. In MuJoCo, with omni-wheel roller contacts and torque saturation, the scheme keeps at least 10,cm of clearance, tracks the plan within 2,cm RMS, keeps the tilt below the limit and plans in 9--12,ms, 10--15 times faster than a full-model nonlinear MPC that enters the inflated obstacles; with predicted obstacles, the conformal inflation removes the collisions of a constant-velocity predictor in 30 random crossing scenarios and reduces them in an endless run on a closed path.The source code and video illustrations are available at https://safe-ballbot.github.io
Figures & tables
Fig. 1: The proposed scheme in MuJoCo. Tracking: (a) figure eight, (b) recovery from a 25 N push. Known obstacles: (c) static, (d) moving, (e) rotating, (f) concave. Predicted obstacles: an obstacle that turns sharply toward the path, with (g) constant-velocity and (h) conformal prediction, (i) four random obstacles crossing the path, (j) an endless run on a closed path among three roaming obstacles.
Obstacles
Work
Year
Planner / controller model
Online
Static
Moving
Concave
Tilt limit
Evaluation
Nagarajan [ 1 ]
2013
shape-space planner
×
–
×
×
–
hardware
Jespersen [ 2 ]
2020
path-following MPC, reduced quaternion model
✓
✓
×
×
✓ soft
sim. + hardware
Mavrogiannis [ 3 ]
2021
topology-informed MPC
✓
–
✓ crowd
×
–
hardware + crowd sim.
Fischer [ 4 ]
2024
identified LTI model, MPC + LQR
✓
×
×
×
–
hardware
Vu [ 5 ]
2024
flat output, offline time-optimal + RRT*, ESO
×
✓
×
×
✓ ECBF
sim. (design model)
TABLE I: Comparison with related work on ballbot motion planning and safe control.
Fig. 2: The ballbot in MuJoCo: (a) balancing robot, (b) omni wheel 1 with its axis a1 (violet) and the roller frames, (c) contact points (blue) and forces (red).
Yaw LQR
(Sec. III-F )
Fig. 3: Two-layer architecture. References (cyan), torques (orange), measurements (gray), ESO estimates (violet); dashed red: acceleration bound ( 19 ), set at design time from φ⋆ . Badges: contributions of Table I .
Fig. 4: Conformal prediction. (a) Offline, qk is the quantile covering a fraction 1−α of the calibration errors Sk . (b) Online, the predicted obstacle at step k is inflated by r+qk , and the plan (cyan) stays outside.
Tilt 5∘
Step 0.5 m
Sine
Figure eight
Signal
RMS
r
RMS
r
RMS
r
RMS
r
x
15.7
0.94
1.7
1.00
2.7
1.00
1.8
1.00
pitch
7.9
0.86
3.5
0.99
4.4
1.00
8.0
0.99
x˙
7.0
0.91
3.0
1.00
3.3
1.00
3.5
1.00
pitch rate
3.6
0.97
2.2
0.99
16.3
0.84
28.1
0.30
τy
4.3
0.68
6.3
0.77
35.2
0.45
35.5
0.28
TABLE II: RK4 models vs. MuJoCo.
Fig. 5: LQR on MuJoCo, the planar and the 3D model: step xr:0→0.5 m.
Fig. 6: Figure eight ( A=0.6 m, 12 s per lap): x – z plane (left) and y – z plane (right).
Fig. 7: (a) Largest planar–3D difference versus initial tilt (dotted: 1∘ ). (b) RMS lean error of each RK4 model with respect to MuJoCo.
Metric
HSMC-ESO-ECBF
HSMC-ESO
LQR
Step of 1 m
max tilt [deg]
5.71
21.16
25.42
undershoot [cm]
0.2
6.1
8.1
settling to ±5 cm [s]
2.91
2.24
2.03
control variation [1/s]
10.5
5.5
16.5
ECBF active [%]
34.6
–
–
TABLE III: Tracker comparison in MuJoCo.
Fig. 8: (a) Step to x=1 m and (b) 25 N push: the ECBF keeps the tilt below 5.73∘ , at the price of a longer braking distance.
θmax=3∘
θmax=5.73∘
Fig. eight
ε
δ
step
push
step
push
RMS [cm]
0.02
0
+4.75
+4.73
+4.50
+2.74
1.9
0.01
0
+1.24
+1.40
+1.34
+0.54
2.5
0.01
0.2
+0.82
+1.01
+1.04
-0.17
2.5
0.01
0.5
+0.01 ∗
-0.40
-0.02
-1.23
3.9
TABLE IV: Overshoot of the tilt limit, maxθ−θmax [deg].
Fig. 9: Steady tilt held in MuJoCo versus the requested lean, (a) along an axis and (b) along a diagonal; dashed: φ⋆ and φˉ⋆ ( Proposition 2 ).
Static
Moving
Ellipse
Concave
Min clearance [cm], robot / plan
11.8 / 10.0
11.1 / 10.0
10.3 / 10.1
11.0 / 10.0
Max plan deviation [m] / max tilt [deg]
0.52 / 4.06
0.74 / 4.07
0.66 / 4.05
1.15 / 4.23
Tracking error [cm], RMS / max / final
2.0 / 3.8 / 0.9
2.0 / 4.5 / 0.1
1.9 / 3.8 / 0.4
1.6 / 3.5 / 0.8
TABLE V: Jerk-model MPC-CBF planning with HSMC-ESO-ECBF tracking in MuJoCo.
Fig. 10: Paths in the four scenarios: nominal line ( gray dashed ), MPC-CBF plan ( cyan ) and ball path in MuJoCo ( orange ), from the start (black dot) to the goal ( red star ). Obstacles are filled and their inflated boundaries dotted; moving obstacles are drawn at t=6 , 12 , 18 s (darker = later), with the robot (dots) at the same times.
Fig. 11: Time histories of the four scenarios: smallest clearance of the robot to the obstacles, measured tilt, and tracking error.
Min clearance [cm]
RMS error [cm]
Max error [cm]
Goal
Variant
S
M
E
C
S
M
E
C
S
M
E
C
reached
Proposed: amax=ρφ⋆/κ , rtrack=10 cm
11.8
11.1
10.3
11.0
2.0
2.0
1.9
1.6
3.8
4.5
3.8
3.5
4/4
amax from θmax
11.2
6.8
10.7
11.1
6.7
3.6
5.4
11.7
18.5
10.0
16.7
39.1
3/4
No tracking margin ( rtrack=0 )
1.6
1.4
0.7
1.9
1.8
2.0
2.2
1.5
3.5
4.5
4.8
3.5
4/4
TABLE VI: Ablation of the planner.
Min clear. [cm]
Max tilt [deg]
Solve, median [ms]
Scenario
Prop.
NMPC
Prop.
NMPC
Prop.
NMPC
static
11.8
-11.2
4.06
5.21
10
145
moving
11.1
-12.3
4.07
8.02
12
131
ellipse
10.3
-2.3
4.05
5.38
9
150
concave
11.0
-3.7
4.23
6.30
11
108
TABLE VII: Jerk-model MPC-CBF (proposed) versus full-model NMPC-CBF with a tilt filter.
Fig. 12: Predicted obstacles, paths: (a) Scenario 1 (triangle: start of the turn), (b) one run of Scenario 2, (c) Scenario 3, (d) Scenario 4, first 90 s. Robot with the oracle ( black dotted ), the constant-velocity prediction CV ( red ) and CV with conformal inflation ( green ); obstacle paths (except in (d)) and footprints at the smallest clearance of the CV planner.
Fig. 13: True clearance between the footprint and the nearest obstacle in the runs of Fig. 12 , same colors.
Clearance [cm]
Solver
Planner
Coll.
min
median
Tilt [deg]
slack
[ms]
oracle (true future)
0
6.9
13.1
4.60
0
18
CV
7
-8.8
6.5
4.81
392
18
CV + CP
0
5.2
28.0
4.57
329
22
TABLE VIII: Predicted obstacles, Scenario 2: 30 random scenarios per planner, soft barriers.
Planner
Coll.
Clearance [cm]
Tilt [deg]
slack
Laps
Scenario 3: four random obstacles
oracle (true future)
0
9.0
4.46
0
–
CV
1
-1.4
4.57
37
–
CV + CP
0
19.4
4.33
10
–
Scenario 4: closed path, 90 s
oracle (true future)
0
11.7
4.51
0
1.97
TABLE IX: Predicted obstacles, Scenarios 3 and 4: one run per planner, soft barriers.
Autonomous mobile robots operating in tight environments require motion planning frameworks that account for the physical footprint of the robot. Simplifying the geometry to a point or a circle is conservative and discards information needed to successfully and safely traverse narrow passages. This work proposes a safe local motion planning and control method that guarantees that a polytopic robot footprint stays inside a continuously updated convex free-space region. The containment condition is formulated as a set of discrete-time control barrier function constraints within a model predictive controller. The number of safety constraints depends on the complexity of the local free-space geometry and the robot shape, instead of the number of obstacles. The proposed free-space formulation does not need any obstacle detection or segmentation. A comparative analysis against a polytope-based obstacle avoidance formulation confirms favorable scaling up to a reduction of 91× in computation time as the number of obstacles increases. The approach is validated in simulation with an autonomous surface vehicle and on hardware with a non-holonomic mobile robot, using both occupancy grids and LiDAR sensing. The experiments demonstrate safe real-time motion planning and control at 10~Hz on an onboard embedded computer, including reactive avoidance of dynamic obstacles.
Alejandro Gonzalez-Garcia, Dries Dirckx, Jan Swevers +1
Safe and efficient robot navigation in crowds requires anticipating pedestrian motion despite uncertain and potentially shifting prediction errors. Existing reactive methods can produce oscillatory behavior, while predictive planners often treat forecasts as exact or rely on restrictive error models. Incorporating conservative uncertainty sets as hard constraints can also render model predictive control (MPC) infeasible. We propose CoCoNav, a crowd-navigation framework that combines online conformal calibration with runtime-certified planning. A horizon-specific conformal proportional--integral controller adapts trajectory-error bounds to regulate long-run empirical coverage, enabling the framework to respond to changing prediction errors. A relax-then-verify planner preserves solver feasibility by generating nominal trajectories with soft-constrained MPC and separately certifying them, together with contingency maneuvers, against the calibrated bounds before execution. Simulations and quadruped experiments show that CoCoNav achieves a favorable balance among collision avoidance, task success, and navigation efficiency relative to the evaluated baselines.
Cheng Guo, Mingzhe Ni, Zheng Liang +5
Department of Computer Science, The University of Manchester, Manchester, UK. · Human-Robot Interfaces and Interaction Laboratory, Italian Institute of Technology, Genoa, Italy. · Genisom AI, Shanghai, China. +3
Control barrier functions (CBFs) have become one of the most popular tools for encoding and enforcing state constraints in safety-critical robotics. Standard CBF approaches are inherently myopic in nature as they enforce safety only at the current time step. Consequently, the system can be driven toward the boundary of the safe set where no feasible safe control exists at a future timestep. Model predictive control (MPC) based approaches address this by enforcing state constraints over a receding horizon. However, such approaches generally require the model to be known for solving a constrained optimization problem at every step, which is computationally expensive for real-time deployment. We propose BarrierFormer, a barrier-supervised transformer framework that addresses these limitations by encoding rollout-level CBF constraints in learning a model-free safe policy. A causal transformer encodes observation-action history, autoregressively generates a predictive rollout through the dynamics head to replace the model, and provides a residual correction to a nominal controller through the action head to replace the online computation. A barrier critic operating on local observations evaluates CBF constraint violations along this rollout, and a safety teacher computes barrier-consistent actions satisfying these constraints as direct supervision targets for the learned control policy. During inference, the policy maps observation-action history to control actions without any online optimization or model knowledge, enabling real-time model-free predictive safety enforcement. Evaluations across linear and nonlinear, 2D and 3D dynamical systems for safe goal-directed navigation demonstrate that BarrierFormer outperforms existing reinforcement learning (RL)-based, diffusion-based, MPC-based, and transformer-based approaches in safety rate and inference latency.