OCCRA
Go to Post why does everyone think im so violent? - Kim Masi [more]
Home
Go Back   Chief Delphi > Technical > National Instruments LabVIEW and Data Acquisition
CD-Events   CD-Media   CD-Spy   FRC-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 01-13-2009, 03:01 AM
rwood359 rwood359 is offline
Registered User
AKA: Randy
FRC #0359 (Hawaiian Kids)
Team Role: Mentor
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Waialua, HI
Posts: 208
rwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to all
Inconsistent reading from encoder get rate

I have been getting inconsistent reading for rate from the encoder get VI. The distance is good, but the rate will alternate between multiple values. The values are different depending on the Mode (1X, 2X, or 4X). I thought it was a difference between makes of encoders. It turns out that there is a LV problem that NI tech support has been able to reproduce. See my thread: http://forums.usfirst.org/showthread.php?t=11004
Reply With Quote
  #2   Spotlight this post!  
Unread 01-13-2009, 11:18 AM
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 2,960
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Inconsistent reading from encoder get rate

Have you checked the outputs of the encoders with an analog oscilloscope, AT the pins on the Digital Sidecar? That is, leave everything hooked up, and probe the pins while they're still connected. I've had issues with crosstalk between encoder signals before. It was extremely confusing until I probed my inputs with an O-scope and discovered the noise. You'd be looking for spikes in the A channel when the B channel is transitioning, and vice-versa. It's not necessarily something you'd see if the encoders were disconnected, as the O-Scope inputs are much higher impedance than the digital inputs on the cRIO. Nor would I trust that the USB NI device would necessarily be fast enough to pick them up.

This would explain the differing behavior at different resolutions, as the counter would be looking at different transitions on different lines in each of the modes.

Admittedly, when I saw this behavior, it would also throw the encoder counts off. That is, spinning the encoder X revolutions forwards, and X revolutions backwards would leave a significant remainder, as opposed to zero. Have you checked to make sure your encoder numbers are corresponding to reality, and that they're agreeing in each direction?

(Note: This is all speculation sight unseen of the FPGA code. It's entirely possible there's something in that code that's wonky instead.)
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #3   Spotlight this post!  
Unread 01-13-2009, 12:49 PM
rwood359 rwood359 is offline
Registered User
AKA: Randy
FRC #0359 (Hawaiian Kids)
Team Role: Mentor
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Waialua, HI
Posts: 208
rwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to all
Re: Inconsistent reading from encoder get rate

Quote:
Originally Posted by Kevin Sevcik View Post
Have you checked the outputs of the encoders with an analog oscilloscope, AT the pins on the Digital Sidecar? That is, leave everything hooked up, and probe the pins while they're still connected. I've had issues with crosstalk between encoder signals before. It was extremely confusing until I probed my inputs with an O-scope and discovered the noise. You'd be looking for spikes in the A channel when the B channel is transitioning, and vice-versa. It's not necessarily something you'd see if the encoders were disconnected, as the O-Scope inputs are much higher impedance than the digital inputs on the cRIO. Nor would I trust that the USB NI device would necessarily be fast enough to pick them up.

This would explain the differing behavior at different resolutions, as the counter would be looking at different transitions on different lines in each of the modes.

Admittedly, when I saw this behavior, it would also throw the encoder counts off. That is, spinning the encoder X revolutions forwards, and X revolutions backwards would leave a significant remainder, as opposed to zero. Have you checked to make sure your encoder numbers are corresponding to reality, and that they're agreeing in each direction?)
I would have tried what you are suggesting had NI tech support not been able to reproduce the problem. They have reproduced the results including the speed changes by mode and the alternating speeds. The problem is not unique to our robot.

Quote:
(Note: This is all speculation sight unseen of the FPGA code. It's entirely possible there's something in that code that's wonky instead.)
I believe the the FPGA is the most likely bad actor. In all cases the distance was correct to within 1-4 inches after 160-170 inches while the speed varied during the entire 15 second run. I found it hard to believe that noise would have a zero sum on all encoders over the 15 second period on dozens of runs that we made.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-13-2009, 02:48 PM
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 2,960
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Inconsistent reading from encoder get rate

Quote:
Originally Posted by rwood359 View Post
I would have tried what you are suggesting had NI tech support not been able to reproduce the problem. They have reproduced the results including the speed changes by mode and the alternating speeds. The problem is not unique to our robot.
Why wouldn't you believe that crosstalk between the channels would be a common occurrence that could hit NI as well as you? If it's inherent in the system design for some reason, or if the kit encoders are particularly likely to do so, then there's every reason to assume it would be duplicated on NI's end as well. I agree that it's unlikely, but I think it'd bear looking at if you don't have anything better to do but wait for NI to come up with something.
Quote:
Originally Posted by rwood359 View Post
I believe the the FPGA is the most likely bad actor. In all cases the distance was correct to within 1-4 inches after 160-170 inches while the speed varied during the entire 15 second run. I found it hard to believe that noise would have a zero sum on all encoders over the 15 second period on dozens of runs that we made.
It's possible the FPGA is the culprit here, but I'm sort of doubting it. A period measuring interface like this isn't going to be terribly complicated. All you're doing is capturing the ticks elapsed between edges. All the mode does is change which edges you're looking at. If they're being extra tricky about it and adaptively shifting the number of edges they're looking at depending on how fast the wheel is turning, then I could see it there being a problem. But it just doesn't seem as likely to me.

Meanwhile, it's pretty possible for the encoder to trick you into thinking it's working when it's not. Depending on the timing of the spikes, the rising and falling edge of it could simply be nulling each other out as far as the distance is concerned. But it would play heck with your period measurements. Thus my concern. If you're not willing to attempt it, I'll grab an O-Scope and check the functionality on our robot in a few days if NI is still bug-hunting.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #5   Spotlight this post!  
Unread 01-13-2009, 07:07 PM
rwood359 rwood359 is offline
Registered User
AKA: Randy
FRC #0359 (Hawaiian Kids)
Team Role: Mentor
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Waialua, HI
Posts: 208
rwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to all
Re: Inconsistent reading from encoder get rate

Quote:
Originally Posted by Kevin Sevcik View Post
I agree that it's unlikely, but I think it'd bear looking at if you don't have anything better to do but wait for NI to come up with something.
Given the resources available to a high school on the North Shore of Oahu (a 20 MHz scope) I don't see any noise on any of the encoder channels. There is jitter, but nothing that looks like glitches.

Quote:
If you're not willing to attempt it, I'll grab an O-Scope and check the functionality on our robot in a few days if NI is still bug-hunting.
If you have better instrumentation, perhaps you can take the time to download the program from the other thread, modify it to run on your robot and post the results of both the rate readings while the program runs autonomous and any waveform anomalies that you can see.
Reply With Quote
  #6   Spotlight this post!  
Unread 01-13-2009, 07:10 PM
rwood359 rwood359 is offline
Registered User
AKA: Randy
FRC #0359 (Hawaiian Kids)
Team Role: Mentor
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Waialua, HI
Posts: 208
rwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to all
Re: Inconsistent reading from encoder get rate

I should have bet you lunch. Email from NI:
Hey Randy,

We figured it out. There is a problem with the FPGA timer averaging
involving channel swapping in specific cases. We're working on correcting
this issue and getting it out ASAP. Thanks for bringing this up! You have
the right mindset that this is what engineering problems really are like!
Kudos to you and your team for isolating this issue. Have a great
afternoon!

Regards,
John Sullivan
Applications Engineer
National Instruments
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does reading from the serial port work? Alan Anderson Programming 16 01-29-2008 07:15 AM
Reading NES controller from digital inputs bear24rw Programming 10 04-07-2007 01:17 AM
Reading Pan Angle from terminal.c marccenter Programming 3 02-09-2007 02:58 PM
Reading an encoder with interrupts GlennGraham FIRST Tech Challenge 4 08-25-2006 12:44 PM
reading negative numbers from a file in VB complete Programming 4 12-27-2005 07:24 PM


All times are GMT -5. The time now is 12:10 PM.

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


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