mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
current limits for drive
This commit is contained in:
@@ -112,6 +112,18 @@ public final class Constants {
|
|||||||
public static final double TICK_TIME_TO_SECONDS = 0.1;
|
public static final double TICK_TIME_TO_SECONDS = 0.1;
|
||||||
public static final double SECONDS_TO_TICK_TIME = 1 / TICK_TIME_TO_SECONDS;
|
public static final double SECONDS_TO_TICK_TIME = 1 / TICK_TIME_TO_SECONDS;
|
||||||
|
|
||||||
|
// current limits
|
||||||
|
public static final SupplyCurrentLimitConfiguration SUPPLY_CURRENT_LIMIT_CONFIG_STEER = new SupplyCurrentLimitConfiguration(
|
||||||
|
false, 10, 0, 0);
|
||||||
|
public static final StatorCurrentLimitConfiguration STATOR_CURRENT_LIMIT_CONFIG_STEER = new StatorCurrentLimitConfiguration(
|
||||||
|
false, 15, 0, 0);
|
||||||
|
|
||||||
|
public static final SupplyCurrentLimitConfiguration SUPPLY_CURRENT_LIMIT_CONFIG_WHEEL = new SupplyCurrentLimitConfiguration(
|
||||||
|
false, 10, 0, 0);
|
||||||
|
public static final StatorCurrentLimitConfiguration STATOR_CURRENT_LIMIT_CONFIG_WHEEL = new StatorCurrentLimitConfiguration(
|
||||||
|
false, 15, 0, 0);
|
||||||
|
|
||||||
|
|
||||||
// misc
|
// misc
|
||||||
public static final int SMARTDASHBOARD_UPDATE_FRAME = 2;
|
public static final int SMARTDASHBOARD_UPDATE_FRAME = 2;
|
||||||
public static final Pose2d HUB_POSE = new Pose2d(new Translation2d(0, 0), new Rotation2d(0));
|
public static final Pose2d HUB_POSE = new Pose2d(new Translation2d(0, 0), new Rotation2d(0));
|
||||||
|
|||||||
@@ -138,6 +138,28 @@ public class RobotMap {
|
|||||||
rightBackSteerMotor.setNeutralMode(mode);
|
rightBackSteerMotor.setNeutralMode(mode);
|
||||||
rightBackWheelMotor.setNeutralMode(mode);// Coast
|
rightBackWheelMotor.setNeutralMode(mode);// Coast
|
||||||
|
|
||||||
|
// current limits
|
||||||
|
|
||||||
|
leftFrontSteerMotor.configSupplyCurrentLimit(SwerveDriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG_STEER);
|
||||||
|
rightFrontSteerMotor.configSupplyCurrentLimit(SwerveDriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG_STEER);
|
||||||
|
leftBackSteerMotor.configSupplyCurrentLimit(SwerveDriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG_STEER);
|
||||||
|
rightBackSteerMotor.configSupplyCurrentLimit(SwerveDriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG_STEER);
|
||||||
|
|
||||||
|
leftFrontWheelMotor.configSupplyCurrentLimit(SwerveDriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG_WHEEL);
|
||||||
|
rightFrontWheelMotor.configSupplyCurrentLimit(SwerveDriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG_WHEEL);
|
||||||
|
leftBackWheelMotor.configSupplyCurrentLimit(SwerveDriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG_WHEEL);
|
||||||
|
rightBackWheelMotor.configSupplyCurrentLimit(SwerveDriveConstants.SUPPLY_CURRENT_LIMIT_CONFIG_WHEEL);
|
||||||
|
|
||||||
|
leftFrontSteerMotor.configStatorCurrentLimit(SwerveDriveConstants.STATOR_CURRENT_LIMIT_CONFIG_STEER);
|
||||||
|
rightFrontSteerMotor.configStatorCurrentLimit(SwerveDriveConstants.STATOR_CURRENT_LIMIT_CONFIG_STEER);
|
||||||
|
leftBackSteerMotor.configStatorCurrentLimit(SwerveDriveConstants.STATOR_CURRENT_LIMIT_CONFIG_STEER);
|
||||||
|
rightBackSteerMotor.configStatorCurrentLimit(SwerveDriveConstants.STATOR_CURRENT_LIMIT_CONFIG_STEER);
|
||||||
|
|
||||||
|
leftFrontWheelMotor.configStatorCurrentLimit(SwerveDriveConstants.STATOR_CURRENT_LIMIT_CONFIG_WHEEL);
|
||||||
|
rightFrontWheelMotor.configStatorCurrentLimit(SwerveDriveConstants.STATOR_CURRENT_LIMIT_CONFIG_WHEEL);
|
||||||
|
leftBackWheelMotor.configStatorCurrentLimit(SwerveDriveConstants.STATOR_CURRENT_LIMIT_CONFIG_WHEEL);
|
||||||
|
rightBackWheelMotor.configStatorCurrentLimit(SwerveDriveConstants.STATOR_CURRENT_LIMIT_CONFIG_WHEEL);
|
||||||
|
|
||||||
leftFront = new SwerveModule(leftFrontWheelMotor, leftFrontSteerMotor, leftFrontEncoder,
|
leftFront = new SwerveModule(leftFrontWheelMotor, leftFrontSteerMotor, leftFrontEncoder,
|
||||||
SwerveDriveConstants.LEFT_FRONT_ENCODER_OFFSET);
|
SwerveDriveConstants.LEFT_FRONT_ENCODER_OFFSET);
|
||||||
leftBack = new SwerveModule(leftBackWheelMotor, leftBackSteerMotor, leftBackEncoder,
|
leftBack = new SwerveModule(leftBackWheelMotor, leftBackSteerMotor, leftBackEncoder,
|
||||||
@@ -237,10 +259,8 @@ public class RobotMap {
|
|||||||
void configureIntakeMotors(){
|
void configureIntakeMotors(){
|
||||||
intakeMotor.configFactoryDefault();
|
intakeMotor.configFactoryDefault();
|
||||||
intakeMotor.setNeutralMode(NeutralMode.Coast);
|
intakeMotor.setNeutralMode(NeutralMode.Coast);
|
||||||
intakeMotor.configSupplyCurrentLimit(IntakeConstants.SUPPLY_CURRENT_LIMIT_CONFIG_INTAKE,
|
intakeMotor.configSupplyCurrentLimit(IntakeConstants.SUPPLY_CURRENT_LIMIT_CONFIG_INTAKE);
|
||||||
ShooterConstants.SHOOTER_TIMEOUT_MS);
|
intakeMotor.configStatorCurrentLimit(IntakeConstants.STATOR_CURRENT_LIMIT_CONFIG_INTAKE);
|
||||||
intakeMotor.configStatorCurrentLimit(IntakeConstants.STATOR_CURRENT_LIMIT_CONFIG_INTAKE,
|
|
||||||
ShooterConstants.SHOOTER_TIMEOUT_MS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Storage Subsystem */
|
/* Storage Subsystem */
|
||||||
|
|||||||
Reference in New Issue
Block a user