LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID temperature control

Hi everyone,

 

I made a temperature control  program in labview and used the PID.vi for that.

The input to the PID is the temperature measured by a thermocouple and the output is a voltage that controls the power supply for a heating element.If I set a setpoint, the program even begins to regulate.

However, the problem now is that the output of the PID.vi remains at 100% of the heating power,so at the maximum voltage, until reaching the setpoint and only then begins to regulate down. Therefore, the temperature still rises to + 5 ° C above the setpoint and then oscillates around the setpoint with this deviation.

I've already tried a P controller by setting the I and D parts to false, but got the same result.

So what am I doing wrong? Unfortunately, I have no experience with PID regulation and have been working with Labview for a short time.
Message 1 of 6
(4,045 Views)

Hi magic,

 

So what am I doing wrong?

- you don't attach your VI.

- you don't supply any "hard " data (like temperatue curves, used PID gains, any Ziegler-Nichols experimental data, …)

 

I've already tried a P controller by setting the I and D parts to false, but got the same result.

Using just the P gain will not avoid overshoot…

 

I have no experience with PID regulation

Read a book on control mechanism.

Or Wikipedia. Yes, really. Apply Ziegler-Nichols or any other suitable method!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(4,006 Views)

Open the LabVIEW Example Finder and search for Autotuning Smith Predictor.  

 

The example code uses a simulated "Plant" for responses, but the code can be easily adapted to actual IO.  I just did this last week for an application that had a blower and flow meter that were separated by a long distance.  There was that issue of "deadtime" to overcome.  

 

 

Google Smith Predictor and have a read.  

 

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 3 of 6
(4,001 Views)

Based on basic PID operations, if the temperature overshoots on the way up then your P factor is way too high.  If the temperature oscillates around the setpoint then your I factor is too low.  The D factor is mostly used for mechanical systems.  Adjust each factor one at a time by 50% and repeat.

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 4 of 6
(3,984 Views)

@GerdW wrote:

Hi magic,

 

So what am I doing wrong?

- you don't attach your VI.

- you don't supply any "hard " data (like temperatue curves, used PID gains, any Ziegler-Nichols experimental data, …)

 

I've already tried a P controller by setting the I and D parts to false, but got the same result.

Using just the P gain will not avoid overshoot…

 

I have no experience with PID regulation

Read a book on control mechanism.

Or Wikipedia. Yes, really. Apply Ziegler-Nichols or any other suitable method!


Sorry, I forgot to attach my VI.

Since I've already read some of your comments on PID, I knew that you generally recommend that and it is a good advice. Therefore, I have already read the article on it in Wikipedia.

I should add, that I use a NI USB-6008 and the DAQ Assistant for temperature input and voltage output.

So far, I have tried different Kc values between 0 and 100. I tested Ti with 0.01 (and also inf) and I constantly set Td to 0. I got the same result every time.

Probably it would make sense to try Ziegler-Nichols next.

0 Kudos
Message 5 of 6
(3,957 Views)

There is nothing wrong with your code.  Here are 4 suggestions to troubleshoot:

  1. There should be a delay between updating the analog output and resampling the input
  2. Increase the Ki Time to lower the effect
  3. Add the output variable from the PID to your chart on a second scale
  4. Run the VI.  Save front panel as default values and repost.
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 6 of 6
(3,917 Views)