semf
semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE > Class Template Referenceabstract

Interface for using state of charge in a battery model. More...

#include <batterystateofcharge.h>

Collaboration diagram for semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >:
Collaboration graph

Public Member Functions

virtual ~BatteryStateOfCharge ()=default
 
virtual void updateSoc (uint16_t timeDelta, T_VOLTAGE voltage, T_CURRENT current, T_TEMPERATURE temperature)=0
 Updates the state of charge relative to the current, voltage and temperature of the battery. More...
 
virtual T_SOC relativeSoc () const =0
 Returns the relative state of charge. This is the value normally showed on a display. More...
 
virtual T_SOC absoluteSoc () const =0
 Returns the absolute state of charge. More...
 

Protected Member Functions

virtual void initSocByLastSoc (T_SOC lastAbsoluteSoc)=0
 Initializes the state of charge calculation by the open circuit voltage after booting. More...
 
virtual void initSocByOcv (T_VOLTAGE ocv)
 Initializes the state of charge calculation by the open circuit voltage after booting. More...
 
virtual void setAbsoluteSoc (T_SOC soc)=0
 Sets the absolute state of charge. More...
 

Detailed Description

template<typename T_SOC, typename T_VOLTAGE, typename T_CURRENT, typename T_TEMPERATURE>
class semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >

Interface for using state of charge in a battery model.

Template Parameters
T_CAPACITYType for capacity in Ah.
T_SOCType of state of charge in percentage.
T_VOLTAGEType of voltage in V.
T_CURRENTType of current in A. Charging current is positive, discharging is negative.
T_TEMPERATUREType of temperature in °C.

Definition at line 28 of file batterystateofcharge.h.

Constructor & Destructor Documentation

◆ ~BatteryStateOfCharge()

template<typename T_SOC , typename T_VOLTAGE , typename T_CURRENT , typename T_TEMPERATURE >
virtual semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::~BatteryStateOfCharge ( )
virtualdefault

Member Function Documentation

◆ absoluteSoc()

template<typename T_SOC , typename T_VOLTAGE , typename T_CURRENT , typename T_TEMPERATURE >
virtual T_SOC semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::absoluteSoc ( ) const
pure virtual

Returns the absolute state of charge.

It is calculated relative to the design capacity.

Returns
State of charge in percent.

Implemented in semf::app::BatteryModelWithoutDataset< T_CAPACITY, T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.

◆ initSocByLastSoc()

template<typename T_SOC , typename T_VOLTAGE , typename T_CURRENT , typename T_TEMPERATURE >
virtual void semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::initSocByLastSoc ( T_SOC  lastAbsoluteSoc)
protectedpure virtual

Initializes the state of charge calculation by the open circuit voltage after booting.

Parameters
lastAbsoluteSocLast known absolute state of charge in percent.

◆ initSocByOcv()

template<typename T_SOC , typename T_VOLTAGE , typename T_CURRENT , typename T_TEMPERATURE >
virtual void semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::initSocByOcv ( T_VOLTAGE  ocv)
inlineprotectedvirtual

Initializes the state of charge calculation by the open circuit voltage after booting.

Parameters
ocvOpen circuit voltage after booting.

Definition at line 66 of file batterystateofcharge.h.

◆ relativeSoc()

template<typename T_SOC , typename T_VOLTAGE , typename T_CURRENT , typename T_TEMPERATURE >
virtual T_SOC semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::relativeSoc ( ) const
pure virtual

Returns the relative state of charge. This is the value normally showed on a display.

It is calculated by absolute state of charge / state of health respectively with the full charged battery capacity.

Returns
State of charge in percent.

Implemented in semf::app::BatteryModelWithoutDataset< T_CAPACITY, T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.

◆ setAbsoluteSoc()

template<typename T_SOC , typename T_VOLTAGE , typename T_CURRENT , typename T_TEMPERATURE >
virtual void semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::setAbsoluteSoc ( T_SOC  soc)
protectedpure virtual

Sets the absolute state of charge.

Parameters
socAbsolute state of charge in percent.

Implemented in semf::app::BatteryModelWithoutDataset< T_CAPACITY, T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.

◆ updateSoc()

template<typename T_SOC , typename T_VOLTAGE , typename T_CURRENT , typename T_TEMPERATURE >
virtual void semf::app::BatteryStateOfCharge< T_SOC, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::updateSoc ( uint16_t  timeDelta,
T_VOLTAGE  voltage,
T_CURRENT  current,
T_TEMPERATURE  temperature 
)
pure virtual

Updates the state of charge relative to the current, voltage and temperature of the battery.

Parameters
timeDeltaMilliseconds past since last function call.
voltageBattery voltage in V.
currentBattery current in A. Charging is positive, discharging is negative.
temperatureBattery temperature in °C.

Implemented in semf::app::BatteryModelWithoutDataset< T_CAPACITY, T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.