Best Practice for Flywheel Motors

We are currently using 2 NEO’s to drive our shooter. We set our flywheel to run at 2500 rpm from the time the robot was enabled so we would not have to accelerate the wheels as much to get to the RPM needed for a shot from a particular distance. Our actual spot speed varies from 3000 to 6000 rpm depending on how far we need to shoot. After shooting our RPM returns to our setpoint of 2500. We are curious if the better practice would be to turn off the shooter motors and let the motors go into coast mode, until we need to shoot again. It seems the motors are getting warm during a simulated match, and we are not sure if the motor “braking” from a higher RPM to our setpoint is putting more strain on the motors, rather than just letting them coast.

Any advice would be appreciated.

Your motors are almost certainly getting hot because they’re running all match without a break. You should probably turn off your shooter while you’re driving around collecting balls to give them time to cool and to save battery power. Then you can use a button on the driver station to spin up the flywheel when you’re going to shoot. That way it will still be ready when you need it.

As far as brake vs coast mode, that shouldn’t make any significant difference. It only matters when the motor is commanded to zero whether or not the back-EMF generated by backdriving the motor is used to oppose that backdriving force. It certainly won’t make a difference if you’re running the shooter for the whole match (because then the motors will never be commanded to zero), and if you stop them when not shooting it will only affect how quickly the shooter decelerates.

2 Likes

If you use a control loop to spin down your motor, it is possible that they get commanded to brake. Either way it’s certainly best practice to keep them on coast. Regardless, brake mode will not be causing the heat issues. I concur that you should put them on coast and then command them to 0% while not actively shooting or spinning up.

Not disagreeing with you. But just to keep the terminology clear here, are we saying “brake” means “commanded to zero on brake mode” or “applied voltage in the opposite direction of velocity”? Cause those are two very different cases

Thanks for the input. We didn’t think that the motors would be drawing much as the inertia of the flywheel would still be present.

We will plan on going back and double checking that each motor controller is coast mode, before setting the motors to just turn off after shooting. My recollection is that the motors don’t want to spin freely in brake mode as long as there is volatge applied to the robot. I am concerned that in brake mode that just turning off the motor could have an adverse consequence (break stuff).

I did mean brake mode as in shorting the motor leads at 0% command. Unlikely, but possible momentarily, especially if you set your PID loop to have a minimum output of 0% and have aggressive gains.

The motor will still be drawing current even with the flywheel in the system because of the motor’s free current and in order to overcome friction in the system. You can compare that power requirement to the energy needed to accelerate the system from standstill and get a “breakeven” time. (i.e. for a break shorter than that it’s better to keep the system spinning, for a longer break it’s better to stop and restart). I expect that breakeven time to be shorter than it would take to drive around the field and collect 5 balls.

 

Agreed. That’s why I said it will only make a difference in deceleration speed (not heat generation, steady-state power requirements, etc.), and won’t matter at all if they keep the shooter spinning the whole match.

According to the SparkMAX docs:

…so I wouldn’t use brake, but coast should be fine.

I prefer to think of it in terms of energy. When you accelerate, the motor controller and motor are taking energy from the battery and transferring it into flywheel kinetic energy. To keep it at the same speed, you need to provide a trickle of power from the battery to make up for losses like friction and resistance.

To decelerate, you need to dump kinetic energy out of the flywheel system. While it’s just sitting there rotating, the motor is acting like a generator and producing an internal voltage (called back EMF). In coast there’s nowhere for it to go. There’s no braking resistor to dump energy out into, so the brake feature just uses the motor as a resistor and converts the energy to heat.

The other place to put it is back in the battery. If you take a SparkMAX connected to a motor and disconnected from the PDP, and you spin the motor, it will actually power the SparkMAX controller. If you plug it into the PDP, you can actually see it back power other devices (I think I saw this happen).

Now that I think about it, I doubt it can dump energy to the battery. If you were running the motor at 50% speed, then it would be generating roughly 6V back EMF. If you’re actually connected to a battery, I don’t see how you could get the 6V to go “uphill” back into the battery like that.

But, it’s not clear to me what would happen when you give it a reverse command. The motor suddenly has a -6V back EMF? Yeah… maybe someone else can explain it better.