adjusted shooter for new flywheels

This commit is contained in:
2026-03-21 11:08:57 -04:00
parent 7e02ec1ccc
commit b8c376499b
2 changed files with 15 additions and 11 deletions

View File

@@ -362,7 +362,7 @@ public class RobotContainer {
secondary.setRumble(RumbleType.kBothRumble, 0); secondary.setRumble(RumbleType.kBothRumble, 0);
}, },
() -> false () -> false
).withTimeout(5) ).withTimeout(1)
); );
} }

View File

@@ -41,18 +41,18 @@ public class ShooterConstants {
public static final boolean kLeftShooterMotorInverted = true; public static final boolean kLeftShooterMotorInverted = true;
public static final boolean kRightShooterMotorInverted = false; public static final boolean kRightShooterMotorInverted = false;
public static final double kLeftP = 0.001; public static final double kLeftP = 0.04;//0.01;//0.001;
public static final double kLeftI = 0; public static final double kLeftI = 0;
public static final double kLeftD = 0; public static final double kLeftD = 0;//1.8;
public static final double kLeftS = 0; public static final double kLeftS = 0;
public static final double kLeftV = 0.0013; public static final double kLeftV = 0.00129;
public static final double kLeftA = 0; public static final double kLeftA = 0;
public static final double kRightP = 0.001; public static final double kRightP = 0.04;//0.001;//0.001;
public static final double kRightI = 0; public static final double kRightI = 0;
public static final double kRightD = 0.000; public static final double kRightD = 0;
public static final double kRightS = 0; public static final double kRightS = 0;
public static final double kRightV = 0.00121; public static final double kRightV = 0.00125;
public static final double kRightA = 0; public static final double kRightA = 0;
public static final double kMaxManualSpeedMultiplier = 1; public static final double kMaxManualSpeedMultiplier = 1;
@@ -77,13 +77,15 @@ public class ShooterConstants {
.inverted(kLeftShooterMotorInverted); .inverted(kLeftShooterMotorInverted);
kLeftMotorConfig.absoluteEncoder kLeftMotorConfig.absoluteEncoder
.positionConversionFactor(1) .positionConversionFactor(1)
.velocityConversionFactor(60); .velocityConversionFactor(60)
.averageDepth(16); // VERY IMPORTANT FOR RESPONSE OF FLYWHEEL DEFAULTS ARE DOGWATER
kLeftMotorConfig.closedLoop kLeftMotorConfig.closedLoop
.feedbackSensor(FeedbackSensor.kAbsoluteEncoder) .feedbackSensor(FeedbackSensor.kAbsoluteEncoder)
.pid(kLeftP, kLeftI, kLeftD) .pid(kLeftP, kLeftI, kLeftD, ClosedLoopSlot.kSlot0)
.outputRange(-1, 1) .outputRange(-1, 1)
//.allowedClosedLoopError(10.0, ClosedLoopSlot.kSlot0)
.feedForward .feedForward
.sva(kLeftS, kLeftV, kLeftA); .sva(kLeftS, kLeftV, kLeftA, ClosedLoopSlot.kSlot0);
kRightMotorConfig kRightMotorConfig
.idleMode(kShooterIdleMode) .idleMode(kShooterIdleMode)
@@ -92,12 +94,14 @@ public class ShooterConstants {
kRightMotorConfig.absoluteEncoder kRightMotorConfig.absoluteEncoder
.positionConversionFactor(1) .positionConversionFactor(1)
.velocityConversionFactor(60) .velocityConversionFactor(60)
.averageDepth(16)// VERY IMPORTANT FOR RESPONSE OF FLYWHEEL DEFAULTS ARE DOGWATER
.inverted(true); .inverted(true);
kRightMotorConfig.closedLoop kRightMotorConfig.closedLoop
.feedbackSensor(FeedbackSensor.kAbsoluteEncoder) .feedbackSensor(FeedbackSensor.kAbsoluteEncoder)
.pid(kRightP, kRightI, kRightD) .pid(kRightP, kRightI, kRightD)
.outputRange(-1, 1) .outputRange(-1, 1)
//.allowedClosedLoopError(10.0, ClosedLoopSlot.kSlot0)
.feedForward .feedForward
.sva(kRightS, kRightV, kRightA); .sva(kRightS, kRightV, kRightA, ClosedLoopSlot.kSlot0);
} }
} }