AGHSEagleRobotics / frc1388-2022

FRC 2022 - Rapid React
2 stars 0 forks source link

Set current limits to prevent drivetrain from popping breakers #44

Closed jv65537 closed 2 years ago

jv65537 commented 2 years ago

Other teams have experienced popping breakers from Falcon-based drivetrain. 1388 experienced what was possibly caused by this issue at least 3 times in competition in the LA North competition in 2020.

Drivetrain breakers are 40amp.

https://docs.ctre-phoenix.com/en/latest/ch13_MC.html#new-api-in-2020

// Supply Current is the current that passes into the controller from the supply
// Use supply current limits to prevent breakers from tripping

// The new API leverages the configSupplyCurrentLimit and configStatorCurrentLimit routines. The configs are similar
// to the existing legacy API, but the configs have been renamed to better communicate the design intent. For example,
// instead of configPeakCurrentLimit, the setting is referred to as triggerThresholdCurrent.

//                                                                enabled | Limit(amp) | Trigger Threshold(amp) | Trigger Threshold Time(s)  */
  _tal.configStatorCurrentLimit(new StatorCurrentLimitConfiguration(true,      20,                25,                1.0));
  _tal.configSupplyCurrentLimit(new SupplyCurrentLimitConfiguration(true,      10,                15,                0.5));