Skip to main content
Associate III
December 12, 2023
Solved

BMS63EN how to configure AEK_POW_BMS63EN_Pack_Current

  • December 12, 2023
  • 2 replies
  • 1996 views

Is there an input field for the used shunt value or offset? 

If not, where can I manipulate the code? 

Best answer by Max VIZZINI

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

2 replies

OrbiterAuthor
Associate III
December 13, 2023

According to UM3185 Figure 17 there should be a shunt value to change. 

But when I open: AEK_POW_BMS63EN_id.c I find:

float AEK_POW_BMS63EN_GetInstCurrentMeasurement( unsigned AEK_POW_BMS63EN_devnum, uint16_t Rshunt) {

 

So there somewhere else a definition of Rshunt? 

Where?

Max VIZZINI
Max VIZZINIBest answer
Technical Moderator
December 13, 2023

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

OrbiterAuthor
Associate III
December 15, 2023

Hi Max,

ahh I see, thanks.

So after having used a beautiful GUI in the BMS config, I shall head over to AEK_POW_BMS63EN_Appl.c to do set the overcurrent in Ampere an the shunt value in mOhms right there in the code?

As well as the NTC value. Wouldn´t it be nice to have all the necessary configs in the GUI? 

 

But how do I set RShunt to 100uOhms, which are 0.1 mOhms when RShunt is a unsigned int?

I guess its milli Ohm in the code, or is it micro ohm? 

 

OrbiterAuthor
Associate III
December 15, 2023

Start Of Conversion (SOC) routine = 1.

Maybe a total noob question, but where and how do I set SOC = 1 ? 

Shall I work with registers or is there a already a function available?