Skip to content

Commit

Permalink
[BLDC] Fix brushless state machine transition errors
Browse files Browse the repository at this point in the history
- We should use the estimator controller error rather than whether the result is valid
  • Loading branch information
sahil-kale committed Jan 10, 2024
1 parent 5c63855 commit 9e1191a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions control_loop/bldc/foc/brushless_foc_control_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void BrushlessFOCControlLoop::run_calibration(FOCController::FOCInputs inputs,
phase_commands[2] = result.phase_commands[2];

status_.set_error(BrushlessFOCControlLoopError::PHASE_INDUCTANCE_ESTIMATOR_FAILURE,
result.is_phase_inductance_valid == false);
result.state == PhaseInductanceEstimatorController::State::ERROR);
} else if (params_->foc_params.phase_resistance_valid == false) {
PhaseResistanceEstimatorController::Input input;
// Turn the FOC inputs into
Expand All @@ -195,7 +195,7 @@ void BrushlessFOCControlLoop::run_calibration(FOCController::FOCInputs inputs,
phase_commands[2] = result.phase_commands[2];

status_.set_error(BrushlessFOCControlLoopError::PHASE_RESISTANCE_ESTIMATOR_FAILURE,
result.is_phase_resistance_valid == false);
result.state == PhaseResistanceEstimatorController::State::ERROR);
}
}

Expand Down

0 comments on commit 9e1191a

Please sign in to comment.