Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive control of resonant frequency (DAQ VI FFT analysis)

Hi everyone!

 

I am working on implementing a adaptive loop control of frequency in the fft analysis of the experimental system interfaced by the Daq vi.

the whole process is as follows

 

1) sin input from  daq vi is given to amplifier and to the test subject (resonator and beaker module).

2) The resonator induces vibrations into the beaker, converting from electrical signal to vibratory signals.

3) then i perform the FFT analysis of the output signal which is accuired from the beaker by a pressure sensor.

4) The whole process is to test the b eaker for cavitation, like to check for resonance not the frequency and then check for cavitation.. this is a manual repetitive process.

 

 I have build the loop for continuously sampling the data in a particular frequency range...But ny question is........how to make the system to adapt to a particular resonant frequency on its own (own in the sence, it has to adapt to one particular frequency at which the resonance is maximum)? 

 

below is the code for reference......i would be much thankful, if someone could come up with suggestions....

 

Regards,

Vipul

0 Kudos
Message 1 of 8
(4,340 Views)

Vipul,

 

When the cavitation occurs, what kind of signal is observed?  Clearly there will be a component at the excitation frequency. Does the cavitation/resonance generate a single frequency signal or a band of signals? What is the relative amplitude of the cavitation/resonance signal compared to the excitation signal?  Can you post some data of the time domain signals and the results both with and without cavitation?

 

What does the spectrum in the VI you posted represent? There is nothing in that spectrum which is strongly suggestive of a resonance.

 

To make your program adaptive you need:

1. A reliable means of determining whether the resonance is present.

2. A reliable means of detecting the resonance frequency.

3. A means of generating a new excitation signal at or near the detected resonance frequency.

4. A means of sending the new excitation waveform to the DAQ Write loop.

3. and 4. a. A means to avoid large phase shifts at frequency changes.

5. Possibly some limits on range of frequencies or how fast the frequency can change.

 

Unless you can guarantee that the first element in the excitation waveform is zero, it might be better to create a waveform with one zero element and use that for the DAQmx Write after the DAQ Write loop stops. Unless 3 and 4.a above are managed to always start with a zero element, this becomes more difficult.

 

Lynn

0 Kudos
Message 2 of 8
(4,333 Views)

Hi Lynn!

Thank you for coming up with suggestions...

 

When the cavitation occurs the signal obtained will be a purely linear distorted signal, i.e sawtooth edges at positive end and clamped shape in the negative end...non cavitating signal is a pure sin...the amplitude levels of cavitating signal will be as high as 150Kpa.... 

 

The cavitation generated, is based one single resonant  frequency signal. The spectrum in VI is a sin input signal given to the resonator and the FFT determines the resonant peaks in the beaker.. It does not perform the cavitation test but just indicates the resonant peaks at which we will have maximum cavitation....

 

 

I have attached the cavitating signal and non cavitating signal spectrum for reference.. Hope this problem will be solved....

 

 

Regards,

Vipul

0 Kudos
Message 3 of 8
(4,321 Views)

Vipul,

 

It looks like the cavitating signal should be easy to identify in the spectrum. The presence of multiple peaks more than 15-20 dB above the baseline would work, at least on the one signal shown. Cavitation is probably a non-linear process so the appearance of the extra peaks should be abrupt.

 

How close to the resonance does the excitation signal need to be to trigger the cavitation? How much does the cavitation vary as the excitation frequency varies within the range where cavitation continues to occur?  If the excitation frequency sweeps slowly across the cavitation band in opposite directions, do you get a hysteresis effect? 

 

Lynn

0 Kudos
Message 4 of 8
(4,307 Views)

Hi Lynn!

 

yes, you got it right with the cavitation effect...

 

Actually we expect that the excitation frequency and the resonant frequency has to be same on base line when it comes to have the optimum effect of cavitation..on contrary there will be a sligh doppler shift in frequency..so if we take 20800Hz as the excitation frequency then the resonant frequency is expected to be either a few Hz less than the excitation frequency or higher...how much is the cavitation pressure? depends on how far we could built the impedence match between the resonator (Resonator optimization is based on standing wave condition) and test subject...In this project case, we tried to built a 20Kz resonator and that performed well compared to the previous results...

 

 

Varying the excitation frequency depends on the response function obtained after FFT, lets say that the actual excitation frequency is 20850Hz, then if we shift it towords the subband then,we have a loss of 4-5dBSPL and  the cavitation signal either results in reduction of 10000s of pascals or a pure non cavitating signal....

 

i didnt actually notice the  opposite effect....

 

My primary concern with the process is that, i havent got much information on adaptive control and not much literature existed on this kind of process. so my confusion is very much centred on what kind of controller algorithm is to be designed to reach the final results?

 

would be helpful if you could come up with some good suggestions on this adaptive technique.......

 

Regards,

Vipul 

   

0 Kudos
Message 5 of 8
(4,301 Views)

Vipul,

 

I notice that it appears that you have two different sampling frequencies: The AO sampling rate is set at 160000 while the generation rate is 25000. That may cause problems.  The DAQmx Write is set to use an array of DBL which means that it ignores the dt (sampling interval) in the Waveform from the generation VI. The sampling rate must be > 2 * fmax, the highest freqeuency to be generated. If you want to generate a "clean" sine wave, fs must be much higher, >= 16 * fmax. Also the smallest step in frequency which you can generate will depend on the sampling frequency.

 

For operation around 20 kHz you only get 8 samples per cycle at fs = 160 kHz. At exactly 20 kHz the samples are symmetrically placed but as you move away from a frequency harmonically related to fs, the signal looks less sinusoidal.

 

sine generation.png

 

If your hardware will support it, I recommend sampling at 1 MHz or faster.

 

For the control system you are actually looking at something like a phase locked loop (PLL), although you do not require phase locking.  As in PLLs you have two modes of operation: acquiring lock and maintaining it. In your case you define "lock" as having cavitation, which can be measured by the presence of harmonics in the spectrum.  In the acquisition mode you sweep the frequency until cavitation occurs. Then you move the frequency in small increments to maximize the magnitude of the cavitation. In Sweep mode the frequency steps are as large as possible without missing the cavitation band. In Lock mode the steps are much smaller. It also depends on how much variation the magnitude has from reading to reading.  The exact sizes of the steps depend on the behavior of your system. Without a lot more information, I cannot make specific recommendations. 

 

Lynn

Message 6 of 8
(4,284 Views)

Hi Lynn!

 

That was a great suggestion... Actually i also had this sampling rate match problem but as you suggested i understand why the problem is popping up.. so i will try to work on this tomorrow and will see if the problem will be solved or not....

 

as far as the code is concern, did you find any mistakes in the code that can be reedited...you suggestions are quite great and i hope i can make this code better in the end....

 

Regards,

Vipul

 

 

0 Kudos
Message 7 of 8
(4,280 Views)

Vipul,

 

I do not see anything beyond what has already been mentioned that look like mistakes. 

 

When you start working on the control process, some things will need to change. I think it may be too early to worry too much about those things until you decide what you are going to do as far as the control is concerned.  I find it best to carefully plan or design the control process before starting to wire up the code. For this project I would specify the test or comparisons to be made after each frequecy change. The results of those tests determine which mode the process is in and what the next frequency and even the next set of tests will be. This also should include limit tests to prevent the frequency from "running away" and to avoid making decisions when nothing but baseline noise is present.

 

Lynn

0 Kudos
Message 8 of 8
(4,273 Views)