Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronize PXI-4472 and PXI-6602 Samples?

Hello.  I am using LabVIEW 7.1.  I made the switch to DAQmx recently.  I am writing a program to collect vibration data from a planetary gear system.  I have accelerometers mounted to the gears to record vibration data and encoders are used to track the position of the gears.  It is imperative that I synchronize encoder and accelerometer signals to get correct measurements.

I am using PXI-4472 cards to measure accelerometer signals and PXI-6602s to get encoder positions.  I have two separate "configuration" VIs (one for accelerometers and one for encoders) outside the while loop and two separate "read" VIs inside the while loop.  The accles and encoders have separate VIs because I developed them at different times and I thought everything would get too bulky if I combined them.  (The encoder VIs collect data from four encoders and measure the period of two of them to get velocity.)

I need to know how to make sure I'm getting samples form each card at the exact same time.  Maybe I already am, but I'm not confident.  When I set the number of samples for accels and encoders to the same value (typically 8192), everything seems to work.  But how do I know I'm getting all samples simultaneously?  When I set the "number of samples per channel" control of the encoder "read" VI to "-1", the samples obtained per while loop iteration varier wildly.  I don't understand really what setting this value to -1 does, but I do know that it's hurting my confidence that everything is synchronized when I set the control to the same value as the accelerometer "scans to read" control.

I have set the DAQmx Timing VI(s) for accelerometers and encoders in both “config” programs to "Sample Clock," but is that all I need to do?  I read the "Timing and Synchronization Features of NI-DAQmx" page of NI's website, but it wasn't so clear to me.  It seems like I may need to configure some RTSI stuff in MAX, but that's were I get very lost.  Can anyone please explain what else, if anything, I must do to ensure that the accelerometer and encoder arrays are collected simultaneously for comparison?

I uploaded my code along with a few pictures of the relevant block diagrams to my website at: http://rclsgi.eng.ohio-state.edu/~ericson.15/PLANETARY/LabView%20Code/
The larger file contains all SubVIs and the smaller one contains only those which I built.  The picture below shows the block diagram of the main program.  More pictures of the sub-programs I mentioned are found at the link above.

THANK YOU!



Tristan Ericson

Ohio State University Mechanical Engineering
Dynamics and Vibrations
201 West 19th Ave Suite N350
Columbus, OH 43210-1142

Office: 614-292-9029
Lab: 614-247-8077
Fax: 614-292-3163

"No one is useless in this world who lightens the burden of another." - Charles Dickens
0 Kudos
Message 1 of 6
(8,489 Views)
Hi Tristan,
 
There is a similar forum post here that talks about your issue.  You will need to probably use the star line which is explained in this knowledgebase. An example of the synchronizing a DSA board and M-series board sampling at the same rate can be found <link no longer exists>.
Alex A.
Applications Engineer
0 Kudos
Message 2 of 6
(8,463 Views)
Alex,

Thanks a lot for your reply.  I spent a lot of time with the resources you gave me.  I've made some progress, but I'm not there yet.  I took the sample code from the last link you sent and tried to make it fit into the model I have: synchronous sampling of 4472 (accelerometer) and 6602 (encoder) signals.  I think that I got the timing worked out (maybe), but not the triggering.  Again, the metric I am using to convince myself things are working is to set the number of samples on the 6606s to "-1" and look for the same samples as the 4472s.  That number still varies around the nominal value (8192 samples), but to a lesser degree.  And the average number of encoder samples converges to 8192 in fewer while loop iterations.  So I think that I'm sampling at the same time, but I haven't figured out how to trigger the two so that they do start at the same time.

Along with all my investigations, I have not been able to figure out the PXI stare line.  It looks like the PXI Star line can be fed to the 6602 counter here, but not the trigger (can't find that page again right now).  I'm not sure that I am using the PXI Star line to send the clock, but I tried to follow the example.  Can you provide any further help in synchronizing the trigger along with the timing?  It seems strange to me that I can be running off the same clock but am having such a tough time starting the cards at the same time.

Below is a copy of the code that I've been using to troubleshoot the problem (near bottom of list).  My master board (slot 2) is a 4472 card and the 6602 is in slot 5.
synchronize test program.vi

One more thing that's been bugging me... In any code using the couter timer to time pulses, like my encoder application, it seems as though a digital pulse train must be generated (middle of my code below).  I don't understand why.  If the encoder pulse is the gate and the internal timebase of the 6602 (80MHz, or whatever), is the source, why do we need to generate another digital pulse?  Also, LabVIEW throughs and error when the frequency of this digital pulse train is set too high.

Thanks.


Tristan Ericson

Ohio State University Mechanical Engineering
Dynamics and Vibrations
201 West 19th Ave Suite N350
Columbus, OH 43210-1142

Office: 614-292-9029
Lab: 614-247-8077
Fax: 614-292-3163

"No one is useless in this world who lightens the burden of another." - Charles Dickens
0 Kudos
Message 3 of 6
(8,448 Views)

Hi Triston,

I will gather the necessary hardware and test out your code to see if I experience the same issue.

Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 4 of 6
(8,399 Views)
Thanks Ima.

I found a related thread on the LabVIEW forum and I posted there.  You may be interested.  Here's a link.  My post in the link coutains access to my latest troubleshooting programs and comments.  Ultimately, I deleted the "Clock Generation" modules and just ran the clock from the DSA board to the counter.  But still I do not think the synchronization is working.    And I notice some other strange things when I use time stamps to try to determine when things are happening.  Hope this helps, and thank you!
Tristan Ericson

Ohio State University Mechanical Engineering
Dynamics and Vibrations
201 West 19th Ave Suite N350
Columbus, OH 43210-1142

Office: 614-292-9029
Lab: 614-247-8077
Fax: 614-292-3163

"No one is useless in this world who lightens the burden of another." - Charles Dickens
0 Kudos
Message 5 of 6
(8,388 Views)
Has anyone tried the shipping examples in the Order Analysis Tools which implement this sycnronization?  You can find these at
LabVIEW/examples/order analysis/getting started examples/log data (digital tacho, daqmx).vi
 
Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 6 of 6
(8,385 Views)