Skip to content

Commit

Permalink
Undo BMS Software Fault Latch for Charging (#1287)
Browse files Browse the repository at this point in the history
### Changelist 
<!-- Give a list of the changes covered in this PR. This will help both
you and the reviewer keep this PR within scope. -->
Undo software fault latch now that hardware latch is functioning
properly

### Testing Done
<!-- Outline the testing that was done to demonstrate the changes are
solid. This could be unit tests, integration tests, testing on the car,
etc. Include relevant code snippets, screenshots, etc as needed. -->

### Resolved Tickets
<!-- Link any tickets that this PR resolves. -->
  • Loading branch information
will-chaba authored Jun 2, 2024
1 parent 0271509 commit 82b0e4d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
1 change: 0 additions & 1 deletion firmware/quadruna/BMS/src/app/app_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 0 additions & 1 deletion firmware/quadruna/BMS/src/app/app_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions firmware/quadruna/BMS/src/app/states/app_allStates.c
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
9 changes: 2 additions & 7 deletions firmware/quadruna/BMS/src/app/states/app_initState.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down

0 comments on commit 82b0e4d

Please sign in to comment.