LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SoC calculation of battery

I am using NI current module in cRIO9074 to measure the current through CT, to charge/discharge the battery simulator and I have battery simulator initial data at t=0, after giving the command to charge/discharge through the battery inverter I can measure the current and based on this current{charge(+)/discharge(-)} and initial parameters like battery capacity, initial voltage, etc, how can I calculate the SoC of battery?

 

Can you share a sample VI file to calculate the SoC of the battery for further work?

 

Thanks

0 Kudos
Message 1 of 7
(1,703 Views)

Hi meharda,

 


@meharda_92 wrote:
I can measure the current and based on this current{charge(+)/discharge(-)} and initial parameters like battery capacity, initial voltage, etc, how can I calculate the SoC of battery?

To know the SoC of "the battery" you need to know the type of battery and its (electrochemical) behavior.

Each kind of battery has a different relation between current and SoC...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(1,681 Views)

Its just battery simulator , So lets assume its Li-ion battery and based on current and initial parameters , I want to calculate the SoC

0 Kudos
Message 3 of 7
(1,672 Views)

The basic principle is to do "current integration" or in other words you count the amount of Coulombs you put into the battery or discharge from it.

 

Since it is an integration method, you are notoriously inaccurate as every little measurement error in time and current will accumulate over time, so that you need to recalibrate the starting point of the integration regularly, such as when a charging cycle has been successfully completed, by resetting the SoC value at that moment to 100%.

 

This assumes of course that you know what integration is and that you have some basic mathematical and programming knowledge.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 7
(1,663 Views)

then what will be the process and any sample VI file?

0 Kudos
Message 5 of 7
(1,649 Views)

Hi meharda,

 


@meharda_92 wrote:

then what will be the process and any sample VI file?


The process is: you (start to) create a Vi where you implement the algorithm needed to calc the SoC.

 

When you need sample VIs there is the example finder in LabVIEW...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(1,646 Views)

In addition to what others have said there is also the OCV (open circuit voltage) and capacity that needs to be taken into account.  And actual measured capacity.

 

In a real battery there will be an actual capacity.  This is calculated by doing a full charge, then a full discharge, and then maybe even a full charge again.  You count how much amp hour you put into the battery and when you go from full to empty you look at how much you put in, and that is now your actual capacity.  Even understanding what is "full" and "empty" depends on the manufacturer.  Most often a full is 4.2V and empty is 2.8V at the cell level.  But even this can differ because some will taper off the current as it gets closer to this voltage, trying to get every little bit into the the battery to get the best possible reading for an actual capacity.  Oh and then there are usually protections in the real world that might stop you from ever reaching that full or empty.  Having an unbalanced pack or module can also complicate things as you want the cell max to be 4.2V but the cell min to be 2.8V.

 

So if you did a full charge to a full discharge and you got 150AH.  Then you can calculate your SOC by doing a full charge again, and then track how much current goes into and out of the battery.  Once you have discharged a total of 75AH you know you are at 50%.  There is usually additional logic and the Actual SOC can differ from the Displayed SOC, with various math with the SOH, and temperature.  Displayed SOC can also add a buffers on each ends depending on the usage.  Displayed SOC of 0% might be 20% actual for instance, since hitting 0% actual can damage the battery, especially in extreme temperatures.  Current and power can also be d-rated to prevent damage at these extremes.

 

But back to the OCV again.  If your battery has been sitting idle for some long amount of time, the measured voltage can be used in a look up table to get a close approximation of the SOC.  If 4.2V is full and 2.8V is empty, and we are at 3.5V and haven't done any charging or discharging for 30 minutes, it is safe to say we are around 50% SOC.  This lookup table is also a thing from the manufacturer.  If your simulation is very simple, then maybe just a lookup from voltage to SOC is good enough.  Real batteries have a bit of hysteresis making this OCV method only useful if there hasn't been any charging of discharging recently.

Message 7 of 7
(1,562 Views)