Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add P45B cell characteristics #168

Merged
merged 3 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions Core/Inc/bmsConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,32 @@
#define NUM_THERMS_PER_CHIP 14

// Firmware limits
#define MAX_TEMP 65 //degrees C
#define MIN_TEMP -25 // deg C
#define MAX_VOLT_MEAS 65535
#define MIN_VOLT_MEAS 0
#define MAX_TEMP 60 /* Celsius */
#define MIN_TEMP -40 /* Celsius */
#define MAX_CELL_TEMP_BAL 45 /* Celsius */
#define MAX_DELTA_V 0.015
#define BAL_MIN_V 4.00

// Boosting Parameters
#define BOOST_TIME 5 // seconds
#define BOOST_RECHARGE_TIME 30 // seconds
#define CONTDCL_MULTIPLIER 3

//cell limits
#define MIN_VOLT 2.5
#define MAX_VOLT 4.2
#define MAX_CHARGE_VOLT 4.21
#define MAX_DELTA_V 0.015
#define BAL_MIN_V 4.00
#define MAX_CELL_TEMP 55
#define MIN_CELL_TEMP 15
#define MAX_CELL_CURR 500 // Amps per BMS cell
#define MAX_CELL_TEMP_BAL 45
#define MAX_CHG_CELL_CURR 20
/* Molicel P45B Cell Specifications */
#define TYP_CAPICITY_AH 4.5 /* Amp-hours */
#define TYP_CAPACITY_WH 16.2 /* Watt-hours */
#define MIN_CAPICITY_AH 4.3 /* Amp-hours */
#define MIN_CAPACITY_WH 15.5 /* Watt-hours */
#define MIN_VOLT 2.5
#define NOM_VOLT 3.6
#define MAX_VOLT 4.2
#define MAX_CHARGE_VOLT 4.205
#define MAX_CHG_CURR 13.5 /* Amps */
#define MAX_DISCHG_CURR 45 /* Amps */
#define MIN_CHG_TEMP 0 /* Celsius */
#define MIN_DISCHG_TEMP -40 /* Celsius */
#define MAX_CELL_TEMP 60 /* Celsius */
#define TYP_IMPDNCE 0.015 /* Ohms, DC, 50% SoC */

// Algorithm settings
#define CHARGE_SETL_TIMEOUT 60000 // 1 minute, may need adjustment
Expand Down
14 changes: 7 additions & 7 deletions Core/Src/analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,13 +432,13 @@ void calc_dcl(acc_data_t *bmsdata)
}

/* ceiling for current limit */
if (current_limit > MAX_CELL_CURR) {
bmsdata->discharge_limit = MAX_CELL_CURR;
if (current_limit > MAX_DISCHG_CURR) {
bmsdata->discharge_limit = MAX_DISCHG_CURR;
return;
}

/* protection against being init to a high value */
if (bmsdata->discharge_limit > MAX_CELL_CURR) {
if (bmsdata->discharge_limit > MAX_DISCHG_CURR) {
bmsdata->discharge_limit = 0;
prev_dcl = 0;
}
Expand Down Expand Up @@ -517,8 +517,8 @@ void calcCCL(acc_data_t *bmsdata)
}

/* ceiling for current limit */
if (currentLimit > MAX_CHG_CELL_CURR) {
bmsdata->charge_limit = MAX_CHG_CELL_CURR;
if (currentLimit > MAX_CHG_CURR) {
bmsdata->charge_limit = MAX_CHG_CURR;
} else {
bmsdata->charge_limit = currentLimit;
}
Expand All @@ -541,8 +541,8 @@ void calc_cont_ccl(acc_data_t *bmsdata)
bmsdata->cont_CCL = TEMP_TO_CCL[max_res_index];
}

if (bmsdata->cont_CCL > MAX_CHG_CELL_CURR) {
bmsdata->cont_CCL = MAX_CHG_CELL_CURR;
if (bmsdata->cont_CCL > MAX_CHG_CURR) {
bmsdata->cont_CCL = MAX_CHG_CURR;
}
}

Expand Down