Robotic arm project

Hello ODrivers! I bought my first ODrive a while ago but didn’t get to do a lot until recently. I also never imagined such a vibrant community forum.

I want to share my 6dof robotic arm. Before ODrive I used hall sensors and cascade PID loop with FF. I couldn’t get FF terms right for desired performance. But no need for that anymore. ODrive just blows my mind. its awesome!

For joints it uses 5 harmonic drives and planetary gearbox. I paid 120$ each for harmonic drives from ebay seller regardless of the model (private messaging). All the motors weren’t dual shaft, so I drilled and tapped the other end then extended the shaft using a grub screw, superglue and a shorter tapped rod.

To stiffen and provide support for glueing 3D printed parts, I made cavities for carbon fiber rods and
inserted them after applying superglue. Seems to work well for joining large prints. But it still needs to be stiffer. I am considering either sand casting+machining or carbon fiber/epoxy combined with 3D printed parts

Each joint has a tiny stm32f103 board that reads motor rotor position (AMT203) and joint absolute position (magnetic encoder) and sends it off to a CAN bus. These angles are then read and ‘encoder.config.offset’ are calculated and written manually(based on offset saved after motor calibration). I do this so that joints don’t have to move at all on startup and also because without shielding the encoder cables, Z signal quality was horrible. I don’t quite understand but its much worse compared to A/B. I am in the process of adding differential drivers to them.
I had trouble losing USB connection after running for a bit, but now with release of CAN feature, I have no issues communicating with ODrive.

After working on this project I now understand why so many people are interested in integrated single axis ODrive concept. There are just too many wires to route and too many tiny terminals to crimp! I want to workon single axis concept soon and hope I can collaborate with other community members.



3 Likes

Amazing looking project!

I’m interested in getting absolute encoder feedback up and running to avoid joint movement on startup for a project I’m working on. Can you clarify how you’re doing this?

It sounds like you don’t have your encoder hooked up directly to your odrive-board but instead are sending the Encoder Count constantly via the CAN bus - is that correct? How do configure the odrive to handle that?

Also what Harmonic Drives are you using!? I’d love to check out a cheap one for that excellent backlash performance.

Oh man, how did I miss this project before? That arm looks awesome! Do you have any video?

Great to hear that CAN is working well for you!

Hi Lewis, so in order to use absolute position on startup:

  1. do a full calibration sequence then save it.
  2. turn the motor by hand until encoder count is at zero. (encoder.phase should be almost zero as well, but I recall this wasn’t always the case not so sure why).
  3. now read the absolute encoder’s position and write it down somewhere. lets call this ‘zero_angle’.
  4. assuming motor has been rotated randomly and ODrive has just been reset, read the absolute encoder position. lets call this ‘current_angle’.
offset_angle = zero_angle - current_angle
if offset_angle < 0; offset_angle += encoder_cpr  // not strictly necessary
  1. write this offset: odrv0.axis0.encoder.config.offset = offset_angle
    set is_ready prop: odrv0.axis0.encoder.is_ready = True
    (is_ready might be readonly in older firmware, if so make it regular property)
  2. now you are ready to enter closed loop control. (I am doing step 5 using a custom CAN command added to the firmware)

And I don’t have the encoder directly connected to ODrive, tho it is possible (I just didn’t want to have more wires to route).
There is a working version using ODrive’s SPI and AMT203 in Wetmelon’s feature/amt20 branch (older commit somewhere around march of 2018 if I recall correctly). I’m guessing the contributors are working on some generic implementation that will work with many absolute encoders.

The harmonic drives I’m using are:
Joint1: SHG-25-50-2UH
Joint2: SHG-20-50-2UH
Joint3: SHG-17-50-2UH
Joint4: SHG-17-50-2UH
Joint5: CSF-14-50-2UH
Joint6: (planetary)
The SHG series are hollow shaft and has much higher backdriving torque than the CSF series. Seems like sizes 17 and 20 are very common in both SHG and CSF series than sizes 14 and 25. I bought all of these +more harmonic drives from this guy(ebay seller). I am of course looking for cheaper, open source alternatives too, but 3D printed split-ring compound planetary gears were just too noisy and my printer can’t print rotating parts that well.
Glad to meet someone working on a similar project!

@Wetmelon Thank you for all the features to make the projects possible! your feature/* branches are a treasure trove! Happened three times already turns out stuff that I want in ODrive next is already there in your fork :grinning: The endstop branch is next thing I’m incorporating. I just got to work on the gripper so I’ll post a pick n place video soon.

Hey naktamello,

Thanks for the guide!

My project is similar to yours in that absolute positioning of joints is a must and that several of the joints have finite range and so I’m a bit constrained on how uncontrolled the startup sequence can be. My joints must all be very backdrivable, however, so the gearing, if any, will be very minimal - so harmonic drives are out of the question for the moment, though, I am interested in them for future projects - thanks for the links!

I took a look at wetmelon’s AMT203 branch - it could be just what I need.

Amateur question: how do I go about implementing his AMT203 SPI support features into the latest main release of the odrivetool/firmware? ie how do I add/merge his feature with the latest branch in such a way that the rest of the code stays at the latest rev?

I’ll look into it on my own - but if you know how to do that I’d really appreciate a tip!

Do you have a repo for your project or are you keeping it private?

Thanks again for your engagement!

@Wetmelon
Here is a video of the arm. Might be a few days until I get to work on it again so I’ll just post it as is. It is using trap_traj(prevents arthritis in robots!) for movement and CAN for communication.

@Lewis_Siempelkamp
I see. I’m guessing maybe sort of walking robot? I’m interested in reading about it so post about it when you get a chance! as with AMT203 branch,
i think the follow commit is the working version:

784d7177eaf1a2a041a15403f522bf39845542e4

The encoder class has another property ‘amt203_config’ and you should set

odrv0.axis0.encoder.config.encoder_type = ENCODER_TYPE_ABSOLUTE_AMT203
odrv0.axis0.encoder.amt203_config.use_absolute = True

the changes are mainly in main.cpp (odrive_main), encoder.cpp (Encoder::setup()), and amt203.cpp/hpp. I think if you have the above configs set when ODrive boots up, Encoder::setup() reads the absolute angle and sets the offset. Its been a while for me so this is all I can say about it. Shouldn’t be too hard to get it working.

As for merging I’m not sure what the proper way is in this case. In VSCode you can install an extension called ‘Git History Diff’ so you can place the latest version and this commit side by side and manually copy stuff over.

the project is a personal hobby so there is no need to keep it private but it needs some organizing before it can be useful to anyone.

hope this helps,

1 Like

So nice. I have always been fascinated with 5-6dof arms.
I made this one a while back using SHG and CSF HD.

Once you use HD for joins you never wanna use any other type of reducers!

Here is a vid

2 Likes

How did I miss this project? Looks awesome!

I also made a 6dof robotic arm for my thesis with ODrives and ROS as the simulation software. I didn’t use harmonic drives, but dual planetary gear sets based on a design I found online. Now I am documenting everything to publish it soon on this community and other communities.

Here is a picture:

2 Likes

@Jamil84 lookin real smooth!

I fiddled around with 3d printed reducers for a long time until I found out used HDs were available. I might try chinese clones (~300$) from alibaba for next arm. I also noticed HD rips the 3D printed parts right through when you crash the robot!

@LowiekVDS, so nice to meet someone using ROS with ODrive robot arm! I look forward to reading about your project, and congrats on having done a thesis on a such exciting project. In fact I am considering the planetary gear with frameless motor for my next arm. I hope to get some ideas from your design.


I am also working on ros_control plugin for ODrive(odrive_ros_control) and will be posting here after more testing.

thanks for stopping by and sharing your projects!

3 Likes