|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
|
|
#2
|
|||||
|
|||||
|
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.) |
|
#3
|
|||
|
|||
|
Re: Inconsistent reading from encoder get rate
Quote:
Quote:
|
|
#4
|
|||||
|
|||||
|
Re: Inconsistent reading from encoder get rate
Quote:
Quote:
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. |
|
#5
|
|||
|
|||
|
Re: Inconsistent reading from encoder get rate
Quote:
Quote:
|
|
#6
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Does reading from the serial port work? | Alan Anderson | Programming | 16 | 29-01-2008 07:15 |
| Reading NES controller from digital inputs | bear24rw | Programming | 10 | 07-04-2007 01:17 |
| Reading Pan Angle from terminal.c | marccenter | Programming | 3 | 09-02-2007 14:58 |
| Reading an encoder with interrupts | GlennGraham | FIRST Tech Challenge | 4 | 25-08-2006 12:44 |
| reading negative numbers from a file in VB | complete | Programming | 4 | 27-12-2005 19:24 |