Replacing the VW BMU aka implementing high level BMS functions
Posted: Mon Nov 20, 2023 8:27 pm
by johu
Now I'm using the VW battery modules together with their cell management units. They provide me with per cell voltage and per module temperature and allow me to dissipate energy from cells for balancing.
The BMU however I won't be using for the time being because it uses 2 MBIt CAN and I don't feel like reverse engineering it.
Now for me one of the most critical parts is the charge curve. I think manufacturers spend a lot of time tuning them in a way that you have good charge speed and longevity. So I want to mimic as closely as possible what VW does.
Then I wrote down the voltage and current curves and also tried to work out the internal resistance of the entire system by using the current step at the beginning of the charging session.
With that done I arrived at this:
It may not immediately jump out from the curve but it does when looking at the raw data: It seems like they are running 2 3 subsequent CC-CV curves.
The first: CC=310A, CV=3.93V (per cell). In the recorded session that runs to 50%.
The second CC=170A, CV=4.03V (60-70%)
The third: CC=114A, CV=4.25V - yes they actually go above 4.2V, 459V on the charger display and it is a 108S pack
In the session that started at 70% till 100%
From 3.93V to 4.03V they seem to run some A/mV profile that starts at 170A (cutoff of first CV) and ends up at 114A (CC2).
By using a P-controller only the CV point is very soft and approached linearly.
At least that's how I interpret it and programmed it. I like making it all cell voltage rather than SoC dependent because in the latter case errors in SoC calculation could screw up the charge curve.
I have no data on temperature derating but I'm thinking this ideal charge curve would start at 20°C and end at 40°C. Outside that window I plan to derate the CC values. Most of all it should stop charging before 45°C because arber says that's where the cells behave unsound.
Will probably linearly ramp down the power to 50%@0°C. And below - I don't know.
Any input appreciated
Re: Replacing the VW BMU
Posted: Tue Nov 21, 2023 9:12 pm
by johu
And here is the code I'm currently running. I've tested it with a "battery model" and results look sane.
When comparing with the stock curve be aware the x-axis is time scaled
I have also implemented low and high temperature derating, here is a charge session starting with a 15°C cold battery
The CC phase starts lower than normal and ramps up as the battery self-heats
And here is a charge session that overheats towards the end
My battery model uses a constant internal resistance, so it won't behave that way with the actual battery. Also no cooling is simulated
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Wed Nov 22, 2023 12:13 pm
by Aragorn
I'll try to remember to pull some data points from CarScanner for you. This is an older screenshot in my phone:
Hopefully you can cross reference these with your model and see that it lines up somewhat sensibly.
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Wed Nov 22, 2023 2:41 pm
by johu
Thanks, yes more of that
The Nyland curve is 220A @ 35% or 204A@40%. Seems like there is not much derating at 8°C. Unless of course it goes down once you actually start charging. This could be the regen limit, right?
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Wed Nov 22, 2023 3:25 pm
by Aragorn
Yeah that is in "drive" mode, not sure if it would then apply different limits when charging vs regen.
I've seen one log taken during a rapid charge (from someone elses car) where it was showing 80A on a warm battery, with the charger churning along at 37kw, but that felt like it was showing the charger limit or something, because theres no reason i could see for it showing that low a value. The battery was over 20c and the SOC was low enough that it should have been doing 100kw+. As soon as it was unplugged it jumped back up to over 200A.
My own car only has the "50kw" charging option as i didnt pay the extra to unlock the full 120kw, so not sure what mine would show when charging.
I will try to get some more points on the curve and also see if i can get some at much lower temperatures once the weather cools.
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Thu Nov 23, 2023 6:04 pm
by johu
While we wait for that next up is SoC estimation.So whenever the pack has been unloaded (say less than 1A current) I want to derive the state of charge from the idle voltage of the lowest cell. So I need a voltage->SoC curve for those cells. Anyone know where to find it?
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Fri Nov 24, 2023 11:55 am
by Aragorn
We can probably pull similar data from Carscanner as a cross reference, a different page can show us SOC and cell voltages (though for this particular screenshot i dont know if the battery was fully unloaded):
Two snaps from yesterday before leaving work and after getting home, bit warmer though so not giving us much data for low temps:
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Mon Nov 27, 2023 10:00 pm
by johu
I found a curve for NCM712 chemistry which apparently the MEB cells are.
It is not open circuit though... Loaded with 0.2C
Surprised to see these can go to 4.4V. Explains why it is allowed to reach 4.25V in the charge session (and then still has a top buffer)
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Tue Nov 28, 2023 8:10 am
by johu
And next up is the "state of energy" or SoE. SoE as opposed to SoC takes the cell voltage into account. The upper 50% SoC contain more energy than the lower 50%. The voltage is then lower and the inverter will draw more amps for the same torque request.
Some cars only display SoC and even base the range estimate on it. Then you're in for a surprise when SoC drops much quicker at the low end.
I graphed it here:
grafik.png (9.67 KiB) Viewed 7867 times
Basically made 5% segments and calculated the energy left in the middle of that segment. That is then divided by the total energy.
For both SoC and SoE to make sense the actual capacity of the worst cell must be known. So that is up next
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Thu Feb 08, 2024 4:23 pm
by johu
Today I took the battery a little lower and I found the drop from 3.8V to 3.7V is rather steep. This step isn't represented in my SoC table so SoC I think is now estimated much too low. In my table 3.7V corresponds to just 30%. I think I will discharge as low as possible and then recharge like 5 Ah at a time, pause 5 minutes, take an cell voltage reading, and continue with the next 5Ah.
Re: Replacing the VW BMU aka implementing high level BMS functions
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Thu Feb 08, 2024 9:26 pm
by rstevens81
You really going to go all out with 4.2v/cell seems quite a bit more than the 4.1v we are used to but I guess if the OEM does it it's probably ok Not sure I would want to push it that far daily.
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Thu Feb 08, 2024 9:50 pm
by johu
No, not daily but the lookup table needs to map it correctly. Normally I limit to 80% or 3.95V
New SoC and SoE curve
Re: Replacing the VW BMU aka implementing high level BMS functions
Gets interesting around 4.1
PyBamm mentioned there is interesting too.
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Fri Feb 09, 2024 1:47 pm
by johu
Still on my todo list. Will study that. At first approach I was going to track the difference between Ah counting and voltage to SoC curve
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Sat Feb 10, 2024 11:46 am
by rstevens81
I would, keep things simple and not bother with degregagtion calculation all you really want is soc calculation based on resting voltage and have a fall back where ah are used when voltage isn't possible e.g. motorway drive. a variable for battery ah is all that is needed and as we can record ah used (from shunt) this value can be manually updated every few years or so
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Sun Feb 11, 2024 1:59 pm
by johu
I guess you're right, will bring it out as a parameter that I can adjust with experience.
Will probably implement the extrapolation also strictly informative. It's not hard if you remember at which estimated SoC you started (dis)charging, at which estimated SoC you stopped and what the reported Ah are in comparison.
Edit: here's what I do after 2 minutes current < 1A
int32_t as = isa->GetValue(IsaShunt::AS);
if (ABS(as) > 36000) //more than 10Ah difference
{
float estimatedAs = mebBms->EstimateSocFromVoltage() - estimatedSoc; //Calculate difference in percent to last estimation
estimatedAs = ABS(estimatedAs); //only the absolute value is of interest
estimatedAs*= mebBms->GetMaximumAmpHours(); //multiply with supposedly available amp hours
estimatedAs/= 3600.0f / 100; //multiply by 3600 (Ah to As) and divide by 100 because percent
float soh = ABS(as) / estimatedAs;
Param::SetFloat(Param::soh, soh * 100);
}
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Mon Mar 04, 2024 3:08 pm
by johu
The SoC table is still inaccurate. Probably because the table from the video is taken under load 8A/0.1C. So SoC estimation is always to high, depending on the slop the error can be over 10%! Certainly need to fix this.
I think I'll make a new curve with the remaining module. Empty it, charge 5 Ah, wait 5 min., take voltage reading, charge 5 Ah,...
Re: Replacing the VW BMU aka implementing high level BMS functions
Posted: Sun Apr 28, 2024 9:15 pm
by johu
rstevens81 wrote: ↑Sat Feb 10, 2024 11:46 am
variable for battery ah is all that is needed and as we can record ah used (from shunt) this value can be manually updated every few years or so
Did a charge from 43 to 82% today or 60 Ah. I've set the capacity to 155 Ah (nameplate is 158) and indeed SoH calculated as 99.3% So 155 seems appropriate for now.
In certain areas of the curve there are still SoC jumps in one direction or the other, so far 3% at most. I think that is acceptable