Reduce overshoot with velocity damping
A robot can reach its target while still moving too fast. Velocity damping reduces the command before arrival, helping it stop without overshooting.
Try the controller
Run the robot. Change one setting and try again.
Go2 test lane
The 3D workspace loads when it comes into view.
More controls
Position 0.000 m · actual velocity 0.000 m/s · limited command 0.000 m/s
The robot is at 0.000 m at simulation time 0.0 s. The orange line marks the 1 m target; it is not a physical barrier. Run the experiment or scrub time below.
2D reference and fallback
Model, units, and limits
A one-dimensional model of the Go2's forward motion, integrated every 0.02 s. The drive approaches its requested speed with a 0.4 s lag: acceleration = (efficiency × command + disturbance − velocity) / 0.4. The command is limited to ±0.80 m/s. A timed command requests 0.50 m/s for 2 s, then zero. Feedback requests Kp × position error + Ki × accumulated error − Kd × measured velocity.
The accumulated error is clamped to ±2 meter-seconds. This simple clamp is not a complete anti-windup design. Delay applies to measured position and velocity; before a past sample exists, the measurement stays at the starting state. The disturbance is a speed bias, not a force in newtons. No friction, foot slip, sensor noise, or hardware safety system is modeled. The legs are animated from the distance covered, using the Go2's real link lengths; balance and walking are not simulated.
Optional reasoning check
Opening the Python editor…
Requirements and learning goals
Before you start
- The proportional-feedback lesson
- A browser with JavaScript enabled
You will be able to
- Identify overshoot in a position trace
- Calculate a proportional-plus-velocity command
- Distinguish the P, I, and D contributions
A robot can be near its target and still be moving too quickly. A controller that considers only position error may reduce the command too late. In our model, the drive approaches a new speed with a 0.4-second lag. That stored motion can carry the robot past the target.
This lesson starts with = 5, drive efficiency = 1, and no integral or derivative contribution. It uses the same robot model as the earlier lessons. The larger proportional gain is deliberately chosen to make visible. Allow about 15 minutes to compare traces and work through the calculation.
Try it
Press Run experiment to watch the robot. Kd changes how much the controller reduces its command in response to velocity. Open More controls for additional settings and Inspect time. The position trace is in 2D reference and fallback. Changing a setting pauses and resets the run.
- Reset and note the maximum overshoot below the scene.
- Leave Kp at 5 and at 0. Predict what subtracting a term proportional to velocity should do while the robot is moving toward the goal.
- Increase to 2. Compare overshoot with the reset run. Scrub the time slider to inspect the command before the robot reaches 1 meter.
- Set Kd back to zero. Increase Ki to 0.60 and observe the complete trace. Do not judge the run from its final position alone.
- Reset before comparing the worked PD calculation below. It describes a particular position and velocity, independent of the current inspection time.
Work through the terms
Our controller requests Kp × error + Ki × accumulated error − Kd × measured velocity. P responds to the current position error. I adds position error over time, so a small persistent error can eventually produce a substantial contribution. D responds to motion; we use negative measured velocity as the derivative term for a fixed position target.
Suppose the robot is at 0.90 meters and moving forward at 0.20 m/s. With Kp = 5 and Kd = 2, the proportional contribution is 5 × 0.10 = 0.50 m/s. The velocity term subtracts 2 × 0.20 = 0.40 m/s. The resulting request is only 0.10 m/s. The robot slows earlier than it would under proportional control alone.
For this model, Kp has units 1/s, Ki has units 1/s², and Kd is dimensionless. These units depend on what the controller commands. A controller that commands motor torque needs different units and dynamics.
Check the expected results
The reset run has about 0.104 meters of maximum overshoot. With Kp = 5, Ki = 0 and Kd = 2, displayed overshoot is 0.000 meters, and the final position rounds to 1.000 meters. That is a useful comparison within this model, not a universal tuning recipe.
Integral action can worsen the transient because it accumulates positive error during the initial approach. Here that accumulation is clamped to ±2 meter-seconds. The clamp limits the stored value but is not a complete anti-windup controller.
Check a different state
Imagine the robot is already at 1.00 meter but still moving forward at 0.20 m/s, with Kp = 5, Kd = 2 and Ki = 0. Work out the requested command before you choose.
Actual velocity does not reverse instantly.
You are done when you can explain why a zero position error can still require a nonzero command, and compare a run's overshoot as well as its final error.
Troubleshooting
If Kd seems to have little effect early in the run, check whether the requested command is . Reset Ki to zero to isolate the damping comparison. The chart rescales its vertical range when necessary; use the numeric overshoot value for fair comparisons.
The disturbance lesson gives integral action a purpose and tests delayed measurements.
Before you move on
Can you do each of these?
- Identify overshoot in a position trace
- Calculate a proportional-plus-velocity command
- Distinguish the P, I, and D contributions
0 of 2 checkpoints solved. Try checkpoint 1