semf
|
Simple battery model implementation without using a battery model. More...
#include <batterymodelwithoutdataset.h>
Public Member Functions | |
BatteryModelWithoutDataset (T_CAPACITY designCapacity) | |
Constructor. More... | |
virtual | ~BatteryModelWithoutDataset ()=default |
void | update (uint16_t timeDelta, T_VOLTAGE voltage, T_CURRENT current, T_TEMPERATURE temperature) |
Updates the state of charge and state of health. More... | |
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 void | updateSoh ()=0 |
T_SOCSOH | relativeSoc () const |
Returns the relative state of charge. More... | |
T_SOCSOH | absoluteSoc () const |
Returns the absolute state of charge. More... | |
T_SOCSOH | soh () const |
Returns the state of health of charge. More... | |
T_CAPACITY | designCapacity () const |
Returns the designed battery capacity. More... | |
T_CAPACITY | fullChargeCapacity () const |
Returns the battery capacity of a full charged battery influenced by the state of health. More... | |
T_CAPACITY | remainingCapacity () const |
Returns the remaining battery capacity. More... | |
void | setAbsoluteSoc (T_SOCSOH soc) |
Sets the absolute state of charge. More... | |
void | setSoh (T_SOCSOH soh) |
Sets the state of health. More... | |
Public Member Functions inherited from semf::app::BatteryStateOfCharge< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE > | |
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_SOCSOH | relativeSoc () const=0 |
Returns the relative state of charge. This is the value normally showed on a display. More... | |
virtual T_SOCSOH | absoluteSoc () const=0 |
Returns the absolute state of charge. More... | |
Public Member Functions inherited from semf::app::BatteryStateOfHealth< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE > | |
virtual | ~BatteryStateOfHealth ()=default |
virtual void | updateSoh ()=0 |
virtual T_SOCSOH | soh () const=0 |
Returns the state of health. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from semf::app::BatteryStateOfCharge< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE > | |
virtual void | initSocByLastSoc (T_SOCSOH 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_SOCSOH soc)=0 |
Sets the absolute state of charge. More... | |
Protected Member Functions inherited from semf::app::BatteryStateOfHealth< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE > | |
virtual void | initSoh (T_SOCSOH lastSoh)=0 |
Initializes the state of health calculation by the last known state of charge after booting. More... | |
virtual void | setSoh (T_SOCSOH soh)=0 |
Sets the state of health. More... | |
Simple battery model implementation without using a battery model.
To use this class, inherit from it and implement the both functions updateSoc
and updateSoh
with the calculation algorithms for state of charge and state of health.
T_CAPACITY | Type for capacity in Ah. |
T_SOCSOH | Type of state of charge and state of health in percentage. |
T_VOLTAGE | Type of voltage in V. |
T_CURRENT | Type of current in A. Charging current is positive, discharging is negative. |
T_TEMPERATURE | Type of temperature in °C. |
Definition at line 36 of file batterymodelwithoutdataset.h.
|
explicit |
Constructor.
designCapacity | Designed battery capacity of a new battery in Ah. |
Definition at line 114 of file batterymodelwithoutdataset.h.
|
virtualdefault |
|
virtual |
Returns the absolute state of charge.
Implements semf::app::BatteryStateOfCharge< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.
Definition at line 137 of file batterymodelwithoutdataset.h.
T_CAPACITY semf::app::BatteryModelWithoutDataset< T_CAPACITY, T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::designCapacity |
Returns the designed battery capacity.
Definition at line 149 of file batterymodelwithoutdataset.h.
T_CAPACITY semf::app::BatteryModelWithoutDataset< T_CAPACITY, T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::fullChargeCapacity |
Returns the battery capacity of a full charged battery influenced by the state of health.
Definition at line 155 of file batterymodelwithoutdataset.h.
|
virtual |
Returns the relative state of charge.
Implements semf::app::BatteryStateOfCharge< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.
Definition at line 128 of file batterymodelwithoutdataset.h.
T_CAPACITY semf::app::BatteryModelWithoutDataset< T_CAPACITY, T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::remainingCapacity |
Returns the remaining battery capacity.
Definition at line 161 of file batterymodelwithoutdataset.h.
|
virtual |
Sets the absolute state of charge.
soc | Absolute soc in percent. |
Implements semf::app::BatteryStateOfCharge< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.
Definition at line 167 of file batterymodelwithoutdataset.h.
|
virtual |
Sets the state of health.
soh | Soh in percent. |
Implements semf::app::BatteryStateOfHealth< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.
Definition at line 173 of file batterymodelwithoutdataset.h.
|
virtual |
Returns the state of health of charge.
Implements semf::app::BatteryStateOfHealth< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.
Definition at line 143 of file batterymodelwithoutdataset.h.
void semf::app::BatteryModelWithoutDataset< T_CAPACITY, T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >::update | ( | uint16_t | timeDelta, |
T_VOLTAGE | voltage, | ||
T_CURRENT | current, | ||
T_TEMPERATURE | temperature | ||
) |
Updates the state of charge and state of health.
This function should be called periodically (e.g. every 100ms).
timeDelta | Milliseconds past since last function call. |
voltage | Battery voltage in V. |
current | Battery current in A. Charging current is positive, discharging current is negative. |
temperature | Battery temperature in °C. |
Definition at line 120 of file batterymodelwithoutdataset.h.
|
pure virtual |
Updates the state of charge relative to the current, voltage and temperature of the battery.
timeDelta | Milliseconds past since last function call. |
voltage | Battery voltage in V. |
current | Battery current in A. Charging is positive, discharging is negative. |
temperature | Battery temperature in °C. |
Implements semf::app::BatteryStateOfCharge< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.
|
pure virtual |
Updates the state of health.
Implements semf::app::BatteryStateOfHealth< T_SOCSOH, T_VOLTAGE, T_CURRENT, T_TEMPERATURE >.