firmware
IEM Firmware Documentation
Loading...
Searching...
No Matches
PackCalculations.h File Reference
#include "BMSconfig.h"
#include "LTC6811.h"
#include "Fault.h"
Include dependency graph for PackCalculations.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAXINT16   65535

Functions

void setCriticalVoltages (BMS_critical_info_t *bms, CellData const bmsData[144])
 This method calculates the maximum and minimum cell voltages in the pack, and sets those values w/ the associated cell number to the bms critical info struct.
void setCriticalTemps (BMS_critical_info_t *bms, CellData const bmsData[144])
 This method calculates the maximum and minimum cell temps in the pack, and sets those values w/ the associated cell number to the bms critical info struct.
void balance (BMSConfigStructTypedef const *cfg, BMS_critical_info_t *bms, CellData bmsData[144], bool cellDischarge[12][12], bool fullDischarge[12][12], uint8_t balanceCounter, uint8_t *chargeRate)
 This function is still a work in progress.
void thresholdBalance (BMSConfigStructTypedef *cfg, BMS_critical_info_t *bms, CellData bmsData[144], bool cell_discharge[12][12], uint16_t cell_discharge_threshold, uint8_t num_cells_discharge_per_secondary)
 WIP/untested. Should be run while accumulator is not charging, discharges any cells above the threshold.

Variables

uint8_t balance_counter

Macro Definition Documentation

◆ MAXINT16

#define MAXINT16   65535

Function Documentation

◆ balance()

void balance ( BMSConfigStructTypedef const * cfg,
BMS_critical_info_t * bms,
CellData bmsData[144],
bool cellDischarge[12][12],
bool fullDischarge[12][12],
uint8_t balanceCounter,
uint8_t * chargeRate )

This function is still a work in progress.

◆ setCriticalTemps()

void setCriticalTemps ( BMS_critical_info_t * bms,
CellData const bmsData[144] )

This method calculates the maximum and minimum cell temps in the pack, and sets those values w/ the associated cell number to the bms critical info struct.

Parameters
cfgis the bms configuration file with constants used in our bms
bmsis the bms struct that contains critical info regarding our pack
bmsDatais an array of 144 cellData structs, containing index, fault, voltage and temperature
Returns
none
Here is the caller graph for this function:

◆ setCriticalVoltages()

void setCriticalVoltages ( BMS_critical_info_t * bms,
CellData const bmsData[144] )

This method calculates the maximum and minimum cell voltages in the pack, and sets those values w/ the associated cell number to the bms critical info struct.

Parameters
cfgis the bms configuration file with constants used in our bms
bmsis the bms struct that contains critical info regarding our pack
bmsDatais an array of 144 cellData structs, containing index, fault, voltage and temperature
Returns
none
Here is the caller graph for this function:

◆ thresholdBalance()

void thresholdBalance ( BMSConfigStructTypedef * cfg,
BMS_critical_info_t * bms,
CellData bmsData[144],
bool cell_discharge[12][12],
uint16_t cell_discharge_threshold,
uint8_t num_cells_discharge_per_secondary )

WIP/untested. Should be run while accumulator is not charging, discharges any cells above the threshold.

Here is the caller graph for this function:

Variable Documentation

◆ balance_counter

uint8_t balance_counter
extern