A 4DoF Robotic Arm
Ongoing independent project · Mechanical design, servo control, kinematics, simulation
GitHub RepositoryObjective
A robotic arm project built to work through the full mechatronics stack including mechanical design, closed-form kinematics and low-level motor control, paired with a MuJoCo model. The two run parallel. The simulations where the control strategies get iterated on and the hardware is where the model’s assumptions get tested against backlash, dead-band and saturation.

CAD Model of Arm

Robotic Arm
System Overview
Hardware
I went through two SolidWorks iterations. Prototype 1 used laser-cut acrylic and 3D-printed links. Prototype 2 is fully 3D-printed and smaller, which reduced inertia and simplified assembly. Prototype 1 showed structural resonance in testing, and servo dampers and foam damping measurably reduced the vibration.
The power board is a custom distribution board for a 2s2p Li-ion pack. It uses dual buck converters for load sharing and has decoupling at each IC. I added bulk capacitors after seeing voltage dips during fast motions.
For actuation, I removed the internal controller boards from the MG995 servos because they were tuned for low-inertia loads. The motors now run through a DRV8833 H-bridge with a custom PID loop that uses the servo’s internal potentiometer for feedback.
I derived a closed-form IK solution for the 4-DOF layout by extending the 2R planar-arm equations, since no general solution existed online. I validated it in Desmos and against a Simulink numerical solver. It runs fast enough for real-time control on an Arduino Uno.

Power Distribution Board
Simulation
I built a digital twin of the arm in MuJoCo to simulate different control strategies.
As a first test, I used a simple damped least-squares Jacobian IK and analytical IK to make the simulated arm draw a circle.
The main reason I moved to simulation is hardware. The motors need two PWM pins each, so three of them use six pins, and an Uno has only six PWM pins in total. A servo can be driven from any digital pin, but the Servo library uses the same timer that generates PWM, which interferes with the motor outputs.

Tracking path and error in MuJoCo
Design decisions
- Hardware: the stock servo tuning didn’t match the load, so I removed the internal controller and built an external PID.
- Hardware: the first prototype’s inertia and vibration led to a lighter redesign plus damping.
- Hardware: I used analytical IK because the Uno needed the runtime speed.
- Hardware: parallel buck converters and bulk capacitors give load sharing and voltage stability.
- Simulation: I moved to numerical IK once iteration speed became the bottleneck.
Future work
- Bring up all four joints, including the multi-servo driver circuit so a single Arduino Uno can control them.
- Finish the tracking error analysis (commanded vs. simulated vs. real).
- Extend trajectory generation beyond shape drawing to general path planning.