From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Erroneous reading from encoder for multiple encoder using NI 9074 and NI 9401

Hi,

 

I have  a weird problem for my application to read 4 encoders value using NI 9401.

 

I'm using the NI 9401 DIO module under FPGA. I modified the standard program using the standard encoder reading method (LINK). 

 

When using one encoder, it always give the right value. When use muliple encoders, it become to give weird value. Sometimes, when I just rotate two encoders, I will get some similiar position value for the other two which is completely stall. I have using oscilliscope to see if there is any noise pass into the two stalled encoder, but I didn't see anything. So my only crazy guess is that the fpga messed up with shift registers in someway. 

 

I'm sure the individual one works perfectly, however the chance to go wrong seems goes up increasing amount of encoders. When use two encoders, 95% times it works ok. When use three encoders, 70% time it works ok. When use four encoders, it always give very weird values.

 

Could anyone take a look at this crazy problem? Thanks.

 

Best,

 

Fei

 

Download All
0 Kudos
Message 1 of 4
(5,483 Views)

i would say that it most likely ground plane noise making it's way into your other channels.

first make sure you have good ground connection.

you can prove this by putting a transition counter on each line.  you know how many transitions you expect and you will see how many more you are detecting.

While the best way to overcome this is to use differential signals into an encoder input module like the 9411, you can help yourself by adding a deglitch filter to each input before you try to quadrature decode the signal.  your noise is probably one or two counts in duration so a deglitch of 10 counts would eliminate this and not affect your overall encoder speed.

a deglitch filter will not pass a signal until it has been in the same state for n cycles.

Stu
0 Kudos
Message 2 of 4
(5,469 Views)

I don't think it's the ground plane noise, because I have hooked up the osciloscope to inspect noise. The counter number keep changing while I didn't see any thing shows up in osciliscope. And I only power up the encoder without powering up the motor. The whole system is powered by 24

v battery.

0 Kudos
Message 3 of 4
(5,457 Views)

good luck then.  i don't think you have a software problem.

Stu
0 Kudos
Message 4 of 4
(5,455 Views)