🎯 Robotics & Motion ⏱ 11 min read • Updated 2026-10-26

Machine Vision Fiducial Alignment: Camera-to-Stage Affine Calibration & Pivot Offset

Engineering guide to dual-camera fiducial mark alignment, pixel-to-millimeter affine transformation matrix calibration, camera mounting angle compensation, and iterative closed-loop visual servoing.
Interactive Workstation Available: Test the protocols and algorithms covered in this guide live in your browser using UVW Stage 3D Kinematics Twin.
Launch UVW Stage 3D Kinematics Twin ➔

In automated precision assembly and lithography alignment machines, two high-magnification telecentric cameras (Left Camera $C_1$ and Right Camera $C_2$) inspect fiducial marks on a work substrate resting on a 3-DOF UVW stage. However, cameras measure mark deviations in image sensor pixels $(u, v)$, whereas the stage controller moves in physical millimeters $(X, Y)$ and degrees $(\theta)$.

If a camera is mounted with even a $0.5^\circ$ mechanical tilt relative to the stage axes, or if the mechanical center of rotation $(X_R, Y_R)$ is offset from the camera baseline midpoint, an open-loop alignment move will miss the target by tens of microns. This guide presents the complete mathematical calibration procedure for dual-camera vision alignment systems.

1. Pixel-to-Stage 2D Affine Transformation Calibration

Each camera $k \in \{1, 2\}$ has its own optical scale factor ($s_x, s_y$ in mm/pixel), sensor mounting rotation ($\alpha_k$), and possible lens shear. Rather than assuming ideal orthogonal axes, a 9-Point Step Calibration moves the stage through a $3 \times 3$ grid of known physical offsets $(\Delta X_j, \Delta Y_j)$ while recording the observed pixel shifts $(\Delta u_j, \Delta v_j)$.

Solving the overdetermined linear least-squares system yields the $2 \times 2$ Pixel-to-Millimeter Jacobian Matrix $M_k$ for camera $k$:

$$\begin{bmatrix} \Delta X \\ \Delta Y \end{bmatrix} = M_k \begin{bmatrix} \Delta u \\ \Delta v \end{bmatrix} = \begin{bmatrix} m_{11} & m_{12} \\ m_{21} & m_{22} \end{bmatrix} \begin{bmatrix} u - u_{\text{ref}} \\ v - v_{\text{ref}} \end{bmatrix}$$

For an ideal unrotated camera with resolution $p\text{ (mm/px)}$ and inverted $Y$-down image coordinates, $M_k = \text{diag}(p, -p)$.

2. Determining the True Center of Rotation (3-Angle Circle Fit)

When the stage rotates by an angle $\Delta\theta$, any fiducial mark on the substrate traces a circular arc around the stage's physical center of rotation $C_R = (X_R, Y_R)$. To find $C_R$ in camera coordinates:

  1. Step the stage to three or more rotation angles (e.g., $\theta = -1.5^\circ,\ 0.0^\circ,\ +1.5^\circ$) with $X = 0, Y = 0$.
  2. Convert the three observed fiducial positions into millimeter coordinates $P_1, P_2, P_3$.
  3. Compute the circumcenter (or Kåsa algebraic least-squares circle fit) of the points $(P_1, P_2, P_3)$ to obtain the exact pivot offset $(X_R, Y_R)$ relative to the camera's optical center.

3. Dual-Camera Fiducial Error Pose Calculation $(\Delta X, \Delta Y, \Delta\theta)$

Suppose two fiducial marks are separated by baseline vector $\vec{B}_{\text{ref}} = P_{2,\text{ref}} - P_{1,\text{ref}}$ when a golden master substrate is placed at the taught target position. When a new unaligned part arrives, Left Camera 1 and Right Camera 2 measure the current mark positions $P_{1,\text{cur}}$ and $P_{2,\text{cur}}$ (converted to global stage millimeters):

// 1. Current & Reference Baseline Vectors between Mark 1 and Mark 2
const dx_ref = P2_ref.x - P1_ref.x;
const dy_ref = P2_ref.y - P1_ref.y;
const dx_cur = P2_cur.x - P1_cur.x;
const dy_cur = P2_cur.y - P1_cur.y;

// 2. Angular misalignment dTheta (exact atan2 cross/dot product)
const angle_ref = Math.atan2(dy_ref, dx_ref);
const angle_cur = Math.atan2(dy_cur, dx_cur);
const dTheta = angle_ref - angle_cur; // Required correction rotation

// 3. Predict where Midpoint M_cur moves after rotating by dTheta around Pivot C_R
const M_cur_x = 0.5 * (P1_cur.x + P2_cur.x);
const M_cur_y = 0.5 * (P1_cur.y + P2_cur.y);
const M_ref_x = 0.5 * (P1_ref.x + P2_ref.x);
const M_ref_y = 0.5 * (P1_ref.y + P2_ref.y);

const rx = M_cur_x - CR.x;
const ry = M_cur_y - CR.y;
const rotated_Mx = CR.x + rx * Math.cos(dTheta) - ry * Math.sin(dTheta);
const rotated_My = CR.y + rx * Math.sin(dTheta) + ry * Math.cos(dTheta);

// 4. Required Stage Translational Correction (dX, dY)
const dX = M_ref_x - rotated_Mx;
const dY = M_ref_y - rotated_My;

4. Closed-Loop Visual Servoing Convergence

Iteration Step Typical Residual Error Physical Cause of Residual & Control Action
Initial Placement (Pre-Align) $\pm 1.5\text{ mm},\ \pm 1.2^\circ$ Mechanical pick-and-place vacuum gripper tolerance.
1st Alignment Move (Coarse) $\pm 8\ \mu\text{m},\ \pm 0.005^\circ$ Eliminates 99.5% of error; small residual remains from lens distortion at FOV edges and ball-screw backlash.
2nd Alignment Move (Fine Trim) $< \pm 0.5\ \mu\text{m},\ < \pm 0.0008^\circ$ Marks are now near the optical center of the telecentric lens where distortion is zero; converges within tolerance.

Frequently Asked Questions (FAQ)

Q. Why are telecentric lenses used in precision UVW stage alignment cameras?

Telecentric lenses have parallel chief rays (zero perspective magnification change), ensuring that slight vertical Z-height variations in substrate thickness do not shift the apparent X/Y pixel coordinates of the fiducial mark.

Q. Why does a vision alignment system usually execute 2 iterations (Coarse + Fine) instead of 1?

On the first capture, the fiducial mark sits near the outer edge of the camera field of view where optical distortion and calibration error are highest. The first move brings the mark to the optical center, allowing the second fine trim move to achieve sub-micron accuracy.

Q. How far apart should the two fiducial marks be placed on a panel or wafer?

Maximizing the baseline distance L between the two fiducial marks minimizes angular measurement noise, since angular uncertainty scales inversely with baseline length: sigma_theta ≈ sqrt(2) * sigma_xy / L.

Q. What happens if camera mounting rotation is not calibrated in the 2x2 affine matrix?

A pure X error in camera pixels will command a coupled Y movement on the stage, causing spiraling oscillation that requires multiple extra iterations to converge.

📘 Complete Engineering Guides Directory (16 Technical Articles)