11-14-2011 01:47 PM
I'd try something like this (I put this together very quickly, can't guarantee that it works, but it's probably the right idea).
11-17-2011 03:40 PM
I added the precentage vi's before and after the pid Im still having an issue with the output the it just jumps from the 100 to -100 percent no real imbetween
11-17-2011 04:21 PM
@cbt wrote:
I added the precentage vi's before and after the pid Im still having an issue with the output the it just jumps from the 100 to -100 percent no real imbetween
Why did you insert the percentage VIs? Do you understand what you're doing here? How did you determine your PID tuning parameters? Look at the math, and the units. You set the minimum and maximum output to values in Amps. If you're using the percentage VIs on the input, then the PI input should be in the range of 0-100. Your Proportional gain is 80. With that proportional gain, how large an error do you need before you reach the 0.02 output limit? (Hint: very, very little).
11-17-2011 04:28 PM
the 80 was a default i was using lower P at around 2 and I of .0001 no D I will setup the 0 to -100 that will help Im sure
11-17-2011 04:31 PM
This is my personal preference, but I would skip the percentage VIs. Set the PID output range to 4-20mA, then divide the output by 1000 before you write it to the analog output.
11-18-2011 08:37 AM
another issue Im having is when the pressure falls below the setpoint it sends the valve to 20 ma to compensate but at 20 ma the valve is full open and at 4 ma it is closed so should my max output be 4 ma and 20 for my min?
11-18-2011 11:25 AM
@cbt wrote:
another issue Im having is when the pressure falls below the setpoint it sends the valve to 20 ma to compensate but at 20 ma the valve is full open and at 4 ma it is closed so should my max output be 4 ma and 20 for my min?
No, you should keep the same limits, but make your proportional gain negative. This will invert the operation of the controller.
11-18-2011 04:04 PM
that helped alot thanks I just need to do some tuning would a autotune pid vi work better?
11-18-2011 04:30 PM - edited 11-18-2011 04:33 PM
I haven't used the auto-tune VIs so I cannot comment on them. I usually use the Ziegler-Nichols closed-loop approach for fast systems and the Cohen-Coon method for slow ones. Once you've done this a few times it becomes easy to generate good initial parameters, which you can then adjust by hand if necessary. If you use either of these methods you do need to be aware that the I parameter is time in minutes, not seconds. There's a reasonably good description in the manual that comes with the PID toolkit, in the manuals folder inside the folder where LabVIEW is installed. However, if you're not already familiar with one of these tuning methods, it may be just as fast to set up the auto-tuning.
EDIT: by the way, it's important to know that because the I parameter is time, a small value increases the effect of the integral. If you chose 0.0001 as the I gain because you expected it to have little effect, you have it backwards.
01-08-2012 01:28 PM
Hi cbt,
I am building a pressure control system which is similar to yours. I am now searching for a metering valve acutator like the one you use. Could you let me know which actuator did you use? Also, could you upload LabVIEW 2010 version of your attached files.
Thanks a lot in advance,
Zacharia