Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.

Commit e9fb11e

Browse files
committed
idk
1 parent 5a6664c commit e9fb11e

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

src/main/java/frc/robot/arm/ArmConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static class ShoulderConstants {
4444
}
4545

4646
/** Maximum speed of the shoulder in rotations per second. */
47-
public static final double MAXIMUM_SPEED = Units.degreesToRotations(120.0);
47+
public static final double MAXIMUM_SPEED = Units.degreesToRotations(240.0);
4848

4949
/** Maximum acceleration of the shoulder in rotations per second per second. */
5050
public static final double MAXIMUM_ACCELERATION =
@@ -67,6 +67,6 @@ public static class ShoulderConstants {
6767

6868
public static final Rotation2d SKIM = Rotation2d.fromDegrees(30);
6969

70-
public static final Rotation2d AMP = Rotation2d.fromDegrees(60);
70+
public static final Rotation2d AMP = Rotation2d.fromDegrees(80);
7171
}
7272
}

src/main/java/frc/robot/shooter/Shooter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ public void periodic() {
6262
setpoint = goal;
6363

6464
double flywheelSetpoint = FlywheelConstants.ACCELERATION_LIMITER.calculate(setpoint.flywheelVelocityRotationsPerSecond());
65+
double serializerSetpoint = SerializerConstants.ACCELERATION_LIMITER.calculate(setpoint.serializerVelocityRotationsPerSecond());
6566

6667
flywheel.setSetpoint(flywheelSetpoint);
67-
serializer.setSetpoint(setpoint.serializerVelocityRotationsPerSecond());
68+
serializer.setSetpoint(serializerSetpoint);
6869
}
6970

7071
@Override

src/main/java/frc/robot/shooter/ShooterConstants.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public static class SerializerConstants {
4242

4343
/** Maximum speed in rotations per second. */
4444
public static final double MAXIMUM_SPEED = 45.319;
45+
46+
public static final SlewRateLimiter ACCELERATION_LIMITER = new SlewRateLimiter(MotionProfileCalculator.calculateAcceleration(MAXIMUM_SPEED, 0.1));
4547
}
4648

4749
/** Constants for the flywheel motor used in the shooter subsystem. */
@@ -54,7 +56,7 @@ public static class FlywheelConstants {
5456

5557
static {
5658
PIDF.kS = 0.14;
57-
PIDF.kV = 0.2539;
59+
PIDF.kV = 0.1969;
5860
}
5961

6062
/** Flywheel's controller constants. */
@@ -67,15 +69,17 @@ public static class FlywheelConstants {
6769
CONTROLLER_CONSTANTS.sensorToMechanismRatio = 28.0 / 16.0;
6870
}
6971

70-
public static final double SPEAKER_SPEED = 44;
72+
public static final double PULL_SPEED = -20;
73+
74+
public static final double SPEAKER_SPEED = 60;
7175

72-
public static final double PASS_SPEED = 44;
76+
public static final double PASS_SPEED = 60;
7377

7478
public static final double AMP_SPEED = 20;
7579

7680
/** Maximum speed in rotations per second. */
77-
public static final double MAXIMUM_SPEED = 46.711;
81+
public static final double MAXIMUM_SPEED = 60;
7882

79-
public static final SlewRateLimiter ACCELERATION_LIMITER = new SlewRateLimiter(MotionProfileCalculator.calculateAcceleration(MAXIMUM_SPEED, 0.25));
83+
public static final SlewRateLimiter ACCELERATION_LIMITER = new SlewRateLimiter(MotionProfileCalculator.calculateAcceleration(MAXIMUM_SPEED, 0.1));
8084
}
8185
}

src/main/java/frc/robot/shooter/ShooterState.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public record ShooterState(
1313

1414
public static final ShooterState INTAKE = new ShooterState(0, SerializerConstants.INTAKE_SPEED);
1515

16-
public static final ShooterState PULL = new ShooterState(0, SerializerConstants.PULL_SPEED);
16+
public static final ShooterState PULL = new ShooterState(FlywheelConstants.PULL_SPEED, SerializerConstants.PULL_SPEED);
1717

1818
public static final ShooterState EJECT = new ShooterState(0, SerializerConstants.EJECT_SPEED);
1919

@@ -34,8 +34,8 @@ public record ShooterState(
3434

3535
public boolean at(ShooterState other) {
3636
return MathUtil.isNear(
37-
flywheelVelocityRotationsPerSecond, other.flywheelVelocityRotationsPerSecond, 2.5)
37+
flywheelVelocityRotationsPerSecond, other.flywheelVelocityRotationsPerSecond, 5)
3838
&& MathUtil.isNear(
39-
serializerVelocityRotationsPerSecond, other.serializerVelocityRotationsPerSecond, 2.5);
39+
serializerVelocityRotationsPerSecond, other.serializerVelocityRotationsPerSecond, 5);
4040
}
4141
}

0 commit comments

Comments
 (0)