From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

LV VI showing a spurious signal from Encoder

I have two stepper motors and two encoders. When I connect them to my PXI 7842R and run the standard "Encoder Loop" VI on the FPGA, I see spurious signal on "Encoer Position" indicator. Even when motors are not moving, this number is increasing in an unbounded fashion. This creates problems in the closed loop system since I cannot rely on this encoder value. I have disconnected and connected all the cables three times and have asked colleagues to check them too. Still the same problem. Anybody with a similar experience?

 

0 Kudos
Message 1 of 6
(3,424 Views)

Hello,


Can you post the code you are referring to?  I am not familiar with the "Standard Encoder Loop VI."   

0 Kudos
Message 2 of 6
(3,411 Views)

Thanks for your reply David. Here is the FPGA VI with two identical encoder loops taken from Closed Loop Servo examples in LV. I think they are not as ‘standard’ as I thought since they may be part of some special toolkits that I have on this system.

 

Here is the problem: The loop S gives spurious signal. The loop X works fine. Let me explain in detail what happens:

 
  1. I click on the ‘S step’ button quickly to generate 8 steps (that is equal to one encoder count) and the S encoder goes from 0 to 1. Good.
  2. I repeat the same process and it goes from 1 to 2.
  3. After a few more clicks, the encoder starts running even without clicking the step button. It goes from 3 to 3000 to 30,000 so fast. Seems to be a leakage of some kind.
  4. I repeat the same with X encoder and everything seems to be OK.
 

If I swap their roles in the VI (use DIOX in place of DIOY, etc), still it is the same physical encoder that gives the spurious signal. Hence, as I say, the ‘software is willing but the hardware is weak’.

 

We must then doubt the quality of the encoder. But when I connect it to an older motion controller based system, they BOTH work fine.

 

The next suspect was wiring of the system. I did call the manufacturer of the drive system, and they agree that the wiring is correct. A colleague checked the wiring physically and gave the same reply.

 

At present I don’t see a way out. My feeling is that there is some vital question regarding the system that I am not asking (and hence not answering). I am completely stuck. I have made the system work at present by swapping the roles of encoders and running the ‘bad encoder’ axis in open loop. But that is not a permanent solution and I do need help.

 

My system is:

 

LabVIEW 8.6.1

FPGA Module

Real-time module

PXI 7842R FPGA card

PXI 8106 real-time controller (This may be irrelevant as I am getting the error even when just the FPGA part runs).

MDM2200 Series Motor Drive Module from Primatics

Two stepper motors with encoders installed.

 

Please let me know if you need some more information.

 
0 Kudos
Message 3 of 6
(3,382 Views)
Well since the code seems identical on both sides, and you said you tried switching and saw the problem with the same encoder on the different inputs, this definitely seems like a HW issue.  Is it possible your other motion controller is somehow filtering spurious signals?  Try hooking up both encoders to a Oscilliscope and watching the signal.  This might show some more insight on what problems might be happening.
0 Kudos
Message 4 of 6
(3,363 Views)
I agree with David, look at you encoder signals on a o-scope.  The FPGA board is likely sampling much faster than the motion control hardware and your encoder loop as you have written them have no filtering.  Your encoder may have some spurious signals.
SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 5 of 6
(3,300 Views)

I do not have access to an o-scope here but I do have plotted the raw encoder output in LV using simple charts and I do see very noisy signal on the 'bad' encoder. However I do not understand why the noise is present on one of them and not on the other. In the last two weeks I was working on a different system and hence had no time to take advantage of your valuable comments. I'll do that by the end of next week and will let you know. Thanks for your comments since I now have a few more directions to work on.

 

Ali

 

0 Kudos
Message 6 of 6
(3,291 Views)