Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Talon SRX magnetic encoder issues (http://www.chiefdelphi.com/forums/showthread.php?t=146687)

cjl2625 04-04-2016 21:24

Talon SRX magnetic encoder issues
 
I've been having a strange issue with the SRX mag encoders, sometimes leading to rather catastrophic results.

Running them in absolute mode, I've seen an issue where the reading seems to unexpectedly jump. For example, we're driving around the robot, and then one of the encoder readings suddenly jumps from 0.8 to 1.8 (measured in rotations). So it jumps up by exactly 360 degrees, and then the motor tries to unwind the extra full rotation. And when this happens, things rotate too far, wires get ripped out, and all sorts of Bad Things™ ensue.

I was never able to reproduce the issue in the pits, so perhaps it was an issue that arose with the robot getting beaten around on the field.

Does anyone have any ideas as to what could be causing this odd behavior?

Arhowk 04-04-2016 22:02

Re: Talon SRX magnetic encoder issues
 
Do you need the rollover feature? If not, just take the decimal part of the rotation count and discard the rollover (everything to the left of the decimal).

If you do, send Omar a passive aggressive email telling him to fix the rollover feature :) (or just write it yourself while discarding the rollover that the talon gives you)

Ether 04-04-2016 22:31

Re: Talon SRX magnetic encoder issues
 

More detailed info would be helpful.

What exactly are you measuring with this encoder? It sounds like it might be steering angle of a swerve wheel? But that's just a guess.

What is the max angular speed the encoder will see in this application?

In normal operation, does the encoder cross the 360/0 discontinuity?

And just to be perfectly clear, the encoder is wired directly to the SRX, right?



cjl2625 04-04-2016 23:01

Re: Talon SRX magnetic encoder issues
 
Quote:

Originally Posted by Ether (Post 1567714)

More detailed info would be helpful.

What exactly are you measuring with this encoder? It sounds like it might be steering angle of a swerve wheel? But that's just a guess.

What is the max angular speed the encoder will see in this application?

In normal operation, does the encoder cross the 360/0 discontinuity?

And just to be perfectly clear, the encoder is wired directly to the SRX, right?




1. It's a rotating cage that holds the ball. Video for reference
2. Rotates fairly slowly, it should take several seconds to go one rotation.
3. No, I've made sure that it doesn't cross
4. Yes

RyanShoff 04-04-2016 23:01

Re: Talon SRX magnetic encoder issues
 
Check for CAN bus errors in the driver station logs when you notice this happening. I may have noticed something similar, but it didn't affect our design so we didn't looked into it very hard.

Also is the positioning loop running in the Talon SRX or the RoboRIO?

cjl2625 04-04-2016 23:03

Re: Talon SRX magnetic encoder issues
 
Quote:

Originally Posted by RyanShoff (Post 1567737)
Check for CAN bus errors in the driver station logs when you notice this happening. I may have noticed something similar, but it didn't affect our design so we didn't looked into it very hard.

Also is the positioning loop running in the Talon SRX or the RoboRIO?

It's running in the SRX.

Ether 04-04-2016 23:15

Re: Talon SRX magnetic encoder issues
 
Quote:

Originally Posted by cjl2625 (Post 1567736)
1. It's a rotating cage that holds the ball.
2. Rotates fairly slowly, it should take several seconds to go one rotation.

So to be clear, the encoder is mounted to the cage?



RyanShoff 04-04-2016 23:16

Re: Talon SRX magnetic encoder issues
 
Moving the loop to the RoboRIO would allow you to just use the above mentioned decimal portion of the encoder position.

cjl2625 05-04-2016 07:11

Re: Talon SRX magnetic encoder issues
 
Quote:

Originally Posted by Ether (Post 1567757)
So to be clear, the encoder is mounted to the cage?



The encoder is integrated right into the versaplanetary gearbox that rotates the cage.

RyanShoff: that could be a good idea, I'll try that if I can't figure out how to fix it directly.

Ether 05-04-2016 10:04

Re: Talon SRX magnetic encoder issues
 
Quote:

Originally Posted by cjl2625 (Post 1567833)
The encoder is integrated right into the versaplanetary gearbox that rotates the cage.

Does the encoder rotate at the same speed as the cage?

If not, what is the max angular speed the encoder will see in this application?



cjl2625 05-04-2016 10:18

Re: Talon SRX magnetic encoder issues
 
Yes, it should be rotating at the same speed.

ozrien 05-04-2016 14:18

Re: Talon SRX magnetic encoder issues
 
It sounds like you have a cabling issue between the magencoder and Talon.

You can confirm this by grabbing the self-test before and after reproducing the problem and observing that the absolute position (pulse width) and relative position (quadrature) disagree. That's one of the benefits of the CTRE magnetic encoder; you have two references that rely on different physical wires.

Most likely the ribbon cable needs to be replaced, or if you are using a breakout inspect the solder contacts/wiring.

Are you close or exceeding the peak rated RPM for CTREMagEnc_Absolute? If so then select CTREMagEnc_Relative and setposition() to what the absolute reading reports. See github examples/Talon SRX Software Reference manual for more info and peak RPM specs.

cjl2625 05-04-2016 14:28

Re: Talon SRX magnetic encoder issues
 
Quote:

Originally Posted by ozrien (Post 1568014)
It sounds like you have a cabling issue between the magencoder and Talon.

You can confirm this by grabbing the self-test before and after reproducing the problem and observing that the absolute position (pulse width) and relative position (quadrature) disagree. That's one of the benefits of the CTRE magnetic encoder; you have two references that rely on different physical wires.

Most likely the ribbon cable needs to be replaced, or if you are using a breakout inspect the solder contacts/wiring.

Are you close or exceeding the peak rated RPM for CTREMagEnc_Absolute? If so then select CTREMagEnc_Relative and setposition() to what the absolute reading reports. See github examples/Talon SRX Software Reference manual for more info and peak RPM specs.

The rotation is quite slow, so I don't think exceeding RPM is an issue.

At some point, I switched to relative mode and the problem stopped. So perhaps you are correct.
But we have two components robot using a mag encoder, and I've seen the same issue in both of them, so I figure it would be unlikely for them both to have the same cabling issue.

Ether 05-04-2016 16:16

Re: Talon SRX magnetic encoder issues
 
Quote:

Originally Posted by cjl2625 (Post 1568019)
The rotation is quite slow, so I don't think exceeding RPM is an issue.

At some point, I switched to relative mode and the problem stopped. So perhaps you are correct.

Are you sure the encoder is spinning at the same (slow) rate as the cage itself? Or is there a gear ratio between them?




All times are GMT -5. The time now is 13:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi