Unkown Error 0x00000004

Good day,

I am tuning my ODrive for an autonomous differential robot platform.
It has these 50:1 geared motors for both wheels and I am using the included hall effect encoders (Attached to the motor before the 50:1 transmission).

My ODrive is V3.5 24V with Firmware 0.5.1
I configured both axis and I can calibrate and run both wheels in velocity control mode. I am using CAN Interface for controlling the ODrive from a Jetson Xavier running ROS.

The problem: occasionally when accelerating from 0 to 60 Turns/s (considering this speed from the motor and not from the wheels) both axis will stop responding, and and Unknown Error 0x00000004 appeard on both axis.

Am I missing some configuration? I followed both the getting started and the hoverboard motors setup guides.
What can be the cause of this errors?

Thanks in advance for your support.

Error dump

In [15]: dump_errors(odrv0)                                                     
system: not found
axis0
  axis: Error(s):
    UNKNOWN ERROR: 0x00000004
  motor: no error
  sensorless_estimator: no error
  encoder: no error
  controller: no error
axis1
  axis: Error(s):
    UNKNOWN ERROR: 0x00000004
  motor: no error
  sensorless_estimator: no error
  encoder: no error
  controller: no error

My axis setup:

In [23]: odrv0.axis1.controller.config                                          
Out[23]: 
anticogging:
  anticogging_enabled: True (bool)
  calib_anticogging: False (bool)
  calib_pos_threshold: 1.0 (float)
  calib_vel_threshold: 1.0 (float)
  cogging_ratio: 1.0 (float)
  index: 0 (uint32)
  pre_calibrated: False (bool)
axis_to_mirror: 255 (uint8)
circular_setpoint_range: 1.0 (float)
circular_setpoints: False (bool)
control_mode: 2 (int32)
enable_current_mode_vel_limit: True (bool)
enable_gain_scheduling: False (bool)
enable_overspeed_error: True (bool)
enable_vel_limit: True (bool)
gain_scheduling_width: 10.0 (float)
homing_speed: 0.25 (float)
inertia: 0.0 (float)
input_filter_bandwidth: 2.0 (float)
input_mode: 1 (int32)
load_encoder_axis: 1 (uint8)
mirror_ratio: 1.0 (float)
pos_gain: 20.0 (float)
torque_ramp_rate: 0.009999999776482582 (float)
vel_gain: 0.46000000834465027 (float)
vel_integrator_gain: 0.0 (float)
vel_limit: 84.0 (float)
vel_limit_tolerance: 1.2000000476837158 (float)
vel_ramp_rate: 1.0 (float)
In [24]: odrv0.axis0.controller.config                                          
Out[24]: 
anticogging:
  anticogging_enabled: True (bool)
  calib_anticogging: False (bool)
  calib_pos_threshold: 1.0 (float)
  calib_vel_threshold: 1.0 (float)
  cogging_ratio: 1.0 (float)
  index: 0 (uint32)
  pre_calibrated: False (bool)
axis_to_mirror: 255 (uint8)
circular_setpoint_range: 1.0 (float)
circular_setpoints: False (bool)
control_mode: 2 (int32)
enable_current_mode_vel_limit: True (bool)
enable_gain_scheduling: False (bool)
enable_overspeed_error: True (bool)
enable_vel_limit: True (bool)
gain_scheduling_width: 10.0 (float)
homing_speed: 0.25 (float)
inertia: 0.0 (float)
input_filter_bandwidth: 2.0 (float)
input_mode: 1 (int32)
load_encoder_axis: 0 (uint8)
mirror_ratio: 1.0 (float)
pos_gain: 20.0 (float)
torque_ramp_rate: 0.009999999776482582 (float)
vel_gain: 0.46000000834465027 (float)
vel_integrator_gain: 0.0 (float)
vel_limit: 84.0 (float)
vel_limit_tolerance: 1.2000000476837158 (float)
vel_ramp_rate: 1.0 (float)

Encoder Setup

In [27]: odrv0.axis0.encoder                                                    
Out[27]: 
calib_scan_response: 143.0 (float)
config:
  abs_spi_cs_gpio_pin: 1 (uint16)
  bandwidth: 200.0 (float)
  calib_range: 0.019999999552965164 (float)
  calib_scan_distance: 150.0 (float)
  calib_scan_omega: 12.566370964050293 (float)
  cpr: 12 (int32)
  enable_phase_interpolation: True (bool)
  find_idx_on_lockin_only: False (bool)
  idx_search_unidirectional: False (bool)
  ignore_illegal_hall_state: False (bool)
  mode: 1 (int32)
  offset: -66 (int32)
  offset_float: -0.4443618059158325 (float)
  pre_calibrated: False (bool)
  sincos_gpio_pin_cos: 4 (uint16)
  sincos_gpio_pin_sin: 3 (uint16)
  use_index: False (bool)
  zero_count_on_find_idx: True (bool)
count_in_cpr: 2 (int32)
error: 0 (int32)
hall_state: 2 (uint8)
index_found: False (bool)
interpolation: 0.5 (float)
is_ready: True (bool)
phase: 3.083325147628784 (float)
pos_abs: 0 (int32)
pos_circular: 0.17110556364059448 (float)
pos_cpr: 0.17081031203269958 (float)
pos_cpr_counts: 2.0497236251831055 (float)
pos_estimate: 0.16690075397491455 (float)
pos_estimate_counts: 2.0028090476989746 (float)
set_linear_count(obj: object_ref, count: int32)
shadow_count: 2 (int32)
spi_error_rate: 0.0 (float)
vel_estimate: 0.0 (float)
vel_estimate_counts: 0.0 (float)
In [28]: odrv0.axis1.encoder                                                    
Out[28]: 
calib_scan_response: 143.0 (float)
config:
  abs_spi_cs_gpio_pin: 1 (uint16)
  bandwidth: 200.0 (float)
  calib_range: 0.4000000059604645 (float)
  calib_scan_distance: 150.0 (float)
  calib_scan_omega: 12.566370964050293 (float)
  cpr: 12 (int32)
  enable_phase_interpolation: True (bool)
  find_idx_on_lockin_only: False (bool)
  idx_search_unidirectional: False (bool)
  ignore_illegal_hall_state: False (bool)
  mode: 1 (int32)
  offset: -66 (int32)
  offset_float: -0.4645048975944519 (float)
  pre_calibrated: False (bool)
  sincos_gpio_pin_cos: 4 (uint16)
  sincos_gpio_pin_sin: 3 (uint16)
  use_index: False (bool)
  zero_count_on_find_idx: True (bool)
count_in_cpr: 4 (int32)
error: 0 (int32)
hall_state: 4 (uint8)
index_found: False (bool)
interpolation: 0.5 (float)
is_ready: True (bool)
phase: -1.0843665599822998 (float)
pos_abs: 0 (int32)
pos_circular: 0.41282007098197937 (float)
pos_cpr: 0.41252967715263367 (float)
pos_cpr_counts: 4.9503560066223145 (float)
pos_estimate: 0.4166117310523987 (float)
pos_estimate_counts: 4.999340534210205 (float)
set_linear_count(obj: object_ref, count: int32)
shadow_count: 4 (int32)
spi_error_rate: 0.0 (float)
vel_estimate: 0.0 (float)
vel_estimate_counts: 0.0 (float)

Just missed a detail about my PS.

I am using a 24V Battery and the included 50W power resistor from ODrive.

My setup for current are as follows:

In [33]: odrv0.axis0.motor.config                                               
Out[33]: 
acim_autoflux_attack_gain: 10.0 (float)
acim_autoflux_decay_gain: 1.0 (float)
acim_autoflux_enable: False (bool)
acim_autoflux_min_Id: 10.0 (float)
acim_gain_min_flux: 10.0 (float)
acim_slip_velocity: 14.706000328063965 (float)
calibration_current: 10.0 (float)
current_control_bandwidth: 1000.0 (float)
current_lim: 10.0 (float)
current_lim_margin: 8.0 (float)
direction: -1 (int32)
inverter_temp_limit_lower: 100.0 (float)
inverter_temp_limit_upper: 120.0 (float)
motor_type: 0 (int32)
phase_inductance: 0.00023735454306006432 (float)
phase_resistance: 0.23227234184741974 (float)
pole_pairs: 2 (int32)
pre_calibrated: False (bool)
requested_current_range: 60.0 (float)
resistance_calib_max_voltage: 6.0 (float)
torque_constant: 1.722000002861023 (float)
torque_lim: inf (float)
In [34]: odrv0.axis1.motor.config                                               
Out[34]: 
acim_autoflux_attack_gain: 10.0 (float)
acim_autoflux_decay_gain: 1.0 (float)
acim_autoflux_enable: False (bool)
acim_autoflux_min_Id: 10.0 (float)
acim_gain_min_flux: 10.0 (float)
acim_slip_velocity: 14.706000328063965 (float)
calibration_current: 10.0 (float)
current_control_bandwidth: 1000.0 (float)
current_lim: 10.0 (float)
current_lim_margin: 8.0 (float)
direction: -1 (int32)
inverter_temp_limit_lower: 100.0 (float)
inverter_temp_limit_upper: 120.0 (float)
motor_type: 0 (int32)
phase_inductance: 0.00023899710504338145 (float)
phase_resistance: 0.23066973686218262 (float)
pole_pairs: 2 (int32)
pre_calibrated: False (bool)
requested_current_range: 60.0 (float)
resistance_calib_max_voltage: 6.0 (float)
torque_constant: 1.722000002861023 (float)
torque_lim: inf (float)

Error 0x04 on 0.5.1 is DC_BUS_OVERVOLTAGE. Are you braking hard perhaps? You may need to use the brake resistor to absorb some of the energy.

By the way, you should match your odrivetool to your firmware. pip install odrive==0.5.1.post0 works

1 Like

I thought my brake resistor was already enabled with

odrv0.brake_resistor_armed = True

Although, I kept fine tuning my vel_gain and vel_integrator_gain and this error stopped appearing. But now once in a while when calibrating I get error 0x0000002 & 0x0000040, MOTOR_ERROR_PHASE_INDUCTANCE_OUT_OF_RANGE.

This only happens when calibrating, and with one wheel. I move the wheels a bit, reboot, and calibration goes on with no problems. I use Hall Effect Encoders.

Btw, thank you for the heads up about my odrivetool version!

Hello @axlspinedoc ,

Since you are using a battery, you may need to adjust the following parameters:

dc_max_negative_current
max_regen_current

and maybe
dc_max_positive_current

See the documentation from the changelog here:

I know I ran into the same kind of error when I was testing. On my machine I do not have a brake resistor, so it was necessary to raise the limits on these parameters to run without error. I dont have any bus overheating on my machine so we choose not to use the resistors.

Good Luck!

2 Likes

I was indeed braking too hard. The solution was to implement ramps for acceleration. I changed my input mode to INPUT_VEL_RAMP and adjusted accordingly until I had no more errors.

Thank your for your support to all of you :slight_smile:

1 Like