Skip to content
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

Did for current shaper not working under certain circumstances #784

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

jeremypoulter
Copy link
Collaborator

fix #762

@jeremypoulter jeremypoulter marked this pull request as draft January 9, 2024 22:28
@jeremypoulter jeremypoulter self-assigned this Jan 9, 2024
Copy link
Contributor

github-actions bot commented Jan 9, 2024

Test Results

36 tests  ±0   36 ✅ ±0   0s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 94ced45. ± Comparison against base commit e09e53a.

@KipK
Copy link
Collaborator

KipK commented Jan 10, 2024

This was there to prevent negative calculation when live_pwr > max_pwr. As in this case, evse should stop anyway.

I'm pretty sure the 73 issue is not caused by this.
However I couldn't reproduce it here.

@zerodur12
Copy link

I test the build openevse_wifi_v1 on my EVSE with 8.2.3.T2 firmware. Every thing work well the current regulation work again to target max_pwr (set to 8400W), I also test a change in max_pwr value during the charge (around 20h in the figure below) and the regulation follow the new max_pwr value without problem.
@KipK if you need to prevent negative calculation of the max_cur from any value of live_pwr >> max_pwr, it seems better to force the result of current calculation to be greather than 0 than making live_pwr = max_pwr, if live_pwr is saturated to any fix value it is like opening the close loop with no mesure any more of live_pwr (from my point of view)
image

@graememk
Copy link

Removing that check has allowed my install to load balance as expected.

On the latest release build (5.0.2), The EVSE could sit at full speed and still be a few kW over the set limit.

The negative Value in the max_pwr - live_pwr is key to the operation of the load balancing

max_pwr = 8000, live_pwr = 10000, voltage = 230, getAmps() = 32

_max_cur = ((max_pwr - livepwr) / evse.getVoltage()) + evse.getAmps();

_max_cur = ((8000 - 10000) / 230) + 32
_max_cur = (-2000/230) + 32
_max_cur = (-8.7) + 32
_max_cur = 23.3A

Possibly a check on _max_cur to prevent that from going negative, If the reduction was more than 32 amps _max_cur would go negative. (or rollover?)

Ran a test: It goes negative, Charging stops
image

@KipK
Copy link
Collaborator

KipK commented Jan 11, 2024

Thanks for the test. The saturation prevention was there just in case negative value could mess-up something. Seeing it works ok, there''s no need to keep it.
I have no clue why it fixes your issue btw. But if it does... :)

@jeremypoulter jeremypoulter marked this pull request as ready for review January 11, 2024 21:30
@jeremypoulter jeremypoulter changed the title Experimental changes to try to fix #762 Did for current shaper not working under certain circumstances Jan 11, 2024
@jeremypoulter jeremypoulter merged commit f4a3d31 into master Jan 11, 2024
21 checks passed
@graememk
Copy link

In an abundance of caution,
Should the _max_cur be checked for negatives before being returned, it does work, as is but it could be a precaution.
If less than 0, _max_cur =0;

@jeremypoulter jeremypoulter deleted the jeremypoulter/issue762 branch July 14, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shaper not working anymore with release v5.0.2
4 participants