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
-
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.
-
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
-
Boot and Configure the RPi. Basically all the standard things, WiFi, update, upgrade, reboot…
-
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?
- 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
-
Run odrivetool and check errors
try running with DFU (for Device Firmware Updae on the oDrive)
obviously something is not happy -
Try updating the dfu.py file by changing python to python3 on the first line
Results aren’t better
-
Try odrivetool again, it’s still the same
-
try $sudo odrivetool dfu
-
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.
… 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)
Then switch DFU off and run odrivetool
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!
Now need to figure out what is going wrong!