Hi all!I’m seeking a help in this labview application that I’m using in my research project. I have two actuators, outputs, both are operating at the same frequency and sampling rate. The first output, speaker 1, is my excitation to the system. I used a simulate signal function to generate the sine wave signal and feed it to the DAQmx vi. The second output, speaker 2, is my controlled output to the system to keep my input at a certain level. In a close loop control system style, I take the input signal which has been excited by speaker 1 and compare it to a desired fixed value. I take the difference, Error, and multiply it by a gain and feed it back to the system, and that is my speaker 2. The goal is to have my input, the resulted sinusoidal signal due to speaker 1, at a certain value by comparing it instantaneously to a fixed value and feed back the error value to the system. in order to achieve this goal, an RMS value has to be taken from the input signal to be compared to the desired value which is the reference value.
what I am trying to achieve here is taking the RMS/peak value of the acquired data for every single cycle by speaker 1 and multiply it by a gain and feeding it back to speaker 2 before speaker 2 generates its next cycle of the sinusoidal signal. Starting off the first generated cycle of the signal form speaker 1, the DAQ acquires data from microphones, sensors, and takes the RMS or Peak value for this single cycle. The RMS value will be subtracted from the desired value, and the resulted error will be multiplied by a gain, and sent to speaker 2. And It will keep on running until the RMS value matches the desired value and the error would be zero. The job of speaker 2 is to control the system and keep the output at a certain level.
I don't how to make this work. As I am still clueless on what do. I have tried methods like Case Structure where I've delayed the iteration time to wait till first period finishes and speaker 1 excites, and then acquire data and then process it and send signal to speaker 2. Also I tried flat structures, timed structures....