From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID controller using Labview is not working properly.

Hi friends I have a trouble with PID controller.

 

Here is my problem.

 

1.When current temperature is higher than set temperature, output is usually positive.

As a result, temperature is still increasing.

 

2.When PID is working by chance(I`m not sure It is working), Most of time when I change gain to new gain, temperature doesn`t converge to set point.(ocillation is seen which is not relate with set point)

 

I think I have to change rate time(?) or some other variable, But I`m not sure and what is the problem. 

  

0 Kudos
Message 1 of 7
(4,036 Views)

What kind of heater do you use? I guess not a Peltier heat pump, so your comment about the positive output does not make sense. It should be always a positive value, if you use a conventional heater, no? The heating power output will get close to a relatively smaller value when the system reached the desired setpoint, and the heater mainly contributes to keep the temperature againts heat losses (depends on your insulation).

 

Gain: why do you want to change the gain? Of course if the gain is too high, you will get oscillations. What you need is PID tuning!

A common procedure is here with Ziegler-Nichols parameters: http://pages.mtu.edu/~tbco/cm416/zn.html

So first you bring your system into a STABLE oscillation only using pure P-mode (I and D params are zero). Stable oscillation means the amplitude does not change (increase or decrease) in time! Then you found your ultimate gain.

After this, you record this signal for example in Excel, and plot it, then you calculate the ultimate period time in minutes.

Using the PID calculation table, and these two measured parameters, you can calculate the P, I and D terms to be used! In simple thermostats, this is usually a good enough procedure.

 

By the way, get rid of that sequence structure, and use the error wire to determine data flow! Another flaw in the VI is that you open/close the serial VISA resource at EVERY iteration. This is silly! Open the serial interface BEFORE the While loop once, and close it AFTER the While loop once! 🙂

0 Kudos
Message 2 of 7
(4,000 Views)

I used Induction heater which can operator by power(kw).

 

And I changed Gain because I want to know this PID controller is operate properly.

Also, I change set point instead of gain.

 

Finally It doesn`t work at any gain.

Because the graph of temperature is not ocillate up and down of setpoint, and It is not converge to set point. 

 

I think that some set value is wrong like dt, But what it is exactly.

 

Furthermore, The reason why I initialize device each time is that when I initialize once at start point, It can`t read and write command and date.

I can`t solve this problem so I use it like this. How can I solve this problem?  

 

0 Kudos
Message 3 of 7
(3,995 Views)

The VI has several problems, those should be fixed first. You open and close twice your VISA resource at every operation. I do not know how this induction heater works, but I am sure this is not the good way to operate it!

 


@skyhj105 wrote:

Finally It doesn`t work at any gain.

Because the graph of temperature is not ocillate up and down of setpoint, and It is not converge to set point. 

 

I think that some set value is wrong like dt, But what it is exactly.

Why should it work at any gain? First you should test your hardware setup, just apply a constant output to the heater, and observe what happens. Does it heat up the target?

Then FIX your VI, because it does not do what it should, see my previous comments.

I do not think dt is wrong, you do not need to wire anything to that value, it is calculated automatically inside the VI based on your iteration timing of the While loop.

Did you read my explanation how to do PID tuning? So do so! 🙂

 

EDIT:

 


@skyhj105 wrote:

Furthermore, The reason why I initialize device each time is that when I initialize once at start point, It can`t read and write command and date.

I can`t solve this problem so I use it like this. How can I solve this problem? 


I do not understand your problem here. Read the manual of the heater! Check how you can communicate with it properly! What is the manufacturer/model if this heater/controller?

I also do not understand why you read first the actual power of the heater, then you sum this value with the output of the PID. It does not make sense. A simple procedure of your VI would be:

  1. Measure temperature (by the way, that part works fine for you, do you see proper value? you did not attach your temp. subVI!)
  2. Using the (TUNED) PID parameters, you calculate the required heating power via the PID.vi
  3. Apply the required heating power to the heater
  4. Go back to #1!

EDIT2:

your Output range does not seem right! You kept the default values: +-100. This is silly for the induction heater! What is the min/max range of your induction heater which range it accepts via serial command? USE THAT!

0 Kudos
Message 4 of 7
(3,989 Views)

Thank you for your reply.

 

The reason why I sum PID output and my heater power is that when feedback is stable, than output is near zero.

So current power is good for set temperature.

 

Isn`t it corrent?

0 Kudos
Message 5 of 7
(3,983 Views)

@skyhj105 wrote:

Thank you for your reply.

 

The reason why I sum PID output and my heater power is that when feedback is stable, than output is near zero.

So current power is good for set temperature.

 

Isn`t it corrent?


No, it is not.

You do not consider heat losses. Let your PID controller decide what power to output. If the required power is small when you reached setpoint, the PID vi will reduce its output properly, since you feed the actual temperature to it!

0 Kudos
Message 6 of 7
(3,981 Views)

Thank you for your help

I've got some ideas from your reply, as a result I solved all problems.

 

0 Kudos
Message 7 of 7
(3,935 Views)