syssi / esphome-soyosource-gtn-virtual-meter

ESPHome component to simulate the current clamp to control the Soyosource GTN1200 limiter
Apache License 2.0
78 stars 21 forks source link

Overshoot compensation #140

Open kev300 opened 1 year ago

kev300 commented 1 year ago

Like https://github.com/syssi/esphome-soyosource-gtn-virtual-meter/pull/122 but less complicated and works better with ramping consumption changes. :)

Fixes: https://github.com/syssi/esphome-soyosource-gtn-virtual-meter/issues/73 (for me)

Also there is no pid setting anymore, only max_power_sensor_latency_ms. It is necessary because the inverter does not exactly hit it's power target (demand +500W actually ends up producing something like +480W) and when multiple loads are changing within the compensation period.

Works for me with an update intervall of 250ms at the moment. Without this PR the demand only jumps between min demand and max demand constantly. 😬

kev300 commented 9 months ago

This happens, if the latency value is too high. Screenshot_20231220-125959

So I made it adjustable.

(cargingAmps = charging Amps ;-) )

Currently, when the battery is cold, it cannot be charged. So I need to set the Inverter to output the incoming solar power as fast as possible. My Setup is: PV MPPT --> Battery --> Soyosource and power clamps in between. So to get nearly 0W at the battery I'm measuring and adjusting each 250ms. Therefore the sensor_latency value must be lowered, when battery protection is on (too cold).

BTW: This is another case for a very fast update intervall without overshooting. 👅

syssi commented 9 months ago

There is a typo in chargingAmps. ;-)