Trying to control 2 pieces of Odrive by ascii commands through UART with Arduino. I am aware that there is some Arduino Library for Odrive on Github but it didn’t work on my project until I made plenty of changes to it.
(Like, Odrive seems to ignore the commands randomly, so I had to repeat each of the write/read commands for a couple of times to achieve stability. )
Now I need to read the encoder positions/velocities continuously under the closed-loop control state. However, when I tried to, the encoder feedback became frozen and doesn’t change anymore, even when I twisted the motors manually. What’s worse, the Odrive would enter some kind of unknown status and I was not able to idle the motors anymore. It would be stuck and the only thing to do is to reboot the power source.
But if it’s under the idle state, the encoder feedback would work normally.
if I don’t try to read the velocities or positions, the odrive would be able to fall back to idle state when requested.
What can I do about this situation?
The 2nd problem is about current-control mode. As the documentation said,under the closed-loop state I need to send the command “w axis.controller.config.control_mode 1” to corresponding serial port, but it’s not working, neither. Actually the "w axis.controller.current_setpoint " command would still cause some movements on the motors even without the current mode requested. It’s really confusing and I really can’t solve the problems on myself anymore. Could anyone be so kind to give some tips on these?
Thank you bros in advance