05-29-2012 06:54 PM
Hi All,
So I have attached a hardware timed data aquisition system that obtains a signal from the rise of a counter (from an encoder). The encoder is a quadrature encoder and therefore I have 3 more triggers that I could quadripple my resolution with the same hardware.
The current system is triggered off of the rise of the PFI37. I can use Rise-PFI37, Fall-PFI37, Rise-PFI39, and Fall-PFI39. How can I do this?
05-30-2012 01:42 PM
Hi bronco9588,
I was wondering, have you looked at the "Measure Angular Position" example VI which is made specifically to read quadrature encoders? It's located in LabVIEW at Help>>Find Examples>>Hardware Input and Output>>DAQmx>>Counter Measurements>>Position.
Regards,
05-31-2012 02:01 AM
Yup... checked it out. I fully understand how the encoder works and how that program works. I am using hardware timing whereas the examples are using continous samples. I have attached what I have so far. I am pretty happy with how things are turning out, but I just wish there was a way to stack clocks or something. I could always upgrade hardware, but why when the encoder has 4X the triggers, but not all in a happy package.
05-31-2012 01:10 PM
Since your code appears to expect to do quad encoder measurements and analog input on the same device, I'm
supposing that you're probably using either an M-series or X-series device.
If so, good news because both support digital change detection. You may need to parallel wire your quad encoder
to the DIO inputs that support change detection, but you can then create a dummy DI task that samples based
on change detection of the A & B channels. If you choose to be sensitive to both rising and falling edges of both
channels, you'll be able to generate a "Change Detect" hardware event with each quad encoder state transition.
You can config your encoder and analog tasks to use this "change detect" event as their sample clock to keep
them in sync. I would try to be sensitive to the *trailing* edge of that event (likely a falling edge if I recall correctly)
to make sure the encoder position updates before the sample is taken.
-Kevin P