High Five Robot with current (force) feedback

Hello,

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
odrive.SetPosition(0, 100000.0f);
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”;
odrive.readFloat()

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?

Thanks and best regards!

Very cool!

Serial1 << “r axis” << 0 << “.motor.current_control.Iq_measured\n”;
odrive.readFloat()

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?

1 Like

Thank you for your reply. I will try to find a logic analyser and to check where is the problem.

Hi,

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.

Hi,

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 glad your project works well! But some people like me have a problem about UART.


Have you met the same problem? What’s your Odrive version you are using? Mine is 3.4.

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:

THANKS! I will try it later. But maybe v3.5 don’t have this problem. Who knows:joy:

Here is the video about the Force Feedback, and how I increased the frequency of the communication between Arduino and ODrive for this current feedback (by making changes in the Firmware). Force (Current) Feedback: two times speed increase!