LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pressure Controller PID

Hey guys I wrote a simple program that's suppossed to control the value of pressure through a voltage setting, but I'm having trouble with the experiment. I'm using the NIUSB6008 run through an isoverter and a Marsh Bellofram to control the pressure. If you could look at my code and tell me if I'm doing something wrong or if there is something I need to add that'd be great. Thanks in advance.

0 Kudos
Message 1 of 11
(3,452 Views)

Please be more specific than "having trouble with the experiment." What exactly is going wrong?

 

You did not include the Simple PID VI with your attachment, so there's no way to know if the PID itself is working. Did you write it yourself, or download it from somewhere? It would be better to use the PID VI from the PID Toolkit, if you have it.

 

Are you scaling the DAQ input to pressure units? It would be helpful to add a chart showing the setpoint, the process variable, and the PID output. Then you could run it and upload a screenshot showing how the PID is responding.

 

Did you tune the PID at all (adjust the gains)?

 

There should be some sort of timer (such as Wait (ms)) inside the loop, otherwise it will spin as fast as possible and consume all available CPU time.

0 Kudos
Message 2 of 11
(3,446 Views)

The DAQ input is in voltage since LabView wouldn't let me use pressure with the NIUSB6008. We're getting a voltage output, but it's not consistant and when we move the slider to adjust the voltage levels the system output doesn't respond. I did not write the PID, but I wrote the rest of the program. I don't have the toolkit module. I've uploaded the simple PID that I used for the program.

0 Kudos
Message 3 of 11
(3,432 Views)

One simple thing to do is replace the DAQ input with a control, and the DAQ output with an indicator or a chart. Start simple - proportional control only (I and D set to 0). Enter a voltage for the simulated DAQ input, and change the setpoint. You should see that the proportional control works: when the setpoint is equal to the process variable, the output should be 0, and when they differ, the output should be the error multiplied by the proportional gain. Does that much work? Then add in some integral gain, and see how it affects the output. You'll probably have to slow down the loop rate with a wait (which should be there anyway as I previously mentioned) so you can see it happen slowly. The output should respond to moving the setpoint slider.

 

Again, please be as specific as possible in what's not working. "Not consistent" meaning what here? Real data is extremely helpful. As I suggested before, add a chart showing the setpoint, process variable, and output, run your code for a while, and take a screenshot so we can see what's happening.

 

How did you determine what PID gains to use? If you picked them at random, or used the defaults, they will almost definitely not work.

0 Kudos
Message 4 of 11
(3,430 Views)

Are you talking about something like the VI I attached (I know it's not great). By controller are you refering to a numeric controller that I hook into the system or what?

 

By "Not consistent" I mean the output read from the red hand on the gauge will jump from zero to at most halfway to the .25 marker before going back down to zero and repeating. I expect some fluxuation, but not this. For a while the hand would act completly sporadic, jumping from zero to the five and everywhere in between radily so that it's no fixated around a certain point for any reasonable amount of time, but now it's as I descrived initially of the read hand fluxuating around 0-.25 range. Also as I adjust the sliding scale the red hand doesn't seem to adhere to the input and often times regardless of me moving the slider, the red hand acts of it's own accord despite me moving the hand.

 

I added a two charts to the initial program that outlie the input and output levels in the form of Wave charts. I added the photo of it. Also I added the wait(ms) into the program.

Download All
0 Kudos
Message 5 of 11
(3,386 Views)

Also here is the updated program with the DAQ assistants.

 

0 Kudos
Message 6 of 11
(3,382 Views)

@Kisolveig wrote:

Are you talking about something like the VI I attached (I know it's not great). By controller are you refering to a numeric controller that I hook into the system or what?


Yes - that's the right idea. But I didn't use the word "controller" anywhere in my post. I did say "numeric control" which refers to a front-panel item that lets you set a value, and that's what you did. Did you actually play with it at all? The proportional control, at least, works fine; I didn't investigate further than that.


Kisolveig wrote: 

I added a two charts to the initial program that outlie the input and output levels in the form of Wave charts. I added the photo of it. Also I added the wait(ms) into the program.


Looks to me like you have a noisy signal. Do you have any reason to believe that the chart doesn't reflect the value that your DAQ system is actually reading? Are you sure the signal is properly grounded?

0 Kudos
Message 7 of 11
(3,376 Views)

Yeah I played with it and to no avail. I'll try testing the wiring of the system and see if that helps. Is there anyway in the code I can account for the noisy signal?

0 Kudos
Message 8 of 11
(3,357 Views)

Again, please be more specific. What did you play with - the version without any real IO? Could you see the PID doing what you expect?

 

First you need to know if the signal is noisy, or if it's real data. Can you put in a pressure gauge at the same location? Can you apply a fixed pressure to the pressure transducer somewhere outside your system? Do you know what reading you expect from the pressure transducer (or whatever your measurement device is)? Can you hook up some other signal source and see if it's equally noisy? A standard 1.5V battery (such as AA) is a good choice if you don't have anything else.

0 Kudos
Message 9 of 11
(3,351 Views)

I ran the system multiple times adjusting the voltage I wanted on both versions, to no avail. I have a pressure gauge on the tank telling me what pressure I have and since I'm running it through the Marsh I have another pressure gauge at the end. The pressure gauge at the end give off no readings because the Marsh isn't getting the power necessary because if the voltage levels are too insignificant it doesn't let any of the air pressure through. I expect the pressure transducer to be around 5-20 PSI depending on how high I want the pressure. I can try to hook up another signal source and see if that helps. 

0 Kudos
Message 10 of 11
(3,321 Views)