Custom temperature control algo
Moderators: marcelr, TheHogNL, Toonz
-
- Member
- Posts: 66
- Joined: Fri Aug 18, 2017 3:28 pm
Custom temperature control algo
Hi,
Does anyone know if it is possible to adapt the temperature control algoritm?
Just out of curiosity I want to play with different temperature control algoritms by myself.
Is the control algorithm hardcoded and compiled or is it scripted in any of the .qml files?
Maybe also helpfull if the boiler can be turned on and off from the command line (in case of an on/off boiler type).
Regards !
Does anyone know if it is possible to adapt the temperature control algoritm?
Just out of curiosity I want to play with different temperature control algoritms by myself.
Is the control algorithm hardcoded and compiled or is it scripted in any of the .qml files?
Maybe also helpfull if the boiler can be turned on and off from the command line (in case of an on/off boiler type).
Regards !
Re: Custom temperature control algo
It is always possible.
The temperature controller is part of the happ_thermstat executable, which is a piece of compiled code. It is, however, possible to intercept the communication between happ_thermstat and the boiler, and replace any commands given to the boiler and vice versa, by your own.
Once the communication is intercepted, you can tell the boiler anything from the command line.
I have the communication protocol and working interception code. Never managed to find time to merge the two, so far.
You will need a working toolchain for toon's processor and some fluency in C to pull this off, though.
BTW, the controller is a simple PID controller, with some analysis software to estimate the characteristic heating time for your home, in conjunction with your boiler.
The temperature controller is part of the happ_thermstat executable, which is a piece of compiled code. It is, however, possible to intercept the communication between happ_thermstat and the boiler, and replace any commands given to the boiler and vice versa, by your own.
Once the communication is intercepted, you can tell the boiler anything from the command line.
I have the communication protocol and working interception code. Never managed to find time to merge the two, so far.
You will need a working toolchain for toon's processor and some fluency in C to pull this off, though.
BTW, the controller is a simple PID controller, with some analysis software to estimate the characteristic heating time for your home, in conjunction with your boiler.
-
- Member
- Posts: 66
- Joined: Fri Aug 18, 2017 3:28 pm
Re: Custom temperature control algo
Is the source code of this "happ_thermstat" available ?The temperature controller is part of the happ_thermstat executable, which is a piece of compiled code.
I do not have a toolchain installed just yet, but it would already be nice to look inside
Re: Custom temperature control algo
No, that's proprietary code, by Quby.
-
- Member
- Posts: 66
- Joined: Fri Aug 18, 2017 3:28 pm
Re: Custom temperature control algo
That's a pittymarcelr wrote:No, that's proprietary code, by Quby.
-
- Member
- Posts: 66
- Joined: Fri Aug 18, 2017 3:28 pm
Re: Custom temperature control algo
Just for experimentation sake ... is it possible to completely disable "happ_thermstat" and inject the boiler commands directly via a script?
Related to this ... is it possible to make a complete new qml gui that can be started in stead of the normal toon gui (without removing the toon gui, so that we can easily go back )?
Related to this ... is it possible to make a complete new qml gui that can be started in stead of the normal toon gui (without removing the toon gui, so that we can easily go back )?
Re: Custom temperature control algo
No, the communication between happ_thermstat and /dev/ttymxc2 (IIRC, could be ttymxc2 as well) can be intercepted and replaced with something else, in both directions ... still needs some work, though.
If you want to build a new GUI, be my guest ... and good luck to you ...
If you want to build a new GUI, be my guest ... and good luck to you ...
-
- Member
- Posts: 66
- Joined: Fri Aug 18, 2017 3:28 pm
Re: Custom temperature control algo
Are the PID parameters stored somewhere that is accessable from the terminal?BTW, the controller is a simple PID controller, with some analysis software to estimate the characteristic heating time for your home, in conjunction with your boiler.
The "learned" parameters should be stored somewhere on the filesystem.
The problem is that I have a Toon from Marktplaats and I haven't done a factory reset before rooting.
This means that learned parameters are for the house of the previous owner of the Toon.
Is it possible to reinitiate the learning process without doing a factory reset?
Re: Custom temperature control algo
There's no need to do a factory reset. After a factory reset, you will need to reactivate your toon, do all settings again.
The PID parameters are stored somewhere on the fileystem, in /HCv2/config/ or thereabouts. If the engineers at quby made a halfway decent algorithm for control parameter estimation, this estimation should be continuous. That it reaches a steady state solution after 2 weeks, does not necessarily mean that the estimation then stops. In other words; I think, that when you move the thermostat from one place to another, the "learning" process starts anew, only with a different set of initial parameters.
The PID parameters are stored somewhere on the fileystem, in /HCv2/config/ or thereabouts. If the engineers at quby made a halfway decent algorithm for control parameter estimation, this estimation should be continuous. That it reaches a steady state solution after 2 weeks, does not necessarily mean that the estimation then stops. In other words; I think, that when you move the thermostat from one place to another, the "learning" process starts anew, only with a different set of initial parameters.
-
- Member
- Posts: 66
- Joined: Fri Aug 18, 2017 3:28 pm
Re: Custom temperature control algo
Probably in config_happ_thermstat.xml, there I can find some parameters with strange numbers and names:The PID parameters are stored somewhere on the fileystem, in /HCv2/config/ or thereabouts.
Code: Select all
<outsideRate>-0.010000</outsideRate>
<outsideRate0>-0.001468</outsideRate0>
<outsideRate1>-0.009640</outsideRate1>
<outsideRate2>-0.010000</outsideRate2>
<heatingFactor>0.001187</heatingFactor>
<shootFactor>0.000000</shootFactor>
<profile>ThermostatInfo</profile><dp_k_1>0.045</dp_k_1><dpp_k_1>1.000</dpp_k_1><eth_k_1>1.000</eth_k_1><correctionValuesTimestamp>1503514771</correctionValuesTimestamp><heaterFuelType>gasFuel</heaterFuelType></device>
Re: Custom temperature control algo
This is from my test toon:
and
What it means? Search me.
I think you have a boxx, right? Different boiler interface hardware, different control software?
Code: Select all
<measuredHeatingFactors>measuredHeatingFactors:[ 0.001441,0.001471,0.001433,0.000645,0.001212,0.001054,0.001311,0.001223,0.001471,0.000916]</measuredHeatingFactors>
Code: Select all
<dp_k_1>0.260</dp_k_1><dpp_k_1>1.000</dpp_k_1><eth_k_1>0.912</eth_k_1>
I think you have a boxx, right? Different boiler interface hardware, different control software?
-
- Member
- Posts: 66
- Joined: Fri Aug 18, 2017 3:28 pm
Re: Custom temperature control algo
I have an Eneco Toon from marktplaats.nl. In the Netherlands they seem to have flooded the market and many poeple want to get rid of them (too costly ?).
I searched tweedehands.be for a Engie Boxx, but none was available! Actually, I wanted to have a Boxx because the sensor for the electric meter needs to be somewhat different in Belgium, because the meter is "sealed" inside another transparent box and the sensors from Eneco suffer from too much reflection in that case. Boxx comes with a bigger sensor for the electricty meter: https://ic.tweakimg.net/images/member/o ... 35e0p.jpeg. I will look later on how to adapt or build my own sensor. Does anyone know the signals on the cables that go to the sensors? I have opened one of the sensors and they only contain a LED and a photodiode or phototransitor, not ICs. So building my own sensor will not be too difficult. If someone from Belgium happens to read this post and has a larger sensor, please take some pictures from the sensing side and make a distance measurment between LED and phototransistor.
I also have this measuredHeatingFactors parameter, but it only contains one value. Probably this is because last night I did do a factory reset (I know you advised not to do it, but I couldn't resist ). The extra values that you have will be from previous learning phases, i guess.
I searched tweedehands.be for a Engie Boxx, but none was available! Actually, I wanted to have a Boxx because the sensor for the electric meter needs to be somewhat different in Belgium, because the meter is "sealed" inside another transparent box and the sensors from Eneco suffer from too much reflection in that case. Boxx comes with a bigger sensor for the electricty meter: https://ic.tweakimg.net/images/member/o ... 35e0p.jpeg. I will look later on how to adapt or build my own sensor. Does anyone know the signals on the cables that go to the sensors? I have opened one of the sensors and they only contain a LED and a photodiode or phototransitor, not ICs. So building my own sensor will not be too difficult. If someone from Belgium happens to read this post and has a larger sensor, please take some pictures from the sensing side and make a distance measurment between LED and phototransistor.
I also have this measuredHeatingFactors parameter, but it only contains one value. Probably this is because last night I did do a factory reset (I know you advised not to do it, but I couldn't resist ). The extra values that you have will be from previous learning phases, i guess.
Code: Select all
<measuredHeatingFactors>measuredHeatingFactors:[ 0.001187]</measuredHeatingFactors>
Re: Custom temperature control algo
I was trying to figure out the workings of the sensor myself (in another thread about solar power collecting). I figured out that a LED pulse can easily be simulated by connecting two out of the three wires (probably the 3v and the ground/pulled-down input) together which will count for a pulse each time you do that. I didn't figure out what the other wire is for (probably the photo transistor?). But my major problem is when the Toon module is inserted into the power. It then starts some kind of boot up procedure in which it (probably) detects if he can see a red led or need his own blue led to light up and have the reflector on the powermeter reflect it back. I can not simulate that boot up procedure yet with a home made 'sensor' (in my case a raspberry pi). The Toon module stays dark, does not detect any sensor connected.
Member of the Toon Software Collective