How to increase the Talon SRX encoder update freq

I am using a Talon SRX with a quadrature encoder attached to it’s data port. It is up and running and everything is working fine.

I would like to collect the encoder velocity (talon.getSpeed()) for analysis at a frequency of 50 times/sec. However, it is only being updated 10 times/sec. I understand that this is per the specification. See page 93 of https://www.ctr-electronics.com/Talon%20SRX%20Software%20Reference%20Manual.pdf.

The spec says the update frequency can be increased but I could not find out how to do it. Does anyone know how this can be done? I am using Java.

Thanks

CANTalon.setStatusFrameRateMs is what you’re looking for.

If you have CANTalon mLeftMotor, all you’d have to do to set it to a 50Hz update rate is
mLeftMotor.setStatusFrameRateMs(CANTalon.StatusFrameRate.Feedback, 20);

Careful of saturating the CAN bus.

How easy is it to use up the CAN bus bandwidth? I was having some issues with finding the position of the robot, and I think it may be partially due to having a low update rate on the encoders compared to the update rate on the roboRIO.

Considering that we have 4 Talons, the PCM, and the PDP connected to the CAN bus, what is the highest refresh rate we can safely use?

And since I don’t seem to have the ability to edit posts, I forgot to add that 2 of the Talons are connected to encoders, and 2 are set to follower mode.

CAN bandwidth is ~1 Mbps, IIRC. You should be fine in terms of bandwidth, but you don’t want to run 8 SRXs at 100Hz each. Your setup sounds like it would work fine.

Why not? See section 15.1 of the Talon SRX software reference manual.

Thanks, but it did not make any difference. I did find that getPosition() updated at 50 hz and I can make that work.

Thanks again

In Section 15.1 of the Software Manual, it says the default update frequency is actually 100 Hz (every 10 ms), as opposed to 10 Hz like you posted earlier.

The selected sensor speed is updated every 20ms by default…

Section 20.2. Feedback Status
The Feedback Status frame has a default period of 20ms, and provides…“Sensor Velocity: Velocity of the selected sensor”

…and can be overridden with the status frame rate API.

You should be fine on CAN bandwidth, but the SRX Software manual explains how to check the utilization in the driver station if need be.