Running on RPi (Help please)

After failing completely to be able to connect the oDrive to a PC I am now trying to connect to a Raspberry Pi. Hopefully this thread will help anyone else trying to connect to the RPi. My system consists of:

  • Two 56V O-Drives V3.6 (using only one but swap to see if issue is the board)
  • 5065 270KV motors purchased from Odrive
  • CUI 8192 encoder purchased from Odrive
  • RPi 4B8Gb (Brand new) [Have also attempted on a 4B-4Gb with same results]
  • 50W resistor purchased from Odrive
  • 24V, 10A power supply

Here are my steps

  1. Wire the system together. Seems pretty straightforward. Power supply + to +, - to -. mount encoder and connect wire (goes on the motor only one way) and on the board Yellow to 5V, black to GND. Wire in the resistor (no polarity). Wire the motor in any order. Note: I’m using M0.

  2. Prepare a brand new microSD card

  • Get the image from Operating system images – Raspberry Pi Note: The image from 10/30/2021 has Python 3.9 and the earlier image from 8/22/2021 has Python 3.7 (so this is the one I used since oDrive doesn’t work with versions newer than 3.8.6)
  • Format the card and burn the image with Balena Etcher
  1. Boot and Configure the RPi. Basically all the standard things, WiFi, update, upgrade, reboot…

  2. Verify python versions

  • python is Python 2.7
  • python3 is Python 3.7
    Note: I know we want 3.8.6 but I don’t know how to install this version. Will oDrive fail completely with 3.7?
  1. Install oDrive
  • sudo pip3 install --upgrade odrive

  • Fix UDEV (per the instructions)
    • echo ‘SUBSYSTEM==“usb”, ATTR{idVendor}==“1209”, ATTR{idProduct}==“0d[0-9][0-9]”, MODE=“0666”’ | sudo tee /etc/udev/rules.d/91-odrive.rules
    • sudo udevadm control --reload-rules
    • sudo udevadm trigger

  1. Run odrivetool and check errors


    try running with DFU (for Device Firmware Updae on the oDrive)

    obviously something is not happy

  2. Try updating the dfu.py file by changing python to python3 on the first line


    Results aren’t better

  3. Try odrivetool again, it’s still the same

  4. try $sudo odrivetool dfu

  5. Try $sudo odrivetool


    Now there’s an error MOTOR_ERROR_SYSTEM_LEVEL
    Note the supply is at 24V and at this point not drawing current so not sure what the REGEN_CURRENT message is all about.

I’m pretty much out of hope at this point. This shouldn’t be so difficult. Ground hog day all week. Any advise would be greatly appreciated. Where are my steps wrong?

There are 2 dip switches (SW1) on the board that I don’t see on images of the board on the website and I don’t see documented anywhere. I’ve just left these as set by the factory.


image
… let me guess they say DFU and CAN. I’ll set them to NO CAN and DFU then run sudo odrivetool dfu again (looks like success)
11-OdriveDFU-DFU-Switch

Then switch DFU off and run odrivetool
12-NoErrors

Calibrate: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
Seemed to work!

odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.input_pos = 1

Failed!

13-MotorErrors

Now need to figure out what is going wrong!

1 Like

Python 3.9 or 3.7 is fine. We recommend a slightly older version of Python only because matplotlib usually takes a little while to update, so people get weird errors trying to run or install odrive if python updates but the deps haven’t yet.

Everything looks good now. Put the DFU/RUN switch in RUN, do an odrv0.erase_configuration() and then you should be fine to follow the Getting Started guide to set it up for first run.

P.S. Thanks for the detailed bug report, it makes it much easier to understand what you’ve done and how to fix it :slight_smile:

1 Like