Mode: X ruler
Y ruler
X and Y ruler
Perimeter ruler
Z test four corners
Z test grid
Dense segments
Acceleration
Acceleration and jerk
Text
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
X Extent: mm
Y Extent: mm
Z Test Cross Size: mm
Dense segments min: mm
Dense segments max: mm
Save bandwidth:

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.

Acceleration and Jerk Not Yet Implemented

Eventually will generate gcode to test acceleration and jerk settings, assuming classic "jerk" approach is being used instead of junction deviation.

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.

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