Questions about closed loop control and control mode

Hello everyone,

I ran into some problems while testing Odrive.

First, sometimes, when I requested closed_loop_state, the motor will start rotating without any other commands. When I then try to talk to odrive using either position control or velocity control, the motor no longer respond. But no error is shown. How could I solve this problem?

I am working on an Arduino project and running Anaconda prompt to debug; is it possible that this is the reason? Plus, I found odrv0.axis0.controller.config.control_mode to be 3 for both position and velocity control mode. Is it correct?

I really appreciate your help!

If the motor starts rotating immediately, it may be the case that pos_setpoint didn’t match pos_estimate or that vel_setpoint wasn’t 0 when in velocity control mode.

What commands did you exactly put in? Keep in mind that position is expressed in counts (so it is not rare to have 8192 counts for 1 full rotation) and the velocity is expressed in counts/second.

Thank you for your reply. I think you are right. I was controlling motor using both Arduino and Anaconda Prompt, so there might be a mismatch. I tried it again today and it works.