CNC controller and Odrive

Hey, thinking about switching to odrives for my cnc-build and need some help to start out. Is there any other way of controlling the odrives from a cnc-controller then to use the step/dir interface? And are there any disadvantages by using step/dir to control the odrives?

Hi there!

This definitely depends on the CNC controller itself. We support UART and CAN bus (as well as USB and STEP/DIR). If your CNC controller is flexible and programmable, then either UART or CAN is great, as it supports high bandwidth bidirectional communication, and you can couple that with things like velocity/torque feedforwards. That being said, I think this is pretty uncommon, and STEP/DIR works just fine. Really the only main disadvantage is the fact that you don’t get digital feedback from the ODrive, e.g. actual encoder position, motor temperature, etc. But we have plenty of people just using STEP/DIR for CNCs or 3D printers, and it works great for their application!

Thank you for your answer! So with step/dir, the controller treats the odrive as a stepper motor, and the odrive takes care of the position control on its own? Would it be right to assume that I would get a more robust solution by using odrive then a regular stepper motor which can loose steps due to big loads etc? Would the controller on the odrive prevent this?

So with step/dir, the controller treats the odrive as a stepper motor, and the odrive takes care of the position control on its own?

Exactly!

Would it be right to assume that I would get a more robust solution by using odrive then a regular stepper motor which can loose steps due to big loads etc? Would the controller on the odrive prevent this?

Yup! The main thing to note is that the positioning resolution the ODrive can achieve is typically directly proportional to your encoder resolution. My rule of thumb is that you can typically maintain a position hold down to about +/- 10-20 counts, so for e.g. a 16384 CPR encoder, that would translate to a positioning resolution of about 20/16384 * 360 = +/- 0.44° (worst case, under transient load).

One follow up question, would this work with hall encoders? Or would the resolution not be accurate enough? An are the steps per rotation proportional to the resolution of the encoder?

I’d definitely say halls aren’t whatsoever high enough resolution – we usually recommend against them for any sort of position control – e.g. a 7 pole pair motor w/ halls would have an “encoder resolution” of 6*7 = 42 CPR, which given my previous rule of thumb of maintaining a position hold down to +/- 10-20 encoder counts, would be 85-190° :slight_smile: not great!

However, halls would be more fine if either you have some massive gearbox, or you have an additional high resolution encoder or linear scale.

An are the steps per rotation proportional to the resolution of the encoder?

By this I assume you mean step/dir to angle mapping? Those are arbitrary, set by steps_per_circular_range (Step/Direction — ODrive Documentation 0.6.11 documentation)