[Ovmsdev] Battery capacity metrics (for the Leaf, and in general)
anko_hanse at hotmail.com
Mon Mar 4 06:01:06 HKT 2019
Yes soc.nominal seems to behave correctly on my 30kwh model:
xnl.v.b.soc.instrument = 79%
xnl.v.b.soc.newcar = 105.337% (I often see gids = 375 which is above the maxgids = 357....)
xnl.v.b.soc.nominal = 75.1%
After updating the module with your code (resulting in a reset of the metrics, I did again see:
xnl.v.b.e.available = 22.4kwh
Then a very short drive (<2km):
xnl.v.b.e.available = 26.64kwh
And after some more driving it corrected itself again to:
xnl.v.b.e.available = 30kwh
From: Robin O'Leary <ovmsdev at caederus.org>
Sent: Monday, 4 March 2019 3:35 AM
To: Anko Hanse <anko_hanse at hotmail.com>
Cc: ovmsdev at lists.openvehicles.com
Subject: Re: [Ovmsdev] Battery capacity metrics (for the Leaf, and in general)
On Sun, Mar 03, 2019 at 04:53:08AM +0000, Anko Hanse wrote:
> Just a remark about the naming of your constants.
> The numbering of the generations is always confusing. We are used to Gen1, Gen2, etc for the 2011-2017 models.
> But Nissan itself seems to consistently call all of these Gen1 and only starts Gen2 at 2018. The confusion will even increase more whenever they will introduce a Gen3 in 202x...
Hopefully there is limited scope for confusion, as naming them "enum battery_type" and "BATTERY_TYPEn..." should make clear they relate only to the battery, not the car as a whole, or model year.
On reflection though, I think the naming could be simplified by not conflating the type (as it strictly relates to CAN bus communication format), with the capacity. Then the types may as well just be numbers 0,1,2... as they are reported in "xnl.v.b.type" with no deeper meaning.
It is then tempting to add 1 to the enum values so they match this:
> Gen 1.1 2011-2012, 24kwh
> Gen 1.2 2013-2017, 24kwh
> Gen 1.3 2016-2017, 30kwh
> Initial test with your ' leaf-chargetime' code looks good on my 30kwh Leaf (after a short drive):
> xnl.v.b.type = 2
> xnl.v.c.duration = 60;135;195Min (only 'full', no 'range' values on my model)
Do you get a sensible value in xnl.v.b.soc.nominal?
More information about the OvmsDev