Control systems

Press once.
The robot does the rest.

PedroPathing autonomy, Pinpoint odometry fused with an EKF, and a one-button auto-aim that computes heading, distance, RPM, and pitch on its own.

Why PedroPathing.

We plan paths with PedroPathing, generating smooth, predictable trajectories from Bézier curves. To simplify coding, we define paths for one side of the field only; on the other side the code mirrors every path and angle automatically, cutting the chance of error.

Compared with RoadRunner, PedroPathing supports real-time pose correction — the robot keeps adjusting heading and position while following a path, so even a mid-auto collision recovers onto the correct trajectory. It also exposes Bézier control points directly, so we build complex non-linear paths precisely, with a drag-and-drop online tool that renders the simulated run.

Always knows
where it is.

The swerve base runs three odometry pods and an IMU, fused through an Extended Kalman Filter for high-refresh, high-accuracy pose (x, y, θ) in both auto and teleop — the foundation for path following and auto-aim. Field-centric drive means the driver never tracks which way the robot faces.

We use a GoBILDA Pinpoint as the core localization module. Versus a hand-rolled encoder odometry, Pinpoint just needs the two perpendicular odometry-pod offsets at init, then solves pose in hardware and outputs global coordinates over I²C — simpler software, faster loop, quicker response.

GoBILDA Pinpoint odometry computer
GoBILDA Pinpoint — hardware pose solver (I²C)

Near and far.

AutoMain · near

1
Shoot preload
From the start, turn in place and fire the three preloaded artifacts at the first shot position.
2
Collect row one
Drive the first artifact line, intake on, gather three along a straight path.
3
Return & fire
Return to the start shot point and fire the three collected artifacts.
4
Collect row two & finish
Gather the second line, return, and complete the final volley.

AutoFar · far

1
Move & fire preload
From the far start, drive to a preset point and fire the preloaded artifacts.
2
Collect & midfield shot
Head to the third artifact line, then move to the midfield shot point and fire.
3
Open gate
Unlock the gate to release overflow artifacts back onto the field.
4
Final shot & park
Drive to the final shot-and-park point, fire, and end autonomous parked.
Straight from our engineering notebook
PedroPathing field coordinate map
Field frame — (0,0) to (144,144), heading 0–360°
Bézier autonomous path with control points
Editable Bézier path — control points dragged on-field
Multi-segment autonomous trajectory
Multi-segment far-side trajectory

Two drivers, one map.

Main driver owns the base; second driver owns intake and shooting. Functions are physically grouped — fire, assist, mode — so the layout stays readable mid-match.

Gamepad control scheme
Dual-gamepad control scheme
LSVector drive · translate
RSRotate in place · turret trim
L1Enter auto-aim mode
R1Fire (when up to speed)
R2Turntable forward · buffer
L2Turntable reverse · release
YFlywheel +100 RPM
AFlywheel −100 RPM
XIntake reverse · clear jam
BEmergency stop
↑↓Turret pitch trim
←→Turntable slot index

The math behind
one button.

With the robot's live coordinates, the system computes the bearing to the target with atan2, compares it to current heading to get a heading error, and feeds a PID loop that rotates the base onto target — fast and smooth.

heading_error = atan2(t_y − y, t_x − x) − θ → PID → base rotation

Once aligned, it reads the distance and looks up a calibrated flywheel-RPM model. We recorded twenty valid data points from 1.0–3.0 m — flywheel RPM, arc-plate angle, and hit result — pruned outliers, and fit trend lines into an empirical formula embedded directly in the turret controller.

RPM = f(distance) · pitch via Newton–Raphson: f(θ) = R(v₀, θ, h) − R_target

Pitch comes from a projectile model with drag and height correction, solved with Newton–Raphson to back out the elevation for a required range. In TeleOp, the driver presses one button — the rest is automatic, freeing them to focus on field tactics.

Auto-aim turret geometry
Turret geometry — bearing, range, and pitch solved per shot
Auto-aim heading geometry
ΔX, ΔY → atan2 bearing vs. robot heading
Distance to flywheel RPM calibration scatter
20 calibration points: distance → flywheel RPM
Up-to-speed indicator flowchart
Up-to-speed gate: green light when RPM ≥ target
Per-module PID error convergence
Per-module PID — error convergence under tuning

Tuned for a shorter window.

01
Per-module PID

Each swerve module gets its own steering PID, tuned to its friction, backlash, and load — so low-speed micro-moves, alignment, and lock are far steadier.

02
Four-wire servo feedback

We moved from an external MA3 encoder (with a switch-point error that caused jitter) to four-wire servo internal feedback — continuous, stable angle for reliable closed-loop control.

03
Power mapping & restart comp

A new power-distribution map keeps servos precise under varying load, and a minimum-start compensation on rotation commands kills both dead-zone stall and overshoot.

04
Closed-loop triple-shot

Encoder-based velocity closed-loop with an up-to-speed threshold and timed trigger/reset logic delivers a stable three-shot cadence with pitch travel protection.