LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing PID Controller to Regulate Temperature

I am a lab assistant from an undergraduate teaching laboratory and I have only been using LabVIEW for approximately 2 months. We are trying to implment a PID controller without any toolkit for an existing heat exchanger experiement to control the temperature by regulating the steam value. The temperature has to be kept constant once the desired temperature is obtained, and increase it automatically when it drops. My rationale in this case is: set steam value - obtain desired temperature - stop supplying steam - temperature drop - open steam valve automatically - obtain desired temperature . However, we have a problem with wiring the correct set point and the output. I am using a Control and Simulation Loop and a PID Advanced Autotuning subVI within. cDAQ-9174 is used.

 

I can screenshot part of the block diagram if needed. Thank you!

0 Kudos
Message 1 of 7
(3,601 Views)

Please be more specific than "we have a problem with..." What question do you need answered? What isn't working? Are you able to run the LabVIEW code but not achieve the desired setpoint, or you cannot run the program because there's an error in the code itself? Attaching your code will help, but you also need to explain the exact issue.

 

Are you running this with a real system yet, or so far purely in simulation? If you are able to run your code, can you provide a graph showing the setpoint, process variable, and output?

0 Kudos
Message 2 of 7
(3,574 Views)

In the documentation, there is an example that might help. The online documentation can be found here: https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/addons/control/pid/autopid-llb/pid-...

 

The example that it is referencing can be found on your machine under Program Files at \National Instruments\LabVIEW 2013\examples\control\PID\Autotuning PID Online.vi

 

I may be misinterpreting your question. Are you having an issue with the actual acquisition and generation of signals?

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

Edit: Double post

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

Now, our main problem is that we are unsure whether the "set point" and the "process variable" must be of the same scale/unit. Our set point is the temperature of the hot water tank in unit degree Celsius, while the process variable is the opening size of the steam valve in unit percentage. Steam valve regulates the amount of steam supplied to the hot water tank to increase the temperature. Since these two variables are not in parallel unit, this hinders us from moving forward. Hopefully someone can clarify this 🙂

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

If you're trying to control temperature, shouldn't your process value be the current temperature? I would assume you would apply some sort of threshold to the output then which tells you whether or not to open your valve.

 

Also: This is for cRIO, but you might be able to re-use some of the pieces in your application: https://forums.ni.com/t5/Example-Code/CompactRIO-Temperature-Controller-Reference-Application/ta-p/3...

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

You have a problem with terminology. Process Variable is the value you are MEASURING. Of course it must have the same units as the setpoint, because the goal of PID is to drive the process variable to the setpoint (more specifically, to drive the error - the difference between setpoint and process variable - to 0). In your case both the Setpoint and the Process Variable have units in degree Celsius. The Output is how far to open the valve, and does not need to be in the same units (in most cases it would be impossible for it to have the same units). The Proportional Gain acts as a conversion factor between the input units and the output units - it specifies how much to change the output (in output units) for a given difference in the input units.

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