From a40976c8a77b4bb737694b66accb2c7430ee04ec Mon Sep 17 00:00:00 2001 From: spellingcat <70864274+spellingcat@users.noreply.github.com> Date: Sat, 21 Mar 2026 20:28:25 -0700 Subject: [PATCH 1/4] new gear ratio not tested yet --- .../subsystems/intake/SlapdownSubsystem.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java b/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java index 25f8dc1e..9d7346bf 100644 --- a/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java @@ -32,7 +32,7 @@ public class SlapdownSubsystem extends SubsystemBase implements Intake { public static final Rotation2d PIVOT_RETRACTED_POSITION = PIVOT_MAX_POSITION; public static final double CURRENT_ZEROING_THRESHOLD = 30.0; // TODO: TUNE public static final double ROLLER_GEAR_RATIO = 60.0 / 29.0; - public static final double PIVOT_GEAR_RATIO = 39.375; + public static final double PIVOT_GEAR_RATIO = 36.17578125;//39.375; private final PivotIO pivotIO; private PivotIOInputsAutoLogged pivotIOInputs = new PivotIOInputsAutoLogged(); @@ -93,18 +93,20 @@ public Command agitate() { return Commands.sequence( this.run( () -> { + //maybe needs to go slower but idrk how to do that rn pivotIO.setMotorPositionSetpoint(PIVOT_EXTENDED_POSITION); rollerIO.setRollerVelocity(10.0); }) - .until(atExtensionTrigger), - this.run( - () -> { - pivotIO.setMotorPositionSetpoint( - PIVOT_EXTENDED_POSITION.plus(Rotation2d.fromDegrees(40))); - rollerIO.setRollerVelocity(10.0); - }) - .until(atExtensionTrigger)) - .repeatedly(); + // .until(atExtensionTrigger), + // this.run( + // () -> { + // pivotIO.setMotorPositionSetpoint( + // PIVOT_EXTENDED_POSITION.plus(Rotation2d.fromDegrees(40))); + // rollerIO.setRollerVelocity(10.0); + // }) + // .until(atExtensionTrigger)) + // .repeatedly(); + ); } @Override From dda6acb4669542871dc5815f5fe9b0d931f43d79 Mon Sep 17 00:00:00 2001 From: spellingcat <70864274+spellingcat@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:35:41 -0700 Subject: [PATCH 2/4] not tested yet but find new cancoder offsets for intake --- .../subsystems/intake/SlapdownSubsystem.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java b/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java index 9d7346bf..e4f81962 100644 --- a/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java @@ -32,7 +32,7 @@ public class SlapdownSubsystem extends SubsystemBase implements Intake { public static final Rotation2d PIVOT_RETRACTED_POSITION = PIVOT_MAX_POSITION; public static final double CURRENT_ZEROING_THRESHOLD = 30.0; // TODO: TUNE public static final double ROLLER_GEAR_RATIO = 60.0 / 29.0; - public static final double PIVOT_GEAR_RATIO = 36.17578125;//39.375; + public static final double PIVOT_GEAR_RATIO = 36.17578125; // 39.375; private final PivotIO pivotIO; private PivotIOInputsAutoLogged pivotIOInputs = new PivotIOInputsAutoLogged(); @@ -91,12 +91,12 @@ public void simulationPeriodic() { @Override public Command agitate() { return Commands.sequence( - this.run( - () -> { - //maybe needs to go slower but idrk how to do that rn - pivotIO.setMotorPositionSetpoint(PIVOT_EXTENDED_POSITION); - rollerIO.setRollerVelocity(10.0); - }) + this.run( + () -> { + // maybe needs to go slower but idrk how to do that rn + pivotIO.setMotorPositionSetpoint(PIVOT_EXTENDED_POSITION); + rollerIO.setRollerVelocity(10.0); + }) // .until(atExtensionTrigger), // this.run( // () -> { @@ -106,7 +106,7 @@ public Command agitate() { // }) // .until(atExtensionTrigger)) // .repeatedly(); - ); + ); } @Override @@ -244,8 +244,8 @@ public static TalonFXConfiguration getRollerConfig() { public static CANcoderConfiguration getCancoderConfig() { CANcoderConfiguration config = new CANcoderConfiguration(); - config.MagnetSensor.SensorDirection = SensorDirectionValue.Clockwise_Positive; - config.MagnetSensor.MagnetOffset = 0.26196; + config.MagnetSensor.SensorDirection = SensorDirectionValue.CounterClockwise_Positive; + config.MagnetSensor.MagnetOffset = 0.510498; config.MagnetSensor.AbsoluteSensorDiscontinuityPoint = 0.5; return config; From 11b7cd6bdedc9cebfc7a7ba575496134ef393b3e Mon Sep 17 00:00:00 2001 From: spellingcat <70864274+spellingcat@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:53:13 -0700 Subject: [PATCH 3/4] goated --- .../subsystems/intake/SlapdownSubsystem.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java b/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java index e4f81962..c853c4b7 100644 --- a/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java @@ -25,7 +25,8 @@ import org.littletonrobotics.junction.Logger; public class SlapdownSubsystem extends SubsystemBase implements Intake { - public static final Rotation2d PIVOT_MIN_POSITION = Rotation2d.fromRotations(-0.052002); + public static final Rotation2d PIVOT_MIN_POSITION = + Rotation2d.fromDegrees(-26.894531); // Rotation2d.fromRotations(-0.052002); public static final Rotation2d PIVOT_MAX_POSITION = Rotation2d.fromDegrees(122); // Not so sure abt this one... public static final Rotation2d PIVOT_EXTENDED_POSITION = PIVOT_MIN_POSITION; @@ -112,10 +113,17 @@ public Command agitate() { @Override public Command intake() { return this.run( - () -> { - pivotIO.setMotorPositionSetpoint(PIVOT_EXTENDED_POSITION); - rollerIO.setRollerVelocity(80); - }); + () -> { + pivotIO.setMotorPositionSetpoint(PIVOT_EXTENDED_POSITION); + rollerIO.setRollerVelocity(80); + }) + .until(atExtensionTrigger) + .andThen( + this.run( + () -> { + pivotIO.setMotorVoltage(0); + rollerIO.setRollerVelocity(80); + })); } @Override @@ -222,7 +230,7 @@ public static TalonFXConfiguration getRollerConfig() { TalonFXConfiguration config = new TalonFXConfiguration(); config.MotorOutput.NeutralMode = NeutralModeValue.Brake; - config.MotorOutput.Inverted = InvertedValue.CounterClockwise_Positive; // TODO + config.MotorOutput.Inverted = InvertedValue.Clockwise_Positive; // TODO config.Feedback.SensorToMechanismRatio = ROLLER_GEAR_RATIO; @@ -233,7 +241,7 @@ public static TalonFXConfiguration getRollerConfig() { config.Slot0.kD = 0.0; // TODO: TUNE - config.CurrentLimits.StatorCurrentLimit = 55.0; + config.CurrentLimits.StatorCurrentLimit = 25.0; config.CurrentLimits.StatorCurrentLimitEnable = true; config.CurrentLimits.SupplyCurrentLimit = 40.0; config.CurrentLimits.SupplyCurrentLimitEnable = true; From 2b6a3ab286671ac269f984d672b25c899f7dd335 Mon Sep 17 00:00:00 2001 From: spellingcat <70864274+spellingcat@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:56:55 -0700 Subject: [PATCH 4/4] fix retraction lol --- .../java/frc/robot/subsystems/intake/SlapdownSubsystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java b/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java index c853c4b7..fbfe3039 100644 --- a/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java +++ b/src/main/java/frc/robot/subsystems/intake/SlapdownSubsystem.java @@ -95,7 +95,7 @@ public Command agitate() { this.run( () -> { // maybe needs to go slower but idrk how to do that rn - pivotIO.setMotorPositionSetpoint(PIVOT_EXTENDED_POSITION); + pivotIO.setMotorPositionSetpoint(PIVOT_RETRACTED_POSITION); rollerIO.setRollerVelocity(10.0); }) // .until(atExtensionTrigger),