Author Topic: Temperature algorithm (ESP32-S3) (language C)  (Read 1017 times)

0 Members and 1 Guest are viewing this topic.

Offline IriliaTopic starter

  • Regular Contributor
  • *
  • Posts: 92
  • Country: de
    • My YouTube channel
Temperature algorithm (ESP32-S3) (language C)
« on: January 02, 2025, 01:07:14 pm »
I I'm looking for an algorithm I can use for a fridge freezer or oven.
Microcontroller: (ESP32-S3) (language C)
The algorithm have to be able to learn how to get to the asked temperature, and know how to stay at this temperature with no overshoot, or undershoot.
Supporting multiple temperature sensor.
Should be generalist enough to be available (wasn't able to find it) standalone, to be integrated in the two projects.
Thanks for your help
« Last Edit: January 02, 2025, 01:27:46 pm by Irilia »
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28481
  • Country: nl
    • NCT Developments
Re: Temperature algorithm (ESP32-S3) (code C)
« Reply #1 on: January 02, 2025, 01:21:05 pm »
A PI control loop should do the trick. Where things get complicated is wanting the temperature to rise (or fall) as fast as possible. An additional problem with a freezer is that AFAIK these have a limited duty-cycle. You need to wait a while to turn the compressor back on to allow the pressure to equalise.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline IriliaTopic starter

  • Regular Contributor
  • *
  • Posts: 92
  • Country: de
    • My YouTube channel
Re: Temperature algorithm (ESP32-S3) (code C)
« Reply #2 on: January 02, 2025, 01:27:02 pm »
Yes I know that, it also need to be efficient, but normally the temperature of a fridge freezer should change very gradually, so it should not be a problem (the code will obviously contain a hard coded minimum time for the compressor, (for the on and off time)
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 4409
  • Country: gb
  • Doing electronics since the 1960s...
Re: Temperature algorithm (ESP32-S3) (language C)
« Reply #3 on: January 02, 2025, 05:19:58 pm »
In apps where you have long time lags (heater to sensor propagation time) all kinds of tricks are used to make it work, because a classic PID would be sub-optimal by the time you got it stable.

IIRC, one does feedforward stuff i.e. apply heater power appropriate to what is being asked for.

On a freezer it may not matter too much because the user is happy with a long cooling time. Also you feed in whether a door is open.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf