3-DOF Robotic Arm with Inverse Kinematics
Arduino-powered robotic arm with analytical inverse kinematics and interactive 3D control dashboard
Project Overview
This project implements a robot arm control system which can be controlled with a desktop program that doubles as a visualization. The Arduino runs real-time inverse kinematics that converts 3D coordinates to joint angles and controls servos with smooth interpolation. What makes this project unique is the custom desktop dashboard built with Raylib that provides interactive 3D visualization - you can literally click and drag the end effector in 3D space, and the physical robot arm moves to match.
The system achieves ±2mm positioning accuracy across a 210mm workspace using a inverse kinematics solver I did the math for. The Arduino program also implements path planning through 3D space to make smooth movements. 20 in-between positions are interpolated in order to produce fluid motion, while the desktop GUI provides intuitive drag-and-drop control alongside precise numerical coordinate input. Serial communication at 115200 baud connects the desktop to the Arduino and is then parsed into commands by the Arduino.
Technical Implementation
- Inverse Kinematics Engine: Custom geometric solution using law of cosines and triangle decomposition for 3-DOF manipulation with ±2mm accuracy over 210mm workspace
- Interactive 3D Dashboard: C++/Raylib desktop application with real-time 3D visualization, drag-and-drop end effector control, and orbital camera for inspection
- Smooth Motion Planning: Cartesian-space linear interpolation with 20-step path generation creates straight-line trajectories and fluid movement
- Hardware Integration: PCA9685 16-channel PWM driver via I²C provides 12-bit servo control resolution; 3× MG996R servos powered by dedicated 5V/3A supply
- Safety Systems: Workspace boundary validation, self-collision prevention via elbow angle constraints, and per-servo calibration for accurate positioning
- Dual Control Modes: IK mode for position control via 3D coordinates, manual mode for direct servo angle control during testing and diagnostics
Key Challenges
Building the GUI was a major learning curve since I wanted an experience similar to professional 3D modelling software. I had to implement ray casting to convert mouse clicks into 3D world coordinates, handle orbital camera controls with quaternions, and render the arm in real-time while maintaining smooth serial communication. The trickiest part was making the drag-and-drop feel natural which required constraining the end effector to the robot's reachable workspace while the user dragged it around. If they tried to move it somewhere impossible, the system had to smoothly clamp to the nearest valid position rather than just failing.
On the embedded side, debugging the inverse kinematics was challenging. Small errors in the geometric derivations would cause the arm to move to incorrect positions. I had to carefully verify each step of the mathematical solution and add elbow angle constraints to prevent self-collisions. The interpolation system also required careful tuning to not feel too sluggish or jerky that caused instability.