Skip to content

Settle distance moves faster with a minimum push near the target - #102

Merged
kevinyhe merged 1 commit into
mainfrom
feat/faster-settling
Oct 1, 2026
Merged

kevinyhe merged 1 commit into
mainfrom
feat/faster-settling

Conversation

@kevinyhe

@kevinyhe kevinyhe commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Why

The distance PID's output shrinks with the distance left. Near the target it falls to about what the drive needs to overcome friction, so the robot crawls. Then it exits on the "within 1.5 in for 250 ms" rule, short of the target. In the physics simulator, a 24 in drive on a 200 rpm base spent its last 3 in at 0.6–1.2 V, took 3.9 s and stopped 1.3 in short.

Change

  • MotionConfig::settle_min_voltage (new, 1.5 V; 0 turns it off): stopped driveTo() and moveToPoint() push with at least this voltage, toward the target, while outside distance_exit.small_error (0.5 in).
    • moveToPoint(): the floor only covers the part of the distance left that lies along the heading, so a target off to the side isn't pushed into an orbit.
    • Inside 0.5 in, the PID alone finishes the move, so the floor can't make it hunt across the target.
    • Chained moves (exit false) are unchanged.
  • boomerang() hysteresis: after it starts its final turn, it goes back to driving only when drift exceeds twice the position band. Before, it went back at the band edge, so a final turn that shifted the robot slightly could loop pivot, approach, turn until the time limit. That's what made stress/ramsete_low_grip regress with the floor alone (RAMSETE's settle ends with a boomerang).

Results

Full simulator matrix. No baseline scenario fails. The baseline is updated.

Passing Mean time, scenarios passing before and after Mean miss
Two tracking wheels 99 → 101 / 118 2.79 → 2.41 s 1.07 → 0.60 in
Drive encoders only 82 → 84 / 118 2.49 → 2.13 s 1.45 → 0.81 in

24 in drives with tracking wheels:

Drive Before After
four_motor_200 3.91 s, 1.32 in 2.81 s, 0.56 in
six_motor_450 2.16 s, 1.26 in 1.38 s, 0.03 in
speed_base 1.28 s, 1.09 in 1.09 s, 0.20 in

Newly passing:

  • four_motor_200/point_diagonal with tracking wheels, plain and with the fusion;
  • six_motor_450/point_diagonal and speed_base/ramsete_s_curve with drive encoders.

Not fixed

four_motor_200/boomerang and speed_base/boomerang still time out, now at 43° and 102° off heading. The cause is how the boomerang approaches, not settling; it's #101. Steering to the final heading inside 6 in was tried and made every boomerang worse, so it's not in this PR.

Tests

  • New in motion_safety_test: a drive that needs 1 V to start moving. Without the floor, driveTo(24 in) stalls at 21.48 in and runs out its 4 s. With it, the drive reaches 23.15 in in 2.84 s. 1216 checks.
  • make test: 56/56 pass.

The distance PID's output shrinks with the distance left, so stopped
drives crawled their last few inches at the friction limit: a 24 in drive
on a 200 rpm base took 3.9 s and stopped 1.3 in short in the physics
simulator. driveTo() and moveToPoint() keep at least settle_min_voltage
(1.5 V) while outside the small exit band.

boomerang() resumed approach whenever its final turn drifted just outside
the position band, and could loop until its time limit; it now resumes
only past twice the band.
@kevinyhe
kevinyhe merged commit aba8877 into main Oct 1, 2026
5 checks passed
@kevinyhe
kevinyhe deleted the feat/faster-settling branch October 1, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant