Marlin PCB mill auto Z
September 05, 2015 05:53AM
I recently converted my LinuxCNC machine to run Marlin. I had to add some bits for the spindle but generally it was all pretty easy. It is all working perfectly now and I am able to design the circuit with GSCHEM, go through the PCB design, export to Gcode, convert for Marlin( because all the needed Gcodes are not supported in Marlin) then cut the PCB with the Marlin mill.

Under LinuxCNC I had some routines that probed Z so that I didn't have to make sure my PCB was exactly level.

I need to do this with Marlin really other wise I either have to spend for ever making sure the PCB is level or put up with cuts that are too deep in places.

The routine is something like:
Home XY (0,0) to current position, front left of PCB.
Set Z to 0 by bringing Z down to touch the copper, (a crocodile clip on the blank PCB is my home switch so as soon as the cutter touches it is triggered)
Move to safe Z
Move to max Y , min X according to board size
Probe Z down to touch
Save that value as Yz
Safe Z
Move to max X , min Y according to board size
Probe Z down to touch
Save that value as Xz

Xz/Xmax = Z compensate for X
Yz/Ymax = Z compensate for Y

Every G0 or G1 instruciton had a Z value appended.

For example if I had a board size of 30 x 40 mm and that had 0.5 mm of slope in the Z and the machine is sent
"G0 X10 Y15 Z-0.05"

The cut performed would be:

G0 X10 Y15 Z(0.05 + 10*0.5/30 + 15*0.5/40)

I thought I would add the code needed under the G29 bed level command. I already have a "#DEFINE CNCMILL 1" in configuration.h so can use that to skip the servo / bed level routines that are there for the 3d printer.

I am really struggling with the Marlin source finding where it goes to do things. It uses get_coordinates() and prepare_move() but I can't find where it stores the values, I think it is just generally outside my comfort level by a considerable distance.

Is anyone looking at something similar or has it been done already.
Re: Marlin PCB mill auto Z
September 06, 2015 01:58PM
I am looking for a PCB design program that can generate gcode suitable for my reprap, at the moment I use Eagle software, can GSCHEM be obtained for free?
I have just attached a drill to my reprap in the hopes of milling PCB's, I use marlin. My problem is how to convert an 'Eagle' board drawing into direct readable gcode for pronterface without too much modifying,
Re: Marlin PCB mill auto Z
September 06, 2015 03:50PM
I don't use eagle but it should be possible. GSCHEM is Linux (maybe others I don't know) and is a suite of software for schematics and PCBs.

It is open source.
VDX
Re: Marlin PCB mill auto Z
September 06, 2015 04:14PM
... I'm using Target (http://server.ibfriedrich.com/wiki/ibfwikien/index.php?title=Main_Page) - the free version can be used for two-sided PCB's without size-limitation, only limited in 250 pads max.

I'ts generating drill-files and normal or isolation milling contours and exports them in common G-code, but I'm using the NCP-output for my Isel-CNC-softwares ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org]
Call for the project "garbage-free seas" - [reprap.org]
Sorry, only registered users may post in this forum.

Click here to login