Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Talon SRX Missing Encoder Counts in Labview (http://www.chiefdelphi.com/forums/showthread.php?t=134210)

Ether 11-02-2015 12:04

Re: Talon SRX Missing Encoder Counts in Labview
 
Quote:

Originally Posted by Chris_Elston (Post 1441782)
A pull-up resistor on the A/B channels should eliminate this...

roboRIO has weaker pullups than cRIO:

http://www.chiefdelphi.com/forums/sh...3&postcount=22

http://www.chiefdelphi.com/forums/sh...8&postcount=18



Chris_Elston 11-02-2015 17:42

Re: Talon SRX Missing Encoder Counts in Labview
 
Preliminary information....(2-11-2015) 5:45pm

1. Took the encoder out of the gear box and turned shaft connected to Talon SRX. Loosing counts and the decoding is not even close to the spec of the encoders.... Will upload a video later.

2. Wired the same encoder to the Robo-rio (DI1 and DI2), configured for 1X decoding...no counts LOST... 0 to 128 counts, almost perfect everytime. Will upload a video later.

Ether 11-02-2015 17:46

Re: Talon SRX Missing Encoder Counts in Labview
 
Quote:

Originally Posted by Chris_Elston (Post 1442061)
2. Wired the same encoder to the Robo-rio (DI1 and DI2), configured for 1X decoding...no counts LOST... 0 to 128 counts, almost perfect everytime. Will upload a video later.

Can you repeat the exact same test, except at 4X decoding?



Chris_Elston 11-02-2015 21:54

Re: Talon SRX Missing Encoder Counts in Labview
 
Quote:

Originally Posted by Ether (Post 1442062)
Can you repeat the exact same test, except at 4X decoding?

Sorry Ether, we took it all apart before we was able to test for 4X. Maybe tomorrow.

However here are the videos from tonight's test.

https://www.dropbox.com/sh/k294ckivf...cvHHaNmOa?dl=0

The key summaries here are the following:

1. We took the encoder out of the gear box and spun it with our fingers to eliminate any questions with the gear box, or shaft slipping. Just the encoder all by itself.
2. When we wired one of the encoders direct to the robo-rio, like Mr. Anderson suggested, this WORKS!!!
3. Not shown in the videos...we swapped out a brand new Talon SRX, made sure the firmware was 1.4, updated the CAN BUS IDs, then tried again. Still missing counts.
4. I got an email from Omar who suggested maybe the small ribbon cable to be replaced, we tried that, and that did not work.

The Grayhill connected to the Robo-rio, we setup at 1X decoding, so the count was exactly 128 and 0. Right on the money as per the video above.

Maybe we are doing something wrong in the software setup? We are using labview. If anyone might be willing to share a working software setup with Talon SRX in closed loop, digital encoder mode, please let me know.

In Omar's email he was testing with a E4P encoder, so we just happen to have one of those laying around. We had an E4P-360CPR. The results are pretty much the same for that one as well, missing counts.

We are completely baffled at this point and getting pretty sick to our stomach, other than we made the call tonight to code a home brew PID loop to get us by for now, we are now 4 days behind troubleshooting software issues. We gotta keep moving.

ozrien 12-02-2015 00:11

Re: Talon SRX Missing Encoder Counts in Labview
 
Chris, I figured out what is wrong, the problem is your LabVIEW app. Without revealing the details of your project, the brief description of the problem is that "Motor Enable" is being called every loop. Every time "Motor Enable" is called, a frame is sent to the Talon to "set" the current encoder position. Since the caller has wired the position signal to the last received position, it has the negative effect of constantly setting the position to the last received position [not ok]. So changes in encoder position in the Talon firmware are being stepped on by the RIO's request to reset the encoder position.

I reproduced your exact symptom by creating a new Labview project and dropping in your VIs. I teleop'd enabled, moved the encoder to the zero position, marked it, moved it forward one rotation and then back. Encoder pos was no where near zero [not ok]. Then I deleted the call to "Motor Enable" in ElevatorPositions.vi and redid the test, encoder went back to zero successfully [ok].

Long story short, do not call motor-enable continually. If you want to kill the motor drive set the throttle to zero or change the control mode of the Talon object.

ozrien 12-02-2015 01:52

Re: Talon SRX Missing Encoder Counts in Labview
 
One more thought...
In hindsight, a better approach to debugging this might have been to un-deploy code so that the robot is in the no-code state. Then use the Self-Test in the roboRIO web-based config to measure the sensor position, move one rotation, and hand-calc the difference to confirm the right number of ticks. Probably a good trick to ruling out robot-side influence on future problems involving decoding sensor. Wish I had thought of that earlier, oh well.

Chris_Elston 12-02-2015 06:35

Re: Talon SRX Missing Encoder Counts in Labview
 
Quote:

Originally Posted by ozrien (Post 1442256)
Long story short, do not call motor-enable continually. If you want to kill the motor drive set the throttle to zero or change the control mode of the Talon object.

Omar, Thanks for helping us find this one. Me and Tyler (Lead software student) did not know that Motor Enable reset the counts. We must have missed that one while trying to learn about the Talon SRX.

This was a great mentoring experience for both software and electrical sub-teams. They learned how to use the o-scope and document problems along the way.

We will give this a try tonight and see if that wraps up our problem. Again, thanks very much for assisting us!

PS: You are right about self-test. I think from a troubleshooting stand point, we got focused on something slipping, or bad encoders because they were not new, is the reason we didn't think of doing that step as well. To look at what the drive module sees before any data is processed into the robo rio.

Will follow up one more time with good results tonight. I hope this troubleshooting journey helps others in a positive way.

TylerStaudigel 12-02-2015 09:06

Re: Talon SRX Missing Encoder Counts in Labview
 
Quote:

Originally Posted by ozrien (Post 1442256)
Chris, I figured out what is wrong, the problem is your LabVIEW app. Without revealing the details of your project, the brief description of the problem is that "Motor Enable" is being called every loop. Every time "Motor Enable" is called, a frame is sent to the Talon to "set" the current encoder position. Since the caller has wired the position signal to the last received position, it has the negative effect of constantly setting the position to the last received position [not ok]. So changes in encoder position in the Talon firmware are being stepped on by the RIO's request to reset the encoder position.

I reproduced your exact symptom by creating a new Labview project and dropping in your VIs. I teleop'd enabled, moved the encoder to the zero position, marked it, moved it forward one rotation and then back. Encoder pos was no where near zero [not ok]. Then I deleted the call to "Motor Enable" in ElevatorPositions.vi and redid the test, encoder went back to zero successfully [ok].

Long story short, do not call motor-enable continually. If you want to kill the motor drive set the throttle to zero or change the control mode of the Talon object.

What do you mean by the motor enable vi. Is it the motor set output or something in the begin category?

Chris_Elston 12-02-2015 09:16

Re: Talon SRX Missing Encoder Counts in Labview
 
1 Attachment(s)
Quote:

Originally Posted by TylerStaudigel (Post 1442343)
What do you mean by the motor enable vi. Is it the motor set output or something in the begin category?

In my student's code, when a limit switch was hit, he has a true/false condition that "disable the motor" then it would "enable the motor".

What Omar is saying is inside this VI, it writes a SET Position of "0" each time this VI is called. Here is the screen shot Omar sent us to check. We will check this tonight.

Omar recommends NOT USING Motor Enable/Disable in this method because the VI write the SET POSITION in the back ground, I assume for safety reasons...it writes a set position of ZERO so the PID won't take off when the motor is enabled. You don't want a "run-a-away" motor condition on power up.

TylerStaudigel 12-02-2015 09:20

Re: Talon SRX Missing Encoder Counts in Labview
 
Quote:

Originally Posted by Chris_Elston (Post 1442348)
In my student's code, when a limit switch was hit, he has a true/false condition that "disable the motor" then it would "enable the motor".

What Omar is saying is inside this VI, it writes a SET Position of "0" each time this VI is called. Here is the screen shot Omar sent us to check. We will check this tonight.

Omar recommends NOT USING Motor Enable/Disable in this method because the VI write the SET POSITION in the back ground, I assume for safety reasons...it writes a set position of ZERO so the PID won't take off when the motor is enabled. You don't want a "run-a-away" motor condition on power up.

So we don't even have that vi in our code. We are just using the motor set. To make sure we have the same problem, the encoder counts up correctly but when we try to return to zero it doesn't return to the same point. This is the problem you guys are having right?

ozrien 12-02-2015 15:38

Re: Talon SRX Missing Encoder Counts in Labview
 
TylerStaudigel, check the Self-Test to see exactly why the motor movement isn't matching your expectation.

Chris_Elston 12-02-2015 21:45

Re: Talon SRX Missing Encoder Counts in Labview
 
Quote:

Originally Posted by ozrien (Post 1442256)
Long story short, do not call motor-enable continually. If you want to kill the motor drive set the throttle to zero or change the control mode of the Talon object.

I wanted to follow up with this thread to say this solved the problem. Maybe a suggestion to add a bullet point in the manual about how this API VI will SET POINT your count to "0" when called. Everything works great.

Talon SRX on CAN Bus with closed-loop position is amazing so far. Hopefully they will be robust for the weeks to come. Thank you Omar and Cross the Road Electronics.

ozrien 13-02-2015 00:15

Re: Talon SRX Missing Encoder Counts in Labview
 
Actually the MOTOR ENABLE VI will set the position to whatever you tell it to. The problem was specifically that it was wired to the last received position. But even if you had wired it to zero, it would still continually reset the position as a result of it being called all the time. I'm already adding it to the software ref manual. Stay tuned.


All times are GMT -5. The time now is 21:22.

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