|
Re: CANTalon getEncVel update rate
Quote:
Originally Posted by Ken Streeter
Well, the good news is that the behavior you observed with the "step-like" updates of getEncVel every 5 cycles through the RoboRIO loop exactly matches the documented 100ms update rates for the API that fetches the values for the Encoder in the TalonSRX. This is because the Quadrature Encoder Status message is updated every 100ms.
This is described in the Talon SRX Software Reference Manual (see the links at https://www.ctr-electronics.com/talo...ical_resources ). The Quadrature Encoder Status frame is described in section 20.3. Your circumstance is also in the FAQ as question 16.9.
I know it's quite a tome, but there are some valuable things to be learned in the 160+ page Talon SRX Reference Manual.
The key thing to know in your specific usage scenario is that if you ensure your Talon in question is configured with the selected sensor being the Quadrature Encoder, you can then use the various calls like getSpeed() etc., as you found, to get information for the selected sensor, as that is updated every 20ms, as described in section 20.2 of the Talon SRX Reference Manual.
|
Thanks for the info.
We look things up in the reference manual whenever possible, but if you don't exactly know what to look for it's sufficiently lengthy that it can be difficult to find things. I confess I haven't read it cover-to-cover.
We generally don't like to use getSpeed, because we try to avoid using the Talon's internal unit scaling whenever possible (we like our units in RPS, not RPM, and it is easier just to make sure every function we call gives us native units and scale them ourselves).
__________________
"Mmmmm, chain grease and aluminum shavings..."
"The breakfast of champions!"
Member, FRC Team 449: 2007-2010
Drive Mechanics Lead, FRC Team 449: 2009-2010
Alumnus/Technical Mentor, FRC Team 449: 2010-Present
Lead Technical Mentor, FRC Team 4464: 2012-2015
Technical Mentor, FRC Team 5830: 2015-2016
|