|
Re: Talon SRX Encoders
What is the time delay in the loop that sends motor commands?
Using the Talons with encoders requires communication over CAN. There will be more latency than issuing a PWM command. In human-scale timing, it is imperceptible, but it is enough to make control loops appear to behave differently if the assumption is that you have a very fast and very consistent timing in your loop.
I don't know what programming language you are using, but for our team using LabView, we decoupled our control loops from the loop issuing motor commands. In this way, our correcting control runs as fast as we can get new data from our feedback sensor (a gyro), and the motor commands are issued more slowly, which allows for the CAN latency.
One last thing you may want to look at is the PIDF tuning on the talon itself. The PID on the talon runs at a very fast rate. The coefficients used on it will not be the same as what you would use on the RoboRio. You have to tune those to the motors and gearing attached. You may have an aggressive or unstable set of coefficients loaded on the Talons, which may be just fine when running on the RoboRio, or vice versa. I would reccomend making a program that ramps the speed up and down in both directions to tune the PID parameters. Step functions are fine for setting the P and I terms, but really good control can be attained by further tuning the D and F with a sawtooth input.
|