I should have been clearer:
The "low_command" is a tuning constant
the target speed, and was not
intended to be so low that it tops out at a speed below the "spinup_speed". "low_command" should be high enough that it briskly accelerates up to (and beyond) spinup_speed, at which point the full voltage is applied.
Many shooter wheel setups can handle application of full voltage to the motor even at zero RPM, but some can't. It's a function of the gear ratio and the wheel inertia and the motor being used. For such setups, simply set spinup_speed=0.0
The code I posted was for those shooter setups that can't handle a full 12 volts being applied at zero RPM, but could, for example, handle, say, 8 volts at zero RPM and 12 volts at 1000 RPM. For that example, you would set spinup_speed to 1000 RPM and low_command to 8 volts. Simple, and gets the job done.
With the code I posted, the minimum continuous RPM is simply commanded as the target speed
by each team's software to whatever they want it to be
, and the code I posted will bang-bang regulate at that speed
. That target speed can be zero if the team so desires.
finicky setups (e.g. high inertia wheel, not much gear ratio), you could always add a third "else" statement:
if (measured_speed >= target_speed) motor_command = 0.0;
else if (measured_speed >= spinup_speed) motor_command = 1.0;
else if (measured_speed >= medium_speed) motor_command = medium_command;
else motor_command = low_command;