openvehicles / Open-Vehicle-Monitoring-System-3

Open Vehicle Monitoring System - Version 3
http:///www.openvehicles.com/
Other
607 stars 230 forks source link

MG ZS EV (2020) SOC and estimated km wrong after BMS update #724

Open pascalsaul opened 2 years ago

pascalsaul commented 2 years ago

During the maintenance they updated the software versions as well as the BMS to 1027630EU4 which adds delayed charging and battery heating. Very nice but OVMS can't handle the changes all though the "Updated BMS Firmware" is checked and gave OVMS a reboot. Even the latest 3.3.002-47-gfd3554f7/ota_1/edge (build idf v3.3.4-848-g1ff5e24b1 Aug 29 2022 08:47:12) does give the same issues. MG changed the max voltage to be 449.75 instead of 456.25 and SOC changed to 98.9071 which is the new 100%. Also the GOM is sometimes very weird and displaying values of 330km estimated which is crazy off course. Maybe the BMS update is used for the facelift model as well?

Before:
v.b.range.est                            255.5km
v.b.range.full                           263km
v.b.range.ideal                          263km
v.b.range.speed
v.b.soc                                  100%
v.b.soh                                  97.18%
v.b.temp                                 28°C
v.b.voltage                              456.25V

After:
v.b.range.est                            17km
v.b.range.full                           263km
v.b.range.ideal                          260.126km
v.b.range.speed
v.b.soc                                  98.9071%
v.b.soh                                  97.07%
v.b.temp                                 27°C
v.b.voltage                              449.75V

Softver:
DCDC F01R0A7355
ATC REL_DC_BEV_C036     
GWM 0026011080
BCM 2210 4176 
PEPS ZS11SW01
SCU 194136858 C0807
PLC 1770099611
ABS 1019000000
EPS Zs11ESVf18
SRM ZS11.E1.02
EPB       S001
FVCM Z5.0RC07  
TC F01R0A7354
TBOX SNMX007Z1E
FDR ACC_SW:5.0
VCU   blrv0450
RDRA 00000SW026
IPK S200425-09
ICE S160630.01
BMS 1027630EU4
TPMS QY1105A812
mossc001 commented 1 year ago

@pascalsaul , I've just had the BMS update on my MG ZS 2020 and have exactly the same problem with the estimated range, it just stays at 18km regardless of power cycles or distance. The "BMS Update" box in the features seems to have no affect; odd.

I haven't noticed a big change in SOC, but the estimated range is the very annoying one.

Also, your post is now quite old, did you find a fix?

pascalsaul commented 1 year ago

@pascalsaul , I've just had the BMS update on my MG ZS 2020 and have exactly the same problem with the estimated range, it just stays at 18km regardless of power cycles or distance. The "BMS Update" box in the features seems to have no affect; odd.

I haven't noticed a big change in SOC, but the estimated range is the very annoying one.

Also, your post is now quite old, did you find a fix?

No, since the received data by OVMS is different due to BMS update something should be fixed in the code... Maybe @chrisstaite knows it?

mossc001 commented 1 year ago

@pascalsaul , I currently have all the data logging to my own MQTT server, then into Home Assistant, so I might build my own estimation calculation until it's fixed.

Here for reference: https://github.com/mossc001/OVMS_MQTT_with_HA

GreyPeter commented 1 year ago

Hello @pascalsaul and @mossc001. I believe this was a problem that I thought was resolved about 2 years ago but apparently not. I have found an old build by @KilveEng which I have built. If this resolves your issues, I should be able to implement it into the latest edge build. Can you try it out for me please. Peter ovms3.bin.zip

pascalsaul commented 1 year ago

Hello @pascalsaul and @mossc001. I believe this was a problem that I thought was resolved about 2 years ago but apparently not. I have found an old build by @KilveEng which I have built. If this resolves your issues, I should be able to implement it into the latest edge build. Can you try it out for me please. Peter ovms3.bin.zip

The BMS they install nowadays aren't the beta firmware's they developed 2 years ago. Many BMS versions are spread through Europe to fix some things but not always in the good way. I managed to get the file uploaded.

pascalsaul commented 1 year ago

That works @GreyPeter since we got an option to choose the BMS version: image

GreyPeter commented 1 year ago

Thanks for testing it @pascalsaul . I will do a new version with the additional code and upload it here again.

mossc001 commented 1 year ago

@pascalsaul , did this resolve the SOC issue too? I haven't had chance to test the revised *.bin yet, I plan to do it this week.

image

pascalsaul commented 1 year ago

@pascalsaul , did this resolve the SOC issue too? I haven't had chance to test the revised *.bin yet, I plan to do it this week.

image

I just checked the estimated for now and will plan to do a full test with the new version from @GreyPeter (also with a full charge). I believe this will be fixed automatically with the additional code.

mossc001 commented 1 year ago

2023-02-19 17_10_48-HV20NNL Features Looking good my end.

@GreyPeter , will the new version be a custom bin or wrapped into a 3.3.x release?

GreyPeter commented 1 year ago

@mossc001 I am working on an updated version that I hope to push to the current version. It calculates the Estimated Range from the car's own consumption, battery size, state of health and state of charge. I am doing tests at the moment and hope to be able to release the code in the next couple of weeks.

mossc001 commented 1 year ago

Looking all good over the past few days from the *.bin provided above. If it's now in the current version, let me know and I'll go back to auto update firmware.

image

dragon2611 commented 1 year ago

2023-02-19 17_10_48-HV20NNL Features Looking good my end.

@GreyPeter , will the new version be a custom bin or wrapped into a 3.3.x release?

Does this mean the pre facelift MG5 IS supported as the docs seem to suggest it isn't although I saw mention of a possible early firmware build that might support it a couple years back in the mgev's forum.

GreyPeter commented 1 year ago

@dragon2611 I am also working on a version for the ZS EV facelift vehicle which I also hope will work with the MG5. I am not finding much spare time at the moment so not much development getting done. Hopefully next week will be better. I will initially release a custom build for testing and then hopefully push it into the latest build.

dragon2611 commented 1 year ago

Do we know if it’s possible to get the SOC? I’d need to buy the ovms hardware which is why I asked.

GreyPeter commented 1 year ago

SOC should work on the MG5 as well but will need to be tested on a MG5. The ZS EV MK2 pids look very similar to the MG5.

dragon2611 commented 1 year ago

is it worth me ordering the hardware or should I hold off, sorry I'm unclear if there is already a build about that can read the PIDS on the Pre facelift 5.

Also the BMS on my car could be a weird version as it originally had issues where it kept coming up check HV battery and going into turtle (https://www.mgevs.com/threads/mg5-mystery-faults.7702/#post-125902) they had to release a new software to resolve it (Not sure if BMS or ECU)

GreyPeter commented 1 year ago

@dragon2611 I would not advise that you buy the OVMS module until we can check if the version for the MG ZS EV facelift model works on the MG5. I believe there was some work done on an MG5 Version of the OVMS firmware but I don’t believe it was ever released to the public. If there is someone who can test a new version on an MG5, please let me know.

GreyPeter commented 1 year ago

ovms3.bin.zip This is my latest build. It includes code to calculate the vehicle consumption and then calculates the estimated range from consumption. It no longer uses the estimated range from the BMS so is unaffected by the BMS build. There is no longer a need to select the BMS Version. It may still need some fine tuning. Please test it and see if it performs correctly with Estimated Range.

dragon2611 commented 1 year ago

@dragon2611 I would not advise that you buy the OVMS module until we can check if the version for the MG ZS EV facelift model works on the MG5. I believe there was some work done on an MG5 Version of the OVMS firmware but I don’t believe it was ever released to the public. If there is someone who can test a new version on an MG5, please let me know.

I may have to just risk it as I suspect there won't be many people who have the hardware sitting around and also happen to have an MG5 unless they either bought it previously with the hope of getting it working or have more than one car.

As long as it doesn't brick the car I'm willing to be a Guinea pig so to speak.

Edit: Ordered one.

GreyPeter commented 1 year ago

@dragon2611 could you join MG EV Hackers on slack so I can guide you through scanning PIDS when you get your OVMS Module.

dragon2611 commented 1 year ago

@dragon2611 could you join MG EV Hackers on slack so I can guide you through scanning PIDS when you get your OVMS Module.

I think they may have set it to private as I found it via the docs site but it appeared to want an existing account and I didn’t see any options to join

GreyPeter commented 1 year ago

Can you send your email address to me so I can invite you?

dragon2611 commented 1 year ago

Done I think (mobile at the moment so using a tablet)

GreyPeter commented 1 year ago

OK send me a Direct Message on slack when you can.

GreyPeter commented 1 year ago

I have added some code to fix the SOC issue. Try doing a full charge and let me know if it works OK. ovms3.bin.zip

pascalsaul commented 1 year ago

Looks good to me now. Getting the message topping off at 100% again. I must say the last 5% to 100% is going still quickly but that is probably something from the car itself.

pascalsaul commented 1 year ago

Once the SOC is 100% it doesn't decrease anymore

GreyPeter commented 1 year ago

OK @pascalsaul. Looks like I may have to approach it from a different slant. When you next do a full charge, after it finishes Topping Off, note the value of SOC Raw under MG/Charging Metrics

GreyPeter commented 1 year ago

ovms3.bin.zip I have added some selections on the MG/Features please select BMS Firmware EU* and MG EV (UK/EU) as the vehicle under Config/Vehicle. Hopefully this should work correctly. Please Note: The estimated range uses a new calculated average consumption figure. I have initially set it to 165Wh/km (16.5kWh/100km or 265.54 Wh/mi) and it should update as you drive around. I may need to tweak how this averages consumption over time. Please let me know how it performs over time. You can view it in the shell with: me l xmg.avg.con

GreyPeter commented 1 year ago

@pascalsaul-copaco thank you for these figures. I am still working on a better way to calculate the average consumption. I want it to average over a longer time and then the estimated range won't jump all over the place.

pascalsaul commented 1 year ago
v.b.range.est                            214.196km
v.b.range.full                           251.849km
v.b.range.ideal                          259.004km
v.b.range.speed
v.b.soc                                  102.841%
v.b.soh                                  95.76%
v.b.temp                                 13°C
v.b.voltage                              449.5V
xmg.v.bat.voltage.bms                    449.5V
xmg.v.bat.voltage.vcu                    449.5V
xmg.v.range.raw                          194
xmg.v.soc.raw                            93%
xmg.avg.consumption                      294.662Wh/km

What about the strange SOC after full charge of 102.841% ;)

image

GreyPeter commented 1 year ago

ovms3.bin.zip - Try this

GreyPeter commented 1 year ago

ovms3.bin.zip

pascalsaul commented 1 year ago

ota flash http http://home.saul.nu:8081/ovms3.bin

I host the latest BIN here if others want to test as well. Uploaded and will check in some hours again.

Last boot was 3892 second(s) ago
Time at boot: 2023-03-17 15:55:16 CET
This is reset #10 since last power cycle
Detected boot reason: Crash (12/12)
Reset reason: Exception/panic (4)
Crash counters: 2 total, 0 early

Last crash: abort() was called on core 1
Current task on core 0: IDLE0, 432 stack bytes free
Current task on core 1: OVMS Events, 4912 stack bytes free
Backtrace:
0x4008dcfa 0x4008df95 0x40134cf4 0x40092ec3 0x400844fe 0x4010a062 0x4012cac9 0x4012e36b 0x4012e408 0x40131114 0x40133c03 0x4016ba9a 0x4016bb69 0x4016d984 0x4016b806 0x4011865a 0x40118829 0x40118910 0x40118999
Event: ticker.1@ovms-server-v3 0 secs
Version: 3.3.003-300-g0d8a3e6e-dirty/ota_1/edge (build idf v3.3.4-846-ga5ee88178 Mar 16 2023 09:09:56)

Hardware: OVMS WIFI BLE BT cores=2 rev=ESP32/1; MODEM SIM5360

Looks something is wrong with this build...

pascalsaul commented 1 year ago

Charging is fixed now with SOC to 100%.

GreyPeter commented 1 year ago

@pascalsaul thank you for hosting the .bin file. It will allow more people to test it. Is it still crashing?

GreyPeter commented 1 year ago

I am currently working on a better way of calculating average consumption. If I can get it working properly, I will push it to the main build.

pascalsaul commented 1 year ago

@pascalsaul thank you for hosting the .bin file. It will allow more people to test it. Is it still crashing?

Looks ok for now. Maybe an older bug popped up.

mossc001 commented 1 year ago

@GreyPeter , I will get this tested today after a period of being offline.

I've just downloaded it from @pascalsaul server :)

GreyPeter commented 1 year ago

Excellent @mossc001. The more testers the better.

mossc001 commented 1 year ago

I'll need to get the full output later but I'm only getting an SOC to 98.9% when full.

image

GreyPeter commented 1 year ago

@mossc001 have you selected BMS Firmware EU* on the MG/Features page?

mossc001 commented 1 year ago

@mossc001 have you selected BMS Firmware EU* on the MG/Features page?

Sorry, yes, seems it was on AU. I've now done a full charge since and can confirm 100% on SoC.

GreyPeter commented 1 year ago

Ok - all good. I still want to do a bit more work on the code before I am ready to get it put into the main code.

GreyPeter commented 1 year ago

OK. I think it is all done. I have added trip consumption (xmg.p.trip.consumption) which is calculated during a journey by checking the consumption every minute while the car is travelling over 5KPH. At the end of the trip, it is used to adjust the Average Consumption (xmg.p.avg.consumption) over several trips. The average consumption, weighted by the current trip consumption, is then used to calculate the estimated range. I have added selections on the MG/Features page to fix the low SOC readings. NOTE: The Estimated range will vary a little depending on the type of trips that you are doing but should be fairly accurate. ovms3_trip_consumption.bin.zip

mossc001 commented 1 year ago

OK. I think it is all done. I have added trip consumption (xmg.p.trip.consumption) which is calculated during a journey by checking the consumption every minute while the car is travelling over 5KPH. At the end of the trip, it is used to adjust the Average Consumption (xmg.p.avg.consumption) over several trips. The average consumption, weighted by the current trip consumption, is then used to calculate the estimated range. I have added selections on the MG/Features page to fix the low SOC readings. NOTE: The Estimated range will vary a little depending on the type of trips that you are doing but should be fairly accurate. ovms3_trip_consumption.bin.zip

I will get this uploaded this Bank Holiday weekend and give it a test. Thanks!

GreyPeter commented 1 year ago

Thank you

pascalsaul commented 1 year ago

Thank you

Download complete (at 2785280 bytes)
Error: ESP32 error #5379 finalising OTA operation - state is inconsistent

Can't get the image uploaded. Tried Wednesday and today so looks corrupt to me. Can flash the other image on it.

GreyPeter commented 1 year ago

I have done a rebuild and successfully installed it on my vehicle. Try this: ovms3_trip_consumption.bin.zip