Talon SRX Magnetic Encoders

We are trying the new magnetic encoders plugged into the Talon SRX. When we read the encoder values in our java code, the values (both quad and analog) are constantly changing, floating around a center point (if you will) but are not steady values like you see with regular encoders. If you move the magnet, the values do change but never settle to a constant value. The velocity values also are constantly changing. We must be missing something. I can’t see how you can use encoder values that don’t sit a zero when not moving and increase decrease at a constant rate when moving. You can’t look for a particular number of encoder counts or do feedback if the values are constantly changing even when you are not moving.

1 Like

Post your code, and pictures of your wiring.

Also how much is the data changing (plus/minus units).

This is what I would expect if the magnet is not aligned. Is the sensor LED green?

The values vary 20-30 units on pwm and quad, less on analog and if we are careful holding the encoder, the analog settles down. Light is green. Note we are hand holding the encoder for testing as the mount is not built yet. Perhaps that is the problem…but we thought of that and are bracing it and holding as still as possible.

Ok. So it is the manual “mount”. No matter how carefully you hold it you can’t hold it still enough. An actual mount seems to settle it down…though it is very sensitive and may drift a bit but I think that cures it.

20-30 units is about 2 degrees (4096 is one rotation).

You could try placing the magnet in such a way where the entire system is at rest (hands off) and LED is green. Or just continue using your mount.

Analog? You mean the analog input on the Talon SRX? That’s not wired in the CTRE Mag Encoder, so I expect that to be ~100 (section 16.21 Talon SRX software reference manual).