Yahoo Groups archive

Homebrew PCBs

Index last updated: 2026-04-05 19:38 UTC

Message

CNC calibration - an alternative approach

2005-07-06 by David McNab

Hi all,

I was tackling the challenge of mounting the pcb on the CNC carriage for
drilling and getting it perfectly aligned, trying to get holes that line
up perfectly with the artwork.

Some problems happened on the mechanical front, which were proving
catastrophic. As little as 1mm shift meant the drill didn't go through
the centre of the pad, instead it found a nearby trace to sever! :(

So a simple mathematical approach came to mind.

Result is that I can now:
 - stick the board anywhere on the carriage with blue-tac (aka
   'silly putty')
 - in response to host prompts, use the CNC keypad to position the
   drill above the bottom-left-most pad, then above the
   bottom-right-most pad
 - enjoy an the holes are correctly positioned

This is working accurately, even if I stick the board down sideways,
upside down or at a diagonal. The interactive board calibration
procedure takes about 20 seconds.

Algorithm is:
 - read in the holes file
 - compute a bounding box for all the holes
 - find the bottom-left-most and bottom-right-most holes, (xL,yL)
   and (xR,yR)
 - convert all xy drill points into relative cartesian coordinates,
   expressed as distance to the left of and above the
   bottom-right-most hole - (xi',yi') = (xR-xi, yi-yR)
 - convert the vector defined by (xL,yL)->(xR,yR) into polar
   coordinates, (r0, theta0)
 - prompt user to move CNC carriage to position hole (xL,yL)
   under the drill, read coords from CNC as (xLcnc, yLcnc)
 - ditto for (xR,yR)
 - derive another vector from these two points, expressed as
   polar coordinates (xRcnc, yRcnc)
 - from these two vectors compute:
    - net angle of the board on the CNC carriage
    - scaling factor - mm on host to stepper pulses on CNC
 - for each drill point (xi, yi):
     - convert vector (xL, yL)->(xi,yi) to polar coords
       (ri,thi)
     - apply board rotation and scale factors to convert
       vector to absolute CNC units
     - convert this vector to CNC cartesian coordinates
     - move to that point, and drill through the board

-- 
Cheers
David

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.