Odrivetool InteractiveShell.run_code and ChannelBrokenException on Odrive v3.6 56V

I’ve tried different USB cables, not using an external USB Hub, different computers, etc… but always run into this ChannelBrokenException error that prevents my ODrive v3.6 56V that I recently received from being usable. Is there a solution? If so I have not been able to find it. I have found people asking for answers to this problem, but no solutions. Here is an example of the output that I get using odrivetool:

(base) C:\Users\u0073324>odrivetool
ODrive control utility v0.4.12
C:\Users\u0073324\Anaconda3\lib\site-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
C:\Users\u0073324\Anaconda3\lib\site-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
C:\Users\u0073324\Anaconda3\lib\site-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
C:\Users\u0073324\Anaconda3\lib\site-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 208539864D4D as odrv0
In [1]: odrv0.reboot()

ChannelBrokenException Traceback (most recent call last)
~\Anaconda3\lib\site-packages\fibre\shell.py in
----> 1 odrv0.reboot()

~\Anaconda3\lib\site-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()

~\Anaconda3\lib\site-packages\fibre\protocol.py in remote_endpoint_operation(self, endpoint_id, input, expect_ack, output_length)
313 return self._responses.pop(seq_no)
314 # TODO: record channel statistics
–> 315 raise ChannelBrokenException() # Too many resend attempts
316 finally:
317 self._expected_acks.pop(seq_no)

ChannelBrokenException:

Reconnected to ODrive 208539864D4D as odrv0

Let me qualify my response. I am definitely not an ODrive guru mostly I am in the same boat as you but I have gotten a lot of help here so I am trying to pay it back. I realize that the ChannelBrokenExecption looks like an error but Wetmelon has assured me this is “Normal” I see that after that “Error” it says Reconnected to ODrive. So It looks like you are golden to me. Try typing just “odrv0” and see what you get. It should talk to your drive and return all kinds of info. If you get a response just continue in the docs with getting started.
Hope this helps. If anyone else sees a problem with my response let me know, but I think I’m right.

I did try continuing in the docs, https://docs.odriverobotics.com/hoverboard.html, But I still get the ChannelBrokenException error for odrv0.reboot() [I wonder if it is even related to the previous interactiveShell error]. I will ignore it.

But, when I get to odrv0.axis0motor in the instructions, I get

In [19]: odrv0.axis0.motor
Out[19]:
error = 0x0001 (int)
phase_inductance = 0.0 (float)
phase_resistance = 0.0 (float)

But the instructions say it should result in something like:
error = 0x0000 (int)
phase_inductance = 0.00033594953129068017 (float)
phase_resistance = 0.1793474406003952 (float)

Is there anyway to know what error=0x0001 is supposed to mean?

Also, there is a different error code for:
In [23]: odrv0.axis0
Out[23]:
error = 0x0040 (int)

I referrerd to the troubleshooting steps at https://docs.odriverobotics.com/troubleshooting

In [24]: 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

I checked the 3 phase hoverboard motor connections and they are tight. I’m not sure why phase resistance or inductance would ever measure 0.0. Is that indicative of a broken connection somewhere?

When I measure the ohms using the voltmeter (set to range 200 ohms) I get 1.4 between the three phases. If I disconnect the motor wires from the Odrive, and measure the motor wires directly, it shows 1.5 ohms. with the motor wires disconnected, the 3 connectors on the controller read no connection between them (probably normal). Anway, it would seem to me that if I can measure resistance between the phases on the motor, then the ODrive should be able to measure a resistance value (other than 0.0) during calibration using
odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION

That is right, Ignore it. I get the same every time I startup or reboot.
I have never done the hoverboard setup so I can’t help there. Just make sure you are not skipping a step. I can tell you from experience that every time I thought the freaking thing was FUBAR it was some detail that I had overlooked, skipped or did not quite understand. Keep at it, as you solve problems you will start to understand what is going on. Sometimes you have to punt. I do a backup config and then I erase configuration and start over. That way you can be sure that something you had done a week ago isn’t messing you up. Sorry I can’t help more
.

Yes, there’s something wrong. See https://docs.odriverobotics.com/troubleshooting#common-motor-errors

I found out on a different post, that the default odrivetool config values are for smaller motors (I am using a small 250w hoverboard motor) and was able to fix the phase resistance error using
odrv0.axis0.motor.config.resistance_calib_max_voltage = 20.0

Then I redid calibration …
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE

and checked the results …
dump_errors(odrv0, True)

Note: my 250W/36V hoverboard motors have 9 pole pairs (instead of the 15 assumed in documentation at https://docs.odriverobotics.com/hoverboard ) so I had to change a couple of lines:
odrv0.axis0.motor.config.pole_pairs = 9 # half the number of poles
odrv0.axis0.encoder.config.cpr = 54 # = 6 * pole pairs

Doing that seemed to resolve an ERROR_CPR_OUT_OF_RANGE encoder error.

Anyway it seems to be working correctly now. Added the above in case it helps anyone else new.

1 Like