Skip to content

Commit

Permalink
add MOTOR_ERROR_MODULATION_IS_NAN
Browse files Browse the repository at this point in the history
  • Loading branch information
madcowswe committed Aug 23, 2020
1 parent f52c68b commit f59c805
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Firmware/MotorControl/motor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ bool Motor::run_calibration() {
}

bool Motor::enqueue_modulation_timings(float mod_alpha, float mod_beta) {
if (std::isnan(mod_alpha) || std::isnan(mod_alpha))
return set_error(ERROR_MODULATION_IS_NAN), false;
float tA, tB, tC;
if (SVM(mod_alpha, mod_beta, &tA, &tB, &tC) != 0)
return set_error(ERROR_MODULATION_MAGNITUDE), false;
Expand Down
1 change: 1 addition & 0 deletions Firmware/odrive-interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ interfaces:
BrakeDutyCycleNan:
DcBusOverRegenCurrent: {doc: too much current pushed into the power supply}
DcBusOverCurrent: {doc: too much current pulled out of the power supply}
ModulationIsNan:
armed_state:
typeargs: {fibre.Property.mode: readonly}
values:
Expand Down
1 change: 1 addition & 0 deletions tools/odrive/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
MOTOR_ERROR_BRAKE_DUTY_CYCLE_NAN = 0x00002000
MOTOR_ERROR_DC_BUS_OVER_REGEN_CURRENT = 0x00004000
MOTOR_ERROR_DC_BUS_OVER_CURRENT = 0x00008000
MOTOR_ERROR_MODULATION_IS_NAN = 0x00010000

# ODrive.Motor.ArmedState
ARMED_STATE_DISARMED = 0
Expand Down

0 comments on commit f59c805

Please sign in to comment.