Jump to content

How to generate a trigger (hard) on analog threshold ?


Recommended Posts

Hi all,

I am acquiring an analog signal with A PCI 6227 board at 40kHz, this signal comes from a microphone that measures the sound of a mechanical watch.

As you can see on the graph below, every 166ms we see the same noise pattern that correspond to 3 shocks in the mechanism.

I have a DAQmx task to acquire this analog signal. This is basic DAQmx.

post-7452-1213869344.png?width=400

Now I'd like to go one step further and generate a trigger on a digital output ( to trigger an image acquisition) "as soon as possible" after detecting the first noise of the pattern.

I'm not really familiar with DAQmx, and I don't really know what is the best way to go.

I've tried to set a trigger generation on the threshold and to set it as automatically retriggerable, but then I get a trigger for the 3 peak of the pattern ; I'd like only one trigger on the first peak.

Any ideas ?

Link to comment

QUOTE (Antoine @ Jun 19 2008, 05:56 AM)

Now I'd like to go one step further and generate a trigger on a digital output ( to trigger an image acquisition) "as soon as possible" after detecting the first noise of the pattern.

I'm not really familiar with DAQmx, and I don't really know what is the best way to go.

I've tried to set a trigger generation on the threshold and to set it as automatically retriggerable, but then I get a trigger for the 3 peak of the pattern ; I'd like only one trigger on the first peak.

Any ideas ?

My first idea is to use FPGA based hardware. I'm guessing you're locked into the hardware you're using, though.

My second though, and I've not investigated what's possible here, would be to leverage counter timers to as to provide a triggered reset line for, say, 100 msec (think of a off-after-delay relay). I'm assuming you have a PCI-6221 instead of a PCI-6227 (can't locate a 6227 on the website); the PCI-6221 doesn't have any counter/timers, so that's out.

My third-and-least-favorite thought is to keep your loop timed to work at, oh, 20 to 60 Hz (166 msec ~= 6 Hz, so this is at least double to 10 times the rate) and programically re-arm the trigger. This option is entirely at the mercy of the operating system.

Good luck.

Tim

Link to comment

QUOTE (Antoine @ Jun 19 2008, 05:56 AM)

Hi all,

I am acquiring an analog signal with A PCI 6227 board at 40kHz, this signal comes from a microphone that measures the sound of a mechanical watch.

As you can see on the graph below, every 166ms we see the same noise pattern that correspond to 3 shocks in the mechanism.

I have a DAQmx task to acquire this analog signal. This is basic DAQmx.

http://lavag.org/old_files/monthly_06_2008/post-7452-1213869344.png' target="_blank">post-7452-1213869344.png?width=400

Now I'd like to go one step further and generate a trigger on a digital output ( to trigger an image acquisition) "as soon as possible" after detecting the first noise of the pattern.

I'm not really familiar with DAQmx, and I don't really know what is the best way to go.

I've tried to set a trigger generation on the threshold and to set it as automatically retriggerable, but then I get a trigger for the 3 peak of the pattern ; I'd like only one trigger on the first peak.

Any ideas ?

This is admittedly a "hand waving" answer.

How about configuring a triggered acq and set the post trigger size large enough to get the second two chirps.

Anther trick that may help is to set-up (configure but do not start) two acquistions for the same channels but only arm one at a time. When one is trggered, arm the second, etc.

Just sharing ideas,

Ben

Link to comment

Rectify and smooth the signal, that way, you only get one trigger per sound packet. If you need to make things as fast as possible, pipe the processed data back into an output channel and configure the appropriate analog trigger parameters.

Or alternatively, if the noise is occuring at a specific frequency, there is a single tone frequency detector VI in the signal processing palette. I believe the VI has a window size parameter, so you can have it process data in packets large enough to contain an entire packet of sounds at a time. You could then generate a software trigger when you detect your particular tone.

Link to comment

Thanks all for your replies,

QUOTE (Tim_S @ Jun 19 2008, 09:10 PM)

My first idea is to use FPGA based hardware. I'm guessing you're locked into the hardware you're using, though.

My second though, and I've not investigated what's possible here, would be to leverage counter timers to as to provide a triggered reset line for, say, 100 msec (think of a off-after-delay relay). I'm assuming you have a PCI-6221 instead of a PCI-6227 (can't locate a 6227 on the website); the PCI-6221 doesn't have any counter/timers, so that's out.

My third-and-least-favorite thought is to keep your loop timed to work at, oh, 20 to 60 Hz (166 msec ~= 6 Hz, so this is at least double to 10 times the rate) and programically re-arm the trigger. This option is entirely at the mercy of the operating system.

Good luck.

Tim

I'm not locked to the hardware I have, I have a 6221 (not a 6227 which doesn't exist, sorry) because I'm acquiring different signal, but if there is a need for another board I still have a free PCI slot in the computer.

FPGA... well I though about it bit I'm really not familiar with and I'd prefer a DAQmx solution, RT is also something I'd like to avoid even if I lose a bit in time accuracy.

I like your second idea (counter timers so as to provide a triggered reset line for, say, 100 msec (think of a off-after-delay relay)) I though this could be configured in the DAQmx task setting but I didn't find it. Anyone knows it is possible and how ?

QUOTE (neB)

How about configuring a triggered acq and set the post trigger size large enough to get the second two chirps.

Anther trick that may help is to set-up (configure but do not start) two acquistions for the same channels but only arm one at a time. When one is trggered, arm the second, etc.

Just sharing ideas

As I said I've looked for a LabVIEW example that does this but didn't find - I might have missed it though. Do you know how to code this ?

I hadn't thought of 2 acquisitions, one at a time ; I'll keep this idea in mind :lightbulb:

QUOTE (Yuri33)

Rectify and smooth the signal, that way, you only get one trigger per sound packet. If you need to make things as fast as possible, pipe the processed data back into an output channel and configure the appropriate analog trigger parameters.

Or alternatively, if the noise is occuring at a specific frequency, there is a single tone frequency detector VI in the signal processing palette. I believe the VI has a window size parameter, so you can have it process data in packets large enough to contain an entire packet of sounds at a time. You could then generate a software trigger when you detect your particular tone.

Hmmm.. At the very beginning I thought I could trigger both the video camera and the sound acquisition at 4kHz (get one image per trigger with the camera and 10 sound sample at 40kHz per trigger), do some signal analysis to find the noise pattern, get the buffer of the moment it started and get the corresponding buffer on the camera.

I gave up this idea thinking that it would be alot easier to do with DAQmx and also the noise pattern can be very different from a type of watch to another so I'd have to modify the analysis for each type of watch.

Good idea anyway :)

Link to comment

QUOTE (Antoine @ Jun 19 2008, 05:56 AM)

Hi all,

I am acquiring an analog signal with A PCI 6227 board at 40kHz, this signal comes from a microphone that measures the sound of a mechanical watch.

As you can see on the graph below, every 166ms we see the same noise pattern that correspond to 3 shocks in the mechanism.

I have a DAQmx task to acquire this analog signal. This is basic DAQmx.

http://lavag.org/old_files/monthly_06_2008/post-7452-1213869344.png' target="_blank">post-7452-1213869344.png?width=400

Now I'd like to go one step further and generate a trigger on a digital output ( to trigger an image acquisition) "as soon as possible" after detecting the first noise of the pattern.

I'm not really familiar with DAQmx, and I don't really know what is the best way to go.

I've tried to set a trigger generation on the threshold and to set it as automatically retriggerable, but then I get a trigger for the 3 peak of the pattern ; I'd like only one trigger on the first peak.

Any ideas ?

I think your DAQ board is a bit at the low end of the NI spectrum. The higher end DAQ boards support analog triggering including pretriggering and with a long enough post trigger period you will get the entire three chirps in one acquisition.

You could even route the internal trigger signal from the analog trigger to some output signal through RTSI and have that signal available external too in that way if you needed.

Rolf Kalbermatter

Link to comment
  • 1 month later...

QUOTE (Antoine @ Jun 19 2008, 11:56 AM)

Hi all,

I am acquiring an analog signal with A PCI 6227 board at 40kHz, this signal comes from a microphone that measures the sound of a mechanical watch.

As you can see on the graph below, every 166ms we see the same noise pattern that correspond to 3 shocks in the mechanism.

I have a DAQmx task to acquire this analog signal. This is basic DAQmx.

http://lavag.org/old_files/monthly_06_2008/post-7452-1213869344.png' target="_blank">post-7452-1213869344.png?width=400

Now I'd like to go one step further and generate a trigger on a digital output ( to trigger an image acquisition) "as soon as possible" after detecting the first noise of the pattern.

I'm not really familiar with DAQmx, and I don't really know what is the best way to go.

I've tried to set a trigger generation on the threshold and to set it as automatically retriggerable, but then I get a trigger for the 3 peak of the pattern ; I'd like only one trigger on the first peak.

Any ideas ?

Hi,

I just to let you all know, I found an easy way to exactly what I wanted with a PCI 6221 board - other boards would work as well but this is the one I had available.

The solution is based on a LabVIEW example "Cont Gen Voltage Wfm-Int Clk-Analog Start.vi".

Thanks to all who helped on this :)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.