So I am trying to test certain capabilities on an S1 using CAN (basically just sending torque commands and receiving encoder feedback at ~1kHz) before I go ahead and buy the full 8 I need for a system. I am currently using an isolated USB->CAN-FD adapter (although the price is suspect, I admit link:Amazon.com).
I was able to setup and configure the odrive with the 270kV 5065 motor and had it spinning up and accepting torque set points through the web GUI. I then spent several hours struggling to get any CAN-FD messages to work (the adapter would just stop receiving data) and am not sure which was at fault the Odrive or the adapter (I am using cangaroo to diagnose the bus).
I tried changing the data baud rate to 5M (normal baud set at 1M) and the brs enable flag to 1 and configured from the json file in odrivetool. Nothing seemed to work so I started taking some creative experimentation approaches.
In the process of such I had reset everything so that the CAN bus was working and sending feedback which was being received by cangaroo when I decided to try changing the brs enable flag to 1 WITHOUT increasing the data baud rate (ie both bauds were set to 1M). I plugged it into USB and it failed to connect to the device giving me a ‘-5’ error. Nothing happened in between it working from the previous configuration set in odrivetool and it failing (no falls, bumps, shorts, multiple devices plugged in ie only usb OR CAN adapter). I’m really at a loss for what went wrong and how to prevent it.
Now I cannot connect to USB at all and it seems to exhibit the following behavior:
If the USB cable is connected but not the DC power the LED on the board still lights up and flashes from ?red? to blue which I did not think was how it behaved when I first got the board.
If I connect the USB cable first but no DC power it shows up in device manager as COM4 and even shows communication in the events log but cannot connect to odrive (GUI shows something like ‘odrive S1 paired’)
If I connect the DC power first then USB cable it doesn’t (potentially inconsistently) show up as a COM device at all and sometimes shows up as a unrecognized usb device that filed to configure.
The CAN feedback is still sending if I just connect DC power and the USB->CAN-FD adapter and check with cangaroo and sending id:0x000 drc:0 data: gets me a response from the odrive with the version information. I have not gotten far enough with the device to check more complicated commands as I was still trying to setup and test CAN thus I have yet to actually command the motor with CAN, thus I am unsure if the other features of the device are not damaged.
I have not tried to flash firmware to the device as I didn’t want to make a bad situation worse if at all possible. I would appreciate maybe some potential debug steps as I am still very novice to these devices. Perhaps what string of CAN messages I can send to clear errors, set state to closed loop control, and send a setpoint torque? I am not sure if some commands require any data in the message or if the id alone is sufficient to trigger the action (device has node_id = 0)
Would the following be correct?
id:0x018 drc:1 data:[00] #clear errors
id:0x00b drc:8 data:[00 00 00 01 00 00 00 01] #torque control, passthrough (direct control of torque)
id:0x00e drc:4 data:[3c 23 d7 0a] #set torque to 0.01 Nm (not super confident on float conversion)
Sorry if this is a bit all over the place.
PS If anyone has any suggestions on C++ libraries to use to send CAN-FD messages through a Canable 2.0 FD compatible device I would greatly appreciate it. I see stuff on candlelight and libusb (which I have heard GREAT things about lol) but am not sure how the gsusb packaging works (would love a good reference).