2702 Recipes

Five Mechanisms to Tune

Why almost every FRC mechanism tunes like a flywheel, turret, arm, elevator, or linear deployment, how to tell which one you have, and the cases that need extra care.

Robots look different every year, but their motors see only a few kinds of load. From the controller's point of view, almost every mechanism is one of five types: a flywheel, a turret, an arm, an elevator, or a linear deployment. Once you know which type a mechanism is, you know which gains it needs and which tuning procedure to follow. In short:

  1. Ask three questions. Does the controller hold a speed or a position? How does gravity load the motor: not at all, by the same amount everywhere, or by an amount that changes with angle? Is the travel long, or short with hard stops?
  2. The answers pick the type. Speed control is a flywheel. Position with no gravity is a turret, with a constant gravity load an elevator, and with a load that changes with angle an arm. Short travel between hard stops is a linear deployment.
  3. The type picks the gains. Arms and elevators need kG for gravity: a cosine for an arm, a constant for an elevator. Turrets, arms, and elevators need kD and usually a motion profile. Flywheels need neither.
  4. Some mechanisms need extra care. A wrist on an arm, a telescoping arm, or a spring-balanced mechanism doesn't fit one type exactly. Start from the closest type and add what's missing.

6.1 The five types

FlywheelControls speedNo gravityTurretControls angleNo gravity (top view)θArmControls angleGravity varies as cos θElevatorControls heightConstant gravityLinear deploymentControls positionShort, between hard stops
The five mechanism types, by what the controller holds and how gravity loads the motor. Blue arrows show the motion, orange arrows the gravity load. Almost every mechanism on an FRC robot tunes like one of these.
TypeController holdsGravity load on the motorGains that matterExamples
FlywheelSpeedNonekS, kV, kP (and kA for spin-up)Shooter wheels, intake and indexer rollers, swerve drive wheels
TurretAngleNonekS, kV, kA, kP, kDTurrets, swerve steering
ArmAngleChanges with angle: largest when horizontal, zero when verticalkG (cosine), kS, kV, kA, kP, kDArms, wrists, shooter pivots, intake pivots, hoods
ElevatorHeightThe same at every heightkG (constant), kS, kV, kA, kP, kDElevators, linear climbers, telescoping stages
Linear deploymentPositionAny of the aboveLike an arm or elevator, but often just kG, kS, and kPIntake slides, short intake pivots, climber hooks, hopper extensions

The gain names come from the gain slot model: kS for friction, kV for speed, kA for acceleration, kG for gravity, and kP and kD for feedback. The table assumes voltage mode. In torque-current mode, kV is close to zero (Feedforward in Torque Mode).

6.2 Why five are enough

Every mechanism driven by a motor obeys the same balance. The motor's torque goes into speeding the mechanism up, and into overcoming friction and gravity:

J θ¨=τmotor−τfriction−τgravity(θ)J\,\ddot{\theta} = \tau_{\text{motor}} - \tau_{\text{friction}} - \tau_{\text{gravity}}(\theta)

Term by term:

  • J θ¨J\,\ddot{\theta} is inertia times acceleration. JJ is how hard the mechanism is to speed up: its mass and how far from the axle that mass sits. For an elevator, use mass and linear acceleration instead. The feedforward gain kA covers this term.
  • τmotor\tau_{\text{motor}} is the motor's torque, after the gearbox. In voltage mode, part of the voltage goes to cancel the motor's back-EMF, which grows with speed. That is what kV covers (Voltage Control).
  • τfriction\tau_{\text{friction}} is friction in bearings, gears, and belts. It is roughly constant and always opposes motion. kS covers it.
  • τgravity(θ)\tau_{\text{gravity}}(\theta) is the torque gravity puts on the motor. kG covers it.

The first three terms look the same on every mechanism. Only the gravity term changes, and it comes in three shapes:

Gravity termWhenType
ZeroThe mechanism turns about a vertical axis (a turret), or it is balanced about its axle, so gravity pulls equally on both sides (a flywheel)Flywheel or turret
ConstantThe mechanism moves in a straight line, up or at a fixed tiltElevator
Cosine of the angleThe mechanism rotates in a vertical planeArm

The rest of the difference is what the controller holds. A flywheel holds a speed, so it needs kV and doesn't care where it is. A turret, arm, or elevator holds a position, so it needs kP to pull back to that position and usually kD to settle there.

The fifth type, the linear deployment, is not new physics. It is an arm or an elevator with short travel between hard stops. Short moves are almost all speeding up and slowing down, so a simpler tune is often enough (Linear Deployment).

6.3 Which type is it?

Go down the table. The first row that fits the mechanism gives its type:

If the mechanism...Type
Holds a speedFlywheel
Moves a short way between hard stops, to only a few positionsLinear deployment
Holds a position, and gravity doesn't load the motorTurret
Holds a position, and gravity loads the motor the same everywhereElevator
Holds a position, and gravity's load changes with angleArm

Mechanisms from recent games, sorted by type:

TypeMechanismGameNotes
FlywheelShooter flywheels2022, 2024, 2026Recovery after each shot matters most
FlywheelIntake, indexer, and end effector rollersEvery yearUsually run open loop at a set voltage
FlywheelSpindexer, rolling floor, or dye rotor2026Spins at a set speed. Often run open loop
FlywheelSwerve drive wheelsEvery yearSpeed control. The traction limit caps the current (Swerve Tuning)
TurretTurret2022, 2026Watch for cable limits. Most turrets can't spin forever
TurretSwerve steeringEvery yearWraps around continuously (Swerve Tuning)
ArmArm2023Its kG grows with what it carries
ArmPivot on an elevator carriage2025Gravity acts the same whatever the elevator's height
ArmPivoting shooter2024Heavy, with the flywheels far from the axle
ArmClimber on a pivot2025Pulls the whole robot. Pull with a set current
Arm, or linear deploymentHood2022, 2026A light hood with short travel tunes like a deployment
Arm, or linear deploymentIntake pivotEvery yearOften only two positions: in and out
ElevatorElevator2025Check the rigging. Some elevators need a different kG for each stage
ElevatorClimber on a lift2024, 2026Pulls the whole robot. Pull with a set current
Linear deploymentIntake slide2026Drives out to a hard stop, and back in
Linear deploymentExpanding hopper2026Often only needs to reach a hard stop

6.4 Mechanisms that need extra care

Some mechanisms don't fit one type exactly. Start from the closest type, then handle what's different:

MechanismWhat's differentWhat to do
Wrist on an armGravity acts on the wrist's angle from horizontal, which is the arm's angle plus the wrist's angle. The wrist's own encoder only knows its angle relative to the armCompute the gravity feedforward in code from both angles and pass it with the request (Compound Arms)
Two-joint armEach joint's gravity load depends on the other joint's angleSame as a wrist on an arm
Telescoping armThe pivot's gravity load grows as the arm extends. The extension's gravity load changes with the pivot's angleSchedule kG by extension (switch gain slots), or compute the feedforward in code
Tilted elevatorGravity pulls along the rails with only part of its strengthStill an elevator. kG is just smaller
Spring- or gas-spring-balancedThe spring force changes with position, so the leftover load is neither constant nor a cosineMeasure the hold at several positions with the bracketing test. If it changes a lot, schedule kG or compute it in code
Holding a game pieceA heavy piece raises kG and kAMeasure kG with and without the piece. Switch gain slots when the robot picks one up
Differential mechanismTwo motors work together to drive two joints, as in some wristsConvert motor motion to joint motion first. Each joint is then one of the five types

6.5 Tune it

Once you know the type, go to its tuning procedure:

On this page