From: Shaurya Piplani Date: Sun, 15 Feb 2026 19:06:42 +0000 (-0800) Subject: Update Intake.java X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=8454d4d6c395cbe5fa617b0d409fb8491a3d73b5;p=FRC2026.git Update Intake.java config for for roller motor --- diff --git a/src/main/java/frc/robot/subsystems/Intake/Intake.java b/src/main/java/frc/robot/subsystems/Intake/Intake.java index 9fbc76e..0146a08 100644 --- a/src/main/java/frc/robot/subsystems/Intake/Intake.java +++ b/src/main/java/frc/robot/subsystems/Intake/Intake.java @@ -70,19 +70,18 @@ public class Intake extends SubsystemBase { maxAcceleration = maxVelocity / 0.25; // Configure the motors - - // Build the configuration - TalonFXConfiguration config = new TalonFXConfiguration(); + // Build the configuration for the roller + TalonFXConfiguration rollerConfig = new TalonFXConfiguration(); // config the current limits (low value for testing) - config.CurrentLimits + rollerConfig.CurrentLimits .withStatorCurrentLimit(3.0) .withStatorCurrentLimitEnable(true) .withSupplyCurrentLimit(3.0) .withSupplyCurrentLimitEnable(true); // config Slot 0 PID params - var slot0Configs = config.Slot0; + var slot0Configs = rollerConfig.Slot0; // TODO: set PID parameters slot0Configs.kP = 5.0; slot0Configs.kI = 0.0; @@ -90,6 +89,31 @@ public class Intake extends SubsystemBase { slot0Configs.kV = 0.0; slot0Configs.kA = 0.0; + // set the brake mode + rollerConfig.MotorOutput.withNeutralMode(NeutralModeValue.Brake); + + // apply the configuration to the right motor (master) + rollerMotor.getConfigurator().apply(rollerConfig); + + // Build the configuration for the left and right Motor + TalonFXConfiguration config = new TalonFXConfiguration(); + + // config the current limits (low value for testing) + config.CurrentLimits + .withStatorCurrentLimit(3.0) + .withStatorCurrentLimitEnable(true) + .withSupplyCurrentLimit(3.0) + .withSupplyCurrentLimitEnable(true); + + // config Slot 0 PID params + var rollerSlot0Configs = config.Slot0; + // TODO: set PID parameters + rollerSlot0Configs.kP = 5.0; + rollerSlot0Configs.kI = 0.0; + rollerSlot0Configs.kD = 0.0; + rollerSlot0Configs.kV = 0.0; + rollerSlot0Configs.kA = 0.0; + // configure MotionMagic MotionMagicConfigs motionMagicConfigs = config.MotionMagic;