LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT - PID Gains - where and when to use them

The attached is example code for controlling a temperature chamber. The question is where and when to use PID Gains? This code looks as though the PID Gain is used for the variable/parameter temperature (i.e. the temperature is the controlled variable).

 

So would there be just one PID Gain per controlled variable/parameter (temperature in this case) or would each device controlling temperature in the system get a PID Gain?

 

In this example, the fan and lamp are controlling the temperature.

0 Kudos
Message 1 of 23
(2,908 Views)

Your question doesn't make much sense in the context of the example you posted, since the fan is simply on or off and the PID controls only the lamp. That example is designed to show how the PID responds to turning the fan on or off. Note that the "Apply Disturbance" button turns the fan on.

0 Kudos
Message 2 of 23
(2,892 Views)

I am sorry you are having trouble understanding my question. I don't know how else to ask it. NI has really confused me and left me in the dark prior to my SSP running out. They screwed me on my SSP because it took them six months to get me the proper hardware after the SSP activation and now I am stuck with the discussion groups.

 

I was using this example for discussion with them because my code is proprietary. They told me for every controlled device I added to my code, I would need to add a PID Gain to "Initialize.vi" and "Chamber Control.vi".

 

1. Where and when to use PID Gains

2. Now that you mentioned the "Apply Disturbance" button, I actually thought this example was turning on/off the fan itself. It went along with the RT class, which I did remote and made it impossible to observe the system response.

0 Kudos
Message 3 of 23
(2,880 Views)

Russ_in_Louisville wrote:

2. Now that you mentioned the "Apply Disturbance" button, I actually thought this example was turning on/off the fan itself. It went along with the RT class, which I did remote and made it impossible to observe the system response.


That's exactly what the Apply Disturbance button does - it turns the fan on or off, which changes the temperature and forces the PID controller to react to maintain the temperature. Since the fan has no role in controlling the temperature in this example, your comment in your initial post that "the fan and lamp are controlling the temperature" is incorrect, and that's why I don't understand your question.

 

Independent of LabVIEW, do you understand PID control? If not, there are many good resources on the NI site and elsewhere on the web.

 

Blaming NI for your problems, and claiming you're "stuck with the discussion groups," is unlikely to win you much assistance from volunteer posters here.

0 Kudos
Message 4 of 23
(2,870 Views)

I am sorry I am looking for a simple answer. Not looking to wade through endless forests of PID info. I could spend years on this site looking for an answer if I am left to looking for it by myself.

 

Where and when to use PID Gains? Is what the NI applications engineers told be wrong or correct? As I expand on the idea of this example, does each controlled device get a PID Gain as the app engineers suggested or just each variable/parameter? In this example, it looks like to me the variable/parameter to be temperature; and only it is getting the PID Gain. Since the disturbance was brought up, if the disturbance button is removed, is the PID Gain removed too? Let's say the fan is automated to respond to the heat from the lamp. 

 

Not blaming, just stating the facts. They took six months to get me the correct hardware while the clock was ticking on my SSP and refused to acknowledge such. I think the board is good but I find information gets lost, hence my frustration. Just the misunderstanding of my original question demonstrates info gets lost.

0 Kudos
Message 5 of 23
(2,860 Views)

You are asking questions that reflect your mental model of the system, and I think the problem is that your mental model does not match the code. Since the only description of the system you have provided is the code, when you ask questions that do not make sense in the context of that system it is very hard to give you answers. You think you're asking for a simple answer but the question itself is based on a faulty model.

 

If you are not willing to take the time to learn and understand the system, you should seriously consider hiring someone to write your code for you. If you do not understand PID, it would be easier to start with a simpler example that does not also involve RT and shared variables. I think there are several that ship with LabVIEW.

 

In the code you posted, the fan is completely independent from the PID control. The fan exists only to demonstrate that the when something outside the system causes the temperature to change, the system responds by changing the power to the lamp. If this system were placed next to a window in wintertime, you could get the same effect by opening or closing the window. What you asked is equivalent to "If I seal the window closed, is the PID Gain removed too?" Why would sealing the window have any effect on your code?

 

Maybe the question you meant to ask was "If I remove any possible disturbance, do I still need a PID loop?" That depends. Do you have an accurate model of how the system responds? Will you need to change the setpoint? It's not a simple yes or no question, and maybe it's not even the question you wanted to ask. However, if you spent some time understanding PID control, you would have the answers to this and many other related questions.

0 Kudos
Message 6 of 23
(2,839 Views)

Are you finished attacking me now?

 

If I could hire someone to write the code, I would. I don't appreciate the language and patronizing.

 

I came here for help as this is where NI pointed me in their failure. I did not come here to get my "mental model" attacked.

 

I came here to be shown how to fish without going on a life-long fishing expedition. I need to be shown as I don't do reading through a forest of information.

 

Can you please answer the question?

 

Where and when to use PID Gains? Is what the NI applications engineers told be wrong or correct? As I expand on the concept of this example, does each controlled device get a PID Gain as the app engineers suggested or just each variable/parameter?

0 Kudos
Message 7 of 23
(2,821 Views)

> Where and when to use PID Gains?

Answer: Whereever and whenever you want to use a PID controller.

 

e.g. Since you want your temperature to be under PID control, your temperature controller needs a set of PID gains. However, since your fan is under on/off control (not PID control), your fan controller won't have a set of PID gains.

 

> Is what the NI applications engineers told be wrong or correct?

(Not enough information) What did the NI applications engineers tell you?

 

> As I expand on the concept of this example, does each controlled device get a PID Gain as the app engineers suggested or just each variable/parameter?

Devices, variables and parameters do not get PID gains. PID gains are parameters that you give to your PID controller(s), in order to optimize their performance.

 

To carry the discussion further, please answer this question: What do you want your PID controller(s) to do?

Certified LabVIEW Developer
0 Kudos
Message 8 of 23
(2,806 Views)

Russ_in_Louisville wrote:

I came here for help as this is where NI pointed me in their failure. I did not come here to get my "mental model" attacked.


Can you accept that your model of the system might be wrong, though? In this thread from a few weeks ago, multiple experienced users told you that what you had on your block diagram was an array, and yet you insisted - repeatedly - that what you had was a cluster. Your model was that the item on the block diagram was a cluster, leading to the question "how do I get an index display on it?" which made no sense, because the item was in fact an array. And, when you finally realized you were wrong, you couldn't even admit it or thank the people who pointed out your error - it just "turned out" that the constant wasn't what you thought it was. I am trying to tell you that you are making a similar error here by asking questions about the system that do not correspond to what the system actually does.

 

"Parameter/variable" isn't clear. There is correct terminology. A PID controller has, as inputs, a process variable and a setpoint. The process variable is the parameter you want to control, such as temperature. The setpoint is the desired value of the process variable. Let's say you do have a temperature control system where there is both a heating system and a cooling system (again, not the situation in your sample code). The two systems could both be driven by PID and share the same setpoint and process variable. Some control options for this system:

- a single PID controller with one set of gains, where a negative output drives the cooling system and a positive output drives the heater (or some variation on this), if both the heater and chiller have similar performance characteristics.

- two PID controllers, each with a set of gains, one controlling the heating and one controlling the cooler.

- a combination of these two: a single controller with gains that are selected based on the setpoint or process variable, which is known as gain scheduling. The advantage to a single controller is that you'd never have the two controllers fighting each other.

 

You could also have a code that controls several similar processes (for examply, multiple identical temperature chambers). In that situation you could have a single set of PID gains but multiple controllers each with a different setpoint and process variable.

 

So there's not a simple yes/no answer to when you need a separate set of PID gains or an additional PID controller. It depends on the characteristics and design goals of your system. Does that help?

Message 9 of 23
(2,794 Views)

Thank you Nathand for your comments. At this time I have no forward plans for futher communication with you. I am not finding it mutually beneficial.

 

Others are welcome to join in the discussion as this issue remains unresolved.

0 Kudos
Message 10 of 23
(2,780 Views)