The goal#
A flywheel shooter that holds a target surface speed and recovers quickly after each game piece. We'll size the wheel and write velocity control that doesn't sag on every shot.
Step 1 — Why flywheels are a velocity problem#
Unlike arms/elevators, a shooter cares about angular velocity, not position. Each shot robs energy (RPM drops), and your control loop must shove it back fast. The energy stored is E = 0.5 * I * omega^2, where I is the wheel's moment of inertia.
Step 2 — Wheel and ratio#
Use a 4 in stealth/compliant wheel pair. A direct or light reduction keeps speed high. A Kraken X60 (WCP/CTRE) free-spins at 6000 RPM in trapezoidal commutation (5800 RPM with FOC, per the WCP/CTRE Kraken X60 motor-performance docs); run it near direct drive (1:1 to 1.5:1) so the wheel spins fast. Higher wheel inertia = more stable exit velocity but slower recovery, a classic tradeoff documented in the 1678 Rapid React shooter writeup (backrollers, flywheel mass, hood actuation).
Step 3 — Velocity control code#
For velocity you combine SimpleMotorFeedforward (predicts the voltage for a target speed) with a small kP that closes the gap on disturbances. You can run it on the Talon FX's onboard velocity loop or in code:
private final SimpleMotorFeedforward ff =
new SimpleMotorFeedforward(0.18, 0.123, 0.011); // kS, kV, kA (volts per rps)
private final PIDController pid = new PIDController(0.05, 0, 0);
private double targetRps = 0;
public void setTargetRps(double rps) { this.targetRps = rps; }
@Override
public void periodic() {
double measured = encoder.getVelocity(); // rotations/sec
double ffVolts = ff.calculate(targetRps);
double pidVolts = pid.calculate(measured, targetRps);
motor.setVoltage(ffVolts + pidVolts);
}
public boolean atSpeed() {
return Math.abs(encoder.getVelocity() - targetRps) < 2.0; // gate the feeder
}
Step 4 — The recovery trick#
Never feed the next game piece until atSpeed() returns true. This is the single biggest reliability fix for shooters: an interlock that waits for RPM recovery prevents inconsistent shots. kV dominates here (volts to maintain speed), kA matters during spin-up, and kS overcomes static friction; get these from a SysId quasistatic+dynamic test, not by guessing.
Step 5 — Mechanical notes#
- Use a backroller or top roller to add backspin for a flat, repeatable arc.
- Run the flywheel on a 1/2 in hex shaft with a heavy-duty hex bearing (e.g. AndyMark am-2986, 1/2 in hex ID, 1.125 in OD) so set-screw slip can't desync your encoder.
- Balance the wheel: an unbalanced flywheel at thousands of RPM shakes the whole superstructure and loosens fasteners over a match.
the part worth keeping
Key takeaways
- Flywheels are velocity-controlled: combine SimpleMotorFeedforward (kS/kV/kA) with a small kP for disturbance rejection.
- Gate the feeder on an atSpeed() check so the next game piece only fires after RPM recovers, the top reliability fix for shooters.
- Wheel inertia trades exit-velocity stability against recovery speed; characterize gains with SysId rather than guessing.
Mechanical, Build & PneumaticsWorked Examples & Mini-Projectslesson 3 of 5
Keep going
Take the quiz+10 XP with an accountMore in Worked Examples & Mini-Projects
where this came from
Sources and corrections
This lesson is AI-assisted: drafted from primary sources, then reviewed and edited by hand. Errors still get through. When one is reported we fix it and write down what changed, in public, in the corrections log.
sources and further reading
- docs.wpilib.orgWPILib Feedforward Control (SimpleMotorFeedforward)
- frcdesign.orgFRCDesign Mechanism Examples (1678 Rapid React Shooter)
- docs.wcproducts.comWCP/CTRE Kraken X60 Motor Performance
clipped to this lesson
Articles that go further on this
The lesson gets you through the topic. These go wider on it, and they read in one sitting.
answer sheet
Lesson quiz
All 3 right completes the lesson. Miss one and only that question comes back, anything you already answered correctly stays banked.
0 of 3 answered
01Why is a flywheel shooter treated as a velocity-control problem rather than a position-control problem?
02What combination is used to hold flywheel speed and reject the disturbance of a shot?
03What is the single biggest reliability fix for a flywheel shooter?
Answer every question to submit.
All 47 lessons in Mechanical, Build & Pneumaticsopenclose
01 / prerequisites
02 / drivetrains
03 / power-transmission
04 / structure-materials-fasteners
05 / mechanisms-fabrication-assembly
06 / pneumatics-fundamentals
07 / pneumatic-components
08 / build-wire-program
09 / safety-rules-testing
10 / worked-examples-mini-projects
- Not read yet:Mini-Project 1: A Single-Jointed Arm From Math to Motion
- Not read yet:Mini-Project 2: A Two-Stage Cascade Elevator
- Not read yet:Mini-Project 3: A Velocity-Controlled Flywheel Shooter
- Not read yet:Mini-Project 4: A Pivoting Roller Intake
- Not read yet:Mini-Project 5: Integrating a COTS Swerve Module
11 / common-mistakes-troubleshooting
- Not read yet:Pneumatics Won't Fire: A Full Diagnostic Tree
- Not read yet:The Robot Won't Drive Straight (and Other Drivetrain Sins)
- Not read yet:Gearboxes That Grenade and Fasteners That Vibrate Loose
- Not read yet:Closed-Loop Mechanisms That Oscillate, Sag, or Stall
- Not read yet:Field-Ready Reliability: Inspection, Spares, and the Pit Checklist
12 / advanced-techniques-case-studies
- Not read yet:Characterizing Any Mechanism with SysId
- Not read yet:Simulation-Driven Design with WPILib Physics Models
- Not read yet:Motion Profiling and Superstructure Coordination
- Not read yet:Designing for Weight, Stiffness, and Manufacturability
- Not read yet:Case Studies: Learning From Open Alliance Robots