Skip to content

Commit

Permalink
Revert "add back subcomponent error flags"
Browse files Browse the repository at this point in the history
This reverts commit cc7bbd4.
  • Loading branch information
tobbelobb committed Apr 7, 2022
1 parent 58a6567 commit 4ec5a01
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 24 deletions.
4 changes: 0 additions & 4 deletions Arduino/ODriveArduino/ODriveEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ enum CanError {
enum AxisError {
AXIS_ERROR_NONE = 0x00000000,
AXIS_ERROR_INVALID_STATE = 0x00000001,
AXIS_ERROR_MOTOR_FAILED = 0x00000040,
AXIS_ERROR_SENSORLESS_ESTIMATOR_FAILED = 0x00000080,
AXIS_ERROR_ENCODER_FAILED = 0x00000100,
AXIS_ERROR_CONTROLLER_FAILED = 0x00000200,
AXIS_ERROR_WATCHDOG_TIMER_EXPIRED = 0x00000800,
AXIS_ERROR_MIN_ENDSTOP_PRESSED = 0x00001000,
AXIS_ERROR_MAX_ENDSTOP_PRESSED = 0x00002000,
Expand Down
1 change: 0 additions & 1 deletion Firmware/MotorControl/encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ void Encoder::set_error(Error error) {
vel_estimate_valid_ = false;
pos_estimate_valid_ = false;
error_ |= error;
axis_->error_ |= Axis::ERROR_ENCODER_FAILED;
}

bool Encoder::do_checks(){
Expand Down
7 changes: 2 additions & 5 deletions Firmware/MotorControl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,8 @@ void ODrive::control_loop_cb(uint32_t timestamp) {
MEASURE_TIME(axis.task_times_.sensorless_estimator_update)
axis.sensorless_estimator_.update();

MEASURE_TIME(axis.task_times_.controller_update) {
if (!axis.controller_.update()) { // uses position and velocity from encoder
axis.error_ |= Axis::ERROR_CONTROLLER_FAILED;
}
}
MEASURE_TIME(axis.task_times_.controller_update)
axis.controller_.update(); // uses position and velocity from encoder

MEASURE_TIME(axis.task_times_.open_loop_controller_update)
axis.open_loop_controller_.update(timestamp);
Expand Down
1 change: 0 additions & 1 deletion Firmware/MotorControl/motor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ bool Motor::setup() {

void Motor::disarm_with_error(Motor::Error error){
error_ |= error;
axis_->error_ |= Axis::ERROR_MOTOR_FAILED;
last_error_time_ = odrv.n_evt_control_loop_ * current_meas_period;
disarm();
}
Expand Down
2 changes: 0 additions & 2 deletions Firmware/MotorControl/sensorless_estimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ bool SensorlessEstimator::update() {
// Check that we don't get problems with discrete time approximation
if (!(current_meas_period * pll_kp < 1.0f)) {
error_ |= ERROR_UNSTABLE_GAIN;
axis_->error_ |= Axis::ERROR_SENSORLESS_ESTIMATOR_FAILED;
reset(); // Reset state for when the next valid current measurement comes in.
return false;
}
Expand All @@ -44,7 +43,6 @@ bool SensorlessEstimator::update() {
}
if (!current_meas.has_value()) {
error_ |= ERROR_UNKNOWN_CURRENT_MEASUREMENT;
axis_->error_ |= Axis::ERROR_SENSORLESS_ESTIMATOR_FAILED;
reset(); // Reset state for when the next valid current measurement comes in.
return false;
}
Expand Down
7 changes: 0 additions & 7 deletions Firmware/odrive-interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,6 @@ interfaces:
tried to run encoder calibration or closed loop control before the
motor was calibrated, or you tried to run closed loop control
before the encoder was calibrated.
MOTOR_FAILED:
bit: 6
doc: Check `motor.error` for more information.
SENSORLESS_ESTIMATOR_FAILED:
ENCODER_FAILED:
doc: Check `encoder.error` for more information.
CONTROLLER_FAILED:
WATCHDOG_TIMER_EXPIRED:
bit: 11
brief: The axis watchdog timer expired.
Expand Down
4 changes: 0 additions & 4 deletions tools/odrive/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@
# ODrive.Axis.Error
AXIS_ERROR_NONE = 0x00000000
AXIS_ERROR_INVALID_STATE = 0x00000001
AXIS_ERROR_MOTOR_FAILED = 0x00000040
AXIS_ERROR_SENSORLESS_ESTIMATOR_FAILED = 0x00000080
AXIS_ERROR_ENCODER_FAILED = 0x00000100
AXIS_ERROR_CONTROLLER_FAILED = 0x00000200
AXIS_ERROR_WATCHDOG_TIMER_EXPIRED = 0x00000800
AXIS_ERROR_MIN_ENDSTOP_PRESSED = 0x00001000
AXIS_ERROR_MAX_ENDSTOP_PRESSED = 0x00002000
Expand Down

0 comments on commit 4ec5a01

Please sign in to comment.