3D Printer with X stepper and Y Odrive D5065 w/AMT encoder using step/dir

I need help tuning an Odrive for step/dir control of a D5065.

I’ve built a 3D printer that I’m testing Odrive on. To do this, I’ve swapped out the Y-axis stepper for an odrive3.6 with a D5065 and AMT 102 encoder, same ones as in the Odrive store. My 3D printer control board (duet WiFi) is sending step/dir via its expansion header to the Odrive via a twisted pair. As far as I can tell, this is working fine.

My problem is this: the motor’s responsiveness to step/dir control is too slow. It’s not tracking with the stepper on the X axis. Instead of producing linear trajectories, it’s producing bezier curves. I don’t think this is an issue with lag between the controller and the odrive. Initiation of moves, requiring both the X stepper and the Y Odrive seem to happen at the same instant, as evidenced by 3D prints. I essentially need the Odrive motor to spin up and stop as quickly as possible. As much as I dislike this solution, I need the motor’s velocity/acceleration to be handled by the 3d printer controller.

Any suggestions for how to actually tune the motor’s position control (I’m assuming I need to tune current control) to get it to act more like a stepper?

You’ll need to increase the position control gains (controller.config.pos_gain) until it behaves how you want. Also, make sure you have your controller.config.counts_per_step set correctly (the default is 2, but you may elect to change your microstepping and your counts_per_step to achieve better pulse rates from the controller)

I forgot to mention, if you really want to reduce the lag you need to send the ODrive the velocity and current feed forward terms. Or use a newer branch like my RazorsEdge branch that generates those terms automatically based on the step rates, via the “input filter”


Thanks! Is there a location I can read about the meaning/effect of, velocity/current feed forward terms? And where can I read about the position gain? I’ve got the steps configured correctly. I’m going to try these changes out in the next day or so.

torsenRED, please post updates when you get it to work!
Here is a related post on this topic.