Hello,
I’m fairly new to electronics and would like an explanation on how to set up CAN protocol. Currently, I control the Odrive with a raspberry pi and python. I have been running into USB connectivity issues and read on this site that CAN is recommended.
I would like to know the following:
- How to wire up the Odrive to the raspberry pi CAN hat
- How to select an appropriate Baud rate for my application
- Once it’s wired up correctly, do I need to change my code to accommodate CAN? If so, what do I need to change?
My code starts out as follows:
import odrive
print("finding an odrive...")
odrv0 = odrive.find_any()
print("voltage is ")
print(str(odrv0.vbus_voltage))
and then I proceed to control the motor with commands such as…
odrv0.axis0.controller.input_vel = 0
odrv0.axis0.requested_state = AXIS_STATE_IDLE
odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
Thanks in advance! I appreciate any help!