This time I got the machine moving under GRBL Arduino control, which is a little annoying after I’d ordered a parallel port capable mini-itx machine as a backup plan.
The main problem I’d had (and this is a head slap doh moment) is that I’d read the pin assignments for a female parallel port connector, and forgot to invert the layout for the male connector. I then inverted them, and bingo it worked.
I then demonstrated all 3 axes moving! Awesome.
This lead to the next problem - calibrating and zeroing. This was frustrating as I was learning gcode as I went, and I did bump the end with the steppers a couple of times - watch out for that.
The important thing to note is it should be a right handed coordinate system - at least according to G-Code tutorial - Coordinate System. So after playing with my machine, I determined that it was going backwards on some coordinates. I inverted directions on the X and Z axis - using a bitmask of 160. In GRBL this is a flag set with
$6 - https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.8#6--step-port-invert-mask-intbinary.
I have been using The Rep Rap Wiki G Code Reference
While playing with this, I also started using Universal GCode Sender - a free tool on github that interfaces nicely with grbl - and gave me machine control. This was after learning enough gcode to switch between absolute and relative control systems. It is likely that before each job, I will need to use the manual controls to reset to 0, and then reset the coords in grbl too.
However - note that the reset button here resets the “work position” - not the machine position to 0. I’ve no limit switches yet - so I can not auto-home currently.
This may also mean homing for each job - some start around zero as the centre of the work piece I think - at least the grbl demo circle does.
So - I now have a machine with the right axes - but does it move the correct lengths? I have a nice metallic shop ruler - so time to see if 50 in the Y direction really tallies - or if I have something wrong.
I am suspecting that the pulses may need to hold low instead of high, or that pulses/steps per mm may be wrong yet - but I’ll need measurements, to read more of the machine spec from the ebay page (better save that for future reference), and also specs on the motors themselves too.
The documentation shows mach3 screenshots with the settings - for every axis it is 400 steps/mm, and the lowest axis acceleration is z at 100. I used
$3 to set the steps/mm, and then
$8 to set the acceleration. I used 40 - bit cowardly for now - but I shall get used to it before setting it higher. This is far faster than the default 10.
Trying this against the metal ruler - it looks pretty close - so I’ll go with this for now since it is what I got from the vendor.
The first is the grbl circle demo I think: Grbl Circle Demo
I first moved the head so zero was middle of the bed, and dropped the z down a little too, then soft reset. There is no bit in the spindle, and no job to mill - I just wanted to see it all moving. I pasted the code above into a simple text file, loaded it in the GCode sender (in file mode), and then first tried the visualise button to see what it would look like. I then used send to stream over the gcode - and watched while the machine went through some fine moves. It made some odd noises while doing it - but it looks good.
Time to finish for today. Tomorrow - get some test subjects on the bed - try milling out some examples. I may want sacrificial material under them. Hobbycraft or Maplin may be able to provide something to mill from…
Time to build your own robot! Using a Raspberry Pi with parts and some time, you can use my book to learn how to make and program a robot with automatic behaviours.