07-21-2010 10:47 PM
im learning how to program PID with labview.i just program a simple PID ,but it cann't work.now i want some advice.
i set a initial value 3, and i want to get 10 finnaly.
07-21-2010 11:04 PM
I'd recommend looking in the example finder for PID examples and learn from those.
The problem with your VI is you are confusing your setpoint with your process variable with your output. The PID subVI compares the setpoint to the process variable (I want 70degF, water bath is currently 60degF), how much do I turn on the heater to warm it up (the output). But you are taking your output, multiplying it by 2 and feeding that back around to the process variable by way of the shift register. The key part you are missing in your VI is your actual "plant" (which is simulated in the example), where you output of the subVI causes modifications to the real world (the heater slowly warming the water up, output) which is read by a temperature sensor (process variable) and the subVI continually makes adjustments (the amount of adjustments based on the PID parameters) until you've reached your desired temperature (setpoint).
07-22-2010 02:38 AM - edited 07-22-2010 02:46 AM
thx.In fact,i have learned the example.but i think i have some missing understanding. the PID is just tested whether i get the point about PID. now maybe i must learn deeply.
I want to use PID in my pump system. Check the pressure about water in pipeline, set an anticipant value of pressure, and then, use the PID arithmetic to control the valve close or open. The valve is controlled by current (0-10mA). The whole flow is as the Snap42.jpg. and the program of PID is as the Snap43.jpg.
and now i have tried to add pid into my system. but it cannt work.
I get the output of PID, and put it into the DA function to control the valve. It cannt work. now i have no idea about this,feel confused.
07-22-2010 08:35 AM
What do you mean "it cannot work"? What is it doing or not doing?
Of course you'll have to do the appropriate scaling of the output which appears that you are trying to do. Output value (MV) is set up to be -100% to +100% according to the help of the PID subVI. It may be necessary to change that.
The most common problem with dealing with PID loops is trying to tune it to get the correct PID parameters. Search the forums and NI.com for PID tuning and you should find some knowledgebase articles to guide you how to do that.