Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

9401 counting erroneously from quadrature encoder

Solved!
Go to solution

I'm using a 9401 module in a 9188 chassis to measure position of a shaft in 1E6 count/rev. The signal is an emulated AQuadB out from a Kollmorgen AKD servo drive. My problem is that when the drive is enabled, the noise it makes it being picked up as extra positive counts by the 9401. The drive has RS485 outputs, but my cable length is short and well shielded, so I thought it would work okay. It's wired like this:

 

9401 CTR1 channel

A+: 9401 pin 20

B+: 9401 pin 23

GND: 9401 common

Cable Shield: 9401 common

 

Is this occuring since the encoder signal is differential, or is my grounding/shielding not correct? If I disable the encoder entirely the 9401 picks up a solid zero. Should I use some sort of converter from the RS485 to TTL?

0 Kudos
Message 1 of 4
(6,841 Views)

Hi mooktank,

 

RS-485 is usually differential, but I guess if the A+ and B+ fit the TTL logic level requirements relative to GND then you might be able to get away with using it in this manner (though obviously with less noise tolerance than the intended RS-485 configuration).  In any case, it seems that you are able to detect edges, so that's a good start.

 

The 9188 supports digital PFI filtering which you can quite possibly use to eliminate the noise.  You can enable the filter with the following property node (assuming you are using a quadrature encoder task and that you are using LabVIEW, although other task types and other APIs have equivalent functionality):

 

Untitled 1 Block Diagram _2013-03-05_16-06-33.png

 

The minimum pulse width parameter depends on your signal (I'd suggest scoping it): it should be low enough such that your actual quadrature signal is always passed through but high enough that the noise is rejected.  Something like:

 

Maximum noise duration < Min Pulse Width < Minimum encoder pulse duration (accounting for enough time for the noise to settle out)

 

 

 

If you continue to have noise problems, it would probably be good to see what the signal actually looks like using a scope (A+ relative to GND and B+ relative to GND) so you know what it is you're dealing with.  If the output signal is simply not compatible with the specified input requirements of the 9401 then I suppose you'll have to look into a converter.

 

 

 

Best Regards,

John Passiak
Message 2 of 4
(6,836 Views)
Solution
Accepted by pbachant

In addition to following John's advice to help with digital noise immunity, I'd further recommend that it'd be a good idea to formally convert the differential to single-ended TTL.  I've had occasions in the past where I did a quick-and-dirty hookup of a 5V differential encoder channel to a DAQ board and it would often work properly.  But there have also been times where the differential (-) signals were trying to drift relative to each other while both being tied to the DAQ common digital ground, causing some sporadic but strange counting behavior.  At least that's the diagnosis I came up with at the time.

 

All such issues disappeared immediately and permanently after putting in a differential to TTL converter.  Here's a link to the product I used (and then successfully re-used on subsequent projects).  Just double-check the specs for your particular differential signals vs. what this product is spec'ed to handle.

 

-Kevin P

 

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 3 of 4
(6,817 Views)

Thanks for the detailed replies!

 

I ended up picking up a couple RS485-TTL converters and turning down the resolution of the encoder output. Seems to be working fine now. 

0 Kudos
Message 4 of 4
(6,808 Views)