Skip to content

Working with the OpenSCAD file

Pawel Szymczykowski edited this page Jun 4, 2015 · 14 revisions

The original version of the SumoBot was create in Adobe Illustrator. This was great for prototyping and creating something visually, but it wasn't ideal because the file had to be recreated from scratch every time we changed the material thickness or cutting method to account for different kerf.

There were several points in the design that interlock and all needed to be changed at the same time. We needed something parametric, where we could specify the material thickness and the kerf in one spot, and then have all of the dependent sizes be calculated automatically and cascade down. The first attempt at this was a weird file format called psvg that embedded variables into an SVG file. It worked pretty well, but it was unfortunately pretty hard to work with and understand the source file because it wasn't a true declarative programming language - rather it was a bunch of polygon points with embedded mathematical formulas.

OpenSCAD is a declarative CAD language for creating STL files for 3D printing. It is also possible to export to DXF and SVG. The OpenSCAD source files have become the most supported version of the SumoBot design for both 3D printing and laser cutting, supporting not only kerf and material thickness but a bunch of other parameters you might like to tweak.

Generating Laser Cutter Files

What you'll need:

  1. Download OpenSCAD for your platform.
  2. Clone the SumoBot repository. Alternatively, just download sumobot.scad.
  3. Digital Calipers for measuring material thickness.

Opening the .scad file

First, start OpenSCAD and File -> Open sumobot.scad. If you cloned the entire repository, it will be in the 3d_print directory. You should see something like this:

The window on the left is the editor. Any time you change anything there, you'll need to hit F6 or the render button () to see it reflected on the right. You'll also need to do this prior to exporting.

The variables under 'Build Flags' determine what to output. I order to do a laser cut sheet of all the parts, your variables will need to look like this:

build_laser_sheet = 1;
build_wheel = 0;
build_top = 0;
build_shovel = 0;
build_bottom = 0;
build_side = 0;

All of the other build variables are for selecting an individual part to generate for STL (3D printing export). You can generate those too, but make sure only one of them is selected at a time or everything will overlap.

Customizing the dimensions for your laser cutter / material

Scroll a little farther down in the file until you see the comments for kerf and material_thickness - these are the most important things to set in the file as they will vary greatly depending on the type of laser and material you are working with.

// Kerf is the amount of space removed by a cutting tool. I use it
// here to describe how much space to leave between tabs and space.
// For laser cutters, I use 0.05, for 3D printers I use 0.375
kerf = 0.05;

// How thick is the material? This also is the tab height.
material_thickness = 4.75;

First, let's measure the material thickness using the calipers:

  1. Make sure they are set to mm mode using the 'mm/inch' toggle button.
  2. Close the calipers all the way so the two jaws are touching, and press the 'zero' button to calibrate them.
  3. Now open the jaws and close them around the material you are cutting. The surface height will vary a little, so don't close them too tightly.
  4. Read the value and replace the material_thickness value in the OpenSCAD file with your value.

Next, you'll need to calculate the kerf adjustment - the kerf is the amount of material removed by a cutting tool such as a saw or laser beam.

It can be a little tricky to calculate, so I usually estimate, run it through the laser cutter and adjust. The kerf value you put in will be added as 'padding' to both sides of the generated tabs. If you can measure the difference between the tabs and the tab holes and then halve it, you should be pretty close!

The 0.05 kerf value I have in the file by default is for a 2 megawatt industrial laser cutter which is much smaller than most hobby lasers which are 90 watts or so.

If you need to make a lot of kits, it's best to find a local fab shop to laser cut for you. I use Ramsey and Son in Vegas, and it costs me around $5 per kit.

Exporting the things

Once you have those settings down and have changed others things you would like (sled_width, wheel_diameter, etc) hit F6 or 'Render' one last time. Then in the menu, File -> Export -> Export as SVG (or DXF). You'll get a graphic like this:

You should be able to feed this to your laser cutter and make many happy robots!