BLDC Control ODrive-for-ARC


Skip to comments
robot video thumbnail
robot video thumbnail
robot video thumbnail

This is the setup for my Tarot 6S 4108 KV:380 BLDC motor to be used like any other servo in ARC...

It is just MY PERSONAL setup and meant to get you started, please READ THE manual over at the official Odrive website!

First you will need to install and configure your Odrive Software...
I am running Linux, please check the installation guide for Windows found at the official Odrive website if you are running Windows!
This will just be needed for the first time setup. After the setup you will use an Arduino connected to a Windows PC running ARC!

You should see your BLDC motor moving, after being put to closed loop and receiving the odrv0.axis0.controller.pos_setpoint command...

Next you will have to upload this code to your Arduino Uno

In ARC just add a servo control to your project, and connect to the Arduino!
The Arduino sketch will receive those servo positions and send them to the ODrive...

All non-power I/O is 3.3V output and 5V tolerant on input, on ODrive v3.3 and newer.

This tutorial is just meant to be a starting point, please mess around with my settings and share your experience, so we will get a better understanding on how this whole setup can be utilized!!:)

User-inserted image

By — Last update


Upgrade to ARC Pro

Get access to the latest features and updates with ARC Early Access edition. You'll have everything that's needed to unleash your robot's potential!

@ptp I am planning to design a bigger robotic arm and also a hip joint for ZOE, which will offer more torque and a more degrees of freedom...
I am about to do an assembly video of the gearbox and will make all those files available, if you are interested in building one for yourself!:)
I dont want to clog up this thread with more info..head back to robot dog thread...your gonna want to see this!
You can always clog my threads with god findings...happy that you do!

Here that assembly video one more time...I will upload all those files asap, if you guys want to give it a try!!!:)


This is very very good and also understandable video of PID control, if you are setting up your ODrive the

.controller.config.pos_gain = 20.0 [(turn/s) / turn]
.controller.config.vel_gain = 0.16 [Nm/(turn/s)]
.controller.config.vel_integrator_gain = 0.32 [Nm/((turn/s) * s)] 

are the values that you would want to tweak, when setting up your motor...the above video explains what they mean, and how they are used.
#16   — Edited
...That was a good video. I found Skyentifics description a bit better to understand in reference to position control...I also believe James B has a good explanation for how we are using it. In the case of MJBots dev kit...I find that playing with the "P" (proportional) of PID, affects the stiffness or compliance (springiness) of the motor on full stop or holding. And "D" (derivative) of PID, as dampening that motion. And James says stay away from "I" (integral) unless necessary.
That is funny, I think I watched most of Skyentifics videos, but cannot remember that it if you can find it!
Good you are having the MJBots dev kit, I will definetely also get one, to see the differences!

James B has so much stuff out there that I might have missed a few, but his and Skyentifics are really awesome channels...
#18   — Edited
Sure it starts...@ 7:30...
This is the MJ Dev Kit.
Ah, coooool this one is the newest...I did not check into it because I don't have the kit, but I will just watch it now to be up to date!:)
FYI to all, don't forget the Chinese New Year is coming sure to order all your testing stuff before then or you'll be waiting a long time for it.
Hi Mickey,
Did you ever make a video of the gearbox in action? I am curious what the vibrations are like at higher speeds.
In the firmware for the set servo position, don’t you want to map 180 not 100? Because ARC will by default send 180 servo position degrees 


odrive.SetPosition(0, map(pos, 0, 100, 0, 180000));

Should be...


odrive.SetPosition(0, map(pos, 1, 180, 0, 180000));

also, that code will only move one osdrive and no pwm servos. If you simply add an IF condition to make d0 the o drive, the rest could still be pwm servos.
#25   — Edited

@Perry_S this is a clip of the gearbox being controlled with ARC! I will make a torque, speed and precision test soon...:)
@DJSures thanks a lot for looking at my code, I might have just typed those numbers wrong, this was more or less just a proof of concept and meant to be developed that time nobody seemed to be interested so I kind of forgot about it!:)
But since the firmware update of the Drive, the whole code would need to be updated anyways...

So I guess if there are a bunch of people being interested, we could think about doing so?

I think at the moment there are a few options for BLDC control being discussed here in the forum...
Can you adjust the velocity, set positions etc in ARC in your video example? What changed in the Firmware update?
Hey, this should be possible...all you would need to do is to adjust the Arduino code!
I think @DJSures would take a look in case there are a few requests?

These are the changes

But you might want to go ahead and setup your motors once again so everything runs as smooth as possible...
I revisited my settings too and started from scratch!:)

Oh also I found that GUI now, that a nice thing to have...
Thanks for pointing it out to me, I guess they are not advertising it too much since it is still in beta!
Yah we can whip up a firmware once you're ready. And a robot skill that allows fine tuning the specs & details of the servo.
#31   — Edited rush, it only makes sense once there is a real usecase scenario!:)