I’ve decided to build a High Five Robot using ODrive and brushless motor. The idea is to use current feedback in order to detect the force. In other words the idea is to build 1 degree of freedom robotic arm, which will slide the 3d printed hand, and as soon as the arm slaps with obstacle (a human hand) it will go backward. I hope I explained it well. I’ve managed to build the first prototype and it works decently well. (check out my youtube: DIY: High Five Robot (Brusless Motor + ODrive + Arduino)
I use Arduino for my project. And with Arduino first I send a command to set a new position
to start to move. And afterwards I check the current on motor in a loop with
Serial1 << “r axis” << 0 << “.motor.current_control.Iq_measured\n”;
But for me at looks like Arduino does not check the current very fast (or maybe ODrive cannot provide fast current measurements). Does anyone know how the current feedback should be made properly?
That is the basic way of doing it, I think it should be very fast on the ODrive side. I don’t know maybe the Arduino has some issues with it or maybe sending the long ascii string takes a while on 115200 baud. Do you have a logic analyzer to check who is being slow?
I did not find any logic analyser. But I found an oscilloscope. So I connected Rx and Tx to the oscilloscope. The yellow signal is what Arduino sends to ODrive, and the pinkish-red signal is what ODrive reply to Arduino. Thus entire cycle which check the current is around 5ms. This is very fast!!!
From this 5ms cycle, 3.6ms goes to send: “r axis0.motor.current_control.Iq_measured\n”, around 0.4ms is the time before ODrive start to respond, and around 1ms goes to send the response from ODrive to Arduino.
It seems to me that most of the time of this cycle is just spend to send this very long command: “r axis0.motor.current_control.Iq_measured\n”. So may be if it is possible to change firmware to dedicate very short command for this, like just one lettre command? If I understand correct this will reduce the time cycle by two times.
I managed to change the firmware to make shortcuts for Arduino to monitor the current much faster! I will post the video about this in couple of days. With the shortcuts the time needed to check the current on ODrive is reduced from 5ms to 2ms.
I am using ODrive 3.5 version, 24 volts. And it works just fine. You can check the my videos on youtube, I explain there how I build the project. But basically I followed instructions from ODrive robotics website. You can check my video here: https://youtu.be/qTVohNscEmM. There are also couple of other videos about ODrive there.
The only thing which I changed, I add a delay at the beginning of the Arduino program, because I switch on the Arduino and ODrive at the same time, and I want to give a time to ODrive to be ready to accept commands from Arduino: