Calibration immediately stops with error

Hello everyone,

I’m new to motor control and odrive and I can’t get the odrive to work with my motor.
I have a Maxon EC flat motor with an encoder mounted on it.

It’s this motor:
https://www.maxongroup.com/maxon/view/product/motor/ecmotor/ecflat/ecflat90/607942

with this encoder:
https://www.maxongroup.com/maxon/view/product/621792

To me it seems this motor would be supported out of the box. When I issue the calibration command the motor tries to spin up but stops almost immediately. When I check the errors it says ERROR_MOTOR_FAILED and ERROR_PHASE_RESISTANCE_OUT_OF_RANGE. On the troubleshooting page this error is mentioned. But the values for phase resistance is 0…

In [11]: odrv0.axis0.motor.config.phase_inductance                    
Out[11]: 0.0

In [12]: odrv0.axis0.motor.config.phase_resistance                    
Out[12]: 0.0

The rest of the help seems to be geared to low peak current motors. But the motor I’m using has a peak current (stall?) of 111 A so this doesn’t seem applicable. I have checked the wires and everything seems correct. I also get some errors from the odrivetool but I think that is unrelated.

This is the full command set I used to try and get it working:

$ odrivetool
ODrive control utility v0.4.12
/usr/local/lib/python3.7/dist-packages/fibre/shell.py:104: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('import sys')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.7/dist-packages/fibre/shell.py:105: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('superexcepthook = sys.excepthook')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.7/dist-packages/fibre/shell.py:106: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('def newexcepthook(ex_class,ex,trace):\n'
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.7/dist-packages/fibre/shell.py:109: RuntimeWarning: coroutine 'InteractiveShell.run_code' was never awaited
  console.runcode('sys.excepthook=newexcepthook')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Please connect your ODrive.
You can also type help() or quit().

Connected to ODrive 206C3868304E as odrv0
In [1]: odrv0.axis0.motor.config.current_lim                          
Out[1]: 10.0

In [2]: odrv0.axis0.controller.config.vel_limit                       
Out[2]: 2000.0

In [3]: odrv0.axis0.motor.config.calibration_current                  
Out[3]: 20.0

In [4]: odrv0.config.brake_resistance                                 
Out[4]: 2.0

In [5]: odrv0.axis0.motor.config.pole_pairs                           
Out[5]: 11

In [6]: odrv0.axis0.motor.config.motor_type                           
Out[6]: 0

In [7]: odrv0.axis0.encoder.config.cpr                                
Out[7]: 25600
In [8]: dump_errors(odrv0)                                            
axis0
  axis: no error
  motor: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: no error
  encoder: no error
  controller: no error

In [9]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQU
   ...: ENCE                                                          

In [10]: dump_errors(odrv0)                                           
axis0
  axis: Error(s):
    ERROR_MOTOR_FAILED
  motor: Error(s):
    ERROR_PHASE_RESISTANCE_OUT_OF_RANGE
  encoder: no error
  controller: no error
axis1
  axis: no error
  encoder: no error
  controller: no error

In [11]: odrv0.axis0.motor.config.phase_inductance                    
Out[11]: 0.0

In [12]: odrv0.axis0.motor.config.phase_resistance                    
Out[12]: 0.0

In [13]: odrv0.axis0.motor.config.phase_inductance                    
Out[13]: 0.0

In [14]: odrv0.axis0.motor.config.phase_resistance                    
Out[14]: 0.0

In [15]:                                                              

In [15]: odrv0.reboot()                                               
Oh no odrv0 disappeared
----------------------------------------------------------------------
ChannelBrokenException               Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/fibre/shell.py in <module>
----> 1 odrv0.reboot()

/usr/local/lib/python3.7/dist-packages/fibre/remote_object.py in __call__(self, *args)
    160         for i in range(len(args)):
    161             self._inputs[i].set_value(args[i])
--> 162         self._parent.__channel__.remote_endpoint_operation(self._trigger_id, None, True, 0)
    163         if len(self._outputs) > 0:
    164             return self._outputs[0].get_value()

/usr/local/lib/python3.7/dist-packages/fibre/protocol.py in remote_endpoint_operation(self, endpoint_id, input, expect_ack, output_length)
    307                     try:
    308                         if wait_any(self._resend_timeout, ack_event, self._channel_broken) != 0:
--> 309                             raise ChannelBrokenException()
    310                     except TimeoutError:
    311                         attempt += 1

ChannelBrokenException: 

Reconnected to ODrive 206C3868304E as odrv0
In [16]:    

I got calibration to work by setting resistance_calib_max_voltage to 4. However without fail the odrivetool loses connection to the odrive afterwards randomly saying Oh no odrv0 disappeared. Sometimes this happens quickly other times it takes a while. Do only thing I can do is reboot the odrive. Anyone has seen this problem?

You’re probably getting an issue with grounding / USB comms noise. Try a different USB port, add a ferrite bead or choke to the cable, braid your motor wires, add a torroid to the motor wires, or try a shorter USB cable. And check that you don’t have a ground loop through the USB cable.

The included USB cable has a ferrite bead I think. I have an USB isolator so I will try that! Thanks!

1 Like

I have added an USB isolater, braided the motor cables and finally added ferrite chokes to each motor cable. The USB isolater and braiding the motor cables didn’t have an effect and I still saw the issue but adding the ferrite chokes to the motor cables makes the issue occur a LOT less frequently. Going from almost instantly losing the USB connection to having it open for minutes to an hour. I have bought 2 larger ferrites that can fit all 3 motor cables at once.

1 Like