# SOC Estimator (Coulomb Counting)

State of charge estimator with Coulomb counting

Since R2022b

Libraries:
Simscape / Battery / BMS / Estimators

## Description

This block implements an estimator that calculates the state of charge (SOC) of a battery by using the Coulomb counting method.

The SOC is the ratio of the released capacity Creleasable to the rated capacity Crated. Manufacturers provide the value of the rated capacity of each battery, which represents the maximum amount of charge in the battery:

$SOC=\frac{{C}_{\text{releasable}}}{{C}_{\text{rated}}}.$

This block supports single-precision and double-precision floating-point simulation.

Note

To enable single-precision floating-point simulation, the data type of all inputs and parameters, except for the Sample time (-1 for inherited) parameter, must be single.

You can switch between continuous and discrete implementations of the block by using the Sample time (-1 for inherited) parameter. To configure the block for continuous time, set the Sample time (-1 for inherited) parameter to 0. To configure the block for discrete time, set the Sample time (-1 for inherited) parameter to a positive, nonzero value, or to -1 to inherit the sample time from an upstream block.

Note

Continuous-time implementation of this block works only in a double-precision floating-point simulation. If you provide single-precision floating-point parameters and inputs, this block casts them to double-precision floating-point values to prevent errors.

This diagram shows the structure of the block:

### Equations

To compute the SOC of the battery, the SOC Estimator (Coulomb Counting) block counts the Ampere hour and current integration:

$SOC=SOC\left({t}_{0}\right)+\frac{1}{{C}_{\text{rated}}}\underset{{t}_{0}}{\overset{{t}_{0}+\tau }{\int }}{I}_{\text{batt}},$

where Crated is the nominal battery capacity and Ibatt is the battery current.

## Assumptions and Limitations

The nominal capacity of the battery does not consider aging.

## Ports

### Input

expand all

Battery current, in ampere, specified as a scalar for a single cell or a vector for multiple cells. To specify this input as a vector of cell currents, select the Specify Current input as cell current(s) parameter.

Initial state of charge, specified as a scalar or vector of entries in the range [0, 1]. The size of this input port must be equal to the size of the Current input port.

### Output

expand all

State of charge of the battery, returned as a scalar or a vector. The size of this output port is equal to the size of the Current and InitialSOC input ports.

## Parameters

expand all

Since R2023b

Option to specify the value of the Current input port as a vector of cell currents. If you select this parameter, the value at the Current input port can be a scalar or a vector of size equal to the size of the block inputs.

Cell capacity of the battery, in ampere-hour. The block calculates the state of charge by dividing the accumulated charge by this value. The block calculates accumulated charge by integrating the battery current.

Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.

For inherited discrete-time operation, specify this parameter as -1. For discrete-time operation, specify this parameter as a positive integer. For continuous-time operation, specify this parameter as 0.

If this block is in a masked subsystem or a variant subsystem that supports switching between continuous operation and discrete operation, promote the sample time parameter. Promoting the sample time parameter ensures correct switching between the continuous and discrete implementations of the block. For more information, see Promote Block Parameters on a Mask.

## Version History

Introduced in R2022b

expand all