What are offsets in CNC milling

First steps with the CNC router

It can drill and mill circuit boards, manufacture front panels, housings and model components or engrave signs: a CNC portal milling machine is a great addition to the 3D printer in the fablab and workshop. Although the structure is similar, there are essential differences to be considered when working.

Every beginning is difficult - especially when small mistakes and carelessness can lead to considerable damage to people and machines. As is so often the case, the following applies to the smooth use of CNC machines: Practice makes perfect.

Even if the price of the tools was a constant reminder to be careful, we broke countless carbide tools (see page 100) and screwed up workpieces until our CNC system ran reasonably "smoothly". Compared to a 3D printer, it is also much more difficult: Things can constantly get in the way of the tool, such as clamping devices or tool length sensors. And the machine cannot start work anywhere on the machine table, but has to know exactly where the workpiece is.

If you did not pay attention when "zeroing" the workpiece, the milling cutter will wiggle around uselessly in the air (which would be relatively uncritical) or rush into the workpiece or even the machine table at full speed - and then the shreds will truly fly. It is not for nothing that commercial machines are always housed in a dwelling - this not only ensures clean, low-noise operation, but also ensures that fragments cannot be thrown away unhindered and endanger people.

Therefore, a well-meaning advice: Never approach a running machine without protective goggles! The chips reach enormous speeds and are sure to find their way into your eyes. Anyone who has ever had an aluminum chip stuck in the cornea will never make this mistake again.

In contrast to 3D printers, CNC machines work with (at least) two coordinate systems: the machine coordinates and the workpiece coordinates. The machine coordinates are absolute values, calculated from the machine zero point (usually the point that the machine approaches to its reference limit switches after a "home cycle". The machine zero point is not, for example, "bottom left on the table", it is one) arbitrary, construction-dependent position anywhere in the work area.

Everything is relative

Basically, the machine coordinates are of little interest to the operator. They are only needed to specify the positions of permanently installed targets when installing the machine, such as a magazine for the tool changer or a tool length probe. And of course they are also relevant for limiting machine movements so that the axes do not hit the wall if the CNC program is faulty.

A workpiece is always processed in its own workpiece coordinate system. In the simplest case, its zero point is located at the front left on the workpiece surface. All cutting machine movements take place within this coordinate system (see picture). The machine automatically calculates its (internally used) machine coordinates to control the axis position from the workpiece zero point and the relative tool coordinates. Usually you don't have to worry about the machine coordinates.

Incidentally, depending on the machine, they can also be negative - professional machines often have their machine zero point at the top right or top left, so that at least one axis has negative machine coordinates.

In contrast, there is agreement for the workpiece coordinate system: to the right (X) and away from the operator (Y) are positive values. Usually, the XY workpiece coordinates should not be negative and not larger than the workpiece dimensions, this ensures that the tool does not ram a holder or a clamping device.

Z for doubtful

Unfortunately, there are again doubts and discord when naming the Z coordinates: Most machines use positive values ​​above the workpiece surface (as in a Cartesian coordinate system), that is, negative Z values ​​allow the tool to penetrate the material. For others, the positive values ​​are in the workpiece, negative values ​​above.

In some industries, for example in woodworking, the Z zero point is even on the machine table, not on top of the workpiece. Do not be fooled by this - in the following we take (as is usual for small CNC “cheese milling machines”) the Z zero point on the workpiece surface and the direction “positive Z points upwards”.

Of course, we don't know how your CNC control works in detail, but the basic procedure is always the same: create a milling program, clamp the workpiece, determine the workpiece zero point and run through the milling program.

Pure CNC controls require so-called DIN or G-code files, as do the many G-code players in the 3D printing and robotics scene. The route from a technical drawing to a G-code file must inevitably take the detour via an additional program (CAM) that converts the drawing vectors into G-code machine commands. The CAM program defines how deep each individual milling path penetrates the workpiece and by what amount the associated vectors must be offset - because the tool path only corresponds to the drawing vectors or points in the case of engravings and bores. If, on the other hand, you want to mill a cutout for a display or a so-called “pocket” (flat milled recess) with defined internal dimensions, you have to move the polygon inwards by half the tool diameter. Only with very simple shapes can this be done by hand by creating milling paths directly in the drawing program. It works better automatically: Our free program GRBLize is sufficient for two-dimensional objects, which very conveniently converts vector drawings into G-codes, with which it directly controls a stepper motor controller such as GRBL (c't Hacks 4/2014). In addition, it now offers a very useful 3D simulation of the milling path; Errors in an imported G-code file can be identified in the simulation without any danger. A detailed description of GRBLize can be found in issue 4/2014; In the meantime, however, some functions have been added, such as support for GRBL 0.9 and querying Z tool length probes.

Using a simple example, we want to show the complete production process. As a template, we take a part of a quadrocopter skeleton that is to be made of CFRP (carbon fiber reinforced plastic) - for reasons of stability and weight. CFRP cannot be lasered and only laboriously processed by hand.

In view of the material price, it is absolutely recommended to first mill a “sacrificial wood” and only clamp the actual workpiece after carefully checking the dimensions and milling depths. The job parameters such as feed and penetration speed must of course be determined on a CFRP scrap; To start with, you shouldn't go beyond 1 mm infeed (penetration depth) and 400 mm / s feed.

This material is not only demanding in terms of the tool (only diamond-coated, spiral-toothed milling cutters are suitable for machining circuit boards), it also develops unpleasant dusts that resemble spilled laser printer toner. If you have, you should use a minimum amount of spray cooling with water as a coolant, which binds the dust. Otherwise you follow the cutter with the vacuum cleaner trunk - although not every vacuum cleaner effectively holds back the microfine particles.

1 Prepare data

In the best case, a drawing of the workpiece is available, which is loaded into a vector drawing program such as InkScape or CorelDraw. And with even more luck, the drawing will only show closed vectors in the case of sections - those are those that would be suitable as a contour milling path, because they follow the outline continuously and without detaching and finally arrive back at the starting point. This is usually the case with the simple HPGL plotter formats.

2 Close outline vectors

However, there are programs that do not necessarily sort their vectors according to drawing objects - you cannot be sure about drafts from the Internet. Then some manual work is required first: The vectors belonging to a section or object must be combined. The easiest way to do this in CorelDraw is to use the "Create boundary" function. You should immediately assign a new outline color and a new layer to the new overall vector sequence; you can confidently delete the unsorted original vectors.

3 Export of the data

The process may have to be repeated for the cut-outs contained in the object - of course not for each hole individually, a boundary can also be created with several cut-outs at the same time. After deleting the original vectors, the sorted boundaries remain. The drawing is then exported in the simplest format that the CNC software can read - usually this is HPGL (file extension usually .PLT or .PEN). For further processing, it is advantageous if the outlines are given a different color than the cutouts. Professional CAM tools can take the last two steps of their own accord, even with direct imports from third-party formats.

4 Import data

Pure CNC controls only ever import toolpaths, which must then be taken into account in the drawing without an additional CAM tool. With a milling cutter, the tool path must be corrected by the tool radius, otherwise sections will be too large and outlines too small. Exception: With our GRBLize for GRBL-based stepper motor controls, you can assign different tool diameters and correction directions to the HPGL colors. On this page you set the basic settings of a job - file (s) to be imported, feed in Z-direction, measuring block height, workpiece size and so on.

5 Set a job

The following settings can of course be placed completely differently on your CNC control, but the names should at least be similar. Only one file belongs to our “job”. We have rotated it by a total of 90 ° (column "Rotate") so that it fits more comfortably on the machine. Further settings here are the workpiece size (is also used for the simulation) and the joint setting of the Z-immersion speed.

6 Set tool parameters

In the respective row for each “pen”, you also specify the speed and Z-depth to be used for milling. Depending on the material, several milling passes may be necessary, in which case the maximum infeed per pass must be specified in the "Z / Cycle" column. The program then repeats the milling path until the desired depth is reached. These values ​​are a matter of experience; you slowly approach a speed at which the result still looks good and the tool is not stressed too much. Depending on the material, you should be particularly careful with the Z speed when immersing. Here we have assigned the inner contours to the red "pen" (pen in HPGL diction) and the outer contour to the yellow one.

7 Check milling paths

GRBLize displays the active milling paths in color in the "Drawing" window. Here you can now check the dimensions and the tool paths (inside, outside or without radius compensation). In addition, the working area corresponds to the workpiece size set in the job window.

8 Simulate

With GRBLize there is now a rather extensive G-code simulation with a built-in (simplified) G-code interpreter. The 3D display takes place using all set parameters. With GRBLize, processing takes place with increasing HPGL pen number - if everything has been done correctly, the machine first mills the cutouts and then the contour.

If you cannot find a simulation in your software, you have to check the correctness of the milling data and the zero point setting "on the living object" - ideally without a clamped workpiece and without a tool, so that nothing breaks in the event of an error.

9 Clamp the workpiece

Setting up the CNC machine includes firmly clamping the workpiece. With our plywood milling machine, this is done in the simplest case with a few chipboard screws on the "sacrificial board", which also serves as a milling base. Since the MDF used is cheap to buy, the entire board is simply replaced if it becomes too uneven. More on the subject of workpiece clamping devices can be found on page 102.

10 Set the zero point

The workpiece zero point "0, 0, 0" is actually on the lower left, directly on the workpiece surface. You move to the zero point manually (in our case with the jog pad of the GRBL jog board from c’t Hacks 4/2014) and then click on "Set zero point" in the control program; In GRBLize there are the (separate) buttons Zero X, Zero Y and Zero Z. Here it is sufficient to press the middle round button of the jog pad to set the zero point.

Setting the Z zero point is critical, as careless approach to the workpiece can easily damage the workpiece or the clamped milling cutter.

11 Use the Z measuring block

For Z-zeroing, you can place a sheet of paper between the workpiece and the milling cutter tip and move Z down so that the tool just grips the sheet. Many CNC controls - including our GRBLize - allow the (safer) use of a measuring block, the height of which is specified in the program (with us in the job defaults). The block can be, for example, a plastic or wooden block of known thickness. So you don't go all the way down onto the workpiece, but only to the exact height of the "Z-Gauge" (here for example 10 mm). If you now press the Zero-Z button (or the middle jogpad button with GRBL-Jog), the thickness of the measuring block is added to the offset, and the Z workpiece coordinate is in our case at +10 mm - because the tool tip is yes also located 10 mm above the surface.

12 control

Now it's getting serious: Has the zero point been approached and checked whether the real tool tip position also corresponds to the relative workpiece coordinates displayed in the program? Is the feed rate and the penetration depth (not every material can be milled in one pass) correctly set for the tool used? Even experienced CNC users often find that after a tool change the Z-height is no longer correct and breaks. Or that the milling motor is not switched on, which is also not beneficial for the service life of the milling cutter.

13 milling

Press the button (for us it is “Run Job”) and watch: The machine is now processing the tool paths. Since our project manages with only one tool diameter, a tool change break is not necessary - this would also make it necessary to "zero" the Z axis again. The machine cannot know how long the new tool is. Since we have not yet installed a suction device that is carried along with our device, we inevitably have to manually adjust a vacuum cleaner nozzle.

With many controls, you can vary the feed rate during milling if it was set a little too timidly or too bravely. The current GRBLize version cannot do this yet.

14 Done!

It wasn't that difficult after all - as you can see from our “picture story”, most of the work goes into preparing the drawing and setting up the machine. You only have to repeat step 13 for further copies of our quadcopter base plate. The machine has memorized the set zero point, even if the milling spindle has been manually moved aside to clamp and unclamp the workpiece; you just may not turn the stepper motor drives yourself or move the slides with force. Nevertheless, before each new run, first approach the workpiece zero point and check the position (especially the Z-axis). -cm