LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tips for achieveing a 20khz sampling rate across 10 AI?

I have a USB-6229, and have it installed in a CAM test machine where it monitors velocity, acceleration, position of the cam roller, the torque on the cam shaft, as well as the position of the camshaft. The shaft is rotating at about 300RPM, and the optical encoders for camshaft position have a resolution of 4096 pulses per rev. I installed this DAQ because of the high sampling rate, but can’t seem to get it logging to file faster than one sample per second. The data capturing would not need to be logging for more than a second or two. The first goal that I am trying to accomplish is getting the raw data saved to a file that can be analyzed later. The icing on the cake would be to capture a revolution by starting the recording processes by a pulse from the trigger on one of the optical encoders, capture at 20khz,stop when the next pulse from the trigger completes, then do this for 10-15 times and average the data received from the 10-15 runs. 

Any tips on this would greatly be appreciated.

0 Kudos
Message 1 of 6
(3,305 Views)

4096 pulses per revolution at 300RPM gives you 1228800 pulses per second. You can not capture this on an analog input of a USB-6229 and 9 other analog inputs at the same time.

You are trying to do some quite complicated data acquisition.

To properly capture the data you require I think you will need to use the counter/timer inputs of your 6229.

 

Have a look as some of the examples that ship with LabVIEW.

Hardware Input and Output >> DAQmx >> Counter Measurements

 

To save the captured data to a file you will need to send the data to another thread so your data acquisition isn't slowed down by file I/O operations.

See producer / consumer architecture.

Save the data using the TDMS functions.

 

 

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 2 of 6
(3,290 Views)

Thanks for the reply Troy. I will take a look into the examples. I have been playing around with the express vi's such as collector, which seem to be working pretty well.

 

Forgive me if I am wrong, but 300RPM *4096 = 1228800 pulses per minute, or 20480 pulses per second? So my DAQ would still be in the ballpark for reading the optical encoder? 300 also is the high end, it will most likely be around 265-280 RPMs.

0 Kudos
Message 3 of 6
(3,278 Views)

Forgive me if I am wrong, but 300RPM *4096 = 1228800 pulses per minute, or 20480 pulses per second?

You are absolutely correct. Must be my mad cow disease playing up again. Maybe a dose of swine flu will fix it.Smiley Happy

 

Using express vis are ok to do some basic things when you're first learning, but they will probably not suit your complex requirements.

 

It is still advisable to acquire data from an encoder using counter/timers though as far as I'm aware.

The problem is that you don't have 10 counter/timers on your USB-6229 device.

 

20KHz is almost right on your signal frequency. Sampling at that rate will likely give you aliasing problems.

You will need to double your sample rate to 40KHz at a minimum.


 

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 4 of 6
(3,270 Views)

If I remeber correct is not a optical encoder output digital? I think it is much better to use digital Input then sampling those channels. I think it is posible to have syncronized analog/digital input in the M series daq board. Anyway I would recomend sampling your camshaft encoder with at least 200KHz sample rate. This will give you far better accuracy.

 

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 5 of 6
(3,233 Views)

I'd recommend you look for the shipping example that shows you how to acquire using an external clock source. Use the encoder as teh clock source and for each pulse the DAQ takes one sample.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 6
(3,226 Views)