# What algorithm is appropriate for a thermostat controlling the heating of a room with floor heating?

I built my own thermostat that controls the boiler heater for the radiant floor heating in my house and I would like to develop / implement a smarter temperature control algorithm. What I am specifically interested in is the ability to predict when to turn on the heating so that a certain temperature is achieved according to a schedule.

Suppose I want the temperature at 7 am to be 22 degrees Celsius. During the night I want it to be at 18C. Currently, I set the schedule up so that the heating is started at 6 am but depending on how cold it is during the night, an hour may be too little and the temperature does not rise to 22C or it may be to much and the temperature overshoots. I would like an algorithm that would automatically calculate the appropriate time at which to start heating.

I keep searching online and most results are for industrial uses and/or for heating systems that can be modulated such as electrical heaters. The heating system in my house consists of a boiler that heats the water in the floor tubing and I cannot modulate the output, I can only tell it to start or to stop via a mechanical relay that opens or closes a solenoid valve. This, I believe, renders a PID algorithm inappropriate. Fuzzy logic and just PI control may be suitable but can they be made to work with varying set points?

Supervised machine learning is overkill for my needs and I don't want to spend weeks to train it.

What other options would I have?

• I'm not quite sure this is on-topic here. – Yuval Filmus Jan 10 at 12:33
• I'm not either, but this question on stack exchange would seem to suggest it is. – user1969903 Jan 10 at 12:38
• This is not really about an algorithm. It's about modeling the physical environment, with or without using data science. – Yuval Filmus Jan 10 at 12:44
• I agree, but if Honeywell designs a new thermostat, I doubt they will send a team of engineers to every customer's home so that they can model their physical environment. – user1969903 Jan 10 at 12:50
• You can always "fake" a continuous input by controlling the duty cycle -- pick a time period (e.g. 1 minute), then if you want to supply "25% power", you turn it on for 15s, then off for 45s, etc. The shorter the period you pick, the less overshoot there will be, but extremely short periods might not be suitable for other reasons. – j_random_hacker Jan 10 at 12:52

Maybe approach it from a "BTU's needed over time" standpoint. I don't know the exact maths off the top of my head, but consider:

• What is the temperature differential?
• What is the heating capacity (BTU's) of the radiant flooring system?
• How long does it take to start rendering 68% of that heat to the room?
• What is the heating load of the room in BTU's?
• How efficient is the heat generated?

Then do some math on these numbers. Something like...

$$t_{hours}=\dfrac{(T_{end}-T_{start})\cdot H_{demand}}{H_{supply}}\cdot \mathrm{eff}^{-1} + t_{delay}$$

So for an end temperature of 22°C and a start of 18°C, heat of 50kBTU, demand of 20kBTU, 90% efficiency, and 15 minutee delay:

\begin{align*}t_{hours} &= \dfrac{(22°C-18°C)\cdot 20k_{demand}}{50k_{heat}}\cdot 0.90_{\mathrm{eff}}^{-1} + 0.25h_{delay}\\ &= \dfrac{80\mathrm{k}}{50\mathrm{k}}\cdot 1.\bar{1}+ 0.25\mathrm{h}\\ &= 2.02\bar{7}\mathrm{h} \end{align*}

Some analysis and experimentation will be needed to arrive at realistic values but hopefully this is a start.

• Thanks for the MathJax fix. Wish it was standard across Stacks. :) – rdtsc Jan 19 at 21:24
• This is definitely a start. My question would then be how can I obtain these values programatically because the heating load depends on how efficient the room is thermally isolated and on the outside temperature. The supply also changes according to the size of the room, and therefore the size of the radiant surface. How would I be able to automatically calibrate these values? – user1969903 Jan 20 at 10:42