Machine-Mavericks / Machine-Mavericks/FRC-2026
[IntakeArm] Tune Motion Magic PID gains and profile
@kaitlyn134 is already working on this.
Since Mar 10, 2026.
- Dominant language
- Java
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
4. IntakeArm & Uptake Tuning
The IntakeArm has a finite range of travel and uses Motion Magic (TalonFX on-controller closed-loop) to move to commanded positions. Software soft limits, stator current limiting, and optional hardware limit switches protect the mechanism.
4a. Zeroing and Soft Limits (Horizontal = 0)
Important Concept: To properly calculate gravity feedforward, the arm's angle relative to gravity must be known. In this codebase, 0 rotations = PERFECTLY HORIZONTAL.
Parameters to Tune (RobotMap.IntakeArm):
FORWARD_SOFT_LIMIT(currently90.0 / 360.0rotations) — motor rotations at the fully retracted (home/stowed) straight-up position.REVERSE_SOFT_LIMIT(currently0.0 / 360.0rotations) — motor rotations corresponding to the arm fully deployed (down).
4b. Tuning Procedure (using Test Mode)
We have built dedicated tuning controls into Test Mode (in Robot.java) to make this safe and easy.
Step 1: Set Position / Zero Encoders
You MUST do this first so the robot knows where horizontal is.
- Enable the robot in Test Mode.
- OPTION A (Easy Way): If you let the arm boot up resting naturally against its straight-up (stowed) hard stop, simply press the Start button on the Operator controller. This forces the encoder to the
STOWED_POSITION(+90 deg). - OPTION B (Manual Way): If you physically moved the arm so it is perfectly horizontal before enabling, press the Back button on the Operator controller to zero the encoders (0 deg).
Step 2: Tune Gravity Feedforward ($kG$)
- Ensure the arm is free to move.
- In Phoenix Tuner X, find
Slot0for the IntakeArm motors. - Slowly increase
kG(starting from 0.0). - Find the minimum voltage value where
kGalone can hold the arm horizontal against gravity without dropping. Record this value inIntakeArm.java.
Step 3: Tune Motion Magic PID
- While still in Test Mode, use the Operator D-Pad to snap between positions:
- D-Pad Up: Move to
STOWED_POSITION - D-Pad Down: Move to
DEPLOYED_POSITION
- D-Pad Up: Move to
- Adjust
kP(currently12.0) andkD(currently0.1) inIntakeArm.javauntil the arm snaps cleanly without violent overshoot or sluggishness.
| Constant | Current Value | Description |
|---|---|---|
Slot0.kG |
0.0 |
Gravity feedforward — Voltage to hold arm horizontal (MUST TUNE) |
Slot0.kP |
12.0 |
Proportional gain — increase if arm is sluggish, decrease if it oscillates |
Slot0.kD |
0.1 |
Derivative gain — increase to dampen overshoot at end of motion |
MotionMagicCruiseVelocity |
5 rot/s |
Max cruise velocity — reduce to slow arm travel |
MotionMagicAcceleration |
10 rot/s² |
Ramp-up/down rate — reduce if arm jerks on start/stop |
4c. Stator Current Limit
Parameter (RobotMap.IntakeArm):
STATOR_CURRENT_LIMIT(currently40.0A) — protects the motor from stall damage when the arm reaches a hard stop. Lower values provide more protection but reduce peak torque.30–50 Ais a reasonable range for an arm mechanism.
4e. Uptake Feed Rate
Parameter (RobotMap.Uptake):
UPTAKE_SPEED(currently0.8) — simple percent output. If balls are jamming, reduce speed. If flywheel speed drops too much before the second shot, reduce speed to smooth feeding.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.