Thermostat with PID controller

Please post the curves as you did previously, it’s more efficient to diagnose the contributors to over heating.

Ok, no problem. Here it is:








Hello, sorry for long delay. The control output already seems very low, not sure you could gain something by adjusting the thermostat gains. It looks like the boiler is providing too much energy at a time when switched on.
I think you should look to your boiler if you can adjust the water output temperature to decrease it a bit, either manually or by changing slope and offset of the heating curve if it supports it.

Hi, no problem. We don’t use the heating right now because it’s hot out there. We will return to the problem next heating season. Thank you for your help.

apologies for the really dumb questions, but i’ve been reading this thread and this controller is of interest to me. Currently i have two heat pumps (upstairs and downstairs) that handle both heating and cooling. how would one go about implementing this for such a system. reading above, it seems that most examples are for single systems (i.e. heat only).

Hi Guys,

im trying to use this with my floor heating which responds very slowly. Cold someone with a similar setup share their pwm time, kp, ki and kd values, so I have I have something to start from?

This is my hardware setup:

Floor Heating Actuator
It need’s around 170 second to fully open.

My sensors are xiaomi zigbee thermostats.

1 Like

Did you test it …
I Will use the same actuator

Concrete floor with electrical heating. About 1 hour response time:

Kp: 10
Ki: 0.0001
Kd: 6000

Thanks for the great work. The PID controller is working almost perfectly here with electrical heating to replace my gas costs!

I must be missing the obvious here, but is there a way to call a service from node-red to change the preset? I want to implement a program. I can change the temperatures for the preset, but not the preset itself. There’s no service call in the smart_thermostat integration for that, and if I select the normal climate integration, it will not let me select the smart thermostat entity.

not jet, but I can let you know once its working.

Thanks for sharing, whats your pwm time in your setup?

  target_temp_step: 0.1
  precision: 0.1
  noiseband: 0.2
  keep_alive:
    seconds: 120
  kp: 15
  ki: 0.0001
  kd: 6000
  ke: 2
  pwm: 00:31:01
1 Like

Never mind - got it. I should use the climate integration. It has the necessary service calls to set the temperature and the preset.

Hi Alex
I am trying to use it with belimo actuator to and 3 way mixing valve, hoping to be able to attach a thermostat on the out pipe and be able to control the actuator to provide set output temperature - will it work for that?

I think that is a proportional valve and you would like to to position it anywhere between fully open and closed? You could take from the thermostat the attribute with the pwm signal and use it for control.

But for more detail you better can ask @adrien.b

When setting up autotune, what ruler should I use? I’ve no idea of what values I should use for the PID so I want to let autotune run so I have a starting point

You can use ziegler-nichols, it’s a standard one. But I would rather recommend to manually measure the oscillation of the temperature with PID off and compute the coefficients by yourself, the method is described here : Autotune feature usage. · Discussion #21 · ScratMan/HASmartThermostat · GitHub

Hi,

I computed myself and get this: kp=0,489709 ki=0.0020362 kd= 78.5166763 but always overshooting So something wrong. Yosc: 1,3 and Tosc about: 9620 (“no-overshoot” 100, 40, 60)


Last year I use with that what you give: kp=64 ki=0.007 kd=2000 This is better but still overshoot.
Don’t know how to fine tuning it.


Tryed autotuning but after one day no result from it, so it isn’t working for me.
Can you help me? Why it is so different what I computed and what you give?

(use ke=0.6) maybe turn outdoor temperature off?

You should monitor the control_output with pid_p, pid_i, pid_d and pid_e by using sensor templates to get them from thermostat’s attributes. This will help finding which one is triggering the heating. As control_output = pid_p + pid_i + pid_d + pid_e, the biggest one will easily activate the heating, and it’s gain could be reduced.

Looking at your curves, Kp seems too low Vs Kd.

Hi I’m novice in HA nd trying to setup smart thermostat to control heaters. My question is how to control tow diferent devices (heaters) by one thermostat? Heaters are MQTT Number devices, that resieves number 0-100. Hard solution is to re-communicate electric heaters so that they wil be one device, but first I want to try to do it in HA settings