pub unsafe extern "C" fn CANSparkMax_SetSecondaryCurrentLimit(
this: *mut CANSparkMax,
limit: f64,
limitCycles: c_int,
) -> REVLibErrorExpand description
Sets the secondary current limit in Amps.
The motor controller will disable the output of the controller briefly if the current limit is exceeded to reduce the current. This limit is a simplified ‘on/off’ controller. This limit is enabled by default but is set higher than the default Smart Current Limit.
The time the controller is off after the current limit is reached is determined by the parameter limitCycles, which is the number of PWM cycles (20kHz). The recommended value is the default of 0 which is the minimum time and is part of a PWM cycle from when the over current is detected. This allows the controller to regulate the current close to the limit value.
The total time is set by the equation
@code t = (50us - t0) + 50us * limitCycles t = total off time after over current t0 = time from the start of the PWM cycle until over current is detected @endcode
@param limit The current limit in Amps. @param limitCycles The number of additional PWM cycles to turn the driver off after overcurrent is detected.