ODrive 1st Time CAN Control

Hello, I’m working on a quadruped project. I plan to use a Teensy 4.1 with a CAN transceiver to communicate to 3 motors (test for 1 leg).

I wanted to know the work flow I can expect, since I’m a little confused with GUI vs ODrive Tool vs Arduino IDE, and I’ve also never used CAN.

1 - How am I supposed to approach calibration?

If I calibrate on the GUI, will it just save it all onto the ODrive? Will I need to disconnect all my CAN wires? Can I simply calibrate over CAN?

2 - How do I communicate with everything?

I plan to program sequences and such so I know I’ll need to be in some sort of IDE and not just the GUI. This is mainly why I want to calibrate the ODrive over code too.

However, I’m confused on what ODrive Tool is, and why some people use the Arduino IDE? What’s the best approach (or most common). What are pros and downsides of each.

3 - Calibrating with hard stops

I have hard stops in my assembly so my motor cannot do complete rotation (likely 4 rotations max). I know an instruction for GUI calibration is to ensure continuous rotation. How do I avoid this with having my hardstops?

4 - CAN Communication and what changes?

My CAN transceiver has not come in yet but I was thinking about starting coding. Will the complete workflow, syntax, etc. of the code change if I use USB vs CAN? Should I just wait to get the CAN items and them start?

5 - What is the CAN-USB thing on ODrive shop used for? I purchased it assuming I’ll need it .

6 - How do I connect to the CAN port on the ODrive S1? what connector port is it?

These are some great questions!

If I calibrate on the GUI, will it just save it all onto the ODrive? Will I need to disconnect all my CAN wires? Can I simply calibrate over CAN?

Yes, calibration in the GUI will save all the parameters onto the ODrive. I usually recommend doing calibration/setup/tune on the GUI, then using CAN for runtime stuff. You don’t need to disconnect CAN to do so. You can definitely also calibrate over CAN (CAN has full feature parity with USB/GUI/ODrivetool), but it takes an extra step or two. Only thing I’d note is that if you’re using an incremental encoder (as opposed to hall sensors or an absolute encoder), then you will need to run encoder calibration (or do index search, if your encoder has an index line). This can also be done over CAN!

2 - How do I communicate with everything?

You would connect a CAN transciever (like this one) to the teensy, which would let it talk the hardware voltage levels that CAN uses. You’d then connect the CANH/CANL to the ODrive S1’s CAN pins (either on J11 or J16/J17, it’s all internally connected). Then you can use our Arduino CAN library. We have an Arduino CAN guide here, I’d strongly recommend giving it a look: Controlling ODrive from an Arduino via CAN — ODrive Documentation 0.6.11 documentation

However, I’m confused on what ODrive Tool is, and why some people use the Arduino IDE? What’s the best approach (or most common). What are pros and downsides of each.

The GUI and ODrivetool are both just different interfaces to make it easy to communicate with an ODrive over USB. The GUI is, well, a GUI, and ODrivetool is just a command-line interface in Python. They both can do the exact same things, but the GUI has things like easy graphing and configuration, while ODrivetool lets you write and run code in Python. We also have a python library for communicating with the ODrive over USB.

Since the Teensy is just a microcontroller, and not a full computer, you’d have to write code for it in the Arduino IDE.

I plan to program sequences and such so I know I’ll need to be in some sort of IDE and not just the GUI. This is mainly why I want to calibrate the ODrive over code too.

Well, you should only have to calibrate once (assuming absolute / hall / onboard encoder), likely easiest to do so in the GUI.

3 - Calibrating with hard stops
I have hard stops in my assembly so my motor cannot do complete rotation (likely 4 rotations max). I know an instruction for GUI calibration is to ensure continuous rotation. How do I avoid this with having my hardstops?

The encoder calibration in the GUI only takes about +/- 1 rotation of the motor, so this should be fine. Usually we recommend disconnecting any load from the motor, assuming you’re using something other than an incremental encoder – that way the one-time calibration is as accurate as possible.

My CAN transceiver has not come in yet but I was thinking about starting coding. Will the complete workflow, syntax, etc. of the code change if I use USB vs CAN? Should I just wait to get the CAN items and them start?

Yes, it will. The behavior of the ODrive will be the same between USB and CAN, however the specific commands will be different. For instance, if you’re using ODrivetool over USB, and you want to set the velocity setpoint to 10 rev/s, you’d write something like:
odrv0.axis0.controller.input_vel = 10
But with CAN (assuming you’re using our Arduino library), you’d write something like:
odrv0.setVelocity(10.0);

5 - What is the CAN-USB thing on ODrive shop used for? I purchased it assuming I’ll need it .

That’s for communicating over CAN bus from a USB interface, like from your computer. It’s mostly used in case you have something like a Raspberry Pi which doesn’t have a CAN interface (unlike the Teensy) and you want to talk CAN from it. You can use it for debugging and monitoring the CAN bus, or experimenting with communications from your computer.

6 - How do I connect to the CAN port on the ODrive S1? what connector port is it?

There are CAN pins on both the S1’s main I/O connector (the big white one), as well as the two small 4-pin ones on the side. All the CANH/CANL pins are internally connected to each other (so each connector type is electrically identical), they’re just duplicated for more flexibility in wiring, as you can daisy-chain CAN devices together. We sell a CAN cable specifically designed for the 4-pin connectors on the side, but that’s just to make wiring easier – you can connect to either those connectors or to pins 1/2 (or 3/4, they’re identical) on S1’s main IO connector: ODrive S1 Datasheet — ODrive Documentation 0.6.11 documentation