Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

AO of Sine Sweep with Amplitude Modulation in Real Time on M-series

I am trying to obtain a constant sound pressure level (SPL) at a speaker over a wide range of frequencies (20-20k Hz).  I have an SPL meter for feedback which is very linear. However, my amplifier and mechanical test setup have varying distortions and resonances that change with frequency and between test setups which produce gains in losses in the SPL.  With the goal of producing a flat SPL over the entire frequency range, I would like to use the feedback from the SPL meter to change the amplitude of my output sine wave to compensate for the resonances.  I would like to do this while sweeping over the entire frequency range and adjust in real-time using PID or other gain controls.

 

Can this be done with an M-series DAQ board (6259) or must I use a function generator? 

 

The issue I run into is that the DAQ card does not like to cleanly output the sine wave if I modify the write register while it's outputting a signal.  I can change the clock frequency (with a property node) to adjust the frequency of the output sine wave, but amplitude adjustments seem to require changes to the write register in the card.  Is there any way to time reading and writing to the card's memory so that it outputs seamlessly, or do both reading and writing rely on the same BUS in the M-series? 

 

Thanks,

 

-Eric

0 Kudos
Message 1 of 3
(3,744 Views)

Hey Eric, 

 

Sounds like a fun application. I can think of a few different options for staying with the 6259:

 

For changing the amplitude, you could do it in SW (tricky but doable) or you could do it in HW if you're willing to use an extra AO channel. To do generation in SW, you've got a couple options there too. You can continue to change the clock, or you could just change the waveform amplitude and frequency. Any time you're trying to maintain phase, I would make sure to use non regeneration (start with the Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi shipping example) and use the Basic function generator to maintain phase. You should be able to update the amplitude as well... though you might have a spike if you're not at a 0 crossing. A good way to make sure you're at a 0 crossing would be to write out a sine wave with an integer number of periods, update the sample clock to change frequency and the amplitude (without changing the frequency on the basic function generator vi) with the basic function generator. 

To change the amplitude in HW, the 625x devices have an option to use an external reference for your voltage. I'd start with the Gen Voltage Update-Ext Reference.vi example. You could use a different AO channel to supply the reference voltage, and vary it to scale your output channel. You could change the clock to change the frequency, and change the reference voltage to change the amplitude. Note that you cannot have two AO channels clocked at different rates, so you'd have to have the AO channels in the same task, and just update the array for the reference channel, or you could update the reference channel statically (without a clock). Note that when you use an external reference the output data is uncalibrated, but AO is highly linear so you should be able to measure the offset pretty easily. The M-series user manual has good info on the AO Reference, but feel free to post if you have more questions on it.

 

Also, I assumed you're in LabVIEW but the examples should be pretty much the same in other languages, or one can be modified quickly. 

 

Hope this helps,

Andrew S 

Message Edited by stilly32 on 04-10-2009 10:04 AM
0 Kudos
Message 2 of 3
(3,731 Views)

It turns out the 6259 will not work well in my desired frequency range.  The dividers are too coarse in the higher frequency range. I ended up sourcing my sine sweeps with a pxi-4461 and sensing the accelecometers with a 4472b. I used the output filters on the 4461 to get a smooth sine wave.

0 Kudos
Message 3 of 3
(3,368 Views)