Pid autotune for a 220v heater control

Hi,

I am currently working on a project where I control a 220 ac heater with an arduino. The temperature is read through a thermistor and a pid control control a triac to heat the heating element.

I have used the pid autotune function with my 3d printer and find it was very convenient. I am now wondering how can I implement this functionality to my project

I have tried to read marlin firmware to "extract" the bit of code I need but this program is way too massive and complex for me to understand what's going on.

What would be your ideas?

Are you sure you need PID in this case? What are you heating?

Wild Bill has a point what is the project ?

There is an Arduino PID library of google can show you how to write your own

Thanks for your reply both of you, I will do a recap as I did not explain the project.

Have you hever heard of the "perfect egg" ?

It is a way of cooking an egg, this technique is quite complex as you must keep the water temperature at precisely 64°C during around 45 min. It is not 63, nor 65, it is exactly 64. So I thought it would be fun to develop a small arduino program for this application.

No, but it sounds specious. How do you propose to even measure the temperature to that degree of accuracy?

With a high precision thermistor it should work I guess, some are given to 0.2 degree of accuracy

You need a stirred heated and insulated water bath to get a steady temperature across the egg .

You also need a precision RTD and hi spec amplifier .

PID can be difficult due to system lags , which will make the response time to change very slow if it is to be stable. Build it and try on/off control first .

I would check the figures you have , the spec you want is very tight - given the variation in egg size and shape … I’ve googled the subject , no figures for how they do it or what with .

Accuracy > expensive .

4 mins boiling does it for me

Would that be enough? You said exactly 64 degrees.

Around? The cooking time is not precise? Would that not make a difference?

Of course it does I just need to make more research about the way to get the precise cooking time!

I'll look into that. But isn't it what we do with 3d printer? When we'll tuned the temperature control is pretty stable

Beware of integral windup - you will likely need to let the temperature settle and light an LED to tell the user to put the egg in.

You may wish to get the temperature close by continuous heating and then engage the PID. Then you can tune it to finer control.

Sous vide wands generally seem to have a pump to move the water around, so to @hammy's point you will likely need something similar.

Wikipedia has an article about methods of picking PID coefficients, have a read. I think there's a PID tuning library available for Arduino too.

Hi,

The accuracy will only be as good as the quality of the surrounding electronic circuitry needed for you to get a measurable output.
You will need to calibrate your circuit when you have built it, do you have a thermometer that is accurate to the tolerances you need to independently check your temp reading?

Also make sure your circuit and AtoD can work at that precision.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

Thanks for all your replies it helps a lot!

My perfect egg is one I can dip toasty solders in, nice a runny yoke. :+1:

Just when one thinks they have heard everything,,,, :rofl:

I foresee a problem due to the latency (as already mentioned) between detecting the temp, turning on/off the heat and allowing for the heat buildup in the heater to dissipate.
Then same same in reverse......

Lead free, I hope.

This guide covers all the "perfect egg" options: Guide to Sous Vide Eggs | The Food Lab

Lead content is not discussed.

Everyone seems to have missed “egg” type jokes in this thread .

If you keep yoking like that you will see the whites of my eyes and I'm not eggsadurating...

@thomasrtg good luck on the quest for the perfect egg....