Getting started with PCB milling

I’m just getting started with PCB milling on a new Nomad. I’m having a couple of problems related to tool changes and zeroing when drilling.

I’m using Eagle with the pcb-gcode plugin to generate the gcode for the board and then running the etch and drill files with Carbide Motion, starting with single sided boards so I get that right before hassling with double-sided. I start by connecting, zeroing by bringing the engraving bit just into contact with the board, running the “etch” file, and then reloading the “drill” file (leaving the zero setting alone) and running it.

The drill gcode contains tool changes and I get prompted to put tool 1 in. After changing to the first drill size and clicking continue, the machine measures the length of the bit, and then returns to the board and moves the tip of the drill bit into contact with the board, apparently punching through the copper layer (fortunately this doesn’t seem to have broken the bit). Carbide Motion then prompts me a 2nd time to insert the same tool, remeasures it, and then returns to the board without punching into it, and then starts the spindle and drills successfully.

When it gets to the 2nd drill size I also get prompted twice and it punches into the board (in the zero position I think) again.

What’s causing the machine to hit the board with the drill bit, and why is Carbide Motion prompting for the tool change twice?

I don’t know anything about GCode but I looked at the file and did a little googling and my suspicion is this bit:

M06 T01 ; 0.0320
G01 Z0.0000 F20.00
M06
G00 Z0.1000

The change to tool 2 has the same sequence later in the file. If my Google-fu has not abandoned me, this looks like a tool change, followed by selecting the first bit, followed by a move to zero height, followed by a second tool change. Are these redundant M06 commands responsible for prompting twice? Is the move to Z0 responsible for the bit hitting the board?

More importantly I suppose, what have I got wrong in Eagle, pcb-gcode, and/or Carbide Motion that is causing this in the first place?

Your guesses look correct to me. M6 is tool change. M6 is interpreted by Carbide Motion (Grbl doesn’t understand it) and CM commands via gcode it generates to move the spindle to the top and turns it off, prompts you to change the mill and waits for you to hit continue. Then it moves the spindle over the probe and probes to measure the tool length, then it moves back to the previous X position, turns on the spindle and moves back to the previous Z position,and resumes playback of the gcode.

That first G1 is supposed to move very slowly (20mm/min) back to the top of the board (just barely touching if you’ve zero-ed your Z properly) and then the G0 Z0.1 moves up as quickly as possible 0.1mm (retraction) which is kinda moot because the preceding M06 apparently does the tool prompt dance again (I didn’t know that an M06 without a T parameter would do that, but hey).

I haven’t done PCB milling yet and I’m surprised at this g-code. Why does it generate an M06 with no tool number? Why is it generating a 0mm touch?

Did you see this thread? Nomad: Great results milling PCBs from Eagle

1 Like

I found it quite annoying, so I remove the second M6 by hand. For many things, I remove ALL of the tool changes, and open holes that need it by hand, since the wonderful whacky libraries for Eagle tend to have inconsistent drill sizes, each of which will produce a drill sequence. For example, I ran a board the other week, and the drill sizes for the assorted parts (TI, MAXIM, and a couple other standard part libraries) were 0.8mm 0.81mm 0.83mm, 0.032" 0.03125" and I don’t recall. There were about a dozen tool changes for what is substantially the same hole size. Easier to edit the Gcode than to fix all of the library parts or remake them, less time consuming and less frustrating to open a few holes by hand than figure out which are which in the drill file.

Ah. This gcode for switch tool is for people without tool measuring. It uses the top of the material as a reference so you can keep the same stick out from bit to bit. Whoever wrote it didn’t expect the Nomad’s M06.

Apparently you can change the tool change sequence that pcb2gcode generates via configuration. Though I couldn’t tell if it requires recompile.

Eventually I’ll try this out on my machine. I have the copper boards, just haven’t got around to designing a board yet.

1 Like

At least the manual seems to indicate that you can set user gcode (page 37): https://www.google.com/url?q=http://www.johnjohnson.info/wp-content/uploads/2013/05/pcbgcode.pdf&sa=U&ved=0ahUKEwju65T81NPRAhVBXGMKHVZLD6EQFggLMAA&sig2=ysWU8gilHdfLMl5Z6reeQQ&usg=AFQjCNEeL_LevppHO3OIRWZxCrYRSIdDeg

Also there is a rack file that allows you to tell it what drills you have available. Perhaps it’ll use closest rather than precise if you tell it you have a limited rack?

1 Like

Aha! There is an option “Do tool change with zero step” in the GCode Options tab of pcb-gcode. Turning that off removes the Z0 move and the second M06 from the gcode file… will try that on the machine just as soon as everyone’s ready to have motors running this morning.

I never went to the point of configuring a rack file, and actually forgot that I can (I read the manual long ago). I never dd try the zero step option off, as I never realized what it does so never thought to since I have been cutting the tool changes out myself.

Every time, I think to myself that I should write a perl script to do it, but I never do… I may try turning off zero step and setting up a drill rack, I I remember next time I need to bang out a board quickly.

Thanks for the info.

Finally got a chance to rerun the board. The setting worked - the bit’s not going to Z0 and the drill change prompt is only happening once. Thanks for mentioning that configuration, that’s what got me looking for the right thing.

I’m looking at the drill rack file now and it has a minimum and maximum size for each bit. I’m going to enter the bits I have here and see how it works. I’m assuming Carbide Motion needs to be set up with corresponding T numbers?

Carbide Motion will just ask for the T# that it sees. As long as the operator knows which bit it means, that’s all you need.

Yep, the setting I was thinking of is in Create, not Motion. At least with this table it’ll use numbers consistently instead of 1, 2, … for whatever sizes, so that helps a bunch. Conveniently the set of bits I bought is in increments of 0.1mm so I just numbered them by those units.

So mischief managed I guess, single-sided boards turning out good, maybe a little more depth/trace size tweaking, then on to double-sided.

I got in the habit of examining the drill files manually, since it can occasionally pick a less than efficient path. You should lay out your bits ahead of time and label them as T1, T2, etc. so that when Carbide Motion prompts you, you know which one to install. I would also manually change depth and retract speed for certain holes that way. When you get into 2-side boards, you’ll find that just drilling all the way through the board creates vias with lips that can really interfere with smd placement if they’re too close to a pad. When drilling vias, I suggest drilling half-way through the board, then flipping and repeating. You absolutely must use registry pins for flipping, and that’s a hole other set of challenges too. I went through about 10 boards before I got the process just right.

I use a usb microscope that I found for ~$20 on ebay to zero with. I’ve tossed around the idea of mounting it on the head of the Nomad so I can take video as it works, but its been a low priority. With the microscope, you can make sure that you’re right at the surface in the center (the low point of the board, from my experience), and don’t have fading or shorting traces. Definitely do a connectivity/resistance test (with a multimeter) to all your traces to catch any milling issues before you start soldering.