Since I started making my own PCB I always complained how boring and tricky is hand drilling all the holes in the right place. Owning a CNC router I could have the work done in a hurry neverthless I prefer etching my own boards and have the drills done by the router. The main problem is how tricky is aligning the board under the machine, furthermore there may be some scaling problem related to the master mask precision. Thus I started coding a little tool which could help me in this process allowing me to not care about all the stuff I just explained above. The goal is to compute a new gcode given the real coordinates of some known holes. Linear algebra here comes in help, in particular here we are doing an affine transformation of the plane. Known three points is quite simple to find the transformation matrix: let be the following matrix

, , ,

Where every column is the vector representing the respective point. To represent affine transformation with matrix we can use homogeneous coordinates, thus a 2-vector is represented as

Let be the matrix representing the three points original coordinates:

, , ,

The transform matrix is simply the matrix multiplication of and the inverse of

Now we can obtain the new point’s coordinates just right multiplying to our vector

Referring to my setup, a camera is attached near the spindle to allow me for detecting the holes coordinates relative to my machine axis. Hence the translation vector represent the distance between the camera center and the spindle’s axis. The tool I coded simply allow to load a gcode file and input the real coordinates in a popup windows which shows up when we select a point. After choosing three points all we need to do is to compute the transformation and save the gcode. In the next article I’ll show how everything works.

AnnirakThis is a great first step, but it can be improved. The commercial PCB manufacturing industry uses fiducial markers to deal with issues similar to this. Fiducials are more for positioning of fine-pitched components, but they would allow for similar compensation on a project like this. It does take some more hardware and software, however.

First, a camera has to pass over the each expected fiducial location and determine an offset, optionally repeating the process until the alignment is corrected. Using this as a starting point, it’s possible to calculate transform matrices between the fiducials in much the same way as you are doing with the existing holes.

The benefit is that this automates the entire procedure.

Dru Nelsonyeah, agreed you need a camera and some OpenCV

alex89rmPost authorYou are totally right, I’m playing around OpenCV to have a completly automated procedure ! 😉

Regards

AbhishekHi, Have you done with the part 2? Also would like to know if you succeeded as I am working on the same thing.

alex89rmPost authorHi, the second part will come up in the next few days ! 😉

Guilherme SchallenbachAre you drilling the board after the etching/masking process?

I always thought doing it beforehand: Drilling >> Etching >> Masking (solder mask), so you can use the pre-drilled holes to align the circuit to be etched/masked.

alex89rmPost authorYes, I do drilling just after the etching process

Pingback: Dejar [Euler] ayudar con la fabricación de PCB - | Indagadores |Seguridad informatica |Seguridad en internet

Pingback: Letting [Euler] help out with PCB fabrication | Cool Internet Projects