OT boiler control algorithm(s)?

This Forum is about the Opentherm gateway (OTG) from Schelte

Moderator: hvxl

OT boiler control algorithm(s)?

Postby marcelr » Fri Aug 07, 2015 11:09 am

Hi all,

Recently, with the help of ierlandfan, I rooted my toon thermostat (domoticaforum.eu/viewtopic.php?f=17& ... amp;t=8743). Over the last few months, I've been ploughing through its software, and I more or less established the serial IO protocol used for the communication with the boiler adapter (ketelmodule in Enecospeak).
Proper communication with the module is still under development, but well on its way.

Inside the toon software the module is aptly called the OpenTherm gateway (wonder how on earth they came up with that term ;-) ).
From the things that I read on this forum and other parts of the internet, I gather that the boiler control is to be done by the thermostat, not by the boiler itself. The main reason for rooting my toon, besides sheer curiosity, was the need for a more advanced boiler control (time-dependent power requirements by switching part of the CH system off during the daytime), outside temperature dependency, that sort of stuff. Similarly, I want to control DHW warming power by using the water inflow temperature (from a solar boiler).

So, my question to you is: Does anyone have (even rudimentary) boiler control algorithms implemented, and, if so, is ready to share them? I'll be happy to roll my own, but if working algorithms exist already, I typically hate to reinvent the wheel.

FYI, the OT IDs available for toon are (found on the opentherm website, and checked to actually exist in the software):

Code: Select all
# from opentherm website; retrieved 20150620.
# http://www.opentherm.eu/product/view/6/toon

Toon

Energy Management Display which also acts as an OpenTherm thermostat

Interfaces (Functions, features and ID's)

Interface 1 (master)

Functions and Features

General: standard
Ch: otc control
Ch: roomtemp control
Dhw: setpoint adjustment
Dhw: eco/comfort

ID's

ID0:HB0: Master status: CH enable
ID0:HB1: Master status: DHW enable
ID0:HB3: Master status: OTC active
ID0:HB5: Master status: Summer/winter mode
ID0:HB6: Master status: DHW blocking
ID0:LB0: Slave Status: Fault indication
ID0:LB1: Slave Status: CH mode
ID0:LB2: Slave Status: DHW mode
ID0:LB3: Slave Status: Flame status
ID0:LB6: Slave Status: Diagnostic/service indication
ID1: Control Setpoint i.e. CH water temperature Setpoint (�C)
ID2:HB0: Master configuration: Smart power
ID2:LB: Master MemberID Code
ID3:HB0: Slave configuration: DHW present
ID3:HB1: Slave configuration: Control type
ID3:HB4: Slave configuration: Master low-off&pump control
ID5: HB0: Service request
ID5: HB1: Lockout-reset
ID5: HB2: Low water pressure
ID5: HB3: Gas/flame fault
ID5: HB4: Air pressure fault
ID5: HB5: Water over-temperature
ID5: LB: OEM fault code
ID6:HB0: Remote boiler parameter transfer-enable: DHW setpoint
ID6:HB1: Remote boiler parameter transfer-enable: max. CH setpoint
ID6:LB0: Remote boiler parameter read/write: DHW setpoint
ID14: Maximum relative modulation level setting (%)
ID15: Maximum boiler capacity (kW) / Minimum boiler modulation level(%)
ID16: Room Setpoint (�C)
ID17: Relative Modulation Level (%)
ID18: Water pressure in CH circuit (bar)
ID24: Room temperature (�C)
ID25: Boiler flow water temperature (�C)
ID26: DHW temperature (�C)
ID27: Outside temperature (�C)
ID28: Return water temperature (�C)
ID35: Boiler fan speed Setpoint and actual value
ID48: DHW Setpoint upper & lower bounds for adjustment (�C)
ID56: DHW Setpoint (�C) (Remote parameter 1)
ID57: Max CH water Setpoint (�C) (Remote parameters 2)
ID73: An OEM-specific diagnostic/service code for ventilation / heat-recovery system
ID113: Number of un-successful burner starts
ID114: Number of times flame signal was too low
ID115: OEM-specific diagnostic/service code
ID116: Number of succesful starts burner
ID117: Number of starts CH pump
ID118: Number of starts DHW pump/valve
ID119: Number of starts burner during DHW mode
ID120: Number of hours that burner is in operation (i.e. flame on)
ID121: Number of hours that CH pump has been running
ID122: Number of hours that DHW pump has been running or DHW valve has been opened
ID123: Number of hours that burner is in operation during DHW mode
ID127: Slave product version number and type

I think these IDs give enough possibilities for more advanced boiler control ;-).

I know, this post is not about Schelte's OTGW, but since somebody has called toon's module exactly that, I thought this might be the right thread to post.

best,

marcelr
marcelr
Advanced Member
Advanced Member
 
Posts: 909
Joined: May 2012
Location: Ehv

Re: OT boiler control algorithm(s)?

Postby marcelr » Sat Aug 22, 2015 9:06 pm

Quick update:

Standalone serial IO with the OT boiler is up and running, data rates up to tens of Hz possible. Since nobody has replied to my question (after almost 600 reads of the first post, so far), will roll my own control algorithm.

grtz,

marcelr
marcelr
Advanced Member
Advanced Member
 
Posts: 909
Joined: May 2012
Location: Ehv

Re: OT boiler control algorithm(s)?

Postby D_Hailsham » Sun Aug 30, 2015 6:56 pm

You might find it helpful to read "phil-in-china's" comments in this topic:

viewtopic.php?f=70&t=2046&hilit=opentherm&start=15

Opentherm is not a control protocol, it's a communication protocol. The Protocol document mentioned in the topic says:

There is only one control value defined - data-id=01, the control setpoint. The control setpoint ranges between a minimum of 0 and maximum of 100. It represents directly a temperature setpoint for the supply from the boiler. The slave does not need to know how the master has calculated the control setpoint, e.g. whether it used room control or OTC, it only needs to control to the value. Likewise, the master does not need to know how the slave is controlling the supply.
D_Hailsham
Starting Member
Starting Member
 
Posts: 39
Joined: August 2013

Re: OT boiler control algorithm(s)?

Postby marcelr » Sun Aug 30, 2015 8:22 pm

Thanks,

I know it's a communication protocol, but using the numbers that are being transmitted, you can build a control algorithm that's a bit more elaborated than just bang-bang control or boiler output temperature control. By squeezing the boiler modulation level to an extent that's just enough to heat my home, and using in-and outflow temperatures of the boiler water, in combination with a lowered maximum temperature, I think I can optimize heat losses and maintain a comfortable home at the same time, maybe at the expense of longer warming-up times. Basically, I want an algorithm that matches power output of the boiler with the power required to keep my house at the temperature I want.

As for the comment of phil-in-china:
Manufacturers have to build a one-size-fits-all solution into their thermostats. I know the people who built toon had to, their thermostat can drive a myriad of boilers, some more, some less adherent to the OT protocol. I don't. Their problem is therefore a lot harder to solve than mine, and will end up in a middle-of-the-road controller, useful for most homes and boilers, but not optimal.
Furthermore, boiler manufacturers efforts are primarily geared towards comfort (they don't want customers to feel cold under any circumstance, that would be the boiler's fault), much less towards energy consumption reduction. Consequently, most condensing boilers mounted in homes today never get to condense, since the thermostats driving these boilers won't let them, at the expense of efficiency.

grtz,

marcelr
marcelr
Advanced Member
Advanced Member
 
Posts: 909
Joined: May 2012
Location: Ehv

Re: OT boiler control algorithm(s)?

Postby D_Hailsham » Tue Sep 01, 2015 2:30 pm

marcelr wrote:I know it's a communication protocol, but using the numbers that are being transmitted, you can build a control algorithm that's a bit more elaborated than just bang-bang control or boiler output temperature control. By squeezing the boiler modulation level to an extent that's just enough to heat my home, and using in-and outflow temperatures of the boiler water, in combination with a lowered maximum temperature, I think I can optimize heat losses and maintain a comfortable home at the same time, maybe at the expense of longer warming-up times. Basically, I want an algorithm that matches power output of the boiler with the power required to keep my house at the temperature I want.

The only parameter which can be changed is the required flow temperature; you can't change the boiler modulation level - that's controlled internally by the boiler. I don't see how knowing the flow and return temperatures help.

The important factors are: the difference between actual and desired temperature in the house and the rate of heat loss/gain. For that you need a TPI type of control

Manufacturers have to build a one-size-fits-all solution into their thermostats.

Some are more successful than others as they provide the facility to 'tune' the thermostat to the environment.

Furthermore, boiler manufacturers efforts are primarily geared towards comfort (they don't want customers to feel cold under any circumstance, that would be the boiler's fault), much less towards energy consumption reduction. Consequently, most condensing boilers mounted in homes today never get to condense, since the thermostats driving these boilers won't let them, at the expense of efficiency.

I agree that many boilers are massively oversized and that most boilers do not modulate low enough.

Things are slowly changing in the UK. Systems are now expected to be designed for a return temperature of 55C. Unfortunately Opentherm is still not used by most UK manufacturers; and the boilers with OT built in are treated with suspicion. The Remeha Avanta range (also sold by Baxi as the Baxi Avanta) has now been discontinued after about nine years. Whether it will be replaced by a later Remeha model, I don't know; but I'm doubtful.

As far as the typical installer is concerned, modulation is just an automatic way of setting the maximum output of the boiler. The fact that you only need to run at max output for maybe 20 days in a year is lost on them.
D_Hailsham
Starting Member
Starting Member
 
Posts: 39
Joined: August 2013

Re: OT boiler control algorithm(s)?

Postby marcelr » Tue Sep 01, 2015 10:19 pm

The only parameter which can be changed is the required flow temperature; you can't change the boiler modulation level - that's controlled internally by the boiler. I don't see how knowing the flow and return temperatures help.


From what I read and heard, it's possible to set the relative maximum modulation level (OT ID 14). Which basically means that you can set the maximum output power of the boiler, within certain limits.

Flow rate and return temperature, in combination with boiler output temperature will give you an indication about the actual power uptake of the house you're heating. If you know how the inside temperature responds (only a very bad thermostat won't tell you), you can estimate the effect of your heating action.

That, combined with output temp control and modulation level will give the possibility for more precise power control of the boiler. Outside temperature, combined with the previous data points, gives an indication about heat loss rates of the house. If you happen to know what your TRV's are doing (which is the case in my house) you can anticipate the level of power needed in the near future, and control the boiler accordingly.

The way I see it, is that a house is a chunk of material having a temperature (the room temp as measured by the thermostat), a variable heat source (the boiler), with heat loss to the outside world. The heat loss depends on factors like outside temperature, ventilation (open doors/windows), maybe sunshine, wind, etc. To keep the temperature constant, you have to apply heating power to the house (with the boiler :-)). In a steady state, (constant outside factors) you should apply a constant power. The steady state is disturbed by other factors, like ventilation, changing weather conditions or changing temperature demands. The controller has to reject these disturbances, with a minimum effort (so minimal energy consumption). There is some time delay between the measured temperature and the effect of heat input by the boiler, which makes control tricky, or slowly responding.
This results in a control model of just a few differential equations, with fairly long characteristic times. Easily solved in real time and fed into an actual system.

I don't have the mathematical proof (yet), but my guess is that optimal boiler control means that the boiler output is matched with the actual power requirements, such that the modulation level is mostly constant, boiler output temperature is relatively low, with a fairly high temperature drop in the heating system, so a low return temp to the boiler.

TPI control is not rocket science (and there a much more complex fields in science than rocket science ;-) ). A typical TPI controller is less than 10 lines of C code. Automatic adaptation of the control parameters is a bit more tricky, especially with doors opening and closing in a house, but not impossible.

The major issues I foresee are:
Adequate parameter estimation for optimal control, in a system with many stochastic disturbances.
Combined with that: the timescale for parameter adaptation (days? weeks?).
Boiler control in really low power requirements; when minimal modulation is still too much, some sort of bang-bang control may be needed.

The reason I asked for algorithms is not because I don't have a clue what to do; I just hate to reinvent the wheel. So far, I've been writing a few thousand lines of code, just to get the communication between toon and the boiler going. I don't mind writing another few thousand, as long as I know that I'm not typing stuff that's available already, and working.

grtz,

marcelr
marcelr
Advanced Member
Advanced Member
 
Posts: 909
Joined: May 2012
Location: Ehv

Re: OT boiler control algorithm(s)?

Postby marcelr » Sat Dec 19, 2015 4:11 pm

Just hooked up an usb-OTGW to my boiler, first findings (copied from another thread, continuing the discussion here):

Data update rates for OT IDs, between toons boiler interface ("ketelmodule") and the boiler:

Status: every 3 seconds
Boiler temp, boiler return temp, relative modulation level, control setpoint: every 12 seconds.
All the rest: every 85 seconds.

grtz,

marcelr
marcelr
Advanced Member
Advanced Member
 
Posts: 909
Joined: May 2012
Location: Ehv

Re: OT boiler control algorithm(s)?

Postby marcelr » Mon Dec 21, 2015 7:31 pm

Before designing a new controller, let's first have a look at what's already there.

Did a few days of continuous logging (and still continuing), one thing strikes me as a bit odd.
(see attached image, horizontal axis: hours, zero is yesterday's midnight. vertical: temperature (degC) )
The boiler starts heating even when the room temperature is at the level required by the program (near the second peak in the controller setpoint). Overshoot in the room temperature is up to 1 degree. Quite a lot for a modulating, learning controller, I think.

Besides that, never mind the room temperature, I've had my wood-fired stove on for the last few days (during the day, the overshoot in the morning has got nothing to do with that, the stove is not on yet, then). The room temperature is not really updated continuously: it seems to "hang" when the level hits an integer number. Don't know why, could be the toon ketelmodule firmware, toon software, whatever. Not very interesting, the boiler doesn't use the number. Will make a combined, direct readout from the thermostat, had no issues with those readings before.

Will try a few days without wood-fired stove, see if I can find typical heat losses for my house (it's not really cold yet, overnight temperature loss is quite limited).

grtz,

marcelr
Attachments
toon_temp_ctrl.png
Temperature history for approximately two days.
toon_temp_ctrl.png (8.28 KiB) Viewed 7228 times
marcelr
Advanced Member
Advanced Member
 
Posts: 909
Joined: May 2012
Location: Ehv

Re: OT boiler control algorithm(s)?

Postby timoline » Mon Dec 21, 2015 8:51 pm

very interesting topic, it would be very nice to have a webbased controller
timoline
Starting Member
Starting Member
 
Posts: 31
Joined: November 2015

Re: OT boiler control algorithm(s)?

Postby marcelr » Mon Dec 21, 2015 9:35 pm

it would be very nice to have a webbased controller

You will still need the hardware to talk to the boiler. Software alone is not going to cut it. If by web based controller, you mean controlling your thermostat settings etc. through a web interface, I think there are some options around already, and I know that some people on this forum have rooted their toon thermostat to do just that.

grtz,

marcelr
marcelr
Advanced Member
Advanced Member
 
Posts: 909
Joined: May 2012
Location: Ehv

Re: OT boiler control algorithm(s)?

Postby hvxl » Thu Dec 24, 2015 10:14 pm

Such a boiler control algorithm apparently isn't that easy. At least the Nest developers got it very wrong, according to this article (in Dutch).
Schelte
hvxl
Senior Member
Senior Member
 
Posts: 1099
Joined: June 2010

Re: OT boiler control algorithm(s)?

Postby marcelr » Fri Dec 25, 2015 10:06 am

It's quite easy to do bang-bang control through the OpenTherm protocol, by just setting boiler temperature to maximum at low room temperature, and to minimum at the correct (or higher) room temperature. Having a thermostat that speaks OpenTherm is no guarantee that your boiler will be controlled as a modulating device.
The Nest used to be a bang-bang controller, and according to what I read, that's still the case, even though is has implemented the OpenTherm protocol, as of its version 3.

Has anyone tested the IO of this thermostat yet? Might explain a lot.

grtz,

marcelr
marcelr
Advanced Member
Advanced Member
 
Posts: 909
Joined: May 2012
Location: Ehv

Re: OT boiler control algorithm(s)?

Postby nickyw » Tue Feb 16, 2016 1:58 pm

Hi, Really intersting topic and just what Ive been thinking about. There is an approach here for control based on the measured opening of the TRV valves.
"With the use of a simulation model, the following algorithm for determining supply tem- perature as a function of the valves’ lift degree is proposed. This solution is possible in sys- tems where the valve lift degree is adjusted using an electronic actuator that communicates with the central controller. Supply temperature changes to maintain set temperature in the rooms according to the following algorithm:"

https://suw.biblos.pk.edu.pl/resources/ ... ontrol.pdf

We a system like the max eq-3 I think a lot of the heavy lifting has been done b the thermeq3 project. However this is aimed at on/off control. Perhaps forking thermeq3 to communicate with an otgw and integrating the approach in the above paper might be a starting point.

N
nickyw
Starting Member
Starting Member
 
Posts: 2
Joined: February 2016

Re: OT boiler control algorithm(s)?

Postby marcelr » Thu Feb 18, 2016 11:24 pm

These guys put a lot of effort in modelling the heated environment, not so much in controlling it. PID controllers with integral limiting features are considered complex. I'm not saying that they did a bad job, but it's not something immediately fit for a domestic boiler controller. There's a lot of talk about control algorithms, but not a single one is actually given.

By now I have some 60-odd days of logged OTGW data and I'm beginning to understand how the control system is made, and what data I can safely use for boiler control and parameter estimation. With my production toon having broken down a week ago, I have some other stuff to attend to first, though.

Not sure about the thermeq3 project. Will check it out.

grtz,

marcelr
marcelr
Advanced Member
Advanced Member
 
Posts: 909
Joined: May 2012
Location: Ehv

Re: OT boiler control algorithm(s)?

Postby D_Hailsham » Fri Feb 19, 2016 12:44 pm

The Polish document seems to be just an executive summary as the pages are numbered 140-148. Where is the rest of the document?
D_Hailsham
Starting Member
Starting Member
 
Posts: 39
Joined: August 2013

Next

Return to Opentherm Gateway Forum

Who is online

Users browsing this forum: No registered users and 1 guest