Skip to content
GitHubYouTubeInstagram

One number, a thousand times a second.volts → amps → speed → a place

Every motor on our robot runs one number from the code: a voltage, a current, a speed or a place. The Talon FX turns that number into torque a thousand times a second. This course follows that number, and each chapter hands the Talon one more job — until picking a control mode is just picking which job you want done.

6 chapters · about 38 minutes

  1. 01 · 7 minDuty cycle, volts and ampsThe three things you can send a motor, on our 2026 launcher.
  2. 02 · 7 minLet the Talon close the loopTune the launcher against a real match log: feedforward, then kP.
  3. 03 · 6 minPosition control: PID and gravityHold our 2025 elevator and shoulder in place: kP, kD, and a kG you can calculate.
  4. 04 · 7 minMotion Magic: plan the moveCruise, acceleration and jerk, on the same elevator going to L4.
  5. 05 · 6 minFOC and current limitsRace two swerve robots and find out what the brochure numbers leave out.
  6. 06 · 5 minChoosing the requestBuild a request name from three questions, then check yourself.
Chapter 1 of 6 7 min

Duty cycle, volts and amps

The three things you can send a motor, on our 2026 launcher.

A Talon FX never hears "go faster". Every loop, the robot code sends it one number inside a control request, and the first thing that request says is what the number means. There are only three meanings:

  • DutyCycleOut(0.5): "switch the battery on half the time". Half of whatever the battery has right now.
  • VoltageOut(6): "put 6 volts across the motor". The Talon measures the battery and adjusts.
  • TorqueCurrentFOC(20): "push 20 amps through the windings". Current is push: on this launcher's Kraken X44s every amp makes 0.0152 N·m of torque.

Every other request in this course is one of these three with a controller picking the number. They do very different things to a real motor.

Why a voltage is a speed

A spinning motor is also a generator. At full speed a Kraken makes almost 12 volts of its own, pushing back against the battery. That's back-EMF, and it grows in step with speed: on the launcher's Kraken X44s with FOC, 1 volt for about every 620 rpm. Current only flows because of the gap between the volts you apply and the volts the motor is making.

So give a motor 6 volts and it speeds up until its back-EMF nearly reaches 6. Then the gap closes, the current falls to just what friction needs, and it stops speeding up. It settles at about half of its top speed (this launcher's wheel tops out near 5,300 rpm), whatever it's attached to. A current request is different. Ask for 20 amps and the Talon keeps 20 amps flowing however fast the motor goes. That's a steady push, so the motor keeps speeding up until the battery runs out of volts to keep the current up.

LabThree kinds of number, one launcher

Hit 3,000 rpm with each kind of request, then press Drive hard to see which ones hold it. The orange line is what your request allows; it settles where it crosses the blue drag line.

What the request allowsWhat the flywheel's drag takesWhere the motor is nowThe most the battery allows
Request

Volts across the motor. Sets roughly where it settles.

The rest of the robot
  • Settle at 3,000 rpm—Within 100 rpm. Try it with each kind of request.
  • Ignore the battery—Settle at the same speed (within 100 rpm) whether the drivetrain is still or driving hard. Voltage and torque current can. Duty cycle can't, and that's the lesson.
More readouts
Battery—
Volts across each motor—
Current in each motor—

Simplified: one lumped flywheel, no ball in it. Motor constants from WPILib's DCMotor.getKrakenX44Foc. The launcher is our 2026 offseason robot's: two Kraken X44s, leader and follower, through 1.38 : 1, so the wheel's top speed is about 5,300 rpm. Its inertia and drag, and the battery's 12.38 V with 0.0144 Ω, are fitted to that robot's log from qualification match 36 at Chezy Champs.

With a voltage, the orange line slopes down: the faster the motor spins, the less current the volts push through, and it settles where that line meets the drag. With a torque current the line is flat, so it only stops at the gray battery line. That's why 10 A and 12 A end up at such different speeds: current sets the push, and the speed is whatever that push leads to.

What a sagging battery does to each one

Our battery isn't a steady 12 volts. In qualification match 36 at Chezy Champs this September it started at 12.7 V and dipped to 7.5 V when the whole robot pulled 371 A. That's what Drive hard does in the lab.

  • Duty cycle slows down, because half of 8 V is less than half of 12 V. A launcher on duty cycle shoots short whenever the drivetrain is working.
  • Voltage doesn't notice, as long as the battery still has more than you asked for. The Talon rescales its duty cycle every loop to keep the volts where you set them.
  • Torque current doesn't notice either, until the battery can't supply the volts that current needs at that speed. Then it falls back along the gray line.

Reading a request name

Phoenix 6 names every request the same way: what to control, then which of the three outputs. VelocityVoltage is a speed loop whose answer is volts. MotionMagicTorqueCurrentFOC is a planned move whose answer is amps. Once you can read the name, you know what the Talon is being asked for and what units its gains are in. The last chapter builds these names from scratch.

In code a request is an object you make once and update every loop:

private final VoltageOut volts = new VoltageOut(0);
// every loop:
motor.setControl(volts.withOutput(6.0));

A request of zero, or a disabled robot, hands the motor to its NeutralModeValue. Brake shorts the windings so the motor resists being turned, and Coast lets it spin free. Our 2025 elevator and shoulder are set to Brake, so when the robot disables they settle slowly instead of dropping. The 2026 offseason launcher is set to Coast, so the flywheel spins down on its own.

The one thing to remember Volts set roughly where a motor settles, and amps set how hard it pushes on the way there. Duty cycle is a fraction of whatever the battery has left, which is why our code uses volts and amps instead.

Next: Let the Talon close the loop ↓

Chapter 2 of 6 7 min

Let the Talon close the loop

Tune the launcher against a real match log: feedforward, then kP.

A launcher has to hold a speed through every ball, and neither a plain voltage nor a plain current does that. So you give the Talon the speed and let it do the rest. VelocityTorqueCurrentFOC(50) means "hold 50 rotations per second, and work out the amps yourself". The Talon reads its own encoder and compares that to the target. It picks a new output 1,000 times a second, twenty times faster than the roboRIO's 50 Hz loop. That's a closed loop, and the rule it follows for picking the output is set by a few gains.

LabThe launcher we're about to tune

Drag to orbit, scroll to zoom. Spin the flywheel: 3-inch grip wheels on one shaft, driven by two Kraken X44s.

Scroll here to load the 3D model.
FlywheelRollersKraken X44s
Flywheel

The 2026 offseason robot's shooter, built from FRC 8044's 2026 design, from our Onshape CAD. The spin is shown 40× slower than real.

Two kinds of gain

Feedforward is the Talon's guess. It's worked out from the target alone, before anything goes wrong. Feedback is the correction, worked out from the error: how far the measured speed is from the target. The Talon adds them up:

output = kS + kV × target speed + kP × error

  • kS: a constant push in the direction of travel, to cover friction.
  • kV: output per rotation-per-second of target. In a voltage loop this does most of the work, because volts buy speed. At 50 rps of wheel (69 at the motor, through 1.38 : 1) our X44s need about 6.7 V just to match their own back-EMF.
  • kP: output per rps of error. The further off the wheel is, the harder it gets pushed back.

The units follow the request's output. In VelocityVoltage, kP is volts per rps. In VelocityTorqueCurrentFOC it's amps per rps. At Chezy Champs our offseason launcher ran VelocityVoltage with kP 0.5: "half a volt more for every rotation per second it's slow".

In a current loop a steady speed only needs enough current to beat friction, so kV is usually zero and kS does the feedforward.

LabTune the launcher against a real match

This is 1.35 seconds of our offseason 2026 robot in qualification match 36 at Chezy Champs: spin up from idle, then eleven balls. The green line is the log. It starts on the gains that robot ran. Try the other presets, especially the bad ones, then tune your own and try to turn every goal green.

TargetSim, with your gainsOur robot (Q36 log)±200 rpm: "at speed"Feedforward part of the output
  • Up to speed—Within 200 rpm of the target in 150 ms. The robot took about 110 ms.
  • Recovers between balls—Back within 200 rpm before the next ball arrives.
  • Holds idle—Within 200 rpm of 700 before the shot is called.
  • Settles without ringing—Once it's up to speed, it overshoots the target by less than 300 rpm before the first ball.
Peak current per motor—
Tune the gains yourself
Request

Volts per rps of target. 12 V ÷ 89 rps (the wheel's top speed) ≈ 0.135.

Volts per rps of error.

Simplified: one lumped flywheel, checked against both the CAD and this log. Its inertia (0.0015 kg·m²) is fitted to the log's spin-up. Each ball is a 25 ms drag pulse sized to the dips in the log. Both modes run under all the launcher's limits from the code: 80 A stator and 75 A supply, and in current mode torque peaks of +80 and −10 A. The Talon's velocity measurement is modeled as a 25 ms lag, fitted to the log's overshoot. Gains: 2026-Spectrum branch 2026-offseason-bot as of 2026-09-19.

What the presets show

Try Same kV, no kP. Before the first ball, the wheel sits within about 30 rpm of the target with no feedback at all, because a voltage settles at a speed by itself (chapter 1). That's why we fit kV from match logs. But each ball drags it down and nothing pushes back harder, so by the end it's about 600 rpm low. Our kP of 0.5 V/rps is what pulls it back between shots.

The datasheet kV isn't quite enough. Two X44s through 1.38 : 1 top out at 89 wheel rps, so 12 V ÷ 89 gives 0.135. With that, the wheel sits about 190 rpm low before the first ball, and the balls drag it lower. The kV we fit from logs, 0.1425, is 6% higher. The extra covers drag the motor curve leaves out.

Switch to VelocityTorqueCurrentFOC with kP 10 A/rps and kS 20 A, and it does about as well, but the feedback matters more. With kS alone the balls stop the wheel. At kP 2 each ball knocks it down for longer than the gap to the next one. kP 40 is no faster than kP 10, because both sit at the 80 A limit during spin-up. It's worse, in fact: the Talon sees the speed a little late, so a high kP keeps pushing after the wheel is back and overshoots.

Tuning a real one

The order is the same on the robot as in the lab. Start with the feedforward, so kV for a voltage loop or kS for a current loop, until the mechanism gets close with no feedback. Then raise kP until disturbances recover fast enough. Stop when more kP stops helping or it starts to buzz. Plot the target and the velocity together in Phoenix Tuner X or AdvantageScope while you do it. SysId can measure kS, kV and kA for you.

kD (output per rps/s of changing error) and kI (output per accumulated error) exist on every Talon loop too. Velocity loops rarely need them. kI will close a small steady error, but it winds up during every ball and then overshoots.

The one thing to remember Tune feedforward first, until the mechanism gets close on its own, then add kP to handle disturbances. If the output is already at its current limit, more kP won't make it faster.

Next: Position control: PID and gravity ↓

Chapter 3 of 6 6 min

Position control: PID and gravity

Hold our 2025 elevator and shoulder in place: kP, kD, and a kG you can calculate.

A launcher holds a speed. An elevator, an arm or a hood holds a position, and gravity pulls on it the whole time. That's a position request, like PositionTorqueCurrentFOC(8.6): "hold 8.6 rotations". The Talon runs the same loop as before, but now the error is a distance, in motor rotations.

Our 2025 elevator has one moving stage, belted up by two Krakens through 11:54 gears to a 36-tooth pulley. That's 4.91:1, and every rotation of the motor lifts the stage 3.7 cm. L2 is 8.6 rotations up, and L4, at 21.1, is the full 77 cm of travel. The loop's main gain is kP, in amps per rotation of error. It works like a spring: the further the stage is from its target, the harder the motors pull it back.

LabOur 2025 elevator and shoulder, from its CAD

Drag to orbit, scroll to zoom. Move the stage between setpoints, and swing the shoulder: the whole claw assembly turns about one shaft.

Scroll here to load the 3D model.
Fixed stageInner stage (moves up)Shoulder assembly (turns)
Setpoint

0° hangs straight down, as in the code.

From the 2025 robot's Onshape CAD, fasteners and all. The inner stage rides inside the fixed stage, pulled up by the two belts. Heights are the code's setpoints in motor rotations, 3.7 cm each. At full height the two stages still overlap by 16 cm.

Why a spring alone sags

A spring only pushes when it's stretched. Gravity pulls the stage down all the time, so a kP-only loop has to be a little bit wrong to push back. Holding the stage, shoulder and claw up takes about 25 A in each motor. With kP = 100 A per rotation, the loop only makes 25 A when the stage is 0.25 rotations low. That's about a centimeter, and a softer kP sags more.

The fix is to give the loop that 25 A up front. That's kG, gravity feedforward: a fixed current added to every output, so kP only has to handle what's left over. Because the stage's weight doesn't change with height, the elevator's kG is a constant (GravityType.Elevator_Static).

LabHold the 2025 elevator at L2

It starts with kP only, and it sags. Turn all three goals green: hold it at L2, make it shrug off a shove, then send it to L3 without overshooting. Try the kI preset too.

kG (feedforward) / inner stagekP + kI + kD (feedback)What gravity needs: 25.3 AHeight error

Amps added always, to hold the weight up.

Target
  • Hold within 0.2 cm—Steady at the target for a full second.
  • Shrug off a shove—Press Shove it: back within 0.2 cm, and staying there, in under 0.5 s.
  • Move without overshooting—Pick another target: it goes less than 0.5 cm past it.
More controls

Amps per rotation of error: how stiff the spring is.

Amps per rps of motion: a damper that stops it bouncing.

Amps per rotation·second: adds up the error over time.

Current per motor—

Simplified: a rigid stage, both motors sharing the load evenly, and made-up friction so an undamped loop still rings down eventually. Gearing (4.91:1 to a 36T pulley) and the drawing are from the 2025 CAD; the 17 kg moving mass is worked out from the tuned kG. Gains are the tuned ones from 2025-Spectrum Elevator.java, which has no kI. 'Shove it' knocks the stage downward at about 0.55 m/s. Changing a gain here clears the kI sum so each try starts fresh; the real Talon keeps it.

We tuned kG to 25.3 A on the real robot, and it doubles as a scale. Working backwards: 25.3 A × 0.0194 N·m per amp × 2 motors × 4.91:1 is 4.8 N·m at the pulley, and on its 28.6 mm radius that holds up about 17 kg of stage, shoulder and claw (the code's simulation assumed 13.6 kg). Going the other way, the CAD's weight gives a first kG before the mechanism is built.

P, I and D

kP is one of the three terms of a PID loop. The other two look at the error in different ways:

  • kD looks at how fast the error is changing. It pushes against motion, so a shove turns into one smooth return instead of a bounce. Our kD of 8 A/rps settles the elevator without overshooting, and the shoulder runs kD 170 for the same reason. It also amplifies noise in the encoder reading, and too much makes the motor buzz, so use just enough to stop the bounce.
  • kI looks at the error so far. It adds the error up over time, so an error that never goes away builds a bigger and bigger push. The kI preset uses it to hold the stage with no kG at all.

Almost none of our code uses kI. In the lab it fixes the sag, but kG does that instantly. Send it to L3 and the stage climbs at the current limit while kI keeps adding up error it can't do anything about, so it arrives still pushing hard and overshoots into the top hard stop. That's wind-up. Feedforward (kG, kS, kV, kA) does kI's job, so we leave kI at 0.

Arms: gravity that changes with angle

An arm is harder, because gravity's pull depends on the angle. It pulls hardest when the arm is level and not at all when the arm hangs straight down or points straight up. A single kG can't be right everywhere. Phoenix's answer is GravityType.Arm_Cosine: kG is the current that holds the arm level, and the Talon scales it by the cosine of the arm's angle from level at every step. Our 2025 shoulder used it: one Kraken at 61.7:1, kG 20.8 A.

The shoulder also sets its mechanism ratio (SensorToMechanismRatio) to 61.71, the number of motor turns in one arm turn. The Talon then reports and controls in arm rotations, so its setpoints are arm angles and kP 1,500 is amps per arm rotation (4.2 A per degree). The elevator leaves it at 1, which is why its setpoints and gains are in motor rotations.

LabHold the 2025 shoulder at any angle

Try to hold all four setpoints within 1°. It starts with our kG as a flat constant, which is only right at one angle.

kG (feedforward)kP + kD (feedback) / shoulderWhat gravity needs hereTarget angle
GravityType
Target
  • Hold every setpoint within 1°—Visit all four targets. Each one counts once it has settled.
More controls

With Arm_Cosine, the current that holds the arm level.

Amps per arm rotation. 1,500 is 4.2 A per degree.

Gravity needs here—

Simplified: a rigid arm and made-up friction. The code has no arm mass, so gravity's pull is set from the tuned kG itself (20.8 A holds it level), and inertia is the code's simulation default, 1.2 kg·m². The arm's 0.27 m, pivot to elbow, is from the 2025 CAD. Gains from 2025-Spectrum Shoulder.java: kP 1,500 A per arm rotation (4.2 A per degree), kD 170. Angles are the code's: 0° hangs straight down.

A constant kG pushes 20.8 A everywhere. At L4 (170°, nearly straight up) gravity needs only 3.6 A, so the extra 17 A shoves the arm past its target until kP's error pushes back: about 4° off. At L1 the mismatch is smaller, about 1°. Arm_Cosine gives 20.8 × cos(80°) = 3.6 A there. For it to work, the Talon must know the real angle: the arm's zero and its mechanism ratio have to be right, or kG pushes the wrong amount at every angle. Arm_Cosine takes the Talon's 0 as level, and GravityArmPositionOffset tells it where level is when your zero is somewhere else. Our shoulder leaves the offset at 0 and subtracts 90° from every angle in code instead, so the Talon's 0 is level.

The one thing to remember kP alone has to be wrong to hold a weight up. kG supplies that push up front, and you can often calculate it. kD stops the bounce.

Next: Motion Magic: plan the move ↓

Chapter 4 of 6 7 min

Motion Magic: plan the move

Cruise, acceleration and jerk, on the same elevator going to L4.

The last chapter ended with the elevator slamming to L3. A position loop sees 11 rotations of error and asks for as much current as it's allowed, because nothing tells it to go gently. It's quick, but the stage accelerates at over 5 g, which is hard on the coral and the belts.

Motion Magic fixes it by adding a plan. Instead of handing the loop the destination, the Talon works out where the stage should be right now on a smooth path to the destination, 1,000 times a second. The loop then follows that moving target. The path follows three limits you choose:

  • cruise velocity: the top speed, in rotations per second. Short moves never reach it.
  • Acceleration: how fast the speed may change at the start and the end.
  • jerk: how fast the acceleration may change. With a jerk limit, the sharp corners of the speed plan get rounded into an S-curve.

The trapezoid

Start without the jerk limit. Then the plan is simple: speed up at the set acceleration, hold the cruise speed, and slow down at the same rate so it stops right on the target. Plot speed against time and you get a trapezoid. The distance traveled is the area under it, so the planner starts braking when the area matches the move.

Getting up to cruise and back down takes some distance: cruise² ÷ acceleration, which is 12.3 rotations for our 70 rps at 400 rps/s. A move shorter than that never reaches cruise. It starts braking at the top, and the trapezoid becomes a triangle.

LabThe shape of a plan

Pick a move and watch the plan play out. Turn all three goals green: make a triangle, make a plan that cruises for a fifth of a second, and round the corners with jerk.

Planned speedDistance so far (the area)Planned acceleration
Move
Jerk
Time for the move—
  • Make a triangle—A move too short to reach cruise.
  • Cruise for 0.2 s—A flat top at least a fifth of a second long.
  • Round the corners—Turn on the jerk limit.

The same profile generator as the lab below, planning a move of the 2025 elevator in motor rotations (3.7 cm each). This is only the plan: the next lab adds the elevator that has to follow it.

Turn on jerk and the acceleration ramps instead of jumping, so every corner rounds into the S-curve Motion Magic runs. It takes a little longer, and the mechanism never gets a sudden kick.

LabSend the elevator from home to L4

It starts on plain position control: fast, but look at the goals. Find a profile that turns all three green. Press Change your mind: L3 while it is moving.

The plan (where it should be)The stageCurrent per motor
  • Get to L4 in under 0.7 s—Within 0.1 rotation of the target.
  • Keep the stage under 2 g—So the coral stays put.
  • Keep the current under 100 A—Per motor, at the peak.
Shape your own profile

Top speed. 70 rps is 2.6 m/s of stage.

How fast speed changes. 400 rps/s is 1.5 g on the stage.

How fast acceleration changes. 0 = no limit (a trapezoid).

Worst distance from the plan—

Simplified: the same elevator model as chapter 3, and the same gains for every option (kP 100, kD 8, kG 25.3; kA 0.2 in Motion Magic). The profile generator re-plans every millisecond from its own position and speed, like Motion Magic does when the target changes. Limits are the 2025 code's: cruise 70 rps, acceleration 400 rps/s, jerk 4,500 rps/s², and the slow auto profile 55 rps/s with jerk 550.

What the numbers say

Plain position gets to L4 0.08 s sooner (0.58 s against 0.66 s), because it slams into the limits: 160 A in each motor and 5.3 g on the stage, every time the operator presses a button. Our Motion Magic profile peaks at 90 A (the 60 A supply limit trims it at speed), and keeps the stage to about 1.5 g. We chose that 1.5 g when we set the acceleration.

Home to L4 is 21 rotations, the full 77 cm. Reaching 70 rps and stopping again takes 12.3 rotations as a trapezoid, and our jerk ramps stretch that to about 18, so it holds 70 rps for the last 3: the short flat top on the speed plot. A short move, like L2 to L4, never gets there. Acceleration and jerk shape the short ones.

With jerk 0, the plan's acceleration flips from full forward to full braking in one step. The loop can't follow a step, so the stage is kicked at 3.3 g for an instant, though the plan never asks for more than 1.5 g. On the robot that's a clunk. Our 4,500 rps/s² jerk takes 0.09 s to ramp the acceleration up, which costs about 0.04 s on this move.

Motion Magic hands the loop the plan's speed and acceleration as well as its position, so the feedforward can push before the stage falls behind. Our kA of 0.2 A per rps/s adds 80 A at full acceleration. That's why "worst distance from the plan" stays small, and kP only has small errors to fix.

Changing your mind mid-move

Press Change your mind halfway up. The plan doesn't restart from zero. It re-plans from where the plan is right now, at the speed it's going, and brakes to the new target within the same limits. That's what lets the code change a Motion Magic target at any time without the mechanism lurching.

The one thing to remember Motion Magic gives the loop a path to follow instead of a destination. It costs a little time, and in return we choose the peak acceleration and current instead of getting whatever the current limit allows.

Next: FOC and current limits ↓

Chapter 5 of 6 6 min

FOC and current limits

Race two swerve robots and find out what the brochure numbers leave out.

FOC (field oriented control) is a better way of driving the motor's three coils. With FOC, the Talon measures the rotor's exact angle and shapes the current in each coil so its magnetic field always pulls at the best angle. It's a Phoenix Pro feature, and it's enabled on all our Talons.

The published Kraken X60 numbers with FOC look big: stall torque 7.09 → 9.37 N·m (+32%) and free speed 6,000 → 5,800 rpm, and CTRE says FOC gives about 15% more peak power. But the stall torque is measured at 366 A without FOC and 483 A with it. Divide torque by current and both come to 0.0194 N·m per amp, so at the same current the motor pushes the same. The extra 32% only appears at stall currents our limits never allow.

LabFOC or not: race two 2026 robots 5 m

Both robots are our 2026 competition robot, and the only difference is FOC. With our real limits, FOC loses by about 1%. Try to find limits where it wins without browning out.

FOC (TorqueCurrentFOC)No FOC (VoltageOut)Wheels slip above 90 A
  • Make FOC win—Find current limits where the FOC robot finishes first.
  • Without a brownout—The battery stays above 6.75 V for both robots.
FOCNo FOC
Time to 5 m——
Speed at 5 m——
Heat in windings——
Lowest battery——
Set the limits yourself

Caps the current in the windings, so the push. 500 means no limit.

Current from the battery, per motor. 130 means no limit.

Simplified: straight line, perfect traction up to CTRE's slip current (90 A per motor in our config; above it the extra current only spins the wheels), each robot on its own battery, and no heating. Robot: 60 kg, 6.03:1, 1.964-inch wheels, from 2026-Spectrum SwerveConfig and PathPlanner settings as it competed. Motors: WPILib's Kraken X60 curves, with and without FOC. The FOC robot requests TorqueCurrentFOC and the other requests full VoltageOut. Both get the slip current as their stator limit and torque peak, and the supply limit drops to 40 A after 1 s of limiting, as on the robot. roboRIO 2 brownout: 6.75 V.

Two limits, two jobs

A Talon FX has two current limits, and in Phoenix 6 both apply in every control mode: duty cycle, voltage and torque current. Torque-current requests get a third cap, the peak torque current, and the Talon uses whichever limit is tightest. All the limits are on out of the box (120 A stator, 70 A supply), so a limit you didn't set is still there.

LimitWhat it capsApplies inOur 2026 drive
Stator current limitCurrent in the windings, so the pushEvery mode90 A (the slip current)
Peak torque currentHow many amps a torque request can ask forTorque-current requests only±90 A (the slip current)
Supply current limitCurrent drawn from the batteryEvery mode65 A, dropping to 40 A after 1 s of limiting

CTRE's swerve code takes the slip current, the current where the wheels start spinning, and writes it into both the stator limit and the peak torque current. So the robot never asks for more push than the carpet can take, in either mode. That's the flat line at low speed on the plot. At the same 90 A it's the same push with or without FOC, which is why they launch together.

Higher up, the curve falls. That's the supply limit and the battery. Supply current is battery current: at low speed 90 A in the windings needs only a few volts and draws little, but as speed rises the same 90 A takes more volts, until our 65 A per motor supply limit bites. Four motors at 65 A pull the battery down to about 8.5 V, and from there the motors run out of volts. After 1 s of limiting, the supply limit would also drop to its lower limit, 40 A by default, to save the breakers. We never set ours, so the drive has it, but a 5 m sprint is too short to reach it.

With our limits, the robot without FOC finishes 5 m about 11 ms sooner, about 1%. Near the end the one without FOC has the higher free speed (6,000 rpm instead of 5,800). FOC only finishes first under a tight supply limit, around 20 A per motor or less, where its lower winding resistance wastes less of the little power it's allowed. Where FOC clearly wins is heat. Its winding resistance is about 24% lower (WPILib's 0.025 Ω against 0.033 Ω), and over this race its motors make about 24% less heat. Heat is what builds up over a match of sprints.

No limits at all shows what the limits are for. Both robots try to pull hundreds of amps each from a stall. The battery can't supply that, so the voltage collapses below 6.75 V and the roboRIO browns out and disables the motors.

Why the drive runs FOC and torque current

FOC barely changes a sprint, but we run it anyway. The race only tests flat-out acceleration, and most of a match is the robot following a path. There the drive runs TorqueCurrentFOC, and that's worth more than top speed:

  • Amps are push. The path planner knows how hard each module needs to push, and in torque current that's a number of amps at any wheel speed. With VoltageOut, the same volts push less as the wheel speeds up (the motor's back-EMF eats them), so the feedforward has to model the motor to get the push it wants. In amps, kS is just the friction, and kP corrects the speed in amps per rps.
  • The slip current is exact. In torque current the slip current is simply the most the Talon will ask for. The wheels get as much push as the carpet can take, no matter how hard the path asks.
  • The battery doesn't change it. A torque request gives the same push on a fresh battery or a tired one, as long as there are volts to make it, so an auto runs the same either way.

All of that needs FOC. You can only ask a Talon for amps if it can control the coils precisely enough to produce them. The 2026 competition robot's launcher, hood and swerve, and the 2025 elevator, are all tuned in amps, so they all need it. The offseason launcher from chapter 2 runs VelocityVoltage, a voltage request, so it doesn't need FOC.

On a Talon without a Pro license, requests with EnableFOC = true quietly fall back to the basic controller. A request that needs FOC, like TorqueCurrentFOC, disables the output and raises the UnlicensedFeatureInUse fault instead. If a Pro-tuned mechanism goes limp on a new robot, check the license first.

The one thing to remember At the same current FOC pushes the same, so it barely changes a sprint. We run it on the drive for torque control: the push we ask for is the push we get, at any speed and on any battery, capped at the slip current.

Next: Choosing the request ↓

Chapter 6 of 6 5 min

Choosing the request

Build a request name from three questions, then check yourself.

Five chapters come down to three questions you can ask about any mechanism. Their answers build the request's name, one piece at a time:

  1. What does it need to hold? A speed (Velocity…), a place (Position…), or nothing, just an output (…Out).
  2. Should the move follow a plan? If a big, sudden move would hurt, add MotionMagic….
  3. What should the answer be in? Volts (…Voltage) or amps (…TorqueCurrentFOC, which needs Pro).
LabBuild the request

Answer the three questions and watch the name build. Or pick one of our mechanisms to see what we chose, and what its gains mean in real units.

1. What does it need to hold?
2. Should the move follow a plan?
3. What should the answer be in?

The planWhat it holdsWhat the answer is in

Gains are in—
Feedforward it uses—

Every example is from our robot code: the 2026 competition robot as it ran at the end of the season (2026-Spectrum, April 30), the offseason robot's launcher as it ran at Chezy Champs, and the 2025 elevator (2025-Spectrum). Covered here: position, velocity and plain output requests. Phoenix 6 also has differential, follower and neutral requests.

What to use on each mechanism

Our recommendation for each kind of mechanism. Without a Pro license, voltage requests still run, without FOC. The three rows that need a different request say so in parentheses.

MechanismRecommended modeFeedforward
Swerve driveVelocityTorqueCurrentFOC (no Pro: VelocityVoltage, stator limit below wheel slip)kS, plus the path's force if you follow a timed path (no Pro: kS, kV, plus the same)
Swerve steerPositionVoltage, CANcoder fused (no Pro: CANcoder as a remote sensor)kS, kV
Intake rollersVoltageOut (to hold a game piece: TorqueCurrentFOC at low amps; no Pro: a low VoltageOut with a stator limit)None
ElevatorsMotionMagicVoltagekG (Elevator_Static), kS, kV
Arms and intake-deploy pivotsMotionMagicVoltagekG (Arm_Cosine), kS, kV
ClimbersMotionMagicVoltage, slot 0 to reach and slot 1 to climb, held up by a ratchet, a brake or a high ratio in brake modekG per slot (the climber alone, then the robot's weight), kS, kV
Launcher rollersVelocityTorqueCurrentFOC (no Pro: VelocityVoltage)kS (no Pro: kS, kV)
TurretsPositionVoltage to track, MotionMagicVoltage to sweepkS, kV

Torque current is worth Pro on the drive and the launcher, because their job is a push: amps set torque, so the drive gets traction control and the launcher recovers at the current limit. Everything else is a position loop, where a voltage request is easier: the current falls as the motor speeds up, so it damps itself. In torque current, all the damping has to come from kD.

A climber's load jumps from the mechanism to the whole robot when it hooks on, so give each state its own gain slot and pick it with withSlot(). The robot is disabled at the buzzer, so kG stops holding it. Brake mode slows a fall rather than stopping it, but its drag at the climber grows with the gear ratio squared, so a high enough ratio lets the robot down slowly enough to count. Otherwise, use a ratchet or a brake.

On a turret, Motion Magic lags a target that keeps moving, because it plans every move to end stopped. Track with PositionVoltage and pass the negative of the robot's turn rate as its velocity, so kV turns the turret with the robot. Switch to Motion Magic for big jumps, based on the size of the error, with a gap between the thresholds (for example, above 10° and back below 5°).

Tuning gains

Every term can come from CAD, the motor datasheet and a few minutes in Phoenix Tuner X. Tune in this order: kG, kS, kV, then kP and kD. Gains are per mechanism rotation (SensorToMechanismRatio = gear ratio N). Kraken X60: 5,800 rpm free and 9.37 N·m stall with FOC, 0.0194 N·m per amp.

TermCalculate itCheck it by hand
kGτ = m·g·r ÷ (N × motors). Volts: 12 × τ ÷ stall torque. Amps: τ ÷ 0.0194. On an arm, r is pivot to center of mass, arm levelRaise the output until it creeps up, lower it until it creeps down. kG is the average
kSCan't: it's frictionThe output where it starts to move. With gravity, half the gap between the two creep readings
kVVolts: 12 × N ÷ motor free speed (rps). Amps: 0Hold a speed with kP at 0; it should get close
kPFull output ÷ the error where you'd want full outputRaise until it rings, back off, add kD

Example with made-up values: 10 kg on a 20 mm pulley, two X60s at 10:1 gives kG 0.13 V (5.1 A) and kV 1.24 V per rps. With the full 12 V at a quarter-rotation error, kP = 48.

When a loop misbehaves

The same few problems come up every build season:

What you seeUsuallyTry first
Slower when the drivetrain works hardDuty cycle output (ch. 1)A voltage or torque-current request
Holds a little low, foreverNo kG, so kP has to be wrong to push (ch. 3)Calculate kG, then trim it
More kP doesn't make it fasterOutput pinned at a current limit (ch. 2)Check the limit, not the gain
Slams or bounces at the end of a movePlain position on a heavy mechanism (ch. 4)Motion Magic, and kD
Clunks at the start and end of a profileNo jerk limit (ch. 4)Add jerk
Browns out when everything runsSupply current too high (ch. 5)Supply limits on what doesn't need speed
Goes limp, LEDs blink red and greenPro-only request on an unlicensed Talon (ch. 5)License it, or use a Voltage request

Plot it

Every signal in these labs (target, velocity, closed-loop error, output, stator and supply current, motor and battery voltage) is a Talon StatusSignal, like getVelocity() or getStatorCurrent(), and our robot logs them every match. The launcher lab's green line came straight from that log. Tune with the plot open: it's the quickest way to see what a gain change actually did.

QuizCheck yourself
  1. 1. A launcher on DutyCycleOut shoots short whenever the drivetrain is accelerating. Why?

  2. 2. Our 2025 elevator on kP 100 A/rot alone holds 0.25 rotations low. What’s the best fix?

  3. 3. You raise kP on the lab’s current-mode launcher from 10 to 40 A/rps and it spins up no faster. Why?

  4. 4. Motion Magic takes our elevator from home to L4 0.08 s slower than plain position. Why use it?

  5. 5. At our 90 A slip current, how much harder does a Kraken push with FOC than without?

  6. 6. A flywheel should ramp smoothly between shot speeds, with the loop answering in amps. Which request?

The one thing to remember Pick a request with three questions: speed, place or plain output; a plan or straight there; volts or amps.

That's the CTRE Control Modes course.

Next up: Swerve Drive, or head back to all courses.