Go to Post Ship dates, rules and deadlines all share one thing in common, they are your friend. - billbo911 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-01-2011, 11:50
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
LabVIEW Encoder not reliably returning Rate

Hello, all.

Yesterday, I was testing and tuning some code on a test chassis. It has two Toughboxes and US Digital encoders (from AndyMark, 250 count) connected to the last four digital inputs on the Digital Sidecar. In code, I found that Encoder Get does not reliably return Rate: I always get Distance (which I found to be accurate in both forward and reverse, by drawing a line on the wheel and reading the distance both ways. Only one of the encoders returns rate, though, which puzzles me. What puzzles me even more is that when I set the Decoding Type to 4x (Because that uses an FPGA Encoder instead of an FPGA Counter) it works - but only until I reboot (when the problem happens again, and is fixed by switching back to 1x).

I dug into the WPI Encoder Get to see if there was a bug there. WPI Counter Get is returning a time of Inf, which Encoder Get is scaling to 0. I went into WPI Counter Get, but that just talks to the FPGA (meaning I cannot dig deeper). When I first had the issue, I probed the Dev Refs and the non-working encoder was using Cntr 1 while the working encoder was using Cntr 0. I did not probe them using the 4x decoding, but when using 4x decoding, the other side (the one that worked before) now has the issue.

I am sure all of the hardware works. I swapped the encoder wires (Between encoders) and the problem is not the encoder itself. I also know that I am not missing the B-phase, because it counts forwards and backwards. Everything I have looked at points to a bug in the FPGA encoder handling, I am using the latest 2011 image. (I guess I could try the 2010 image to see if it works, but I won't have access to the robot until Monday).

Has anyone seen this issue? How did you solve it?
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
  #2   Spotlight this post!  
Unread 16-01-2011, 21:06
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,609
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: LabVIEW Encoder not reliably returning Rate

We had a similar issue in Java.

We had one returning a reasonably rate and a second encoder that was returning essentially garbage. We spent an hour debugging, swapping connectors and twiddling without any success.

We eventually just wrote our own rate functions and moved on.
__________________
History: 624 - Cryptonite --> 118 - Robonauts --> 2158 - AusTIN CANS --> 2587 DiscoBots
Bio: Andrew Lynch "How I Work" ---- LinkedIn , Facebook, Twitter
Reply With Quote
  #3   Spotlight this post!  
Unread 16-01-2011, 22:19
ebmonon36's Avatar
ebmonon36 ebmonon36 is offline
Registered User
AKA: Eric Bredehoeft
FRC #1018 (Robodevils)
Team Role: Mentor
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Indianapolis, IN
Posts: 428
ebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud of
Send a message via AIM to ebmonon36
Re: LabVIEW Encoder not reliably returning Rate

We also noticed the encoder rate not working when using 4x decoding and also found the problem coming from the counter returning a time of Inf. The rate returned a value of 0. We changed the decoding to 2x and began receiving rate data.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2011, 21:26
robotsteve robotsteve is offline
Registered User
FRC #2839 (Daedalus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: USA
Posts: 6
robotsteve is an unknown quantity at this point
Re: LabVIEW Encoder not reliably returning Rate

Quote:
Originally Posted by lynca View Post
We had a similar issue in Java.

We had one returning a reasonably rate and a second encoder that was returning essentially garbage. We spent an hour debugging, swapping connectors and twiddling without any success.

We eventually just wrote our own rate functions and moved on.
What do you mean about writing your own rate encoder??

Please explain --

Thanks-
Steve
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2011, 01:09
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: LabVIEW Encoder not reliably returning Rate

Quote:
Originally Posted by apalrd View Post
Hello, all.

Yesterday, I was testing and tuning some code on a test chassis. It has two Toughboxes and US Digital encoders (from AndyMark, 250 count) connected to the last four digital inputs on the Digital Sidecar. In code, I found that Encoder Get does not reliably return Rate: I always get Distance (which I found to be accurate in both forward and reverse, by drawing a line on the wheel and reading the distance both ways. Only one of the encoders returns rate, though, which puzzles me. What puzzles me even more is that when I set the Decoding Type to 4x (Because that uses an FPGA Encoder instead of an FPGA Counter) it works - but only until I reboot (when the problem happens again, and is fixed by switching back to 1x).

I dug into the WPI Encoder Get to see if there was a bug there. WPI Counter Get is returning a time of Inf, which Encoder Get is scaling to 0. I went into WPI Counter Get, but that just talks to the FPGA (meaning I cannot dig deeper). When I first had the issue, I probed the Dev Refs and the non-working encoder was using Cntr 1 while the working encoder was using Cntr 0. I did not probe them using the 4x decoding, but when using 4x decoding, the other side (the one that worked before) now has the issue.

I am sure all of the hardware works. I swapped the encoder wires (Between encoders) and the problem is not the encoder itself. I also know that I am not missing the B-phase, because it counts forwards and backwards. Everything I have looked at points to a bug in the FPGA encoder handling, I am using the latest 2011 image. (I guess I could try the 2010 image to see if it works, but I won't have access to the robot until Monday).

Has anyone seen this issue? How did you solve it?
I'm really curious if the same issue reproduces in any other language. There have been a few issues with the encoder rates in the past, but I had thought we fixed them all.

Have you tried modifying the averaging settings? How does that setting impact the behavior? Is there any interaction between the 2 resources... i.e. if you make one encoder 4X and the other 2X, does it still do this?

Thanks,
-Joe

<edit>I assume you are using v25 since that is the only non-beta 2011 image</edit>

Last edited by jhersh : 17-01-2011 at 02:37. Reason: clarification
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2011, 12:38
lon.bushweiler lon.bushweiler is offline
Registered User
FRC #0093
 
Join Date: Jan 2009
Location: Appleton, WI
Posts: 11
lon.bushweiler is an unknown quantity at this point
Re: LabVIEW Encoder not reliably returning Rate

We ran into similar issues in Labview over the weekend. Like others, we wrote our own rate code and moved on.
Reply With Quote
  #7   Spotlight this post!  
Unread 18-01-2011, 20:49
nchen99 nchen99 is offline
Registered User
AKA: Nelson Chen
FRC #2587 (DiscoBots)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Houston
Posts: 2
nchen99 is an unknown quantity at this point
Re: LabVIEW Encoder not reliably returning Rate

Today we tested the 9 possible resolution combinations of our two encoders, which we'll call Left and Right. When still, the encoder rates both return 0.0; when moving, the non-working one returns NaN (Not a Number). Here are the results:
Y = Yes/returned decimal value
N = No/returned NaN
Format:
LeftResolution, RightResolution: LeftResult, RightResult
4, 4: N, Y
2, 4: Y, N
1, 4: Y, N

4, 2: N, Y
2, 2: Y, N
1, 2: Y, N

4, 1: N, Y
2, 1: Y, N
1, 1: Y, N
Reply With Quote
  #8   Spotlight this post!  
Unread 19-01-2011, 08:27
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: LabVIEW Encoder not reliably returning Rate

I did some testing last night:
I found that, after booting up the robot as flashed (1x, 1x) it worked fine for about 2 hours, only rebooting once to change the battery.

After it stopped working, nothing would fix it. Nothing. I rebooted several times and re-downloaded the code. I set the counter to average 2 samples, as advised in this thread, and it worked.

I didn't spend a whole lot of time testing, so I don't know if the problem will re-appear after use. I will try tonight.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
  #9   Spotlight this post!  
Unread 19-01-2011, 23:33
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: LabVIEW Encoder not reliably returning Rate

More testing today (about 3 hours or so):

1. The encoder does not work, even averaging 4 samples (only 1 side dosen't work, the other one is fine).

2. After getting it to work, it worked reliably for about an hour before quitting. Then, after changing some settings (like the decoding type) and rebooting, it worked again (and didn't quit while I was working on it)

3. It seems very random, yet always affects the same side. Has anyone from NI been able to reproduce this problem?

4. I am running image v.25
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
  #10   Spotlight this post!  
Unread 25-01-2011, 15:49
Doug Norman's Avatar
Doug Norman Doug Norman is offline
Registered User
no team (National Instruments)
Team Role: Engineer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Austin, TX
Posts: 134
Doug Norman will become famous soon enoughDoug Norman will become famous soon enough
Re: LabVIEW Encoder not reliably returning Rate

I have reproduced this and believe it is a bug in our code. I suspect we may document this rather than fix it for this season for two reasons:
1. It would be a risky fix.
2. There is the work around of writing your own rate code.
__________________
Doug Norman
National Instruments

Last edited by Doug Norman : 26-01-2011 at 09:19.
Reply With Quote
  #11   Spotlight this post!  
Unread 04-02-2011, 12:23
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: LabVIEW Encoder not reliably returning Rate

Quote:
Originally Posted by Doug Norman View Post
I have reproduced this and believe it is a bug in our code. I suspect we may document this rather than fix it for this season for two reasons:
1. It would be a risky fix.
2. There is the work around of writing your own rate code.
Do you have a single document describing all the bugs this season?

EDIT:
The Readme describes some of them, but leaves out CAN issues.
Is there a document that shows new issues, BEFORE a fix is created?
__________________
-- Marshal Horn

Last edited by kamocat : 04-02-2011 at 12:32.
Reply With Quote
  #12   Spotlight this post!  
Unread 04-02-2011, 12:51
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: LabVIEW Encoder not reliably returning Rate

I do not believe this release has a fix for this bug. I saw a post from Joe stating who would not let him fix it. He also didn't indicate whether he had really really fixed it this time, sorta fixed it, turned it into a feature, or other.

I agree there should be a known issues list along with workarounds. I'm not sure if the support forum has one. That would be the appropriate place to request one.

Greg McKaskle
Reply With Quote
  #13   Spotlight this post!  
Unread 04-02-2011, 13:58
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,346
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: LabVIEW Encoder not reliably returning Rate

Quote:
Originally Posted by Greg McKaskle View Post
I do not believe this release has a fix for this bug. I saw a post from Joe stating who would not let him fix it. He also didn't indicate whether he had really really fixed it this time, sorta fixed it, turned it into a feature, or other.

I agree there should be a known issues list along with workarounds. I'm not sure if the support forum has one. That would be the appropriate place to request one.

Greg McKaskle
It has NOT been fixed in this update!

From the 3.1 README:

Quote:
Known Issues:
When you use more than one encoder, the rate indicator does not update for all encoders. To avoid this behavior, write your own encoder rate code.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
  #14   Spotlight this post!  
Unread 31-01-2011, 17:54
cabbagekid2 cabbagekid2 is offline
Registered User
#0368 (Kika Mana)
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Honolulu, HI
Posts: 85
cabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura about
Re: LabVIEW Encoder not reliably returning Rate

We just got started with the encoders that came in the KOP and are running into the same issue as everyone else. Our right side has both rate and distance but the left side only shows distance (rate is 0).

Quote:
Originally Posted by lon.bushweiler View Post
We ran into similar issues in Labview over the weekend. Like others, we wrote our own rate code and moved on.
We're going to write our own rate code and was wondering...since distance works for both sides if it's as simple as storing the present distance into a variable and subtracting the saved (previous present distance) from the prsent distance. This will be in periodic task...so that you can divide it by the loop time interval to obtain rate.

We tried this for our working side and came up with similar results as the encoder rate output and are hoping to get it working on the left side.

One thing we noticed though (both with our rate and the VI rate) is that it's REALLY noisy. When maxing out the joystick it bounces around anywhere from zero to 250 rpm (low gear). We had to up the sample average (which cleaned it up a little) and then added a point by point median filter. The only thing bad about this is that the filtered rate is only 100 rpm (can you imagine the noise to produce this!).

Anyone else have noise issues? We're still not sure if the rate data will be workable after all this filtering. More testing today...

Might also be the placement of our wires...will test that today too.
Reply With Quote
  #15   Spotlight this post!  
Unread 31-01-2011, 18:40
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: LabVIEW Encoder not reliably returning Rate

One thing that was discovered is that every other encoder works... so if you allocate one and ignore it and then allocate another one, you can use the built-in rate function. Naturally this means you have half as many that you can use, but if you don't need that many, this may be a good solution for you.

-Joe
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:53.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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