The single biggest speed gain available in EZ Template. A 15-second autonomous that waits for full PID settle between every movement leaves 2–3 seconds of scoring time on the table. Chaining movements eliminates that waste entirely.
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 (parking, 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 |
| Park or climb 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, parking, 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?