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: 

Temperature control system using thermocouples and cooling fans

Greetings labview community,

I'm fairly new to the labview program and though I have watched the tutorial videos and tried to search these forums I couldn't find a solution to my problem.

 

I need to write a program in labview that controls the temperature via use of fans inside a case with heatsinks and various electronic parts.

In particular I want to use two thermocouples, in order to measure the temperature of two transistors (one in each side of the case), where heatsinks are placed on top of them.

When the temperature is above 25 degrees, a fan should activate. The fans speed should be faster, the longer the temperature stays above 25 degrees, until it drops down to 25 degrees. 

How can this be done? I thought of using a "mask and limit testing" for activating it, but I can't figure out how to control the speed of the fan in a loop automatically based on the temperature.

Here are some of my specifications:

USB-6009 (this was provided to me and is therefore my only option)

Labview 2011

NIDAQmx 9.5 driver

2 thermocouples (one for measuring the temperature for each transistor and activating one fan)

2 fans 0-5V 

Below you'll see an attachment of the program I've wrote so far (just for one set of thermocouple-fan) and I'm using a slider to simulate the input from the thermocouple. If there is anymore information needed, tell me. 

Thank you very much.

 

0 Kudos
Message 1 of 8
(6,171 Views)

Hi Lomedil

 

What you have is a general control problem. This statement:

"The fans speed should be faster, the longer the temperature stays above 25 degrees, until it drops down to 25 degrees. "

 

Is an indication that you at least need a PI-controller, or you could use a PID-controller. The I in PID stands for integral and that means that the longer you have the same value different from your reference the larger the control signal will be and thereby the faster the fan will spin.

 

I would recommend you to have a look at the following article to learn the basic principles of control theory:

 

PID Control

http://zone.ni.com/devzone/cda/tut/p/id/6440

 

To find the coefficients in your design you can either choose to make a mathematical approximation of your test setup and then calculate the three constants Kd, Ki, Kp using this model, or you can choose to estimate the parameters on a "trial-and-error" basis until you have the desired response time / overshoot i.e.

 

In general you should note that designing a control application on a General Purpose O/S as Windows will not give you deterministic timing, thus your control loop can be more unstable than expected, design your controller with this in mind! For the fan operation it should not be a problem but for more advanced control purposes your would always use a Real-Time system like the singleboardRIO, compactRIO or setting up a standard PC as a LabVIEW Real-Time Target (Converting a Desktop PC to a LabVIEW Real-Time Target - http://zone.ni.com/devzone/cda/tut/p/id/2733)

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

Message 2 of 8
(6,124 Views)

Hello A.Rohde,

thank you very much for your responce. I've read while searching for a control system about the PID, but in most cases it said that I needed a labview addon for it, called "PID and fuzzy logic kit", which I cannot use. I've read this article and will try to test it mathematically and practically in order to make this system work.

I just have a couple of questions. On the example given in figure 8 from the link you've posted, it shows the mathematical calculations being performed and the results transferred to a step response graph and a tranfer function. How am I to connect the input from the temperature sensor and the output to the fan to this code?

Again thank you for your help.

With regards,

Lomedil 

0 Kudos
Message 3 of 8
(6,114 Views)

Hi Lomedil.

 

A step response is not something you calculate your physical input or output to, it only have the function to find the right response for your estimated system model (what in the article is refered to as the plant).

 

The transfer function is your controller. And you can implement this by the PID.vi but as you mention this requires the PID and fuzzy logic toolkit.

 

You can do the matemathical function from the article without the PID function. Then you just manually implement it. To to this you must know the following: If you have a transfer function

 

(s + 1) / (s^2 + s + 3)

 

this can be divided in nominator and denominater by s^(-2) by doing this you get

 

(s^(-1) + 1) / (1 + s^(-1) + 3*s^(-2))

 

you want this because s is the next sample that will occure and s^2 is the sample that will occure after that, but since you don't know the samples that will come in the future you will use the one from the past.

 

s^(-1) is the sample from the previous run and s^(-2) is the sample from the run before.

 

You can remember the last samples by using a while loop with a stacked shift register.

 

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

Message 4 of 8
(6,110 Views)

Hello A.Rohde,

thanks again for your quick responce. yes I've come to understand a bit more about the transfer function and how to use it as a controller. I'll use the equations you just gave me to try and approximate the values that I need.

I've also found an interesting paper about PID control system analysis, design and technology in the link below:

http://eprints.gla.ac.uk/3817/1/IEEE3.pdf

I'll try to build a labview VI to test our setup, see how it works and will post my results here so other people with similar questions/problems can find an answer to them.

Thank you for your time,

with regards,

Lomedil

0 Kudos
Message 5 of 8
(6,105 Views)

You are welcome. Good luck 🙂

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 6 of 8
(6,103 Views)

Im also working on the same project .i need the help of you.can u please send me the final vi file of your temperature control of cooling fan using labview.

My mail id (gsyokesh@gmail.com)

  By yokesh.

Thank you

0 Kudos
Message 7 of 8
(4,482 Views)

Oh, do they recyle homework projects after 5 years?? 😄

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 8 of 8
(4,478 Views)