Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/robototes/REBUILT2026/llms.txt

Use this file to discover all available pages before exploring further.

The intake consists of two cooperating sub-components: IntakePivot (a single TalonFX controlling a 35:1 arm) and IntakeRollers (two TalonFXs running velocity torque-current FOC). IntakeSubsystem coordinates them and exposes the high-level commands consumed by Controls.java.

IntakeMode states

IntakeSubsystem uses an internal IntakeMode enum to select behavior each loop. Controls.java writes to the static intakeMode field in response to driver button presses.
Moves the pivot to DEPLOYED_POS (-0.43 rotations) and stops the rollers. Used when the robot is ready to pick up fuel but has not yet started intaking.

Smart intake speed scaling

smartIntake(Supplier<ChassisSpeeds>) scales roller RPS linearly from chassis translational speed to reduce spilling at high drive speeds:
public void smartIntake(Supplier<ChassisSpeeds> speeds) {
    if (!intakePivot.isAtTarget(5, IntakePivot.DEPLOYED_POS)) {
        deployPivot();
    }
    var s = speeds.get();
    runRollers(() -> Math.hypot(s.vxMetersPerSecond, s.vyMetersPerSecond) * 6 + 50);
}
At rest the rollers spin at 50 RPS; at maximum drive speed the multiplier adds up to ~+30 RPS on top, keeping fuel from bouncing back out.

Public API

MethodDescription
smartIntake(Supplier<ChassisSpeeds>)Deploy pivot then run rollers scaled to drive speed
deployPivot()Move pivot to DEPLOYED_POS, stop rollers
retractPivot()Move pivot to RETRACTED_POS, stop rollers
extakeIntake()Move pivot to EXTAKE_POS, reverse rollers
intakeWhileLaunch()Oscillate pivot + agitate rollers during shooting
runRollers()Run rollers at TARGET_RPS (68 RPS)
runRollers(DoubleSupplier)Run rollers at a supplied RPS

IntakePivot

IntakePivot drives a single TalonFX (CAN ID INTAKE_PIVOT_MOTOR_ID = 15) through a 35:1 gear reduction using MotionMagic position control with arm-cosine gravity compensation.

Key positions

ConstantValue (rotations)Description
RETRACTED_POS0.0Zero / home position
DEPLOYED_POS-0.43Fully lowered for intaking
EXTAKE_POS-0.3Partial deploy for ejection
LAUNCH_POS_OUT-0.292Outer oscillation point during launch
LAUNCH_POS_IN-0.13Inner oscillation point during launch

MotionMagic tuning

ParameterValue
kP40
kD1
kG (arm cosine)0.4
kS0.2
Cruise velocity100 rot/s
Acceleration400 rot/s²

Auto-zero sequence

public Command autoZeroCommand() {
    return Commands.sequence(
            voltageControl(() -> Volts.of(AUTO_ZERO_VOLTAGE))  // 8 V drive upward
                .withDeadline(
                    Commands.waitSeconds(0.5)
                        .andThen(
                            Commands.run(() -> SS_intakePivotCurrent.refresh())
                                .until(
                                    () -> SS_intakePivotCurrent.getValueAsDouble()
                                           >= (STATOR_CURRENT_LIMIT - 1)))),  // stall at 59 A
            zeroPivot())
        .withTimeout(3)
        .withName("Automatic Zero Pivot");
}
The pivot zero is performed at startup by Controls.java (driver Start button while disabled). autoZeroCommand() drives the arm toward the hard stop at 8 V, waits for stator current to hit the stall limit (59 A), then calls zeroPivot() to set the encoder to 0. In simulation, autoZeroCommand() falls back to zeroPivot() immediately.

IntakeRollers

Two TalonFX motors drive the rollers via VelocityTorqueCurrentFOC:
ConstantValueCAN ID
Left rollerINTAKE_MOTOR_ONE_ID16
Right rollerINTAKE_MOTOR_TWO_ID17
TARGET_RPS68 RPS
AGITATE_RPS34 RPS (TARGET_RPS / 2)
The left roller runs on the roboRIO bus (comp bot) or the alpha CANivore bus (alpha bot), while the right roller always uses the roboRIO bus. Motors run in Coast neutral mode to prevent fuel damage on sudden stops.

Controller bindings

ButtonAction
Left trigger (hold)INTAKE mode — smart intake with chassis speed scaling
Left bumper (hold)EXTAKE mode — reverse rollers, partial deploy
POV UpDEPLOYED mode — deploy pivot, stop rollers
POV DownRETRACTED mode — retract pivot, stop rollers
Right trigger (hold)Transitions intake to LAUNCH mode via updateIntakeMode() once launcher is at target

Build docs developers (and LLMs) love