-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Determining the "Power calculation method" #73
Comments
There are two methods available:
You can choose between the methods here: https://github.com/syssi/esphome-soyosource-gtn-virtual-meter/blob/main/esp8266-example.yaml#L60 I cannot recommend to use the dump OEM behavior because the method is unable to detect overshooting.You should stick to the https://github.com/syssi/esphome-soyosource-gtn-virtual-meter/blob/main/esp8266-example.yaml#L65-L67 Another option is smoothing the readings of the smart meter locally by applying additional filters: |
BTW: I felt lucky enough to add a 3rd method called "PASSTHROUGH" (you can observe the changes in my fork: https://github.com/careyer/esphome-soyosource-gtn-virtual-meter -- I am sorry but I had to fork because otherwise the esphome build processs does overwrite my local changes with the status of your online repo while building because it pulls the latest code during buildtime) 🙄 The use-case of this method is the following: I wanted to implement a "Solar/PV-First"-Approach... i.e.: I am measuring what power comes from my solar panels right at the very same moment and I want my SoyoSource Inverter to invert exactly this ammount of power while not charging my batteries and leaving them +-0W charging current. |
Feel free to fork this repository (it's how GitHub works). ;-) I would be happy about a contribution / pull request if you want to introduce a third method which fits to your needs. |
Thank you! I see you are embodying the open source idea! Kudos! However I had ideas on how to improve on your 'NEGATIVE_MEASUREMENTS_REQUIRED' method:
What are your thoughts? |
Let's talk about idea 1 in detail: Could you try to explain / outline your idea using example values? |
Hey @syssi, sorry for answering late: I have been way to busy these days. Preliminary considerations: Lets take a look at an example: This way we rapidly approach the current power demand with immediatly and effectively stepping back from any overshoot and without the need for negative power limiter values. |
I understand your idea. Could you explain why you don't like overshooting and why do you prefer stopping the inverter instead of slowly decrease the limiter signals to find a new "positive sweet spot" (f.e. if the smartweter reports a power consumption of 1W). |
Sure! There are two major reasons for this: |
Last question before implementing the method: Are you able to measure negative values (overshooting/exporting to the (off)grid) in case of b) or are you looking for a "positive measurements method" because of this reason? |
Ohh... yes, I can also measure negative values. Just thought it would be beneficial to have a 3rd method that doesn't rely on this prerequisite. Just to make this whole suite of tools more universal ;-) |
Please give it a try:
The implemention isn't exactly your approach but it's pretty similar. The configuration above tries to control the limiter to import 10W from the grid always. If your smartmeter reports a value less than 10W the method tries to reach 10W again. If your smartmeter reports a value |
Hey Sebastian, thanks! Sorry... I was busy again like crazy. I will try it this weekend and will report back to you! Best regards |
@blacklopo Do you have a smartmeter which provides negatives measurements of you overshoot / export to the grid? |
Yes, Shelly 3M. Attaching graph from today. Finally I tried new variant - RESTART_ON_CROSSING_ZERO . But data will be available tomorrow. |
Keep me updated. I will try to provide a similar graph for comparison. |
Could you explain what I can see here? I must admit I didn't get the meaning of FVE and DS yet. |
Now I can see problem with settings - RESTART_ON_CROSSING_ZERO. When negative value is detected, system automatically set Demand power to 0, and iniciate "reset", but for next several seconds the inverter still generates higher power than is expected... |
|
Could you provide your YAML configuration? I would like to know the update interval of the powermeter sensor for sure. It is throttled? |
Please try to throttle the |
Its just that:
The sensor itself sends a value as soon as the meter is updating it's measurement, which is about 1s I am thinking about changing the calculation to something like Throttling the sensor would slowdown the initial reaction on sudden load change. Changing the calculation method would only slow down the following adjustments. I will try to test both methods and see if my assumption can work. ;-) |
If you clone this repository you can make/test all changes locally if you compile the YAML using:
This will build the project using the local component directory instead of cloning the repository. |
I'm happy about possible improvements. My knowledge of control engineering is very limited. |
@kev300 I'm running my inverter with these parameters:
I have no oscillation. My smartmeter updates every second. It's working okay but overshoots for 1-2 seconds are normal. |
It's 48v 1200w with display; no wifi. Interesting. I just tested with low power consumption, because my battery is empty and not connected to solar, yet. But mine never stops oscillating. I'm trying a new algorithm at the moment but didn't have enough time yet. |
I have hooked up the original RS485 limiter to a logic analyzer and it's transmitting the power demand every 0.5s. Have you bought your inverter with the original limiter? |
Yes. If your inverter is a silent one you should use the https://github.com/syssi/esphome-soyosource-gtn-virtual-meter/blob/main/esp8266-limiter-example.yaml example instead of https://github.com/syssi/esphome-soyosource-gtn-virtual-meter/blob/main/esp8266-example.yaml The |
@syssi was about to write the same.
Shouldn't "Monitor an control" only be "Control"? |
I have a similar setup running and was curious too about how fast the Soyo is adjusting. I don't have decent measurement equipment, just a Shelly. But I am sure there is quite a bit of latency of one or even two seconds until a new limit takes effect. And it looks like a smooth ramp between highly different values, no sudden impacts. I have disabled reading from the limiter "port" because this makes no sense in my eyes and for many people the inverter is silent anyway. After testing I have found that "hammering" the limiter twice a second is not necessary at all. It works very good when updating once every 3 seconds - and taking into account the inverter's latency in adjusting, 2 seconds seems like a very good setting. Above 4 seconds is certainly to big of delay. Just my two cents. Keep up the good work guys! |
This seems to work good for me: https://github.com/kev300/esphome-soyosource-gtn-virtual-meter/tree/overshoot-compensation2 But I'm still testing with fast (0.5s) and slow (3s) update interval today and will create a PR if don't find more issues. ;-) |
Please keep in mind you can smooth the regulation too if you
It's not as intelligent as comparing values but it slows things down and let the inverter breathe. |
I know, but my goal is, that the inverter reacts as quickly as possible. I think you have to smooth quiet a lot of data, like 15s in your example, to get rid of the overshooting, but thats too slow for me. :D I'm very happy with 0.5s and if it's working without overshooting: 👍 You can see in my changes, that i tried running with update_intervall: never and only trigger the update by the sensor reading. By the way: my inverter seems to react somewhere between 0.5s <--> 1s to demand changes. But it's the whole loop demand-setting -> inverter -> smartmeter -> esp01 reader -> Home Assistant -> ESP32 -> inverter, which is taking around 2.5-3s latency. So I can't confirm the slow reaction of humpataa Only for the whole control-loop. |
I also like to see the inverter reacting as quick as possible. I think triggering the uptdate by a new power sensor reading, is an good idea, but how can I do this? |
Just set update_interval of soyosource_virtual_meter to never (and use my branch here: https://github.com/kev300/esphome-soyosource-gtn-virtual-meter/tree/overshoot-compensation2) Or instead of using my branch also add this to your powermeter sensor:
virtualmeter0 is the id of the soyosource_virtual_meter |
But keep in mind: |
Thanks, it is working! At first I got this Error:
So I put the update command at the end of the Shelly 3EM query:
Now it is working, with 1s repetition rate and without overshoot. I'm using syssis unchanged software. |
Cool, seems like your shelly and directly querying it is much faster than my smartmeter setup through home assistant. 😉 |
Yersterday I told you, that I would'nt have overshoots. Ok, that was true, but this morning I found one of my 3 inverters was not working yersterday. Operation with one inverter missing yesterday was similar to Kevin's |
Yes, Kp fits. 😁 By the way, I found this right now: Maybe we can use that and just replace °C by Watts (Adapt our sensor + demand control). Not sure if thats realy possible with that component. But I would only go there if my simplified solution does not work good enough. |
Would you please so kind and paste your entire code here? Thanks in advance. |
Wy don't you use the sum of the 3 phases provided by the 3EM http status page?
And at
|
@pfeupfeu : do you have graphs with 1s resolution of you power consumption meter? I can't belive that you don't have overshoots or oscillation with the shelly and 900ms (btw. why 900?). |
Thanks for getting back to me. Maybe you can help me again and tell me where my error is so that your code does not work for me? |
This is my entire code. No matter what I try, it would be appreciated if you can share me yours. So I can find where my mistake is.
|
I'm sorry, I forgot you need also this:
For reference, and in case I forgot something else, this is my entire code:
|
Are you guys all on vacation? :D Or nobody has overshoots anymore? |
Vacation. ;-) |
Currently am busy with my job and I just have some little time windows, in which I need to take care of more important stuff ;) |
Hi, Anyway, currently I have replicated the algorithm of the original component using my method and it works ok (but not perfect) with a 3s interval action. |
Isn't the original behavior already included in this component by syssi or what do you mean by original component? Did you try to run the branch from my pull request? My solution does react immediately on each power demand change but it subtracts the last demand change from the current calculation, because that change has not reach the powermeter, yet. It is subtracted in each update until the targeted zero consumption is reached or crossed. The 5 s works good if your powermeter updates each 1-2s. I have run the display update interval with 1s without issues, but did not go lower. Maybe also a good idea, but the display reading is also very inaccurate and do not reflect the actual ac power. |
Let's close this issue. :-) Feel free to create a new one if you want to improve a specific detail! |
In the CLI output it says: "Using the new method of calculating the power demand" (which overshoots by quite a lot).
Is there a way to use the "standard method"?
I found out, that this is in soyosource_virtual_meter.cpp (L82-L88ff)
Here I can see there is the determination of what method to use.
However both versions do not fit my needs.
I want to implement a "PV-first" functionality in my system and therefore I need the unaltered last MQTT power measurement. This power measurment refelcts the current PV input in Watts and I want to command my inverter to invert exaclty this power so that the PV power gets absorbed right awaybefore charging my batteries.
Thanks for any hints mate!
The text was updated successfully, but these errors were encountered: