Skip to content

Commit

Permalink
removed non critical faults for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Donahue committed Jan 22, 2024
1 parent 6bda5c7 commit f7b46eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Core/Inc/bmsConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#define LOW_CELL_TIME 15000
#define HIGH_TEMP_TIME 60000
#define INT_CELL_COMM_TIME 1000
#define HIGH_INT_TEMP_TIME 0 // TODO SET THIS
#define HIGH_INT_TEMP_TIME 10000
#define CURR_ERR_MARG 50 // in A * 10

#define DCDC_CURRENT_DRAW 2 // in A, this is generous
Expand Down
8 changes: 4 additions & 4 deletions Core/Src/stateMachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ uint32_t sm_fault_return(acc_data_t* accData)
fault_table[3] = (fault_eval_t) {.id = "High Cell Voltage", .timer = ovr_chgvolt_timer, .data_1 = fault_data->max_voltage.val, .optype_1 = GT, .lim_1 = MAX_CHARGE_VOLT * 10000, .timeout = OVER_VOLT_TIME, .code = CELL_VOLTAGE_TOO_HIGH, .optype_2 = NOP/* ---------------------------UNUSED-------------------*/ };
fault_table[4] = (fault_eval_t) {.id = "High Cell Voltage", .timer = ovr_volt_timer, .data_1 = fault_data->max_voltage.val, .optype_1 = GT, .lim_1 = MAX_VOLT * 10000, .timeout = OVER_VOLT_TIME, .code = CELL_VOLTAGE_TOO_HIGH, .optype_2 = EQ, .data_2 = fault_data->is_charger_connected,.lim_2 = false };
fault_table[5] = (fault_eval_t) {.id = "High Temp", .timer = high_temp_timer, .data_1 = fault_data->max_temp.val, .optype_1 = GT, .lim_1 = MAX_CELL_TEMP, .timeout = LOW_CELL_TIME, .code = PACK_TOO_HOT, .optype_2 = NOP/* ----------------------------------------------------*/ };
fault_table[6] = (fault_eval_t) {.id = "Internal Cell Comm Fault",.timer = int_cell_comm_tmr, .data_1 = cell_comm_fault_status, .optype_1 = NEQ,.lim_1 = FAULTS_CLEAR, .timeout = INT_CELL_COMM_TIME, .code = INTERNAL_CELL_COMM_FAULT, .optype_2 = NOP/* --------------------------UNUSED--------------------*/ };
fault_table[7] = (fault_eval_t) {.id = "Extremely Low Voltage", .timer = low_cell_timer, .data_1 = fault_data->min_voltage.val, .optype_1 = LT, .lim_1 = 900, .timeout = HIGH_TEMP_TIME, .code = LOW_CELL_VOLTAGE, .optype_2 = NOP/* --------------------------UNUSED--------------------*/ };
fault_table[8] = (fault_eval_t) {.id = "High Internal Temp", .timer = int_temp_tmr, .data_1 =fault_data->sht30_data->temp, .optype_1 = GT, .lim_1 = MAX_INTERNAL_TEMP, .timeout = HIGH_INT_TEMP_TIME, .code = INTERNAL_THERMAL_ERROR, .optype_2 = NOP /* -----------------------------------UNUSED-----------*/ };
fault_table[8] = (fault_eval_t) {.id = NULL};
//fault_table[6] = (fault_eval_t) {.id = "Internal Cell Comm Fault",.timer = int_cell_comm_tmr, .data_1 = cell_comm_fault_status, .optype_1 = NEQ,.lim_1 = FAULTS_CLEAR, .timeout = INT_CELL_COMM_TIME, .code = INTERNAL_CELL_COMM_FAULT, .optype_2 = NOP/* --------------------------UNUSED--------------------*/ };
fault_table[6] = (fault_eval_t) {.id = "Extremely Low Voltage", .timer = low_cell_timer, .data_1 = fault_data->min_voltage.val, .optype_1 = LT, .lim_1 = 900, .timeout = HIGH_TEMP_TIME, .code = LOW_CELL_VOLTAGE, .optype_2 = NOP/* --------------------------UNUSED--------------------*/ };
//fault_table[8] = (fault_eval_t) {.id = "High Internal Temp", .timer = int_temp_tmr, .data_1 =fault_data->sht30_data->temp, .optype_1 = GT, .lim_1 = MAX_INTERNAL_TEMP, .timeout = HIGH_INT_TEMP_TIME, .code = INTERNAL_THERMAL_ERROR, .optype_2 = NOP /* -----------------------------------UNUSED-----------*/ };
fault_table[7] = (fault_eval_t) {.id = NULL};
// clang-format on
}
static uint32_t fault_status = 0;
Expand Down

0 comments on commit f7b46eb

Please sign in to comment.