Please read about here: http://phk.freebsd.dk/CncPcb/
A modified implementation based on the same idea is available at https://github.com/hase-berlin/pcbGcodeZprobing The basic principle is what Poul-Henning Kamp developed, implemented in Python as an import filter for LinuxCNC: The surface of the PCB is probed, the height profile is stored in G-Code variables and the milling moves are replaced with subroutine calls; the subroutine calculates the Z-height to follow the probed height profile. The implementation done by hase (Hartmut "hase" Semken) works with the G-Code generated by Eagle and probably others.
We will be updating this page documenting.
* export the Gerber files from KiCad? (select Plot Origin as Auxiliar Axis) * use pcb2gcode to convert Gerber files to Gcode, by executing on command line: pcb2gcode --verbose --zup=0.4 --zchange=1 --offset=0,010 --zdown=0,01 --max-deviation=0 --dpi=1000 --toolpath-smoothing-passes=0 example-Component.pho * execute etch_z_adjust.py: python etch_z_adjust.py * open the Gcode files with EMC2, run it and it will automatically probe and mill the PCB