Hi, we currently have an issue on our robot where the flywheel rpm will drop if we turn on our hopper instead of maintaining a constant rpm, which it’s able to do when the flywheel is running alone. we are running 2 falcons on our flywheel and a 775pro on our hopper. I remember last year when we had 775pros for our shooter and a bag motor for our hopper iirc, the flywheel speed would remain constant even when the hopper is ran. This issue is really hurting our ability to shoot consistently, does anyone know what could be the root of this problem?
How are you controlling your flywheel speed? Feedback (e.g. PID) or just feed forward (power control)? Feel free to share your code.
In general, pulling current out of a battery (from any mechanism) lowers the voltage it supplies to all mechanisms. In this case, it seems that the current draw from your hopper is sufficient to lower the voltage supplied to the intake sufficiently to produce a lower speed.
There are a number of ways around it. Mechanical modifications to ensure your hopper is drawing the minimum possible amount of current is one thing. Others include different software techniques to compensate for lower battery voltage.
All solutions will have a limit: the battery cannot supply infinite energy - it is possible you are at a limit of what the battery can supply.
Is there any chance you are applying the full output to the motor? IE the command is at 100%? If this is the case, then your speed will drop with battery voltage!
You always want some headroom on a shooter. 50% of maximum motor speed or so is a good idea, to maybe 75%
Voltage compensation can work wonders for consistency, so if you’re not doing that, I’d recommend you do. Our team voltage comps at 9.0v which does limit our maximum theoretical speed but ensures our robot shoots consistently all the time. I would also recommend also adding some sort of PID control on top of that, but just using voltage compensation should get you most the way there.
We’re using the PID in the CTRE velocity control mode.
we’re usually running at about 60% of maximum velocity on the shooter
Do you have driverstation logs? It would be useful to look at the currents.
Ok.
In cases like this, there’s a few things to be looking for in the data, during a period of time where you activate your hopper and observe a drop in battery voltage?
Does the percent/duty-cycle command increase by a noticeable amount during the hopper activation? It should, if the PID is properly compensating for having less voltage available to feed the motor.
Is the percent/duty-cycle command “railed” at or near 100% during the drop? If so, you’re “saturating” the PID’s ability to control the speed of the shooter wheel. I expect this to be unlikely given your comment about running at 60% of max speed, but it’s easy to check.
How close, both before and after hopper activation, is your desired and actual shooter wheel speed? A well tuned PID should be able to get within 100RPM without too much issue. If the PID constants are tuned in a “wacky” way without hopper load, adding the hopper load could cause additional and noticeable error.
Are you using a feed forward, and is it the “major” contributor to the final percent/duty-cycle control effort? If so, is that feed forward set up in a way to compensate for changes in battery voltage? If the feed forward is well-tuned but not battery-voltage-compensated, and the feedback is relatively weak, that could also cause the symptom you observe.