This is my custom designed and 3D printed 5-axis robot arm that I built to study the math behind forward and inverse kinematics, learn about communication protocols, but also because it was a fun design challenge! This project is very much a work in progress (the learning never ends), so I'll be updating the documentation over time.
This project was inspired by the famous LeRobot SO-101 in concept, but the design was completely done from scratch. The SO-101 robot was designed to be as simple as possible to get up and running quickly as it was primarily intended to be a machine learning tool, not a robot arm tutorial kit. Naturally, corners had to be cut to achieve that goal, such as rigid joints and longevity. No disrespect to that project though, it's an amazing product (as shown by its popularity).
Build DetailsMotors
This is actually my second attempt at building a robot arm. The first time I used simply hobby servos, but those are very limited in functionality (no feedback) and jitter the arm into space if you breathe on them too hard. When the LeRobot SO-101 started popping up on all robotics news media, I discovered a much better solution: smart serial bus servos.
These servos have speed control, position feedback, and many more features besides just being able to move to a commanded position. Of course, I had to try them out and this project was the perfect opportunity.
Joints
To add rigidity and smoothness to all the joints, I used ball bearings on the non-driven side of the servos. This supports each joint so that not all the weight is on the output shaft and gears.
Chassis
The entire body of the arm is 3D printed using PLA. Since I'm not expecting the arm to lift a large amount of weight for long periods of time or for many cycles, creep is not an issue. To balance the arm while it's moving, I have a box filled with sand in the base, which the base joint of the arm screws into. I will post a full BOM later on.
KinematicsNow here's where the fun (and pain) begins. In this project, I used the Denavit-Hartenberg (D-H) method of frame assignment and worked out the inverse kinematics analytically. This is generally the "entry point" into robot kinematics that's taught in school because it's simple in the sense that it just involves a massive amount of trigonometry, but isn't very heavy on the linear algebra.
The math was all done in Python using the Numpy library, which is very powerful for linear algebra.
If you're interested in learning how the inverse kinematics math works, leave a comment and I can turn my handwritten notes into a more useful guide.
Control Panel UIAs you can imagine, there was A LOT of debugging involved in this project. I found it annoying to constantly have to add/remove lines to move the robot a certain way to observe its behaviour and check the math. Eventually, I got fed up and decided to learn some C++ to build a GUI (graphical user interface) using the Qt framework.
The original intent of the GUI was to just provide some simple controls so I can move the robot in any direction and get position feedback, but what if I could also manually control each joint? And why stop there, I could also add a camera view for fun. Since I'm trying out these fancy servos with feedback, what if I could manually drag the robot to a position, read the servo positions, then save that position? Wait a minute, I just implemented a "teaching" feature! This is how the scope of this project spiraled out of control.
CommunicationThere are several components to this project:
- Control panel
- Robot control board
- Main controller (Python socket server, runs on local PC)
There are many more layers within those shown, which are documented in slightly more detail in the Github README.
If you're familiar with the Qt framework, then you're probably also aware that there's a Python wrapper for it. I bet you're wondering why I didn't just use that since I used Python for all the other components as well. The answer is simple: because I enjoy mental abuse and I wanted to learn some C++.
However, this came with its own challenges. To communicate between C++ and Python efficiently and elegantly, I had to create my own binary protocol. Check out my Medium article about binary protocols.
To Be ContinuedThis project expanded way beyond the original scope and I intend to keep adding more as I learn. If you have any suggestions for features, or would like an explanation for anything, feel free to leave a comment or reach out! Don't forget to check out my Github repository for this project as it contains more details on the implementation of the communication protocol.












Comments