Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] add temp. sensor for VL and RL per channel for doing thermal balancing? #4

Closed
linuxdep opened this issue Nov 8, 2021 · 13 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@linuxdep
Copy link

linuxdep commented Nov 8, 2021

Describe the problem you have/What new integration you would like

For thermal balancing i think it was nice to measure VL and RL and calculate thermal balancing automatically.
What do you think is this possible?
That would be the killer application, install underfloor heating, control it, thermal balancing is done automatically. Suspension of control for the valves marked as closed.

Please describe your use case for this integration and alternatives you've tried:

Additional context

@nliaudat
Copy link
Owner

nliaudat commented Nov 8, 2021

Please give a definition of your mean of VL and RL (German abbreviation ?)
At best a calculation formula.

Actually, the target position of valve is calculated with a simplification of arduino map function :

arduino map function :  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 
with parameters : in_min=-1;in_max=1;out_min=0;out_max=1
=>  f(x) = (x+1)/2
diff_temp = (target_temp_high + target_temp_low)/2 - current_temp
=> round(((diff_temp+1)/2)/0.1)*0.1;

I use that formula for 2 years and it works great, is easy to understand and fast to compute.

For temperature fine tuning, I've tested PID climate controller, but my low temperature floor heating has too much inertia to find good values for ki, kp ,kd

The next step I'll go is to fine tune the target valve values with hassio automations. It would be most easy cause hassio retains historical values and can have more sensors, like external temperature, etc.

You can get temperature from external sensors like Xiaomi BLE or via hassio and then compute a template sensor

@Karl-opec
Copy link
Collaborator

Hello, great project,

VL means supply flow,
RL means return flow.

I have on my actual Floor Heating system (standard wax based Actuators to control flow) on top of the PWM a PID controller running. Its PID_PFactor is 0.95, PID_IFactor is 0,59, PID_DFactor =0.5, The D-Value is based on a gradient t(n) to t(n-7) with recalc time of the PID controller of every 60 sec. It works good. My experience is that the PID controller is needed to keep the Temperature close to the desired Temp.

@nliaudat
Copy link
Owner

nliaudat commented Nov 8, 2021

They are 7 free pin available to add custom sensors

Capture

Look at https
Capture2

Look at schematics.pdf for details.

You can use NTC sensors or values from hassio.

Code need to be rewritten a bit (THx_check), but it's simple task

@nliaudat nliaudat added enhancement New feature or request wontfix This will not be worked on labels Nov 8, 2021
@nliaudat nliaudat closed this as completed Nov 8, 2021
@nliaudat
Copy link
Owner

nliaudat commented Nov 9, 2021

The new firmware version lets you change the valve position formula (at line 53). You can adapt it to get what you want.
Regards
(https://github.com/nliaudat/esp32_8ch_motor_shield/blob/main/firmware/esphome_firmware_sample.yaml)

@nstadigs
Copy link

Maybe you already know, but apparently esphome has a PID Climate component with support for autotuning.

@nliaudat
Copy link
Owner

Yes, you can replace thermostat component with PID Climate, I works the same and a sample code is provided in the yaml file (commented out)

@nliaudat
Copy link
Owner

nliaudat commented Nov 10, 2021

Sorry, the code was not fully included :

climate:
  - platform: pid
    id: office_pid_thermostat
    name: "Office PID climate"
    sensor: Office_temperature
    default_target_temperature: 21°C
    heat_output: output_office_cover
    control_parameters:
      kp: 18
      ki: 2300
      kd: 0.5

output:
  - platform: template
    id: output_office_cover
    type: float
    write_action:
      - cover.control:
            id: CH6_cover
            position: !lambda return state;
      - logger.log:
            format: "CH6 moved to position %.1f"
            args: [ 'state' ] 

I have tested the climate component, but the update frequency is to hight for valve good life

@heinemannj
Copy link

heinemannj commented Sep 29, 2023

Is it also possible to use 12 x 1-wire temperature sensors (DS18B20) connected to your board?

I've already implemented via espHome with
Smart Thermostat with auto Heat/Cool mode, PID control and PWM (Home Assistant component) and this is working fine with my actual ON/OFF Actuators.

But I want to change to Homematic valve actuators [HmIP-VDMOT] for some reasons ;-)

@nliaudat
Copy link
Owner

Yes, you only need a VCC, GND, IO.
All is available in https://github.com/nliaudat/esp32_8ch_motor_shield/blob/main/extension.md

@heinemannj
Copy link

heinemannj commented Oct 2, 2023

Coming back to the origional topic: thermal balancing

In Germany, a hydraulic balancing must be carried out after installation or changes to a heating system.

However, if the heating circuit conditions like line cross-sections and line lengths of the individual heating circuits are not known, an exact calculation of the required flow rate is not possible.

For that reason, only a thermal calibration/balancing can be carried out.

By measuring the supply flow temperature and the return flow temperature in each individual heating circuit, you can calculate the spread per heating circuit.

Recommendation for heating pomp system temperature of the heating at full load (in my case the house has an demand of ~40 W/m2):

Supply flow temperature: 32 °C
Return flow temperature: 27 °C
Standard outside temperature von: -12°C
Room temperature: 20 °C

=> System temperature: 32/27/20
=> Spread: 5 °C
=> Required flow rate per circuit to be calculated based on room heating load

Ideally the spread in each heating circuit within one thermal zone (e.g. room) should be equal.

For the thermal calibration/balancing you have three possibilities:

  1. Adjust the flow/spread via your flow meters of the heating circuit distributor
  2. Adjust the flow/spread via proportional valve actuators
  3. Adjust initially via flow meters and then daily on demand based on room and outside temperature conditions and on top finetuning based on corresponding heating circuit spread via proportional valve actuators

The third option is obviously the best method because then you have setup a real dynamic hydraulic balancing.

As mentioned by Karl-opec an external HA PID controller can manage this (please see above).

It is also mentioned in floor-heating-controller wiki that you can use Hassio custom climate components.

Can you please provide some example code for the usage/integration of Hassio components to control the valve percentage of the actuators.

@nliaudat
Copy link
Owner

nliaudat commented Oct 2, 2023

There is 2 ways to go to do external PID control :

The simplest is to adjust the target temperature (like in https://github.com/KartoffelToby/better_thermostat)
The second is to control valves motors and then use the "motor firmware", but I have no experiences in that way.

@nliaudat
Copy link
Owner

nliaudat commented Oct 2, 2023

https://github.com/vindaalex/multizone-thermostat can control proportionnal valves

@nliaudat nliaudat reopened this Oct 2, 2023
@heinemannj
Copy link

I've setup an very early alpha version of a documentation / project paper to describe the goals and the physics behind:

https://github.com/heinemannj/Hydraulic-Balancing/edit/main/README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants