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

Commit 3fa5ec7

Browse files
committed
fix(intake): Improve intake tune.
1 parent 3c9b273 commit 3fa5ec7

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

src/main/java/frc/lib/controller/VelocityControllerIO.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ public static void addToShuffleboard(
5757
velocityController.addDouble(
5858
"Acceleration (dpsps)",
5959
() -> Units.rotationsToDegrees(values.accelerationRotationsPerSecondPerSecond));
60+
velocityController.addDouble(
61+
"Velocity (rps)", () -> values.velocityRotationsPerSecond);
62+
velocityController.addDouble(
63+
"Acceleration (rpsps)",
64+
() -> values.accelerationRotationsPerSecondPerSecond);
65+
velocityController.addDouble(
66+
"Velocity (rpm)", () -> values.velocityRotationsPerSecond * 60);
67+
velocityController.addDouble(
68+
"Acceleration (rpmpm)",
69+
() -> values.accelerationRotationsPerSecondPerSecond * 60);
6070
velocityController.addDouble("Voltage (V)", () -> values.motorVolts);
6171
velocityController.addDouble("Current (A)", () -> values.motorAmps);
6272
}

src/main/java/frc/robot/RobotConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ public enum Subsystem {
4747
EnumSet.of(
4848
Subsystem.ARM, Subsystem.INTAKE, Subsystem.ODOMETRY, Subsystem.SHOOTER, Subsystem.SWERVE);
4949

50-
public static final Set<Subsystem> REAL_SUBSYSTEMS = EnumSet.of(Subsystem.ARM);
50+
public static final Set<Subsystem> REAL_SUBSYSTEMS = EnumSet.of(Subsystem.INTAKE);
5151
}

src/main/java/frc/robot/intake/IntakeConstants.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public static class FrontRollerConstants {
1717
static {
1818
PIDF.kS = 0.13;
1919
PIDF.kV = 0.1683;
20+
PIDF.kP = 0.1;
2021
}
2122

2223
/** Front roller's controller constants. */
@@ -25,7 +26,7 @@ public static class FrontRollerConstants {
2526

2627
static {
2728
CONTROLLER_CONSTANTS.ccwPositive = false;
28-
CONTROLLER_CONSTANTS.neutralBrake = true;
29+
CONTROLLER_CONSTANTS.neutralBrake = false;
2930
CONTROLLER_CONSTANTS.sensorToMechanismRatio = 24.0 / 16.0;
3031
}
3132

@@ -38,14 +39,15 @@ public static class FrontRollerConstants {
3839
/** Constants for the back roller. */
3940
public static class BackRollerConstants {
4041
/** Back roller's CAN. */
41-
public static final CAN CAN = new CAN(50);
42+
public static final CAN CAN = new CAN(40);
4243

4344
/** Back roller's PIDF constants. */
4445
public static final PIDFConstants PIDF = new PIDFConstants();
4546

4647
static {
4748
PIDF.kS = 0.13;
4849
PIDF.kV = 0.1759;
50+
PIDF.kP = 0.1;
4951
}
5052

5153
/** Back roller's controller constants. */
@@ -54,7 +56,7 @@ public static class BackRollerConstants {
5456

5557
static {
5658
CONTROLLER_CONSTANTS.ccwPositive = false;
57-
CONTROLLER_CONSTANTS.neutralBrake = true;
59+
CONTROLLER_CONSTANTS.neutralBrake = false;
5860
CONTROLLER_CONSTANTS.sensorToMechanismRatio = 24.0 / 16.0;
5961
}
6062

src/main/java/frc/robot/intake/IntakeState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public record IntakeState(
1919
}
2020

2121
public boolean at(IntakeState other) {
22-
final double kToleranceRotationsPerSecond = 2.5;
22+
final double kToleranceRotationsPerSecond = 1;
2323

2424
return MathUtil.isNear(
2525
frontRollerVelocityRotationsPerSecond,

src/main/java/frc/robot/superstructure/Superstructure.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ public void addToShuffleboard(ShuffleboardTab tab) {
6565
ShuffleboardLayout state = Telemetry.addColumn(tab, "State");
6666

6767
state.addString(
68-
"Running Command",
68+
"State",
6969
() -> this.getCurrentCommand() != null ? this.getCurrentCommand().getName() : "NONE");
70+
71+
ShuffleboardLayout at = Telemetry.addColumn(tab, "At Goal?");
72+
73+
at.addBoolean("At Goal?", () -> at(goal));
7074
}
7175

7276
private void addStateToShuffleboard(

0 commit comments

Comments
 (0)