Skip to content

Commit

Permalink
added current limits for swerve steering
Browse files Browse the repository at this point in the history
  • Loading branch information
r4stered committed May 26, 2024
1 parent 4ae2695 commit d57cc75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/cpp/str/SwerveModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ ctre::phoenix::StatusCode SwerveModule::ConfigureSteerMotor(bool invertSteer) {
steerConfig.CurrentLimits.SupplyCurrentLimit =
constants::swerve::physical::SUPPLY_CURRENT_LIMIT.value();

steerConfig.TorqueCurrent.PeakForwardTorqueCurrent =
constants::swerve::physical::SWERVE_STEER_CURRENT_LIMIT.value();
steerConfig.TorqueCurrent.PeakReverseTorqueCurrent =
-constants::swerve::physical::SWERVE_STEER_CURRENT_LIMIT.value();

return steerMotor.GetConfigurator().Apply(steerConfig);
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/include/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ inline constexpr double BR_ENCODER_OFFSET = 0.112793;
inline constexpr units::ampere_t SLIP_CURRENT = 180_A;
inline constexpr units::ampere_t SUPPLY_CURRENT_LIMIT = 80_A;

inline constexpr units::ampere_t SWERVE_STEER_CURRENT_LIMIT = 40_A;

inline constexpr std::array<frc::Translation2d, 4> moduleLocations{
frc::Translation2d{WHEELBASE_LENGTH / 2, WHEELBASE_WIDTH / 2},
frc::Translation2d{WHEELBASE_LENGTH / 2, -WHEELBASE_WIDTH / 2},
Expand Down

0 comments on commit d57cc75

Please sign in to comment.