ESPHome-OpenTherm icon indicating copy to clipboard operation
ESPHome-OpenTherm copied to clipboard

PID Controller

Open flodus opened this issue 2 years ago • 8 comments

Hello, I've installed your esphome opentherm by commenting arduino version and replace ESP Async WebServer library, by esphome/ESPAsyncWebServer-esphome @ 2.1.0 I've got the diyless opentherm shield and I've got this boiler https://www.viessmann.fr/fr/chauffage-maison-individuelle/chaudiere-gaz/condensation/vitodens-100-w-vitodens-111-w.html Vitodens 100 w I looked a bit at the doc https://esphome.io/components/climate/pid.html?highlight=climate

and for the autotune of the PID, they explain https://esphome.io/components/climate/pid.html?highlight=climate#autotuning that we must put the values

     control_parameters:
       kp: 0.0
       ki: 0.0
       kd: 0.0

and start the autotune in your opentherm.yaml file there are already the values

     control_parameters:
       kp: 0.38197
       ki: 0.01012
       kd: 3.60387

should we redo the autotune for us or should we keep your conf ?

thank you in advance for your reply and thank you for your great work

flodus avatar Jan 04 '22 20:01 flodus

Hi @flodus,

Yes, you should redo the autotune for yourself.

To start the autotune I think you don't need to set the control_parameters to 0 but, when the process is finished, it is important to copy the calculated values to the yaml file and compile and upload the new firmware version.

rsciriano avatar Jan 11 '22 19:01 rsciriano

Hi @flodus, I have the same boiler and I was wondering - have you managed to run the code successfully with your setup?

foltymat avatar Oct 23 '22 06:10 foltymat

Hi @flodus, I have the same boiler and I was wondering - have you managed to run the code successfully with your setup?

Hello, The code is running fine with my configuration... however I failed to configure the pid as I wanted. I don't have an air conditioner and the temperature doesn't come down fast enough for the autotune to give me a satisfactory result. Especially since I also use a wood stove. Everything else seems to be working fine.

flodus avatar Nov 25 '22 14:11 flodus

I've got crazy KP values from the autotune:

control_parameters: kp: 0.95493 ki: 0.00041 kd: 562.59680

Livingroom heating takes about 2 hours for 1 degree (C) hotter. Are these normal values? Or isn't that impossible to day? Looks so high to me, if you look at the example, its about 559 points higher....

neforce avatar Dec 13 '22 11:12 neforce

Yeah, I got something similar with my autotune experiment, but the values were so off, that the heating started to act super weird. Remember the simple translation for what those values mean.

kp: how big should each change be ki. how often you want it updated? (above one would be multiple times a second, below 0 is once per minutes) kd: how far ahead should it think?

I know it's not ideal but at least having the basic understanding helped me start with the fine tuning. Eventually, I settled on kd: 50 ish

foltymat avatar Dec 13 '22 11:12 foltymat

Yeah, I got something similar with my autotune experiment, but the values were so off, that the heating started to act super weird. Remember the simple translation for what those values mean.

kp: how big should each change be ki. how often you want it updated? (above one would be multiple times a second, below 0 is once per minutes) kd: how far ahead should it think?

I know it's not ideal but at least having the basic understanding helped me start with the fine tuning. Eventually, I settled on kd: 50 ish

Do you have the same kind of heating variables? Like heating 2 hours for one degree increase of the living room (with all other radiators closed) ?

image

These are my stats now. Graphs at the bottom are from the last two hours.

neforce avatar Dec 13 '22 12:12 neforce

My situation is definitely a bit different as I have to switch heating zones thoughout the day. But in your example, yes, if I heat our main living space with everything else closed, it generally takes about an hour to hour and a half to heat it up by one degree. Definitely not the full two hours like in your place.

My current values: kp: 0.5 ki: 0.01 kd: 30

foltymat avatar Dec 13 '22 12:12 foltymat

Thanks for your insights. I'll keep track of the current config a few (cold days now in Holland), and will change it to KD: 50 (10% of now), at the end of this week, and 'll monitor it again. Let's see if anything changes (especially to gas usage).

neforce avatar Dec 13 '22 13:12 neforce