Skip to content

Commit

Permalink
feat: reset Fault on error Hook and then reenables before recovery
Browse files Browse the repository at this point in the history
Instead of using prepare, which does a bunch of stuff, we took the
important bit from it and create the resetFault method, toggles the
reset fault bit on and off. Also, after it was reset the controller must
go through the enable control method before recovery.
  • Loading branch information
jhonasiv committed Oct 2, 2024
1 parent a35667c commit d8a963b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,12 @@ void Task::errorHook()
publishFault();

// Try to reset the faults
m_driver->prepare();
m_driver->resetFault();
// Verify if the controller status is not in FAULT state
auto state = readAndPublishControllerStates();
if (state.inverter_status != STATUS_FAULT &&
state.inverter_status != STATUS_UNDERVOLTAGE) {
m_driver->enable();
recover();
}

Expand Down

0 comments on commit d8a963b

Please sign in to comment.