05-01-2008 12:01 AM
05-02-2008 11:20 AM
05-04-2008 09:51 PM
06-14-2011 02:50 PM
I have a similar issue but I am trying to use a digital signal (Z-index pulse) to read the current position of a currently running Quad Encoder Task.
I am using a PCIe-6320 DAQ card.
What I am trying to do is "map" the marker pulses on a linear scale. I have the DAQmx Task set up to read the counter pulses but instead of using the Z-index to reset the count, I would like to get the current position of each pulse. I have tried to do this using software but the resolution is too low so I need to be able to accomplish this with hardware.
Any ideas?
See also "Using Z-Index on Linear Encoder to determine Absolute Position" for more details.
06-15-2011 10:55 AM
CW_Edge
I would begin by looking at some of the links above. I would also take a look at these examples:
http://zone.ni.com/devzone/cda/epd/p/id/1721
http://zone.ni.com/devzone/cda/epd/p/id/194
There is also a good document on Z index reloading: http://digital.ni.com/public.nsf/allkb/C9D8039FBEF6DCAA86256B8C0060FA3A
🙂
06-15-2011 12:58 PM
Sam,
Please don't take this personally, but did you actually read my post? The examples and discussion you gave me are dealing with the most basic Encoder set up and are using the built in Z-Index functionality of the step to simply RESET the counter.
THAT IS NOT WHAT I AM TRYING TO DO! I have an 18" long LINEAR scale that has 45 marker pulses along the length and I am trying to get an accurate "map" of the positions of each marker pulse - i.e. get the current position of the Encoder task each time there is a marker pulse. I was able to do it using the software, however, the resolution is too slow so I am trying to see if I can do it on the hardware side.
Is there an example of how to measure the number of counts between Z-Index using the hardware sample rate? Does this require buffering? Can I use a digital input looking for rising edge to trigger a read on a currently running task? These are the questions I need help on.
06-15-2011 01:55 PM
CW_Edge,
I apologize for not clearly reading your previous post. The only current way I know how to do that would be using the software (DAQmx) to find the distance between pulses, and then use that to map the current position of the encoder. However it sounds like you were able to do this and were unhappy with the results. I do not know if a way to measure the counts between the Z-index using hardware sample rate for that card. However you could use that digital trigger and buffering to generate a positon but then it becomes a software times update and then you may be running into the same problem that you were previously.
06-16-2011 09:53 AM
I'm still not sure I understand the nature of your operating conditions, constraints, or overall needs. Here's what I've gathered:
- you have 4 linear encoders and are performing buffered measurements on their displacements
- one encoder has multiple "Z-index" marks which are synced to its own A-High B-High quad state
- in addition to buffering displacements, you want to also map out the precise location of these Z-index marks using
hardware
Questions:
- once you do the desired mapping, is there a reason to expect it to change dynamically? In other words,
can you simply have a mapping mode that characterizes your system, followed by a normal operating mode
where you use that info?
- to characterize the specific encoder with the marks, why not enable Z-index reload to a 0 value and then
sum up the delta positions between 0's to figure out absolute? (You'll need to be sure to sample faster than
the rate of quadrature state changes)
- is there some physical linkage among these 4 axis of measurement?
- do you need to correlate the other 3 encoders to the Z-index marks of the 1st? Or does each have its
own set of markings?
- what's the bigger picture here? Once you map out these marked positions, how will you be using them?
- there was an earlier suggestion (from nathand) to use the Z-index mark as a sample clock to capture instantaneous
displacement readings from all 4 encoders simultaneously. This seemed to me like exactly the kind of thing
that ought to help you, so what aspect of that idea didn't work out?
-Kevin P
06-16-2011 01:24 PM
Kevin,
Thank you for responding. The "big picture" of this application is actually to use the marker pulses to be able to establish absolute positioning while the axis in in motion. The distances between the marker pulses are designed to be unique so once the "map" is established, anytime the encoder passes any two marker pulses (assuming direction is known which it is), the system will know exactly where it is in absolute position.
The sampling rate on the DAQ card is plenty fast enough to handle the rate of motion, however, no matter how fast I run a while loop in LabView, it is not fast enough to "catch" the marker pulses accuratly enough. I need to be able to count down to the single count level which in the case of this particular scale is .0002."
During normal running, I don't need such accuracy, my while loop timer is normally set to 10ms, however, for the absolute positioning portion, I need the resolution I can only get from the hardware side.
There is no mechanical relationship between the 4 encoders, the only reason I mentioned the 4 encoders is that I have used all the counter channels on the DAQ card so I do not have an extra one which is why I was trying to see if there was a way to trigger a "Read Current Position" of an existing counter task using a Digital Trigger.
I realize that there are many other ways to establish a "home" position, but I understood from the scale manufacture that this was the intended purpose of the marker pulses and just assumed there would be a way to do it in LabView.
So far, no luck. Let me know if you have any suggestions and/or questions. Thanks again for your time.
06-17-2011 10:49 AM
Hmmm, well, *maybe*. Does your 10 msec while loop timing suggest that you are normally taking software timed position measurements? Or are you buffering the position measurements with a hardware clock but only servicing
the task every 10 msec or so?
If you need to hardware buffer all the time, then I think you'll need another daq board to solve this. You won't be able to use 1 counter with 2 hardware-timed tasks where one of them buffers normally and the other buffers only on marker edges.
Hopefully though your 10 msec while loop could simply take software-timed measurements. In that case, you could do as nathand suggested and use the marker edges as a sample clock. But then in your while loop, you could query the DAQmx Channel property node CI.Count (counter input-->general properties-->more-->count) to get a software-timed snapshot of the count value without disturbing the buffered task that gives you hardware-timed precision for your marker positions. You'd need to do your own scaling from count to distance, but at least you wouldn't need another daq board!
With either approach, I'd also note that you might have a little ambiguity if your marker positions line up pretty exactly with A,B edges. I'd worry that sometimes the count increment might register before buffering and other times the buffering may happen before the count increment registers. It's a bit of a race condition for the electronics. There's a workaround you could do using yet 1 more counter set up for retriggerable single pulses.
-Kevin P