EZ-Template exit conditions need 6 values with units. Pick them based on how precise you need to be vs how fast you need to settle.
flowchart TD
Start([Setting pid_drive_exit_condition_set]) --> Q1{How precise
does it need to be?}
Q1 -->|"Tight ±5mm
e.g. line-up before scoring"| Tight[small_error: 25_mm
big_error: 50_mm
timeouts: longer for precision]
Q1 -->|"Loose ±50mm
e.g. cross the field"| Loose[small_error: 50_mm
big_error: 150_mm
timeouts: shorter for speed]
Q1 -->|"Default 'good enough'"| Default[small_error: 50_mm
big_error: 150_mm
small_t: 250_ms big_t: 500_ms
velo: 500_ms mA: 500_ms]
Tight --> Test[Run test, observe behavior]
Loose --> Test
Default --> Test
Test --> Q2{Behavior right?}
Q2 -->|"Exits too early
not at target yet"| Tighten[Decrease big_error
OR increase timeouts]
Q2 -->|"Takes too long to settle"| Loosen[Increase big_error
OR decrease timeouts]
Q2 -->|"Looks good"| Done([Save constants])
Tighten --> Test
Loosen --> Test
style Start fill:#1e293b,stroke:#22d3ee,stroke-width:2px,color:#e2e8f0
style Done fill:#1e293b,stroke:#22c55e,stroke-width:2px,color:#e2e8f0
style Q1 fill:#fbbf24,color:#0f172a,stroke:#fbbf24
style Q2 fill:#fbbf24,color:#0f172a,stroke:#fbbf24
The single biggest speed gain available in EZ Template. A 15-second autonomous that waits for full PID settle between every movement recovers 1–2 seconds by chaining movements instead.
pid_wait() for the last movement in any sequence. Use pid_wait_until() for intermediate movements. Use pid_wait_quick_chain() when you want the smoothest possible route and can accept minor positional imprecision.Here is a typical 3-movement autonomous using only pid_wait():
That 1.1 seconds of settle time does nothing for scoring. With chained movements, the robot starts the next action the moment it is ready — not when the PID controller has fully relaxed.
pid_wait() (full settle, default), pid_wait_until(distance) (exit at a specific point in the movement), and pid_wait_quick_chain() (exit early and immediately start the next movement). You pick the right tool for each transition.pid_wait_until(x) tells EZ Template: “do not fully complete this movement — exit when the robot has traveled x inches (or degrees for turns).” The PID is still running and controlling the robot. You are just moving on from the wait condition earlier than full settle.
pid_wait_until calls in a single movement. Set the drive, call pid_wait_until(15) to deploy one mechanism, then pid_wait_until(30) to trigger a second action, then pid_wait() to complete. Each call is a checkpoint along the same movement.pid_wait_until near the target to allow deceleration timepid_wait_quick_chain() exits the current PID movement the moment the robot’s velocity drops below a small threshold — the robot is slowing down and about to stop, but has not fully settled yet. The next movement begins immediately, often while the robot still has a tiny amount of momentum from the previous one.
The result: movements flow into each other rather than stopping and restarting. The robot looks smoother, moves faster, and scores more in 15 seconds.
pid_wait() for movements that require precision (final scoring positions, end-game commit, scoring into a tight zone). Use pid_wait_quick_chain() for transition movements where the next action’s PID will correct any small error.| Movement Type | Use | Reason |
|---|---|---|
| Transition between zones | quick_chain | Next movement corrects small error |
| Approach for pickup | quick_chain or wait_until | Start intake before full stop |
| Final approach for scoring | pid_wait() | Accuracy required — full settle |
| End-game commit position | pid_wait() | Must stop in exact position |
| AWP task movement | pid_wait() | Reliability matters more than speed here |
If your next action after the turn requires being in a different location (not just a different heading at the same spot), a swing turn often gets you there faster because it combines rotation and travel into one movement.
initialize() the same way you set drive and turn PID constants. The EZ Template docs cover swing constants under “Swing Movements” — they are typically similar to turn constants but may need separate tuning since swing behavior differs.The robot needs to: drive 30 inches to a game element (intaking along the way), turn 90° to face the goal, drive 14 inches to score, then swing back 70° to reach the AWP position.
pid_wait() — full PID settle. Use for final scoring positions, end-game commit, and anything that requires accuracy over speed.pid_wait_until(x) — exit at a specific distance. Use to trigger mechanism actions mid-movement.pid_wait_quick_chain() — exit on velocity drop. Use for transitions between movements where the next action tolerates small positional error.pid_swing_set() — arc turn on one drive side. Use when the route benefits from covering ground during the turn itself.pid_wait() waits for the robot to reach a tolerance band around the target and stay there for a minimum time — this is the classic settling time criterion in control engineering. pid_wait_until() releases control at an intermediate error value, allowing chained movements. This is analogous to a multi-phase controller — full PID during acquisition, then early exit. The time saved (typically 200–800ms per movement) compounds across a 15-second autonomous: recovering 6 movements × 400ms = 2.4 seconds — enough for one complete scoring cycle.pid_wait_quick_chain() exits the PID movement before it fully settles. What is the engineering trade-off?Movements chained and fast. Now put it all together into a full autonomous tournament strategy with auton portfolio planning.
🏆 Autonomous Tournament Strategy →