Exploring Toolchains

The painting robot project is an interesting software challenge. I’ve been looking at prior art and related projects and I believe I will benefit from studying toolchains further. Particularly those that start with image data.

I found this cool Image to Wood project in Thingiverse which I really liked.

I started with this picture of my friend Britta.

Here is the software toolchain:

  • The image was cropped and resized using Gimp. Had it not been grey-scaled, I’d have done that.
  • Gimp was used to convert the file to a PNG.
  • I installed Cygwin with netpbm and gcc (c++ compiler).
  • I downloaded ImageCarve from the google code repository.
  • I compiled ImageCarve (linux command line: gcc imagecarve.c -o imagecarve).
  • I then used ImageCarve to render g-code for the image (linux command line: cat image.png | pngtopnm | ppmtopgm | ./imagecarve –toolsize=3.2 –stepover=1 –scale=0.25 –clear=12 > output.g). I left the 3.2mm parameter because I have a 1/8″ ball nose endmill on hand.
  • I verified the g-code file by loading it into NCPlot. I like to look at files in there before loading them to my CNC mill since I can often spot problems.
  • I loaded the output.g file into Mach 3 (EMC2 would work too).

Everything went smoothly except the ImageCarve outputs millimeters. My mill is expecting inches so it crashed the Z axis. I need to do another step to either tell Mach 3 about the units (perhaps edit the g-code, change a setting in Mach 3, convert all the numbers in the g-code file or modify the ImageCarve program).

The g-code starts off like this:

G00X0.00Y0.00Z13.60
G01X0.00Y0.00Z-4.06
G01X1.00Y0.00Z-4.01
G01X4.00Y0.00Z-4.05

I did a replacement within the g-code. Replace “G01X” and “G000X” with “G21X”. That seemed to fix it! The mill ran in a bit of a jerkey pattern but it completed the job.

4 Responses to “Exploring Toolchains

Leave a Reply

Your email address will not be published. Required fields are marked *