Our system has two jobs: working out where the arm should go, and making the servos actually get it there. The ESP32 handles the second. Here's how the two sides talk to each other.
The planning code works in real-world millimetres on the paper. For each point on the path, it uses inverse kinematics(based on our measured arm lengths) to work out the angle for each joint, adjusts for each servo's individual calibration, and sends the angles to the ESP32 over a USB serial connection as a short text message.
We designed a simple set of commands:
- Move (B/S/E/G): set the base, shoulder, elbow and gripper angles. The move's duration is calculated automatically from whichever joint has the farthest to go.
- Timed move (T): the same, but with a set duration, for steady, evenly paced tracing.
- Home (H) and Stop (X): return to a safe position, or freeze in place.
The ESP32 moves each servo smoothly to its new angle, updating about 50 times a second, and only replies "done" once the move is actually finished. That means the planning code never has to guess how long a move takes: it just waits for the confirmation and sends the next one. If anything goes wrong, the arm goes to a safe "park" position (claw open, pen lifted, home) instead of freezing mid-move.
We also started with a different approach, fitting servo angles by moving the arm onto all 12 calibration dots by hand. Once we'd measured the arm's real lengths, we switched to direct inverse kinematics, which we verified against 500 random target points with zero error.
Shubhan Mital
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.