LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID VI output looks like On/Off signal

Solved!
Go to solution

Hi all,

 

I am new to PID applications, and am currently starting a project involving PID control of an indoor air heater. I ran into some problems and I will really appreciate any suggestions here Smiley Happy

 

The setup consists of a cDAQ-9174 with a RTD module (e.g. NI-9217) and a current output module (NI-9265). The process variable is the temperature incoming that is read from the RTD, and the current output module sends the PID output of 4-20mA to the heater block, 4mA is equivalent to heater off, and anything above that will turn the heater on to different levels accordingly. 

 

I found an example program on the NI website which I modified to suit my setup. PID loop rate is 10Hz, and for this I used software timing (please see the attached VI). The output range for the PID VI is set to 4-20mA. 

 

Upon running the program, we can see the RTD working well (process variable is updating correctly), but the output signal from the PID VI varies between the two extremes (either 4mA or 20mA), which seemingly turned into an On/Off model instead of PID (please see the screenshot "On-off MV.jpg" attached). This resulted in the system oscillating in an undesired manner.

 

I have looked at the example programs in LabVIEW itself, ran some of them and they seem to work fine. I have also looked at their block diagrams, and apart from a different output range setting (default is -100 to 100), I can't see any important differences for other parameters to the PID VI. 

 

Was there anything that I have set incorrectly, or was there something I missed out? All help will be greatly appreciated... Thanks!!

 

 

Best regards,

Victor

Download All
0 Kudos
Message 1 of 6
(4,704 Views)
Solution
Accepted by topic author VLg

If you are going to be using PID loops you are going to need to learn about tuning a PID.  There is a lot of information all over the internet about how to do it and there are different methods depending on who you talk to.

 

The way it is tuned and the small output range you selected will make things move very fast.  What you can do is change the pid output range to 0-100.  Then you can use the PID percentage to EGU vi to use the output of the pid to control your 4-20mA signal.  So 0-100 = .004 to .02.  Then you will still need to tune the PID to your system.

 

 

https://en.wikipedia.org/wiki/PID_controller

 

Message 2 of 6
(4,685 Views)

You need to tune your system, as _Bryan wrote. It doesn't matter if you leave the output range as mA, or if you change it to a percentage - either way will work with the right tuning values (although the values will be different depending on the desired output range), and neither one will work well if the controller isn't properly tuned.

Message 3 of 6
(4,677 Views)

Apologies for my late reply - I have been away for a couple of weeks without internet access since I started this thread, and only managed to get back now - Thanks Bryan and nathand for your answers!

 

You are both right - The saturation has been because the output range has been set to 4-20mA with the default PID parameters (P=1, ...etc). The solution would have been to use the PID % to EGU VI (while retaining the default PID parameters). I can also stick with 4-20mA output range, but the PID parameters will have to be scaled down significantly.

 

With your advice, I have also been reading up on PID tuning techniques, as well as checking out some autotuning examples within LabVIEW.

 

Once again, thank you so much for the help.

 

 

Best regards,

Victor

0 Kudos
Message 4 of 6
(4,510 Views)

@VLg wrote:

The solution would have been to use the PID % to EGU VI (while retaining the default PID parameters). 


No! The default PID parameters are NOT good tuning values. Occasionally they might work, and in extremely rare situations they might coincidentally be acceptable, but they're basically just random numbers. It's not possible to have default values that will work for most systems. You ALWAYS need to tune your controller, regardless of whether you choose to do the output in percent or engineering units.

0 Kudos
Message 5 of 6
(4,501 Views)

I often use the Ziegler-Nichols tuning rule for temperature controllers with good results. You start the tuning with pure P mode (set I and D to zero), and slowly, step by step increase the P value from a enough small value. You need to find the point when you get stable oscillation in time (so the amplitude of the oscillation does not decrease, neither increase). You can save the oscillation curve to excel or use LabVIEW to calculate the oscillation period time in minutes. The used P value to get stable oscillation will be the "ultimate gain", the period time in minutes will be the "ultimate gain". Using these two values you can calculate the P, I and D parameters using the given formula:

http://www.chem.mtu.edu/~tbco/cm416/zn.html

 

0 Kudos
Message 6 of 6
(4,495 Views)