LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Temperature controling software

Solved!
Go to solution

Hey guys.

 

Im currently studying at technical univeristy of graz and on my way to my bac degrees.

For my thesis it is my job to develope a temperature controling software using a optris cs lt infrared sensor  to measure the temperature and an mcs tc02 controler to heat up the liquid to later heat a patch clamp system. The higher accuracy it acchieves the better, but everything under 0,5 °C is tollerable. At the moment i worked with stupidly measuring the temp. and if its lower heat more, if its hotter heat less. This methode brings mit to about +- 0,3°C but is very unreliable. It walks between plus and minus and sometimes produces spikes  of about 1 °C.

 

Now im thinking about how to make a good controlling software and did stumble apon pid-controllers. But as i'm a beginner in labview i have no idea how to implement one. Can you help me by looking at what i've got so far and maybe help me implement the controler or give me an idea how to do it differently?

0 Kudos
Message 1 of 13
(4,304 Views)

Hi octaris,

 

LabVIEW comes with ready-to-use PID controllers, no need to implement them on your own.

(Btw. which LabVIEW version do you use?)

And they also provide example VIs to explain them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(4,285 Views)

Hi GerdW,

 

Thanks for your quick reply!

 

I'm using labview 2016.

 

In the before post i attached a vi snippet. In that i tried using the std labview pid it provides and read up all in labviews help menu but i cant get it to work.

0 Kudos
Message 3 of 13
(4,261 Views)

According to its website, your MCS TC02 already is a PID (well, PI) controller. Is there some reason you can't use it to do the control?

0 Kudos
Message 4 of 13
(4,257 Views)

Hi octaris,

 

In the before post i attached a vi snippet. In that i tried using the std labview pid it provides and read up all in labviews help menu but i cant get it to work.

I was posting from mobile so couldn't look at your VIs…

Now that I see them it makes me shiver! 😄

 

- Use (more) wires instead of local variables! What's the point of creating all those RACE CONDITIONS?

- You didn't set any PID gains for your PID controller? Read up on "Ziegler-Nichols"!

- Why do you re-init the PID in each iteration???

- Don't use the EXIT function in this place all these places! Clean up before exiting your program! When you want to do things after the loop you need to place them after the loop: THINK DATAFLOW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 13
(4,248 Views)

Hey GerdW!

 

I know it looked like a field of war. Smiley Sad

So i tried to chang some things and here is a newer, hopefully better version.

 

At the moment i'm using the standard values of the pid in labview and my program gets the temperature to about +- 0.2°C with the while-clock set to 650 ms. but still it occasionally has spikes to about 0.8 degrees above the desired value.

 

any further tips? 

 

yours gratefully,

Michael

0 Kudos
Message 6 of 13
(4,233 Views)
Solution
Accepted by topic author octaris

Hi Michael,

 

here is a newer, hopefully better version.

Much better than before!

 

At the moment i'm using the standard values of the pid … the while-clock set to 650 ms. but still it occasionally has spikes

any further tips? 

Sure:

- Ziegler-Nichols!

- decrease loop iteration time: depending on your system you may get better results with iteration times of 100ms. But: this strongly depends on your system setup: what's the heater power, what's the heater/fluid mass, what's the control loop behaviour?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 13
(4,224 Views)

As I understand your code, you're using the PID loop to adjust the setpoint of the TC02 controller, which is a roundabout way of controlling the heater power. How is the TC02 configured? Is it also trying to do its own PI control at the same time, which would mean that you have a cascade control system?

0 Kudos
Message 8 of 13
(4,219 Views)

Yes thats how it works. The Tc02 is configured to heat a flow heater called pt01. It has a max 15w of heatingpower and can heat the distilled water used to a max 60 ºC.

The tc02 has a pi control for its channels. Meaning it controls the pt01 with a pi to set the desired temp. But thats the temperature of the water comming out of my flow heater and not the temperature of the patch clamp system that i want to heat to a specific value.

And thats the reason i need the "selfmade" controll, to alter the tc02s value in order to get the whole system where i want it.

 

I guess thats kind of a cascade system.

 

@GerdW

The heater has 15W power. With a dropspeed of about ~~1/sec.

We are using destilled water as heater fluid.

 

I tested the new version briefly and i thought it worked best at 650ms. At 50 it hat more spikes and alternated quicker around the desired value. But that may come from the fakt that also my tmperature reading is slowed down with the 650ms and so has less readings. ://

0 Kudos
Message 9 of 13
(4,207 Views)

Hi Michael,

 

I tested the new version briefly and i thought it worked best at 650ms. At 50 it hat more spikes and alternated quicker around the desired value.

Changing the loop speed instead of the PID gains is NOT the usual way to tune a PID controller.

Again I suggest to read up on Ziegler-Nichols!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 13
(4,203 Views)