dalathegreat / Nissan-LEAF-Battery-Upgrade

Software and guides for upgrading LEAFs to bigger and newer batteries
GNU General Public License v3.0
218 stars 39 forks source link

Bugfix: Incorrect scaling of instrumentation cluster on ZE0 #30

Closed dalathegreat closed 1 month ago

dalathegreat commented 1 month ago

What

This PR fixes the cosmetic issue that occurs on battery upgraded ZE0s.

Why

On the ZE0, incase you stop charge at any other point than 100%, that point becomes the 12/12 bars. This becomes problematic, for example if you stop charging at 60% on a 62kWh battery, then the instrumentation cluster will be extremely misleading

How

During startup we

Massive thanks to @nzautomate for these findings! 🙌

Testers welcome, .srec file for 2-port CAN bridge included in this PR canbridge_4.22beta.zip canbridge_4.22beta2.zip <- Improved timing

malyjaponec commented 1 month ago

I have not found time to force myself to learn how to build the software. If you prepare 3-port version i will be able to install it tomorrow. Today I am doing 0% discharge test. Already passed 0%. Now charging to 100%. To check how SOH now works. Wife will be driving it on weekend and it would be nice to have SOC bars finally working.

dalathegreat commented 1 month ago

@nzautomate , we tested the startup sequence with the following: (beta) Wait 1 s, turn on full charge flag, wait 1 sec, and turn off At the same time, GIDS is locked to high value for the first 5 seconds

This did not work.

Now we try with: (beta2) Wait 1s, turn on full charge flag, wait 2 sec, and turn off At the same time, GIDS is locked to high value for the first 6 seconds

Let me know if you have a code snippet that I can inspect the timing from!

dalathegreat commented 1 month ago

@nzautomate disregard that, the beta2 method worked! We just needed to hold the conditions for a bit longer :) Thanks for figuring this one out! 🙌

malyjaponec commented 4 weeks ago

I have charged car to 80% (counted by gids in ovms, voltage just under 4V), then I disconnected 12V, upgraded from 4.21 to 4.23, reconnected 12V and I see only 75% in ovms??? and only 74% soc in leafspy. It looks like something again happens with reporting capacity and SOC. I do not know what. Car reports around 15kWh that seems to be right with 74-75% soc. I usually have

Anyway the important thing is that I still seeing full bar scale. The range shows 136km for a while and then jumps down to 130km. But nothing happens with bars.

https://github.com/dalathegreat/Nissan-LEAF-Battery-Upgrade/assets/15339929/8790081b-31cc-49df-8db0-c4f431ef4da6

EDIT: the ovms was not 75, I closed app before it updated, it was 79 probably, just under 80%, because car charged 4-5 minutes and stopped at 80% that is 76.2 in leafspy. No issue there. The issue is only bars. I should not see 12 bars. There should bye only 9 or 10.

dalathegreat commented 4 weeks ago

@malyjaponec The LEAF BMS recalculates when powered ON/OFF, so that is why you see a difference in SOC.

The 12bars is configured to the following amount of GIDS: https://github.com/dalathegreat/Nissan-LEAF-Battery-Upgrade/blob/main/Software/CANBRIDGE-3port/leaf-can-bridge-3-port/can-bridge-firmware.c#L553

If your battery is very degraded, it will show 12 bars too soon. Instead of hardcoding those values, they should scale according to SOH%. I can make a new issue for this!

dalathegreat commented 4 weeks ago

@malyjaponec Created https://github.com/dalathegreat/Nissan-LEAF-Battery-Upgrade/issues/35

malyjaponec commented 4 weeks ago

By the way car reported 312 gids for long time (i do not know how long time but I stated to monitor it since I have OVMS because I use GIDS to count SOC (reading soc "from instrument" does not work reliable, also when I select reading SOH from instrument, OVMS stops updating expected drive range). I bought it in end of winter. So it was like from march at 312 gids? Then I upgraded from 4.20 to 4.21 and car reported 267 gids at full charge. After one 0% cycle it was same. After second discharge to 0% it goes to 280 gids. Just now at 76.2% soc (leafspy) has 224gids.

I do not really 100% understand where is the problem, but I believe you that there is a way to fix it somehow.

malyjaponec commented 4 weeks ago

@dalathegreat I finally understand... with #35 you want to fix SOH bars, but why the SOC bars does not work? Someone can you or someone explain why short presentation of 100% can fix SOC bars to some car but not to mine?

dalathegreat commented 4 weeks ago

@malyjaponec Due to a bug, I have a fix up here for you! https://github.com/dalathegreat/Nissan-LEAF-Battery-Upgrade/pull/36