From 82b0e4d474541f243252ed292d3f9c371afa923b Mon Sep 17 00:00:00 2001 From: Will Chaba <60449481+will-chaba@users.noreply.github.com> Date: Sat, 1 Jun 2024 17:31:44 -0700 Subject: [PATCH] Undo BMS Software Fault Latch for Charging (#1287) ### Changelist Undo software fault latch now that hardware latch is functioning properly ### Testing Done ### Resolved Tickets --- firmware/quadruna/BMS/src/app/app_globals.c | 1 - firmware/quadruna/BMS/src/app/app_globals.h | 1 - firmware/quadruna/BMS/src/app/states/app_allStates.c | 3 +-- firmware/quadruna/BMS/src/app/states/app_initState.c | 9 ++------- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/firmware/quadruna/BMS/src/app/app_globals.c b/firmware/quadruna/BMS/src/app/app_globals.c index 85759ea727..24afc9cc88 100644 --- a/firmware/quadruna/BMS/src/app/app_globals.c +++ b/firmware/quadruna/BMS/src/app/app_globals.c @@ -16,6 +16,5 @@ void app_globals_init(const GlobalsConfig *config) globals->ignore_charger_fault_counter = 0; globals->charger_exit_counter = 0; globals->precharge_limit_exceeded = false; - globals->fault_encountered = false; globals->broadcast_charger_connected = true; } diff --git a/firmware/quadruna/BMS/src/app/app_globals.h b/firmware/quadruna/BMS/src/app/app_globals.h index 7a194a7e7d..f2db72066a 100644 --- a/firmware/quadruna/BMS/src/app/app_globals.h +++ b/firmware/quadruna/BMS/src/app/app_globals.h @@ -22,7 +22,6 @@ typedef struct uint32_t cell_monitor_settle_count; uint32_t num_precharge_failures; bool precharge_limit_exceeded; - bool fault_encountered; bool broadcast_charger_connected; TimerChannel precharge_lower_bound_timer; TimerChannel precharge_upper_bound_timer; diff --git a/firmware/quadruna/BMS/src/app/states/app_allStates.c b/firmware/quadruna/BMS/src/app/states/app_allStates.c index 4ba8db0521..6bd650fa0e 100644 --- a/firmware/quadruna/BMS/src/app/states/app_allStates.c +++ b/firmware/quadruna/BMS/src/app/states/app_allStates.c @@ -161,8 +161,7 @@ bool app_allStates_runOnTick100Hz(void) } else if (acc_fault || ts_fault) { - status = false; - globals->fault_encountered = true; + status = false; app_stateMachine_setNextState(app_faultState_get()); } diff --git a/firmware/quadruna/BMS/src/app/states/app_initState.c b/firmware/quadruna/BMS/src/app/states/app_initState.c index bf64055185..19b120e086 100644 --- a/firmware/quadruna/BMS/src/app/states/app_initState.c +++ b/firmware/quadruna/BMS/src/app/states/app_initState.c @@ -46,7 +46,6 @@ static void initStateRunOnTick100Hz(void) const bool air_negative_closed = io_airs_isNegativeClosed(); const bool ts_discharged = app_tractiveSystem_getVoltage() < TS_DISCHARGED_THRESHOLD_V; const bool missing_hb = app_heartbeatMonitor_isSendingMissingHeartbeatFault(); - const bool fault_encountered = globals->fault_encountered; if (air_negative_closed && ts_discharged) { @@ -58,12 +57,8 @@ static void initStateRunOnTick100Hz(void) app_canTx_BMS_ClearLatch_set(clear_brusa_latch); - // If there was a fault encountered, don't allow charging unless a manual override is sent over CAN. - const bool fault_preventing_charging = fault_encountered && !charging_override_fault; - - const bool precharge_for_charging = - charger_connected && external_charging_request && !fault_preventing_charging; - const bool precharge_for_driving = !charger_connected && !cell_balancing_enabled && !missing_hb; + const bool precharge_for_charging = charger_connected && external_charging_request; + const bool precharge_for_driving = !charger_connected && !cell_balancing_enabled && !missing_hb; if (precharge_for_charging) {