BMS63EN how to configure AEK_POW_BMS63EN_Pack_Current
Is there an input field for the used shunt value or offset?
If not, where can I manipulate the code?
Is there an input field for the used shunt value or offset?
If not, where can I manipulate the code?
Hi Michael,
The current is read by an internal L9963E register in two complement format. The next step is to convert the current in a float value by specifying the Rshunt value. This is carried-out in:
float AEK_POW_BMS63EN_GetInstCurrentMeasurement( unsigned AEK_POW_BMS63EN_devnum, uint16_t Rshunt)
This function is located in AEK_POW_BMS63EN_id.c and it is invoked from AEK_POW_BMS63EN_VA_Measurement() in AEK_POW_BMS63EN_Appl.c
To avoid overcurrent faults, you need to properly set the threshold based on the chosen Rshunt.
To set the overcurrent threshold you can use the following function:
void AEK_POW_BMS63EN_SetOvercurrentThreshold( unsigned AEK_POW_BMS63EN_devnum, uint16_t Rshunt, float current_th_A)
This function is located in AEK_POW_BMS63EN_id.c and invoked from AEK_POW_BMS63EN_init() present in AEK_POW_BMS63EN_Appl.c
To make sure that voltage and current readings are properly synchronized, the cell has to activate the measurement procedure. This is performed by setting the Start Of Conversion (SOC) routine = 1.
Once this procedure is activated, the best way to read the current value is to use the GetInstCurrentMeasurement() function.
If the high precision is not required, you can rely on a different L9963E register for current reading but the measurement would result to be less precise:
float AEK_POW_BMS63EN_GetCalibCurrentMeasurement( unsigned AEK_POW_BMS63EN_devnum, uint16_t Rshunt)
The choice we made in our application is to use the first function with voltage and current synchronized.
Please note that if you use GetInstCurrentMesurement(), you need to make sure that the Start Of Conversion routine is activated otherwise you would read a wrong current value.
Best Regards,
AutoDevKit Team
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.