ESPHome - starting parameters PID Controller underfloor heating

Hi,
i try to set up an independently working PID controller with a ESP8266 that shall be connected to HA to report status and to set setpoint for the temperature. I will use slow_PWM output to connect to the valve (with some kind of relais :slight_smile: ) .

Before starting i would like to get some starting parameters for kp ki and kd. Surely its possible with AUTOTUNE, but as underfloor heating is sooo slow, this would strongly effect the relationship to my wife :frowning: . So to have an idea which starting parameters i should use would help - especially for kd and kiā€¦

Have you figured out your parameters? With autotuning my boiler starts to heat the water for 7s and turns off. It doesnā€™t even heat the water in the circulation.

Forget about the derivative (kd), that is for extreme advanced PID loop control.

Proportional (kp): Think of a lever with a fulcrum, one side is the input (sensor value), the other is the output (valve position). When the pivot is in the middle, an equal increase on the temperature side is reflected inversely in the output (less valve). Increase the kp and you move the fulcrum closer to the sensor side (thus small sensor decrease equals larger valve increase.

Integral (ki): Integral of time. This is for faster moving loops that require more ā€œprecisionā€ of the actual setpoint achieving the command/target. If the proprtional has gotten the control variable (sensor feedback, temperature) close to the setpoint (target temperature) but its not quite able to acheive the target, as more time goes on, the output with continue to accumulate (more and more valve output) will ā€œwind upā€ in order for the controller to acheive the setpoint.

For your application with a heated floor, just focus on the proportional (kp), starting with a value of maybe 1 or 2 and see what it does.

Hi, started all over again with pure P-factor raising up to approx. 3. Then i set integral starting value to 0.5 and Ki factor at 0.0 (ZERO). This leads to a working setpoint of 50% of the output at zero deviation from target temperature. Then with this p-factor of 3 it seems to control pretty well. deviations are less than Ā±0.2 degree centigade which is perfect to a underfloor heating system. Nevertheless i will try to add some Kd for even faster responte to external influences (like door open / sunshine)

Iā€™m working through this as well, did you intend to state that the kd factor was zero? Am I interpreting your values correctly?

kp: 3.0
ki: 0.5
kd: 0.0

Thanks!

Hi, yes youā€™re right. No kd resp kd=0. Ki also at zero. And kp set now to 2.0 A value of more tends to overshoot the temperature.

This works very nice. But also i set starting integral value at 0.5 , also min_integral=0.5 and max_integral=0.5

This sets a fixed working point at 0.5 (50%) and kp can then turn up or down.

Haopy to get your comment and experience.

Addendum: ki was set to zero, because i could not controll the behavior when turning on / off the PID controller

This contribution was really helpfull, a i now do it only with kp=2.0

@maxnomo what kind of results are you getting with this setting?

Hi, still wirkung with this setup. Roomtemperature is within Ā± 0.1ā€¦0.15 degrees centigrade.

Thatā€™s impressive! Just sharing, this guy took the complete opposite settings and it seems those work as well: Problem with part D - value peaks Ā· Issue #180 Ā· ScratMan/HASmartThermostat Ā· GitHub

Makes me wonder how much of an impact these settings actually haveā€¦

@maxnomo I am considering doing something with my underfloor heating, but still on the thinking/planing steps. What sensors are you using to monitor the room temperature and feed it to the PID controler?

Hi, best imho is still the Dallas DS1820 three wire sensor. Pretty precise and fast.

Hello,
IĀ“m doing the same for this winter. How do you control the output of the PID (to binary)? Slow-PWM or Sigma delta? which values for them? I tried sigma delta with 10s and it seems too slow to react.
Thx

Hi, i use the sigma _delta_output. As i have slow thermal Expansion valves i need slow intervall. Having an Update_interval of 173 seconds. Is i wann to avoid interferences with annƤhernd room using 179 seconds (two Prime numbers !). As underfloor heating Systems Reaktion within 30min / 1h Ranges this is sufficiently fast.