LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Feedback using analog input to control digital output

Hi all,
I've got a program that I intended to open and close two valves (and thus actuate two pneumatic cylinders) based on the readings from load cells mounted to each cylinder. The idea was that it would send a digital out to open the valve and extend a cylinder, then close the valve when the load reaches a pre-determined value (with frequency dictated by increasing or decreasing the inlet air pressure and thus the fill time of the cylinder). It would then do so for the other cylinder in a loop. The issue I have is that the response time of the loop actuating the valves was too slow-for a desired force of 1800 N I had to set the limit to 1100 Newtons. It was nice and consistent in this regard but then I started having instances where the valve would stay open long enough to apply a force of 3600+ N. The biggest need in this program is to maintain a consistent load and ensure that the max. load is not being exceeded. I've used local variables and a queue to pass the load values to the valve actuation loop but it did not seem to make a difference. I don't know if part of my problem is the mishmash of data types I'm using in passing the load cell values or if a notifier would be a better bet.
Attached is my code (LV 8.2). Thanks in advance if anyone can offer some guidance.
0 Kudos
Message 1 of 4
(2,711 Views)
Here's a version in LV 8.0 and an image of the block diagram, for those running older versions of LabView.
I'd greatly appreciate any help anyone might provide as I'm getting killed here. Thanks!
Download All
0 Kudos
Message 2 of 4
(2,702 Views)
Johnny-

Without getting into the details of your program operation, I'd like to make a suggestion. In order to achieve better loop rates with your AI, I would suggest lowering your Samples/Channel to something like 100 or even 50. As you currently have it configured, each AI read takes about 1 second and then you compute stastics form that 1 seconds worth of data. Lowering your samples to read means that you will only be analyzing a fraction of a seconds worth a data each loop iteration, but it will speed up your loop and should make your program react more quickly.

Setting the samples to read too low means you run the risk of underflowing your read buffer, but at 1kHz sampling rate, you should be able to run with smaples/channle in the single digits without much difficulty (depengin on how fast your computer is)

Xaq
Message 3 of 4
(2,691 Views)
Thanks for the tip...I'll experiment with that and see what number of scans seems to be optimal. Every little bit helps and I'll now be running this program at a slower frequency anyway so that might get me the desired results. Thanks!
0 Kudos
Message 4 of 4
(2,683 Views)