How to use cad.py.

A set of images that were printed (drawn?) by a repstrap. The top image is a test plot of a RAMPS PCB.

As cad.py works from images, your not restricted to just PCB designs. You can also import any black or white image or text. As long as its white lines on a black back ground it should work. So there is no reason why you couldn’t use cad.py to mill logo’s or names onto things other than blank PCB’s.

Following on from the previous post:

How to use cad.py on Windows.

  1. Open your pcb in Eagle and from the top menu select View->Display/Hide Layers and then deselect all but Top, pads and vias and then select ok.
  2. From the top menu again select File->Export->Image and choose monochrome and suitably high DPI. The larger the image file the lower the chance of traces overlapping, but requires a longer time to process. Images above 3000x3000pixels may result in a memory error. Then save as a .png.
  3. Load cad.py (or similar) and select “Input” and choose a .png image file.
  4. Choose your settings such as x-width and y-width. Thses settings will determine the size of your PCB. By changing one and pressing enter, the other will be scaled to keep the right size ratio. Changing the max and min intensity is useful if your image is not completely black or white, but have a grey areas. The inches per unit changes the units for your pcb. By setting to 25.4 your x-width and y-width will be in cm. After changing any of the settings select ‘render’ to re-render the image.
  5. When ready to output your gcode select ‘cam’ and choose gcodes from the drop down menu.
  6. You may then adjust more settings such as ‘minimum vector fit error (which alters how closely the tool path will match the image), tool diameter (in inches), tool overlap (a ratio) and feed rate (does not alter feed rate for reprap host, change the host settings).
  7. Once finished choosing your settings select ‘contour’ and wait for the processing to be done. Once completed, select save and the output .gcode (or .g) file will be in the same location as the image file.
  8. Load up the .gcode file with your desired host and print. This has only been tested with the Reprap host. You may want to undergo testing with a pen and plotting on paper before moving on to milling your first PCB.

A full copy of the instillation and use instructions can be found on the reprap wiki.

I made a few changes to David Carr’s modified version of cad.py. It now outputs ‘.gcode’ files as opposed to ‘.g’ and I changed a few of the default parameters including setting the ‘inches per unit’ default for milimeters.

Another problem was that no matter what feed rate was set, the end mill always moved at the same very fast speed. This turned out to be because every gcode movement command printed by cad.py was preceded by G0 (rapid move) as opposed to G1 (controlled move). I changed this, but i’m not sure if it was the right way about it. You can find a copy of this modified version of cad.py here.

Advertisements

About Richard

I am a PhD candidate in Materials Engineering located in Melbourne, Australia.
This entry was posted in A Reprap Project and tagged , , , , , , . Bookmark the permalink.

One Response to How to use cad.py.

  1. terramir (AKA daniel) says:

    hi I could use some instructions on what the settings do because I’m having problems with larger traces not being filled in at all and somethings connecting to other traces I dunno maybe the settings are causing me problems I would like to know what the individual settings do if you could help that would be nice
    terramir

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s