LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

PID temperature controller ( compressor and Peltier element)

Solved!
Go to solution
Highlighted

Hi people . I'm figuring out how to properly use LABview and my questions are all about my PID output. Hardware: NI 6211

 

In order to cool, a compressor coupled with 2 fans beside my styrofoam thermal box push and pulll the air (PWM controlled)

for the heater a peltier block does the job( Its an on/off controller)

 

e.g: in order to reach higher temps(T>20ºC) i must switch off the compressor through a relay and control those fans to cool when its necessary( i haven't thought about that part yet)

 

deu ruim.PNGa sample

 

questions: 

My VI just turn on and off structures. As you can see ,there's no PWM to vary fan speed(any tips?)

My PID output just make a comparison between the Setpoin and present temperature. how PID gains influence my system?

 

Least but not last, fans or peltier remain active after i stop the VI. why?

 

Thanks a lot for all your support until now

 

 

 

0 Kudos
Message 1 of 7
(1,020 Views)

Hi Luiz,

 

My VI just turn on and off structures. As you can see ,there's no PWM to vary fan speed(any tips?)

PWM usually is output via a DO channel using a counterOUT task.

You may fake the PWM by outputting a waveform on your AO channel.

 

My PID output just make a comparison between the Setpoin and present temperature. how PID gains influence my system?

Please read the basics on PID controllers - they explain the PID gains very well.

I can recommend Wikipedia…

 

Least but not last, fans or peltier remain active after i stop the VI. why?

Because you don't switch them off…

 

On your VI:

It has several big problems!

- please start DAQmx tasks once before the loop.

- stop the tasks once after the loop (and output a "switch off" value before clearing the DAQmx task!)

- don't use a TimedWhileLoop here: use a simple loop and set some sampling frequency for your DAQmx task!

- I recommend to read the DAQmx basics!

- why do you generate "c=1" or "c=2" in your formula node, when the case structure only has cases 0 and 1?

- you don't need formula nodes at all, use plain LabVIEW functions instead (like InRangeAndCoerce…)

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 2 of 7
(969 Views)

i followed your instructions ! Smiley Very Happy

although i could not test my system , i've simulated different input values and it seems to work fine.

 

regarding the frost free feature we'll use its own drinking fountain relay and set the temperature through a button located there...

 

just one thing... everytime i open up my project i have to ajust PID output range once its always set to default!

 

i've created a constant them...

 

i guess i haven't forgotten anything . anything to add? Best regards! 

 

0 Kudos
Message 3 of 7
(961 Views)

Hi Luiz,

 

i guess i haven't forgotten anything . anything to add?

You forgot to

- replace the local variable by wires, thus still have race conditons in your VI

- clear the Termopar DAQmx task

- replace a comparison with zero by the correct function "=0"

- show the digital display of the Thermometer and use that instead of the additional numeric indicator "Actual T."

- use AutoCleanup

 

 

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 4 of 7
(951 Views)

Sry for the delayed response...

You forgot to

- replace the local variable by wires, thus still have race conditons in your VI

is there any future problem using reference nodes?

 

- clear the Termopar DAQmx task

it will be used to acquire temperature, thus i created a control(voltage test) in order to test my system

 

- replace a comparison with zero by the correct function "=0"

DONE!

- show the digital display of the Thermometer and use that instead of the additional numeric indicator "Actual T."

i googled and tried that "search bar" without success... how is it named?!

- use AutoCleanup

what do u mean ?

 

Best regards,
LUIZ

 

0 Kudos
Message 5 of 7
(931 Views)
Solution
Accepted by topic author LuizMarques
02-07-2018 05:32 AM

Hi Luiz,

 

replace the local variable by wires, thus still have race conditons in your VI

is there any future problem using reference nodes?

Why are you talking about "reference nodes" when you just need some wires?

(Btw. references and property nodes do not avoid race conditions!)

 

clear the Termopar DAQmx task

it will be used to acquire temperature

You can use it for whatever you like, BUT: when you open and start a task you should also clear the task when done (as you do with the other DAQmx tasks)!

 

show the digital display of the Thermometer … i googled…

Right-click the Thermometer indicator and select "Visible items->digital display"…

 

use AutoCleanup … what do u mean ?

AutoCleanup

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 6 of 7
(925 Views)

thanks for all ! 

0 Kudos
Message 7 of 7
(915 Views)