Skip to content

Dynamic Power Shedding

Modern FRC hardware—specifically Krakens and Falcons—can pull more power than a 12V battery can safely provide. MARSLib approaches this ceiling as an opportunity for Innovation. By implementing dynamic Power Shedding, we ensure our robot has the maximum Impact on the field without compromising hardware Safety. This journey of Discovery teaches every programmer how to manage finite electrical resources—a critical skill for professional engineering.

Most teams solve this by configuring static breaker current limits. This is a compromise. It neuters your robot’s acceleration when the battery is fully charged at 12.8V just to protect it when it drops to 9V.

In MARSLib, we use the MARSPowerManager to implement Voltage Scaling and Power Shedding. Instead of static stator current bounds, our subsystems dynamically cap their output voltage based on the real-time health of the battery.

// Inside an IO implementation's periodic loop
double currentSystemVoltage = MARSPowerManager.getInstance().getBatteryVoltage();
double maxAllowedVoltage = 12.0;
if (currentSystemVoltage < 9.5) {
// Battery is sagging heavily, shed power from non-essentials
maxAllowedVoltage = 3.0; // Throttle intake to prevent brownout
}
motor.setVoltage(MathUtil.clamp(requestedVoltage, -maxAllowedVoltage, maxAllowedVoltage));

Not all subsystems are created equal. When the MARSPowerManager detects a critical system voltage sag (e.g., &lt; 9.5V), it initiates a lockdown phase. The framework groups mechanisms into three distinct tiers:

  • TIER 1 (Critical): Drivetrain Swerve Modules. These never scale down. Losing traction or evasiveness is unacceptable.

  • TIER 2 (High): Shooter Flywheels & Pivot. Voltage output is slightly scaled to ensure consistent shots, but not remove.

  • TIER 3 (Sheddable): Intakes, Feeders, and LEDs. If the voltage drops to 9V, these subsystems are aggressively clamped to a maximum output of 2-3 Volts until the battery recovers.