Page 1 of 1
UDCnom
Posted: Tue Jul 23, 2019 6:06 pm
by tom91
So reading the code and not having used UDCnom yet i was wondering if there is a bit of explaination the coding, reading code just made it more confusing.
Code: Select all
if (udcnom > 0)
{
s32fp udcdiff = udcfp - udcnom;
s32fp factor = FP_FROMINT(1) + FP_DIV(udcdiff, udcnom);
//increase fweak on voltage above nominal
fweak = FP_MUL(fweak, factor);
//decrease boost on voltage below nominal
boost = FP_DIV(boost, factor);
}
If I am correct, as soon as UDCnom is set to a value other the zero will values for Fweak and Boost will change based on the factor.
So would the equation for the factor be: (UDC measured - UDCnom) /UDCnom ?
No the comment really throws me off, as I would expect the boost to need to increase to keep the resultant effective voltage the same?
From wiki: boost At full throttle an effective voltage of 1700/37813*355=16V is generated. Thus a lower voltage is a lower effective voltage.

Re: UDCnom
Posted: Tue Jul 23, 2019 6:50 pm
by johu
Hi Tom,
the second comment is indeed wrong. So say udcnom=500, fweak=100, boost=2000 and measured udc (udcfp) is 480. Then udcdiff=-20 and factor is 1+(-20/500)=0.96. Then fweak is lowered to 100*0.96=96 and boost INCREASED to 2000/0.96=2083. Code correct, comment wrong.
Thats why "Clean Code" advises against comments: they add redundancy. I happily adhere to their advise, usually

Re: UDCnom
Posted: Tue Jul 23, 2019 7:17 pm
by tom91
No wonder having different packs make certain tunes feel vastly different.
Will start using UDCnom now as standard.
Re: UDCnom
Posted: Tue Jul 23, 2019 7:22 pm
by johu
Yes I certainly recommend it. Especially on non-LFP packs whos voltage changes a lot over the discharge cycle.
Re: UDCnom
Posted: Wed Jul 24, 2019 7:23 pm
by jon volk
Great info! I definitely need to update my setting in this case.
Re: UDCnom
Posted: Wed Jul 24, 2019 7:56 pm
by tom91
I would be careful, as depending on at what battery voltage you sought out most limits this will determine your true UDC nom.
So i would lean more to the cautious side, however on large drive units from experience you need to drop alot of voltage (having ran with 280V systems using a 360ishV proven tune) to notice a big impact on performance down low.
Re: UDCnom
Posted: Sat Sep 28, 2019 4:46 pm
by jon volk
I’ve been thinking about this value a bit. If fweak determines the speed at which maximum power is generated, wouldn’t it be more consistent to keep this value the same and scale fslipmax with pack voltage?
Re: UDCnom
Posted: Sat Sep 28, 2019 8:51 pm
by johu
Thats what happens if you use udcnom AND also use fconst and fslipconstmax. Those two will start increasing the slip above fweakcalc until it peaks at fconst.
Re: UDCnom
Posted: Sat Sep 28, 2019 9:39 pm
by jon volk
Great. I’m going to have to look at the calculations to understand it.
Re: UDCnom
Posted: Wed Oct 02, 2019 3:05 pm
by jon volk
So based on your example configuration, I put the numbers in a spreadsheet in an attempt to better quantify the changes. Care to take a quick look at the logic here and see if it's accurately representing what's happening between udc/udcnom/fslip/fconst/etc?
Re: UDCnom
Posted: Thu Oct 03, 2019 8:26 pm
by dima
I believe your excel formula is a bit wrong E14 should be
Re: UDCnom
Posted: Thu Oct 03, 2019 11:19 pm
by jon volk
Indeed, good catch.
Updated the file in case anyone else may find it useful for setting things up or if anyone else catches an error.
Re: UDCnom
Posted: Mon Oct 07, 2019 3:11 pm
by dima
Is it possible to put something similar for ampnom?