Hi gyus, I have an old little heater powered refridgerator whose thermostat burnt out. I couldn't find a replacement, so I figured I'd put together a microcontroller, a temp sensor and one relay instead.
I decided to just copy the thermostat hysteresis way of controlling things, so let's say I want to keep 4 degrees celsius inside, I turn the heater on when it's 5 degrees, and off when it's 3.
All looked so simple :). But in practice when I installed the new electronic controller it turned out the system has huge lag/inertia. For example if it's 5 degrees and I start the heater the temp inside will rise up to 6-7 before it starts to fall down, obviously the heater needs time to warm up. And when I turn it off at 3 degrees the hater compartment is so hot, that after the heater is off it continues to cool down to 0 degrees celsius inside (my youghurt freezes).
I have searched around and the obvious solution for such problems is PID regulation. The problem is I don't want to make a complicated circuit for variable control of the heater.
Can you suggest an algorithm to compensate for the lag/intertia but still keep my simple on/off control of the heater?
I have plenty of power to do calculations, 1024 bytes of RAM and 15kb FLASH on the MCU, I know it's an overkill for this task but that's what I had lieing around. Let's hope with your help I will put this power to some useful task :).