LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID temperature control with blower

I am trying to program a PID control loop that will use a blower to maintain a constant temperature.  I am using type K thermocouples, which have a very large range (I cap my range off at 1100C, starting at 0).  I have set up my code using temperature as the PV to the PID.  I take this number and convert it to % using the EGU to % VI and then feed that into PV.  I take my set point and do the same.  I also have clusters for my PID gains and my PID range (which i had set from 0 to 100, assuming percentage).  When I run this program, I can watch numbers go into the PID, but then it spits out a 0% output.  I am running at very low temperatures to start and am wondering if this is part of my problem?  Perhaps it is as simple as having the wrong gains.  Also, when I change the Kc value, for example, on my front panel, run the program, and then open the PID controller in my block diagram, the Kc value there remains unchanged.  Is this normal?  I have attached my very basic code for reference.  Thank you!
 
0 Kudos
Message 1 of 9
(4,558 Views)
If this is a heat-only application, set your output range for 0-100%.  That should help.  The big problem is that your PV is outside of the loop.  Put that DAQ assistant inside the loop or your PID won't react correctly.  Also, that should be a timed loop of some sort.  After that, it should just be tuning.
Message 2 of 9
(4,548 Views)
Oh, I forgot to mention this before.  My output is to control something using analog output that is 0-5 volts.  I was assuming I could use 0-5 as my range because at this point is is outputting the actual number of volts needed, not a percent, or am I wrong here?
0 Kudos
Message 3 of 9
(4,539 Views)
Yes, that is OK for your actual output.  The PID output range needs to be 0-100% for a heat-only application.  -100% to 0% output usually means cooling.
Message 4 of 9
(4,529 Views)
I understand what you mean...when I saved the file it must have defaulted back to -100 to 100 because I did have it set at 100.  I added a 'wait until next ms' VI inside the loop, and put my DAQ assistant inside the loop.  It still wont work.  When I manually feed a PV into the system, it won't turn my blower on unless the PV is less than the setpoint, which is opposite of what I want to happen.  If my set point is 100 degrees, the blower will turn on if it thinks the process variable is 99, 98, 97, etc, down to 0.  But if the PV is set to 110 degrees, the blower won't turn on at all.  Its almost like my PID is backwards, but I have the correct variables wired to the correct inputs.  I am baffled!
0 Kudos
Message 5 of 9
(4,523 Views)
OK, it appears you are using it for cooling.  In that case, the output limits should be -100% to 0%.  -100% would correspond to 5 volts, and 0% corresponds to 0 volts.  Set it up that way, and it should work.
Message 6 of 9
(4,521 Views)
I changed it so that my minmum PID output is -100 and my max PID output is 0.  If I keep the max on my % to EGU at 5 and the min at 0, my cooling air won't turn on.  If I switch them so that the Max is 0 and the min is 5, it turns out, but constantly ouputs a voltage of 5, no matter what the temperature is.  Also, my PID ouputs a percentage of 0 no matter what my temperature and set point are.  I'm sorry, I just started trying to use LabVIEW for control, and my background is not programming, or controls.  Your help is much appreciated!!
0 Kudos
Message 7 of 9
(4,518 Views)
Hopefully this last change will work for you.  Use the absolute value of the PID output to feed into your PID% to EGU VI.  Keep minimum at 5 and maximum at 0.
Message 8 of 9
(4,512 Views)
I figured that out just before reading your post.  Thanks for all of your help, it works great now!
0 Kudos
Message 9 of 9
(4,504 Views)