One of the things that I did when I was testing my new CNC was throw random-ish move commands at it. I’d tell it to move a few inches to the left, and then a few inches to the right, then further to the left, and further to the right, and so forth. Eventually, I’d decide that it was working okay and then I’d either turn up the speed or move on to the next part of the assembly process.

There are at least two problems with this, of course. First, that’s not even remotely random. Second, it’s a pain to keep typing ‘G0 X100 Y200 Z20’, and really hard to keep typing it faster than the CNC can move.

To solve the problem, I wrote a quick tool for generating random gcode moves, just for exercising my CNC. The results looked like this:

I mentioned my random gcode generator it in the middle of a HDZero forum discussion and discovered that there was some demand for a random-move generator. This sort of thing can be useful for testing new CNCs and for validating new top speed and acceleration settings.

To use this, enter the minimum and maximum range for each axis on your CNC, in whichever units it uses. For mine, if I zero it to the home point, then X is between 0 and 1350mm, Y is between 0 and 850mm, and Z is between -145 and 0mm. I’ve used these as the default below; you should replace them with whatever makes sense for your device. Then hit “Produce random gcode” and copy the gcode that is generated into a file using Notepad, etc.

AxisMinimumMaximum
X
Y
Z
gcode goes here