Encoder error 0x0002 questions

Hello, I am just getting started with the Odrive 3.5 24V and until recently able to give position and velocity commands through a USB connection and Python Command window.

I have a AMT102 encoder mounted to D5065 motor.
On startup I run startup_motor_calibration and I get the beep and one full rotation.

Yesterday it stopped responding to my position and velocity requests and I got the encoder error 0x0002. I replaced the encoder with a new one and still get the error.

Any suggestions?

error = 0x0002 (int)
is_ready = False (bool)
index_found = False (bool)
shadow_count = -5066 (int)
count_in_cpr = 3126 (int)
offset = 0 (int)
interpolation = 0.29335498809814453 (float)
phase = -2.0646963119506836 (float)
pos_estimate = -5065.83984375 (float)
pos_cpr = 3126.1962890625 (float)
hall_state = 4 (int)
pll_vel = -727.9998168945312 (float)
pll_kp = 2000.0 (float)
pll_ki = 1000000.0 (float)
config:
  mode = 0 (int)
  use_index = False (bool)
  pre_calibrated = False (bool)
  idx_search_speed = 10.0 (float)
  cpr = 8192 (int)
  offset = 0 (int)
  offset_float = 0.0 (float)
  calib_range = 0.019999999552965164 (float)

Many thanks.

Update to previous post…

I installed a different motor and encoder (different mounting fixture also) and I can control the motor as expected. Below is it’s encoder details:

error = 0x0000 (int)
is_ready = True (bool)
index_found = False (bool)
shadow_count = 0 (int)
count_in_cpr = 0 (int)
offset = -4858 (int)
interpolation = 0.5 (float)
phase = 0.952540397644043 (float)
pos_estimate = 0.853888213634491 (float)
pos_cpr = 0.7691555619239807 (float)
hall_state = 7 (int)
pll_vel = 0.0 (float)
pll_kp = 2000.0 (float)
pll_ki = 1000000.0 (float)
config:
  mode = 0 (int)
  use_index = False (bool)
  pre_calibrated = False (bool)
  idx_search_speed = 10.0 (float)
  cpr = 8192 (int)
  offset = -4858 (int)
  offset_float = -0.06003522872924805 (float)
  calib_range = 0.019999999552965164 (float)

When I install the original motor and encoder, I again get the error (0x0002).
It does not seem like I have any mounting issues with the encoder (nothing has changed). So I can’t really understand how to proceed.

Thanks again.

Encoder error 0x2 means ERROR_CPR_OUT_OF_RANGE, which means that the encoder calibration was inaccurate. This can be caused by incorrect settings, but as you demonstrate, it seems to be the correct settings.

Other things that can cause this issue is if there is any load on the motor during calibration. Here are some things you can try:

  1. Increase axisN.motor.config.calibration_current to 30 or so
  2. Remove any load from the motor at startup
  3. Be less strict on the calibration accuracy, set it to 5%: axisN.encoder.config.calib_range = 0.05

Oskar,

Thank you very much for your help.
The calibration current and calibration range did not fix issue.
But I removed the encoder and re-aligned the mounting base and it seems to be working now.
Does this make sense?
If the AMT102 is not mounted concentric to the shaft can it create this type of error?

Again, thanks for the help.

Hm I have never seen it misbehave myself, but I can imagine that there are some concentricity requirements. Or maybe a dodgy cable/connection?
Either way, I’m glad you got it going.

Thanks for the exceptional support.
If anything changes or if I discover an alternate explanation, I will reply back on this thread.