Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

PCB 352C23 Accelerometer wired to a NI-9234 compatibility

Solved!
Go to solution

I'm having trouble measuring anything other than noise from a PCB 352C23 Accelerometer wired to a NI-9234 held in cDAQ-9188. I am at the start of my troubleshooting journey but wanted to reach out to the community to see if that chain of hardware was fundamentally incompatible.
Will share more details immediately if those three are good with each other and somebody asks for more.

Kind regards,
Henry
 

0 Kudos
Message 1 of 9
(4,390 Views)

PCB 352C23 Accelerometer is compatible with the 9234. Share your code that configures the DAQmx task; it should configure an accelerometer channel or explicitly enable IEPE excitation. The other specification compatibility to note is the low sensitivity of this high-acceleration accelerometer. At 5 mV/g, you will get 5 V out at 1000 g. What acceleration levels are you testing at? 

Doug
NI Sound and Vibration
Message 2 of 9
(4,372 Views)

Hi Doug,

Thank you for the advice. I believe I've enabled IEPE and seem to be making progress. I really had trouble sampling at 1,000Hz while writing to the file in the while loop (I imagine that took more than 1ms, throwing everything out of time) so I'm build an array and then writing the array as a whole at the end, is that the correct approach? and in general are there any other glaringly obvious issues with the code? LabView is very new to me, let alone "visual programming" so I'm not sure if I'm way off in places.

My measurements will be up to 500g potentially so I'm not expecting great sensitivity in the low acc values, but with the attached setup I'm still not even able to pick up the difference in having the accelerometer with or against gravity, is that normal?

In addition I still think something is wrong as infrequently I get decaying signals as an output and other anomalous readings. Once again, I still don't have loads of faith in my code.

Kind regards,
Henry

0 Kudos
Message 3 of 9
(4,352 Views)

It shoudn't be a problem to continously log data with 1kSPS (or even 500kSPS) 

Do have access to the Sound and Vibration Tools ? 

Take a look at the shipped examples  (Help-Find Examples ..)

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 9
(4,343 Views)

Hi Henrik,

That's good to hear. I don't believe I do, I can't find a examples with elements that I can copy of:
an IEPE enabled accelerometer,
sampling at 50kSPS for 50ms,

saving reading out to a csv/tsv file.
Is using a while loop still the right option for that?

Kind regards,
Henry

0 Kudos
Message 5 of 9
(4,322 Views)
Solution
Accepted by topic author HenryHEXR

In your code, I recommend the following changes:

  1. Use the Analog Input>>Acceleration>>Accelerometer instance of DAQmx Create Channel. It will automatically enable IEPE excitation to power the sensor and AC coupling, and it also has an input for sensor sensitivity.
  2. Use the 1Chan, NSamp (Waveform) instance of the DAQmx Read. This instance will return accurate timing information in the t0 element of the waveform, and will efficiently read multiple samples every iteration. Make sure to connect the samples to read input.
  3. Remove the Wait Until Next ms Multiple
  4. Remove the tick count and subtraction
  5. Remove the divide by sensor sensitivity in the loop as DAQmx will return scaled data for you.
  6. Open a file before the loop, write to the file in the loop, close the file after the loop.

Do you always intend to take data for 1 s ? If so, you may consider a finite acquisition.

 

Rather than make changes to your existing VI, it may be more efficient to start from one of the shipping DAQmx examples:
<LabVIEW>\examples\DAQmx\Analog Input\IEPE - Continuous Input.vi

<LabVIEW>\examples\DAQmx\Analog Input\Voltage - Finite Input.vi

 

If you want to use a soft front panel to configure, acquire, and save the data, you can download a free application here:
DSA Soft Front Panels Download - NI

Doug
NI Sound and Vibration
0 Kudos
Message 6 of 9
(4,318 Views)

Learn about the producer-consumer architecture in LabVIEW.

One loop continously read the data and pipe it into a second loop for display and storing..

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 7 of 9
(4,312 Views)

Thank you very much Doug,

With your help my code looks like this now and nearly does exactly what I need it to do.

HenryHEXR_0-1629463101613.png

You've certainly answered my question so I've accepted yours as the solution but have a few follow up questions if you'd be so kind (otherwise I'll start a new treads in a different boards):
- I would like to save the 9 channels I'm collecting to a JSON file, I can't find the right combination of converting the DAQmx Read data output from array to something "Flatten to JSON" accepts without throwing "polymorphic terminal cannot accept this data" I've tried building an array, clusters etc.
- further to this, the best format would be an array of objects like:

{
"time(ms)": "0.0194",
"ch1": "0.000000",
...
"ch9": "1.212011",
}

or each channel has it's own object and time values. but mainly including the time of each sample as I gather they aren't always the same as the theoretical rate.
- This acquisition is one part of a custom build running on a Raspberry Pi 4 that controls stepper motors, electromagnets and more. I assume I can't get a full LabVIEW instance running on the Pi but can I bundle this up and run it in a headless mode with the DAQ wired up to the pi? Anything to avoid using another computer in addition to the Pi
- Finally, whether it's running on the Pi or a sperate desktop. I have light gates that trigger a slow-mo camera & measure velocity, they go into the GPIO on the Pi. Can I use those to trigger the start of the 0.1 second accelerometer data capture window?

Happy to start asking elsewhere but you've been so helpful so far I wanted to ask more questions!

Kind regards,
Henry

0 Kudos
Message 8 of 9
(4,302 Views)

Glad we could help... and happy to continue helping... but yes, please do start a new thread.

Doug
NI Sound and Vibration
0 Kudos
Message 9 of 9
(4,300 Views)