Mode: X ruler
Y ruler
X and Y ruler
Perimeter ruler
Z test four corners
Z test grid
Dense segments
Acceleration
Text
Surfacing
Start with G92 X0 Y0 Z0:
Z level for pen-down: mm
Z level for pen-up: mm
Rapid Feedrate: mm/min
Raise/lower Feedrate: mm/min
Draw Feedrate: mm/min
Draw Feedrate (slow): mm/min
High Acceleration: mm/sec^2
Low Acceleration: mm/sec^2
X Extent: mm
Y Extent: mm
Segment Length: mm
Corner Radius: mm
Number of Staircases: (count)
Z Test Cross Size: mm
Dense segments min: mm
Dense segments max: mm
Save bandwidth:
Surfacing stepover: mm
Cutting direction: (N, S, E, or W)

Ruler Mode

This mode draws many short (~10 mm) segments 1mm apart, with the end result resembling a ruler. These rulers are drawn in pairs, with two rulers drawn next to each other, but drawn in opposite directions.

These are potentially useful for identifying errors in steps per mm, not only for uniform spacing error, but also for nonuniform errors in spacing. These should be uncommon but the test pattern can help identify it or rule it out. By drawing two rulers in opposite directions, backlash (or other similar effects) can be detected. The "perimeter ruler" can also be used to determine whether the machine is square by comparing the diagonals (although it is not a particularly efficient test pattern for just determining squareness).

  • X ruler draws a pair of adjacent rulers along the positive X axis. The "X Extent" setting determines the length to be created.
  • Y ruler draws a pair of adjacent rulers along the positive Y axis. The "Y Extent" setting determines the length to be created.
  • X and Y ruler draws both of the above.
  • Perimeter ruler draws four (pairs of) rulers around the perimeter within a rectangle whose dimensions are specified by X extent and Y extent.

Z-Test Mode

These modes, Z-Test four corners and Z-Test grid, are for checking whether the work surface is level and flat.

These work by drawing "X" shaped marks, where the pen descends (lowers Z) at a shallow angle as it approaches the center of the X, and then slowly rises (increasing Z) as it moves away from the center of the X. Small differences in the height of the surface create longer or shorter pen marks, effectively amplifying surface height errors to be more easily visible.

The Z Test Cross Size setting specifies the horizontal and vertical dimension of the "X" shape. The default value of 14 mm has a corner-to-corner diagonal length of about 20 mm, or corner-to-center length of about 10 mm. With a Z travel of 1 mm (from +0.5 to -0.5) the shallow descent and ascent is at a slope of about 1:10. This means a Z displacement is reflected in segment length amplified by a factor of 20.

For Z-Test grid mode, as many as possible "X" shapes are fit, evenly spaced, within the specified X and Y extent.

Dense Segments

To test parsing and communication speed, this generates line segments that are drawn using a large number of very short G1 segments end-to-end in the same direction.

The lines are drawn in the positive X direction, and the total length is determined by X Extent. Multiple subdivision lengths are tested, each offset by 1 mm in the Y direction. The Y Extent determines the Y size of the final drawn pattern, which is also the number of subdivision lengths to be tested. The "Dense segments min" is the smallest subdivision length that is tested, and the "Dense segments max" is the largest subdivision length. For each 1 mm increment in the Y direction, the subdivision length is increased linearly between the min and max.

The g-code also contains comments showing the subdivision lengths before each line is drawn.

As an additional option to see the possible influence on processing speed, a more efficient mode can be enabled by checking "Save bandwidth". This generates the same toolpath but does not repeat the Z, Y, or F values any more than necessary.

Acceleration Not Yet Implemented

Eventually will generate gcode to test acceleration, assuming "junction deviation" approach is being used.

Text Generation

Generates toolpaths from text, using a fixed-width font, which is potentially useful for ASCII art.

This requires firmware support for G5 (Bezier splines)! This is not enabled by default in MPCNC firmware, but it is fairly straightforward to enable.

The text is stretched to fill a rectangle defined by X Extent and Y Extent. This can create extremely stretched or squished characters which might not be desirable. Strongly recommended: look in the g-code comments at the x pitch and y pitch and y/x aspect ratio, which can indicate if the generated text is likely to be of the size and proportion you want.

Spoil Board (or Workpiece) Surfacing

Generates strokes at a given depth traveling in only one direction.

If the router is not quite perpendicular, then one side will cut slightly deeper than the other. This is not normally an issue for small-diameter bits but the amplitude is larger for large-diameter bits.

It is assumed that the bits are intended for cutting radially and not on axially, so the deeper-cutting side should be the leading side. A standard pocketing tool path from Estlcam for example will traverse back and forth in opposite directions. With the deeper side leading, it will cut radially, but in the opposite direction the leading edge will cut slightly shallow and the trailing edge will cut axially or possibly rub and generate heat.

Therefore the cutting strategy for this cut is to cut only one direction, lifting the bit between cuts. The cutting direction is specified and must be "N", "S", "E", or "W", which cut in the +Y, -Y, +X, and -X directions, respectively.

As an added feature, the cutting toolpath is split into relatively small segments instead of being single, very long G1 movements, which allows dynamic adjustment of the feedrate via the Octoprint interface or the LCD.

Note the recommended feedrates for surfacing are quite a bit slower than for drawing and must be chosen manually. The defaults are unlikely to work well!

Note that the X extent and Y extent are the extent of travel of the center of the cutting bit. The pocket size will be larger by the diameter of the cutting bit.

Text:
Github repository here: https://github.com/vector76/gcode_tpgen
Questions, suggestions, feature requests are welcome.