Updated PID and Motor constants

Added PID to constants
Used michaels candevice type for motor
This commit is contained in:
Michael Mikovsky
2025-01-17 20:09:14 -07:00
parent 32115fa977
commit faf17348c3
3 changed files with 10 additions and 11 deletions
+6 -4
View File
@@ -328,9 +328,8 @@ public final class Constants {
}
public static final class ElevatorConstants {
public static final class IDs {
public static final int ELEVATOR_ID = 420;
}
public static final CanDevice ELEVATOR_ID = new CanDevice("Elevator", 724);
public static final double LEVEL_1 = 123;
public static final double LEVEL_2 = 123;
public static final double ELEVATOR_MAX_HEIGHT = 123;
@@ -338,6 +337,9 @@ public final class Constants {
public static final double ELEVATOR_SPEED_DOWN = -123;
public static final Slot0Configs ELEVATOR_PID = new Slot0Configs()
.withKP(0)
.withKI(0)
.withKD(0);
}
}
+1 -1
View File
@@ -51,7 +51,7 @@ public class RobotMap {
);
/* Elevator Subsystem */
public final TalonFX elevator = new TalonFX(ElevatorConstants.IDs.ELEVATOR_ID);
public final TalonFX elevator = new TalonFX(ElevatorConstants.ELEVATOR_ID.id);
void configureDriveMotorControllers() {}
}
@@ -19,13 +19,10 @@ public class Elevator extends SubsystemBase {
public Elevator(TalonFX elevatorTalonFX) {
elevatorMotor = elevatorTalonFX;
elevatorMotor.setNeutralMode(NeutralModeValue.Coast);
elevatorMotor.setNeutralMode(NeutralModeValue.Brake);
var PIDConfigs = new Slot0Configs();
PIDConfigs.kP = 0;
PIDConfigs.kI = 0;
PIDConfigs.kD = 0;
elevatorMotor.getConfigurator().apply(PIDConfigs);
elevatorMotor.getConfigurator().apply(ElevatorConstants.ELEVATOR_PID);
}
//PID methods