SCARA Arm Calibration

Project brief

Project Overview
A six-parameter calibration solver that brought SCARA arm positioning to a 200 µm target for shared 3D printing.
My Contribution
Built the Python solver that fits six arm-geometry parameters from measured reference points.

The Problem

Multiple SCARA arms needed to print on the same build surface without gaps or layer shifts where their paths met. Small errors in link lengths, joint references, or base position displaced each print head. The calibration target was 200 µm (0.2 mm) positioning accuracy.

Animated SCARA arm tracing a path and showing its joint geometry

The Engineering

I built a Python calibration solver around paired target and measured X–Y positions. It uses the nominal arm geometry to infer joint offsets at each reference point, then fits six physical parameters: two link lengths, two angle references, and the base X–Y position. The solver repeatedly predicts each point’s position and reduces its error against the target, producing corrected parameters for the motion model.

Planar SCARA model labeling the base, proximal and distal links, and joint angles
The model treats the arm as two rotating links. Their lengths and angles, together with the base offset, determine the print head’s X–Y position.

The example input pairs each target X–Y position with an arm measurement and the nominal geometry. Inverse kinematics estimates the joint angles at each measured point, and the solver keeps those offsets fixed. Forward kinematics then predicts the target positions while bounded updates fit the two link lengths, two angle references, and base X–Y position to reduce squared position error.

Original four-point objective from the project image. The linked Python solver now minimizes squared X–Y residuals.

The fitted parameters can replace the nominal geometry in the arm’s motion model. The animation below exposes those same variables, showing how each one changes the predicted print-head path and the square it draws.

Interactive forward kinematics

Watch the arm draw a square

A forward-model simulation of the square, not a robot recording. Change a parameter to see its effect.

SCARA arm drawing a squareA blue proximal link and rust-colored distal link move the print head around a square. The current proximal angle is 63.7 degrees and the current distal joint angle is 142.5 degrees. A dashed outline is the target; the green path is the square predicted by the adjusted arm.XYBaseθp 63.7°θd 142.5°Print head
Proximal Distal Base Target Drawing
Joint angles
θp 63.7°θd 142.5°
Print head X, Y50.0, 50.0 mm
Drawing error
Now 0.00 mmMax 0.00 mm

Model parameters

01 · Base position

Move the whole arm
150.0 mm
+0.0 mm
-50.0 mm
+0.0 mm

02 · Proximal link

Base to elbow
220.0 mm
+0.0 mm
-49.0 °
+0.0 °

03 · Distal link

Elbow to print head
220.0 mm
+0.0 mm
166.0 °
+0.0 °

Proximal length: Extends or retracts the blue link from the base to the elbow.

The Results

Calibration improved positioning accuracy 50× and met the 200 µm target. In the grid traces below, the uncorrected arm bends lines that should be straight and shifts their intersections. With the calibrated parameters, the pattern is straighter and more consistently aligned. This accuracy allowed multiple robots to work on the same printed object without visible seams or layer shifts where their paths meet.

BeforeSCARA arm line traces before calibration showing mechanical error
Before calibration, the arm traces curved, misaligned grid lines.
AfterSCARA arm grid alignment after calibration showing precise straight lines
After calibration, the arm traces straighter, better-aligned grid lines.

The plots below show what the solver did during a four-point sample run. The position-error chart compares the error at each reference point before and after fitting, while the convergence chart follows the RMS error through accepted updates. Together, they show how adjusting the arm geometry brought the predicted positions closer to their targets.

Logarithmic chart comparing each sample point's position error before and after fitting
On the four fitted reference points, model RMS error fell from 1.1236 to 0.0137 mm. This fit residual is distinct from measured arm positioning accuracy.
Chart of RMS position error declining through accepted calibration updates
Sample solver run: RMS error from nominal geometry through each accepted calibration update.

View code on GitHub