I want to use usb-6211 acquisition board to collect displacement. The output of grating displacement sensor is TTL rectangular square wave. I use the example program in the help document to collect displacement. Data can be collected, but the collected value is inconsistent with the actual displacement of the sensor. And I also found that after the sensor moves from the initial value to a certain value and returns to the initial value, the value of the front panel cannot return to the initial value.
Wiring: phase A is connected to PFI0 and phase B is connected to PFI1; Use counter 0;The resolution of the displacement sensor is 1 micron.
Attached is my VI.
Any help or input given would be greatly appreciated.
What type of quadrature encoder are you using?
To eliminate a possible cause of error, I suggest you check the operation with Measurement And Automation Explorer by generating a virtual global channel. If the displayed position is not correct, you should check the encoder signals with an oscilloscope and their wiring to the DAQ board.
There should be an encoder in the grating sensor. You don't need another one. My encoder outputs 5V, TTL square wave.
I used Max to create a virtual global channel and retested the displacement. The same problem does not correspond to the actual displacement display dial. Is it possible to rule out that there is no problem with the program I write, and there may be a problem with the hardware?
What parameters of the encoder can be detected by the oscilloscope you mentioned, and the problem can be detected.
I can't read any of the lettering in the vi, but the general form looks ok, especially if you aren't using the Arm Start trigger. (If you *are* using it, the counter might not start measuring until part way into the motion...)
Another thing to consider is the motion system itself. It's pretty common for mechanical drive systems to have hysteresis or backlash. If the actuator tries to deliver a fixed amount of incremental, relative motion, it would be fairly common for an out-and-back to end up in a slightly different place from where it started.
If it's a step motor system, it's likely doing fixed incremental moves.
Yes, this test with MAX allows to say that the problem does not come from the LabVIEW code.
Is it an encoder with differential outputs (A, |A, B, |B and Z, |Z)? If so, a 26LS32 could be your friend.
Does the manufacturer provide a recommendation (a wiring diagram) for interfacing the signals?
An oscilloscope would allow to check the presence of possible parasites on the encoder signals. These could be of an electrical nature but also come from mechanical oscillations.
In some cases, an LS7184 is useful for "filtering" the signals of the encoder as it allows you to set the pulse width of its output signal.
No idea if it is easy to disassemble the encoder but a test by moving it by hand and monitoring the displayed position would certainly be useful.
Thank you for your guidance,I have a few more questions for you.
1： it would be fairly common for an out-and-back to end up in a slightly different place from where it started
However, the displacement value measured by me is often very different from the displacement value at the beginning (± 2mm). The resolution of the sensor is 1 micron. Is the difference of displacement too big？
Is there any other way to change this problem？
Thank you for your reply.
Grating displacement sensor is a new product just bought. Won't there be any problem? I connect the displacement display instrument to the sensor to display the displacement in real time, which is no problem (the physical displacement corresponds to the instrument display);
I checked the following instructions. The sensor has differential outputs (A, | A, B, | B and Z, |Z). On the wiring, I can only connect A, B and Z to receive the sensor output signal in the form of square wave. It also supports another output mode LD linear differential output adopts RS422 communication, and I use the first mode.
I don't know what the 26ls32 you mentioned is?
1. Offhand 2mm sounds like a lot, but it really depends on the mechanics of the system.
2. Bringing differential signals into your single-ended DAQ device sounds like the more likely source of trouble. The 26LS32 is a chip that converts differential signals to single-ended. With some looking around you can probably find a suitable off-the-shelf converter device if you don't want to integrate a raw chip yourself.
Take care of the differential to single-ended conversion first.
Thank you for your reply.
Now I rewire. A + and B + are connected to PFI0 and PFI11 of NI6211 respectively, and NI6211 provides 5V power supply to the sensor. The initial problem is solved, and the displacement can return to the initial position. However, there are new problems. The collected displacement value is displayed by waveform diagram. The displacement value does not change dynamically with time, and the abscissa is not time. I don't know where the problem is. I don't know whether there is a problem with the wiring or the program? How should the wiring be connected? Do I need to convert the sensor 5V differential to 5V single ended? The program is an example in the help file used.