first soap ideals
This commit is contained in:
parent
75b9136a1d
commit
01de4ce2cf
|
@ -8,7 +8,7 @@ extern uint8_t current_soc;
|
|||
|
||||
#define N_MODELPARAMETERS 11
|
||||
#define BATTERYCAPACITYAs (20000.0*3600) //TODO Check if value is correct Cap in Ah * 3600 (Convert to As)
|
||||
|
||||
#define SOAP_MINIMUM_VOLTAGE 2.5
|
||||
|
||||
void soc_init();
|
||||
void soc_update(int32_t shunt_current);
|
||||
|
|
|
@ -66,7 +66,15 @@ float soe_update()
|
|||
}
|
||||
void soap_update()
|
||||
{
|
||||
//
|
||||
float r0 = soc_approxparameterbysoc(current_floatsoc, R0, N_MODELPARAMETERS);
|
||||
float r1 = soc_approxparameterbysoc(current_floatsoc, R1, N_MODELPARAMETERS);
|
||||
float ocv = soc_approxparameterbysoc(current_floatsoc, OCV_Data, N_MODELPARAMETERS);
|
||||
|
||||
float allowedvoltagedrop = ocv - SOAP_MINIMUM_VOLTAGE;
|
||||
float rin = r0+r1;
|
||||
float maxcurrent = allowedvoltagedrop/rin;
|
||||
//TODO think about how to pass parameters
|
||||
|
||||
}
|
||||
|
||||
float soc_approxparameterbysoc(float soc,float* lut, uint8_t lutlen)
|
||||
|
|
Loading…
Reference in New Issue