4 - Characterization & Tuning¶
Tune from the motors outward. Pose gains cannot fix an incorrect motor model.
1. Collect feedforward data¶
Create a CSV with this exact header:
Run slow voltage ramps and faster step tests for one side of the drive. Record
volts, wheel velocity, and wheel acceleration using consistent units. Save the
left and right files separately as left.csv and right.csv.
Fit each side with the included tool:
The model is:
Copy each result into both TrajectoryConfig and FollowerConfig.
2. Tune wheel velocity feedback¶
- Set
ki = 0andkd = 0. - Command a low wheel-speed step while the robot is secured on blocks.
- Increase
kpuntil measured speed follows without sustained oscillation. - Add a small
kdonly if repeatable overshoot remains. - Add
kionly for persistent loaded bias after feedforward is correct. - If using
ki, set a tightintegralLimit.
Plot target and measured speed for each side. Do not tune from sound alone.
3. Tune trajectory limits¶
Start with a 6 V ceiling and approximately half measured free speed.
- Run a straight trajectory.
- Increase acceleration until tracking error or wheel slip rises.
- Back acceleration down by at least 20%.
- Repeat for deceleration.
- Run a constant-radius curve.
- Lower centripetal acceleration until the robot no longer scrubs or tips.
4. Tune pose feedback¶
Keep kd between 0.7 and 0.9. Increase kp gradually while
starting the robot 5–10 cm away from the planned pose. If the robot snakes on a
straight, reduce kp and check localization delay/noise.
The heading tolerance must be larger than measured stationary IMU noise. Otherwise the robot is mathematically prevented from settling.
5. Raise voltage last¶
Only after the earlier steps pass repeatedly should you raise maxVoltage and
nominalVoltage. Repeat low-battery and payload tests after every increase.
Continue to 5 - Angular Motions.