Friday, 21 June 2013

CNC testing with Mach3

It has taken a bit of trial and error and a good, old-fashioned, low-tech method of validating our CNC setup, but we're thrilled to see that it finally looks like it's working.

To begin with, we placed a pen (instead of a drill) in the z-axis and fiddled with the motor tuning settings in Mach3. We had no idea how many turns per unit (i.e. millimetre) we needed, so went with a default of 200 (assuming that the steppers were 200 steps/rev). The grid it plotted looked like we'd used inches instead of millimetres - the gaps between the dots were massive!

To simplify things, we replaced our grid with a row of three dots, using the g-code

G0 Z0
G0 X0 Y0
G0 Z2
G0 Z0
G0 X10 Y0
G0 Z2
G0 Z0
G0 X20 Y0
G0 Z2
G0 Z0


to draw a row of three dots on a sheet of paper. We checked our Mach3 settings and confirmed that we had, indeed, set the default units to mm and not inches. After measuring with a steel rule, we confirmed that the dots were not actually an inch apart either.

So we were pretty sure that the machine was set up for millimetres (but not 100% convinced) but had no idea of the leadscrew pitch. Inspired by Steve's coding method - where if something works but not quite, you keep applying multipliers and choosing different numbers until it's close enough - we set to work changing the values in the Mach3 settings. Firstly by reducing the steps per millimetre down to 100.

This time, the spacing between the dots looked better, but we were now about 12mm apart, not 10.
Reducing the steps per millimetre to 90 brought the dots too close together, but it seems that 95 is the magic number for our machine:


Each dot was perfectly 10mm apart - exactly as the g-code described.


(the pattern of dots in this photo shows a grid supposedly drawn at 0.1" pitch, but at 100 steps per mm, our machine drew them slightly too far apart. Repeating this later, at 95 steps per mm, resulted in a perfect 0.1" grid)

No comments:

Post a Comment