Yahoo Groups archive

Homebrew_PCBs

Index last updated: 2026-03-31 23:13 UTC

Thread

CNC calibration - an alternative approach

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

Re: CNC calibration - an alternative approach

2005-07-06 by Brian Chapman

David,

Can I make a stab at this?

First, though, what is the thickness of the PCB you mention?

Often, I do the following to locate, and re-locate when necessary,
work pieces atop the mill table:

In the CAM drawing (I import CAD .DXF drawing into CAM software for
G-code processing), I'll draw a bounding box around the work piece (in
this case, using the PCB's actual size) so that when this box is cut
and removed, the PCB drops into the vacated space. For me, this has
been a dead-on, precise fit -- absolutely no wiggle room (initially, I
was surprised at how tight this fit actually was).

From this point, since the bounding box is part of the coordinate
system used to position the cutter/drill, after touching off the Z
axis (at zero), you're good to go.

This has always worked extremely well, too, when a workpiece has to be
repositioned, for example, to mill on the reverse side of the workpiece.

I often use mill tabel double-sided tape to fixture pieces in place.
Johnson Plastics (http://www.johnsonplastics.com/), for instance, has
3/4" wide double-sided tape that is sticky, sticky, sticky. . . .

Hope I accurately caught the drift of your post and this information
is relevant.

-Brian

Brian Chapman
Evansdale, Iowa


---

Re: [Homebrew_PCBs] Re: CNC calibration - an alternative approach

2005-07-06 by David McNab

Brian Chapman wrote:

> First, though, what is the thickness of the PCB you mention?

board is 1.6mm thick.

> In the CAM drawing (I import CAD .DXF drawing into CAM software for
> G-code processing), I'll draw a bounding box around the work piece (in
> this case, using the PCB's actual size) so that when this box is cut
> and removed, the PCB drops into the vacated space. For me, this has
> been a dead-on, precise fit -- absolutely no wiggle room (initially, I
> was surprised at how tight this fit actually was).

Nice

>>From this point, since the bounding box is part of the coordinate
> system used to position the cutter/drill, after touching off the Z
> axis (at zero), you're good to go.
>
> This has always worked extremely well, too, when a workpiece has to be
> repositioned, for example, to mill on the reverse side of the workpiece.

Again, nice.

Show quoted textHide quoted text
> I often use mill tabel double-sided tape to fixture pieces in place.
> Johnson Plastics (http://www.johnsonplastics.com/), for instance, has
> 3/4" wide double-sided tape that is sticky, sticky, sticky. . . .
>
> Hope I accurately caught the drift of your post and this information
> is relevant.

Hi Brian,

Your ideas are valuable, and something I'll definitely think about as my
CNC evolves.

I did consider using a physical box on the CNC carriage for precise
location of the workpiece, but with my present situation I can't yet see
a time saving coming from it.

For a workpiece placement box to be effective, the board needs to be
precision cut, and the artwork on the board needs to be precisely
located relative to the board's physical edges.

Presently, I'm cutting boards by hand with a fretsaw or a powered
jigsaw, and even with my most careful cutting efforts, and my most
careful efforts in heat-transferring the artwork, I'm still prone to
translational/rotational errors that would see some some holes moving up
to a couple of millimetres - disaster.

With my primitive non-workshop situation, the interactive calibration
scheme is working best - holes are ending up within 0.04mm of their
targets, which is an acceptable margin. I can relax while
heat-transferring the artwork and cutting the boards, because the
interactive calibration ond the geometry code wipes out all the errors.

However, if/when I add board milling functionality, I'll definitely look
into putting a placement jig on the carriage, most likely just a
corner-alignment scheme, so my only worry then will be cutting the
boards with a reasonable 90deg angle.

BTW - I'm exporting the drill files from Eagle via an Eagle ULP (script)
which writes out the holes in Python syntax, ready for import to my
Python CNC host program. If anyone would like this short script I'd be
happy to post it.

--
Cheers
David