Velocity tuning: incorrect max_vel_x makes a robot sluggish or uncontrollable
Atlasbot · 17/8/2026 · 11 min read
The article Controller introduced DWB/MPPI to sample the velocity in the "dynamic window". That window limited by the velocity parameters in params.yaml— this article goes into the correct setting of those parameters.
Key concepts
FollowPath:
plugin: "dwb_core::DWBLocalPlanner"
max_vel_x: 0.3 # max speed forward (m/s)
min_vel_x: -0.1 # max reverse speed (negative = reverse)
max_vel_theta: 1.0 # maximum rotation speed (rad/s).
min_speed_xy: 0.0 # Minimal speed to consider "moving"
max_vel_x DO NOT exceed v_max calculated in Select Motor (v_max = ω × r from RPM motor and radius wheel).
How it works
Putting max_vel_x higher than the true physical speed the motor can reach does not make the robot faster — it just makes DWB/MPPI sample velocities that never reach the real-world, wasting part of the search space for meaningless samples. max_vel_xshould be set slightly lower (approximately 80-90%) than the theoretical v_max, leaving the driver/pin amplitude not at 100% of nominal performance in real-world conditions (mentioned in Power — batteries weakening with time).
min_speed_xy— The "running" and "stabilizing" discrimination threshold — affects how some recovery behaviors (the Recovery problem) and the "oscillation detection" logic — work so high that the system thinks the robot is at rest despite the slow real-world movement, triggering unnecessary recovery.
Summarized:
max_vel_xis the soft ceiling applied to the control algorithm, not the hard ceiling of hardware — misplaced in any direction having problems: too high wastes search space or causes wheel slip when driver attempts to squeeze to speed unfeasible; too low makes the robot unnecessarily sluggish despite the redundant hardware.
Technical details
Formulas
Safety margin between max_vel_x configurational and v_max physical — in terms of percentage redundancy for driver/pin failure to meet nominal performance:
Configured_max_vel_x = Theoretical_v_max × Safety_factor (0.8 - 0.9)
Example: theoretical v_max = 0.41 m/s (Choosing a motor: 120 RPM motor, 65mm wheel)
Suggested max_vel_x = 0.41 × 0.85 ≈ 0.35 m/s
Avoid max_vel_x = 0.41 (100% theoretical), since actual drivers/batteries
rarely reach exactly 100% of nominal performance, especially after the battery has
experienced many charge/discharge cycles (Battery calculation)
Parameters
| Parameters | Role | The risk of being wrong |
|---|---|---|
max_vel_x | Progressive speed ceiling | Too high: wasting search/slide space. Too low: unnecessary sluggish robots |
min_speed_xy | "Running" vs. "Standing" threshold | Ultra high: unnecessary recovery activation on normal slow robot |
max_vel_theta | Rotation speed ceiling | Similar max_vel_x but for angular motion |
Practical applications
Multiple Nav2 real-world implementations use different profiles speed, context-driven dynamic switching (via service SetSpeedLimit or runtime parameter changes): wide space, few obstacles → high speed (near max_vel_x max); narrow space, near humans → actively reduced speed (safety over speed); correct docking/alignment → very low speed (preference accuracy). This is an enhanced fine-tuning over just putting a fixed max_vel_x number in params.yaml— that is appropriate when robots operate in environments with human/obstacle densities that vary by region or time of day.
Practical example
# Reduce speed to 50% when the robot enters crowded areas.
ros2 topic pub /speed_limit nav2_msgs/msg/SpeedLimit "{speed_limit: 0.5, percentage: true}"
# Restore normal speed when out of that area
ros2 topic pub /speed_limit nav2_msgs/msg/SpeedLimit "{speed_limit: 0.0, percentage: true}"
Scenario: a warehouse packing area is busy with staff at peak times,
while the shelving area is usually quiet
Configure zone-based speed limits through the application layer (discussed in
Application Layer in AMRs): when the robot enters the packing area polygon,
publish SpeedLimit 50%; when it leaves, publish 0% again (restore default max_vel_x)
Result: the robot slows automatically in high-risk areas and keeps normal speed
in safe areas — no single fixed max_vel_x needs to compromise
between safety and efficiency across the entire operating space
Common mistakes
- Set
max_vel_xequal to 100%v_maxtheoretical — as calculated in the Formula section, leaving no margin for actual performance below the nominal rating, prone to cause wheel slip when driver attempts to force to the impossible speed. - Set
max_vel_xtoo low "for safety" — robots are unnecessarily slow despite redundant hardware, prolonging task completion time for no good reason. - Setting
min_speed_xytoo high — triggers unnecessary recovery behavior when the robot is moving slowly normally (e.g., when docking requires a very low speed), interrupting the desired behavior. - Using a fixed
max_vel_xfor an entire diverse operating environment— misses the opportunity to optimize both safety and performance by tuning speed to specific regions as exemplified above.
Conclusion
max_vel_x is a soft speed ceiling for control algorithms that should set a reasonable margin (80-90%) below the true physical limit, not an arbitrary "sound reasonable" value. For a diverse operating environment, consider a dynamic profile speed by area rather than a fixed number. The next article in the column goes into Tuning Acceleration — the acceleration parameter that determines how fast the robot reaches this speed.
Get new articles and lessons by email
When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.
Unsubscribe any time with the link in each email. See our Privacy policy.