08-11-2010 08:21 AM
I am designing a program to control piezos in a machining work-piece table.
My goal is to use two LVDT sensors embedded in the table to monitor vibration frequency and amplitude, then feedback this information to the piezos which can attempt to counter-act or maintain vibration amplitude; keeping it in control 🙂
I understand that the programing may be over my head but I want to give it all I can.
I have attached my VI thus far. I'm working right now to be able to control the run and calibration of the LVDT sensors. The thing is I'm not sure if the queue archieture I have (using multiple queues) is the best way to go about it. I'm having trouble getting the calibration event to occur after I start the data acquisition in the program. The upper loop (producer) changes the queue to state 1, my lower loop remains in the idle state when I view it in the troublshooting mode. I had it working before I added the calibration step, but now I'm not sure whats going wrong.
Thanks for any help or advice you maybe can offer
Arthur J.
08-11-2010 08:25 AM
Sorry for the labview in german. If it helps, the events I have are "mouse up" events on the buttons.
I am using labview 8, but I have access to labview 9 on other computers.
Thanks again
08-11-2010 10:15 AM
You had several issues, so I wrote it the way I think you want it to be.
You had two queues being fed into the lower loop, but only one was being updated in your upper loop, so that queue was accumulating elements while the second queue was waiting for a new element. In the lower loop, you used a queue to record the mean values of the data. Since that data is only needed in that loop, you should just use a shift register to keep it. You really only need an event structure in the upper loop.
Take a look and let me know if you have any questions. I saved it in LV 8.0
08-12-2010 05:29 AM
Thank you very much Randall for helping me clean it up. It works great.
I didnt think about clustering my data so that I would only need one queue, very cool.
I had a question on the structure though. The new event case created, "task out", how is that triggered. The click on start event starts the task then the state is changed to state1, but how does labview know to run the task out code?
Thanks again,
Arthur J.
08-12-2010 09:46 AM
I've had quite some time at work today to progress on it. I've attached my updated VI. The top most loop is one I made for the waveform generation that is passed to the piezos. Its a hardware waveform generating machine that I'm using to simulate vibrations on the table.
The feedback seems to work, but I think I have some kind of logical error going on. The amplification numbers for the amplitude values fluctuate trying to find an equilibrium. The do that well enough but then for some reason they bottom out at a value of -0.1 and just stay there. I tried to put in a control to always keep the values greater than or equal to 0 but it hasn't worked so far.
Also I feel I may have went overboard on the property nodes but I didn't know how else to vary the data values.
Any advice on the vi's efficiency or how I could improve it?
Thanks,
Arthur J.
08-12-2010 10:31 AM
You are able to register DAQmx events through the Dynamic Event Terminal. You can also create your own events through this mechanism.
In hardware, on the DAQ card, a signal is generated every time the number of points defined in the configuration is acquired. You are able to register the state of this signal to the event structure, so an event is triggered when this signal indicates the correct number of points has been acquired. It is named 'task out' because that is the default name for a task.
You can look here for more info.