I was trying to find a way to make sure that a shooter flywheel maintained a constant velocity even when a power cell is being shot using a PID loop. Has anyone done this, and how so? Considering that a command-based structure is being used, did you use the PID on the motor controllers in the falcon? Used something from the WPILib structures? Made your own PID structure? For reference, the shooter being software-d will be a hooded shooter using 2 Falcon 500 motors geared at a 1:1.333 ratio and a 4-inch flywheel and 1.5 inches of compression.
I would recommend using PID on the motor controller, with kP, kV, and kS values determined through the WPILib characterization tool. The arbitrary feed forward can be used to eliminate the need for an I or D term, so you only need P.
If you post more info, I may be able to help. Or you can create a new thread that describes what problems you’re having.
When you shoot a power cell, your velocity is going to go down. It’s going to be very difficult to have a PID loop that will keep the velocity perfectly at the set point when you put in a power cell. The PID loop for the velocity can be used to get back to the desired velocity quicker. The advantage of using a velocity PID loop is also that you will get consistent results no matter what the battery voltage is
The optimal way to take care of this is to use a Velocity Control setup.
Integrated PID within your CTRE motor controllers is the easiest way to do this is follow their instructions here. We tuned a shooter in about an hour that could shoot all five balls under a second from 25’ away without missing any of them by going step by step.
Hi,
We have 2 x Neo+SparkMAX driving a single hex shaft with flywheels. The Neos are mounted on 2 ends of the shooter and connected to the shaft using chain/sprockets. In such setup, what is the right way to do closed loop velocity control implementation?
a) Setup a closed loop velocity controller on each SparkMAX separately with the same PIDF coefficients.
b) Make one SparkMAX leader and the other one follower, and setup closed loop velocity control only on the leader.
If the motors are mechanically coupled (even if at a distance), make one a follower. If you have separate loops they will likely fight each other at least some of the time.