Software feedback loops cannot compensate for sloppy mechanical joints. When a rotating arm has several degrees of deadband or an elevator carriage sticks on misaligned rails, PID controllers oscillate uncontrollably. Designing mechanical systems with tight tolerances, minimal backlash, and rigid sensor coupling ensures software control loops settle rapidly and repeatably.
Always mount absolute feedback encoders directly to the final driven output shaft, or rigidly link them with a zero-backlash timing belt. Placing a feedback sensor on the motor side of a loose chain drive causes the controller to hunt back and forth across the slop, inducing mechanical chatter.
Backlash sources and compounding stages
Section titled “Backlash sources and compounding stages”Backlash is the angular or linear free play between meshing parts before driving contact occurs. In multi-stage gearboxes, backlash compounds with each additional reduction stage.
| Transmission type | Inherent backlash | Failure mode when loose | Mitigation strategy |
|---|---|---|---|
| Timing belt (HTD / GT2) | Near zero | Tooth skipping under high torque | Maintain proper center-to-center tension with slotted mounts |
| Involute gears (20 DP) | 0.003 to 0.006 in per mesh | Tooth wear, noisy meshing | Minimize reduction stages; use single-stage large spur gears |
| Roller chain (#25 / #35) | Moderate to high | Chain stretch, whipping, joint slop | Incorporate floating idlers or threaded turnbuckle tensioners |
| Hex shaft bores | 0.002 to 0.008 in | Broach loosening, rattling | Apply 0.002-inch steel shim tape or Loctite 680 retaining compound |
To reduce backlash in custom gearboxes, use fewer reduction stages with larger ratio steps rather than stacking three or four small planetary stages. A single 5:1 spur gear reduction has roughly one-fourth the backlash of two 2.2:1 stages in series.
Sensor mounting and mechanical coupling
Section titled “Sensor mounting and mechanical coupling”Closed-loop algorithms depend on accurate position and velocity readings that reflect the true physical state of the mechanism.
On-axis absolute encoder (CANcoder / Mag Encoder)
Directly reads the rotation of the final output arm. Eliminates gear tooth error, chain stretch, and gearbox backlash from the feedback signal. Essential for consistent auto routines.
Rotor encoder (Talon FX / Spark internal encoder)
Measures high-resolution motor velocity. Excellent for velocity feedforward and high-speed flywheel closed loops where gearbox backlash does not affect speed stability.
1:1 timing belt to absolute encoder
Allows the sensor to mount on stationary chassis metal while tracking an arm joint with zero gear backlash. Requires tensioning to prevent belt backlash.
Mechanical hardstops and repeatable zeroing
Section titled “Mechanical hardstops and repeatable zeroing”While software soft limits prevent mechanisms from driving into structural supports during normal operation, mechanical hardstops provide physical zero points and emergency protection.
- Rigid zero hardstops: Design a solid aluminum or steel landing surface that the mechanism rests against when fully retracted. This provides a repeatable physical datum for resetting relative encoders on reboot.
- Energy-absorbing stops: Install 95A TPU bumpers or cellular foam pads at travel extremities to absorb inertia during high-speed autonomous overtravel without bending plates.
- Limit switch placement: Position magnetic reed switches or optical beam breaks slightly before the mechanical hardstop so software can decelerate the motor before impact occurs.
Check your work
Section titled “Check your work”Perform these manual checks on the mechanism before handing it to the programming team:
- Grab the mechanism end-effector by hand while holding the motor output pinion stationary with a wrench. Gently rock the mechanism back and forth.
- Measure the physical free play at the tip. An articulated arm longer than 24 inches should have less than 0.125 inches of total free play at the end-effector.
- If free play exceeds 0.25 inches, inspect each joint in sequence: tighten chain tensioners, check hex shaft broaches for slop, and confirm sprocket hub set screws or clamp bolts are fully torqued.
- Rotate the mechanism slowly by hand across its full travel. Confirm that the absolute encoder shaft turns continuously without slipping in its mounting hub.
Verified Sources & Standards
- WPILib Advanced Controls Overviewdocs.wpilib.orgWPILib Standard
Related content
PID Control Theory & Anti-Windup
Intuitive and mathematical foundations of Proportional, Integral, and Derivative closed-loop feedback controllers.
Feedforward Control (kS, kV, kA, kG)
Why open-loop model-based feedforward handles 90%+ of motor voltage, and how to calculate and calibrate gains for real mechanisms.