05-24-2007 06:20 AM
Good news -- you probably don't need hardware-timed sampling or synchronization at all. If you change your encoder tasks by removing the call to "DAQmx Timing.vi", then you can choose to perform software sampling with "DAQmx Read" in your main loop at any rate you like. Try removing that call and see if you don't get better results. The board's internal count registers will update at the 400 kHz rate you need, and your DAQmx Read calls will simply query an instantaneous snapshot of those count values.
I see that your linear encoder has pretty low speed limits. If any part of the motion exceeds those limits, you might expect the sensor to fail to produce the right # of pulses.
I'm not sure I've got a good picture of what you're doing that gives you the negative slope and the impossible 2mm offset. Does the LV program run continuously during all the take outs / put backs?
-Kevin P.
05-24-2007 08:39 AM
05-25-2007 07:14 AM
I had a chance to briefly look over your vi. It's pretty self-explanatory, and I didn't spot anything of particular concern. I did note the use of digital filtering for the input lines on the magnetic linear encoder task. Odds are, that means you discovered that its signals weren't "clean" and you may find that tweaking the filtering parameters or adding some interface circuitry will still be needed.
I couldn't interpret the test data since I don't know your system and your test method / procedure. But I can see that you have slight trends in data that you would ideally want to repeat exactly.
Are the optical encoders putting out single-ended TTL quadrature? Or do they use a differential line driver output, or something like open-collector which requires a pull-up resistor at your end?
How does the other non-LabVIEW system operate? How repeatable are its results? Could it be averaging lots of readings instead of taking single samples? That kind of thing would make the answers it produces much more stable...
-Kevin P.
05-27-2007 02:00 PM
05-30-2007 07:18 AM - edited 05-30-2007 07:18 AM
Message Edited by MickeyD on 05-30-2007 07:19 AM
06-05-2007 08:45 AM
Sorry so late responding again -- I *thought* a response but mis-remembered that I had also *written* it.
I think that a very likely source of the problem is that you have several encoders generating somewhat independent differential line driver outputs while your counter board is looking for single-ended TTL. I'll bet your other measurement system has a board that's capable of interfacing directly to the encoder's differential outputs.
I'm not an electronics wiz, but I've seen missed-count problems when multiple line driver outputs were tied together to a data acq board's common digital ground. You'll want to put a differential line receiver between the encoder and the data acq board to convert to TTL.
Another quick troubleshooting idea: disconnect all but 1 of the encoders and see if you get the right # of counts from that 1. It's pretty common that differential outputs *from a single device* can be connected directly to a counter board and produce correct measurements. Not guaranteed, but chances of success are higher than when you have many devices.
-Kevin P.