|
Re: PID on a one directional Shooter
Your problem is similar to what we implemented in 2006 for our shooter wheel. From your description, it sounds like the error you're using for PID is the speed difference and the result of the PID calculation is sent directly to the speed controller. This isn't what you want to do.
The way to accomplish this is to get a PWM value that typically gives you the correct steady state shooter speed, or close enough to it. Then use the speed difference as the error in your PID calculation. Now use the PID result not as your absolute PWM value, but instead add it to the typical steady state PWM value. This way if you're going too slow, you'll get an extra boost of power and if you're going too fast, you'll decrease power slightly instead of shutting the motor off or running it in reverse.
For example, through experimentation you learn that a PWM value of .7 usually gives you a shooter speed of 1000 RPM when there are no balls running through it. Run PID on the difference between your current shooter speed and 1000. Add the result of the PID calculation to .7 and set your speed controller to that value.
The PID calculation should not give you huge numbers, but the steady state PWM value + the maximum PID result you see should be enough to give you full power on the speed controller.
|