Ultimate List of Tips, Tricks, and Tutorials for Fab Lab Students

This post is a not on a lot of techniques for using different types of machines and processes for making stuff. I’ve had this for years but decided to finally publish it. I’ll add to it periodically, but I figured others might find it useful as well. RIGHT-CLICK to open in new windows.

Laser Cutting:

Embedded Systems, Microcontrollers, and Arduino

Circuit Board design and Fabrication:

3D Printing:

Casting and Mould Making:

CNC:

Machines:

Mechanical:

Metal-Bending:

Miscellaneous:

 

 

================================================

My favorite Fabrication-related researchers:

Dr. Stephanie Meuller at MIT’s research group

Dr. Patrick Baudisch at Hasso Plattner Institute Human computer interaction reserach group

 

Teaching Research:

Sketchnoting basics

Graphic Recording

Sketchnote travel journal to get started

Control Theory:

Brian Douglas’s awesome youtube channel explains Control with some great examples.

Kat Kim has another great channel on Controls as well as other Electrical and Computer engineering examples and lectures

George Gillard has a great whitepaper explaining PID controls

Another great PID example is from this Reddit thread

Learning Math concepts:

MathVault – Learn higher-level (college-level) math concepts more intuitively

BetterExplained.com ADEPT model for learning math intuitively

Good sources of materials:

XXXXXXXXXXX    Todo when I’m not so busy or lazy: XXXXXXXXXXXXX

Add sections for PCL shapelock and other named plastics to ultimate FabLab list.

Also add cardboard modeling guy and nibbler tool

Add anodizing alum and titanium, bluing/blacking steel,

And interesting research I like with lasers  hydrographics and uv printers and metal hologram art

SAMD11C Multi-use board

I finally got a chance to play with the SAMD11C chips FabAcademy has been recommending for a while. I also wanted to learn to use KiCAD a bit more so I made a multi-use board with the SAMD11C which can be used for UART, UPDI programmer, and as a FreeDAP board. You can find all of my files for this project, including the firmware at my FabAcademy gitlab page.

I will be making a modification of the board Quentin designed.

I designed the board in KiCAD by modifying another of Quentin’s boards, the SAMD11C dev kit with USB-A connector.

To fabricate a PCB, I’ll use the Roland SRM-20 mill as well as my shapeoko/X-carve using Fab Mods.

The steps in this project are:

  1. Download my board files, code, and hex from here.
  2. Mill the PCB with Roland or other CNC
  3. Populate (stuff) the board with components
  4. Flash firmware to the chip
  5. Use this new board as a programmer or USB/UART

Milling a board on the SRM-20 through Fab Mods:

I’ve posted a more detailed explanation of exporting from KiCAD to a milling machine in this previous post.  Be sure to check that out when you get to that part of the process.

Go to http://mods.cba.mit.edu/

Right click anywhere on the screen and select “program” then “open server program” and search for Roland→SRM-20 → PCB png. To use any other CNC (Shapeoko, Xcarve, 3018, etc.) you can select G-code→ mill 2D PCB png. This will accept in a PNG image file and generate the cut file you will send to your machine.

clip_image001

Then we’ll modify this to save a file for us.

clip_image002

 

If your X, Y, and Z, look like the GIF above, you’ll do an “air cut”.  An “air cut” is a test that runs the same code, just offset in the Z axis  (and this case X and Y as well) just to make sure everything will cut as you would expect. Then you’ll regenerate your cut file by changing the X, Y and Z defaults to 0s in mods before exporting your cutfile again.

 

Once the board is cut, it must be populated… Break out the old iron and solder up the design. If you don’t have a switch like the one I used, you can simply install some male headers and use a jumper to select the voltage. The SAMD doesn’t have a lot of external accessories which makes this part a good bit easier than say some of the older FabISP designs.

Once populated, the board needs to have firmware flashed to it. For this step, I will use the Atmel ICE programmer and a windows computer.

First download windows version of edbg which is the debugger tool we’ll use to download the firmware.

https://taradov.com/bin/edbg/

I downloaded it to my desktop.

Then download the binary of the firmware. I am using the SAMD11C arduino bootloader core firmware so I can use the chip with the Arduino IDE and libraries. (This bootloader seems to eat up a good bit of memory, even on these ARM devices).

Connect up the atmel ICE programmer to the SAMD board. I used figure 3-8 from the atmel ice manual to figure out the pinout because we are using the Serial-Wire debug (SWD) pinout.

Above you can see the specific pins for programming the firmware with the Atmel ICE. Pin 1 is Target Voltage (Vcc), pin 2 is SWDIO, pin 3 is GND, and pin 4 is SWDCLK. Pin 10 is the Reset.

Here are the pins and usage of the board:

Finally you’ll need to open the command prompt in windows, cd to the directory you downloaded these files to and run the following command (assuming you went with the 2nd firmware option above):

edbg-windows-r24.exe -bpv -e -t samd11 -f sam_ba_Generic_D11C14A_SAMD11C14A.bin

You should see:

Debugger: ATMEL Atmel-ICE CMSIS-DAP J42700050854 01.00.0021 (SJ)

Clock frequency: 16.0 MHz

Target: SAM D11C14A (Rev B)

Erasing... done.

Programming.... done.

Verification.... done.

The first time I did it I got this error:

Debugger: ATMEL Atmel-ICE CMSIS-DAP J42700050854 01.00.0021 (SJ)

Clock frequency: 16.0 MHz

Error: invalid response during transfer (count = 0/1, status = 0)

I unplugged everything, replugged it and tried again and it worked.

This firmware only allows arduino to program the chip via USB. Let’s now install the correct board info to arduino so we can do that.

In the arduino software, go to File→Preferences and click the icon next to “Additional Boards” and paste the following:

https://www.mattairtech.com/software/arduino/package_MattairTech_index.json

 

Then you need to install the SAMD boards. In Arduino go to Tools→Boards→Board manager

Search for “SAMD” and install the “MattairTech” one only.

Once this is installed (it will take a bit of time) We can write some arduino code to run on our new board. Let’s start with a blinky program. Looking at the pinout of the SAMD11C, we can choose a pin to connect an LED to on a breadboard.

(Image source: https://gitlab.fabcloud.org/pub/helloworld/index/-/tree/master/SAMDino.%20Hello%20SAMD11C14 )

 

You better make sure that you always use “INTERNAL_USB_CALIBRATED_OSCILLATOR” when you plan to keep this plugged into the USB port for power, or “INTERNAL_OSCILLATOR” when you want tit to be standalone. If you select the other two options, you’ll have to reprogram the firmware with the ICE or a DAP.  It basically bricks the chip if you tell it to use an external crystal but don’t add a xtal to your design.

Arduino file to be serial print to test. The pinout is simple. Each output uses the same pin number as the SAMD chip output. This is unlike a normal Arduino.

ATsamD11C14A Arduino pinout

   0 -------------------
  5 | A5                 A4 | 4
  8 | A8 (XIN)        A2 | 2
  9 | A9 (XOUT)   Vdd |
14 | A14             Gnd |
15 | A15             A25 | 25
28 | A28/RST     A24 | 24
30 | A30            A31 | 31
    -------------------

 

You can download this code to test your board (whether you have a working LED or not). Once this uploads, open the serial terminal and you should see “hello”

 

void setup() {
   SerialUSB.begin(0);
}

void loop() {
      SerialUSB.println("hello"); //Send stuff from USB to serial port
} //end loop

If you want to test to make sure that your board can now be programmed from the Arduino IDE, you can flash the built-in LED on pin 2 with this code:

int led = 2;

// the setup routine runs once when you press reset:
void setup() {
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);
}

void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

The following Arduino file makes this board into a UPDI programmer when you add a jumper to the appropriate pins (see above). Simply take data from the USB serial port and put it on the output serial port and vice versa.

 

void setup() {
  
   SerialUSB.begin(0);
   Serial1.begin(57600, SERIAL_8E2); //Adjust baud rate and use SERIAL_8N1 for regular serial port usage
}

void loop() {
   if (SerialUSB.available()) {
      Serial1.write((char) SerialUSB.read()); //Send stuff from Serial port to USB
   }
   if (Serial1.available()) {
      SerialUSB.write((char) Serial1.read()); //Send stuff from USB to serial port
   }
} //end loop

 

Program a target board over UPDI:

Once you have downloaded the above serial code to your board, you can use it to program attiny412 or attiny1614 chips over UPDI.

  1. First, you want to get a Attiny board. Here’s a great simple board to try.
  2. Get the code from that link to blink the LED on pin 0.
  3. Most important part==>In arduino, change the chip to the attiny412!!! If you don’t do this, you’ll accidently reprogram the samd which you don’t want to do. If that happens, go back and put the serial UPDI code above back on the samd.
  4. Change the “programmer” to “SerialUPDI – SLOQ: 57600 baud, any platform…”
  5. Wire up the samd board as shown below. The white wire is the jumper described above to put the board into UPDI mode. The other wires connect to a target board.

 

To program other samd chips with this board:

If you want to use this to program other SAMD boards, you’ll need to download this Free-DAP firmware and flash it to this board using the edbg program as explained above. This now becomes a programmer for other boards (called target boards). Connect up the target board to this one correctly (follow pink pin names as shown in the explanation below) and then you can program the target SAMD board with some firmware using edbg as well.

Note that the pinout for the programmer for a target samd board.

 

FUTURE WORK:

I’d like to take a page from Adafruit’s book and make the Free-Dap project into an Arduino project. Though I I’m pretty sure you can’t flash a bootloader to a SAMD using avrdude (hence the use of edbg). Adafruit’s solution is to have you load the bootloader to an SD card connected to the target board, then the arduino project just dumps the data from the card into the target board’s FLASH. Instead, I think I’d rather take a note from how pyupdi.exe was added to the Arduino IDE and simply include edbg.exe with it instead.

I’d like to make this same board also program ISP chips like the attiny45 or bare Atmega328s, but it isn’t a priority. It should be possible to do this through the ArduinoISP file but…. meh.

 

 

Tips for Mounting Stock Material for CNCing

Holding a workpiece is always an annoyance. You want to flatten a sheet of plywood so there’s no part of it bowing upward because that will throw off your cut depths. Nothing is worse than thinking you have a tab holding a part in place only to find out that the tab was too thin or nonexistent when the interior piece starts getting all chewed up and flopping around, breaking stuff. On close inspection you can see that on your final couple of passes, the tab was cut too thin or clean through because the wood was bowed upwards. Without a vacuum table, there’s only so much you can do, but I’ve found a few ways that seems to work great. Screwing or clamping the wood to the spoilboard is OK, but it makes certain areas no-go zones for your bit. My methods will help you use up every square millimeter of the wood if you’d like.

Dealing with the Wood Itself:

The wood itself is always as straight as I could find, but it’s never perfect. I lay it on my machine such that the cupped edges stick up in the air. Then I mount down the edges.  There shouldn’t be a bubble in the middle because the curve was originally downward to begin with and since I affix the edges (where all the stress to move upward is) it lays pretty well.

image

Traditional Method using screws:

Sally from Shopbot showed me a nifty trick. If you do use screws to secure your stock to the machine you want to make sure your toolpaths will never touch the screws (lest you break your bit or mill your screw head off). Sally’s trick is to add these screw holes to your design.

  1. Lay your stock on the machine and center it but don’t mount it.
  2. Open your cutfile and add small circles (1/8th – 1/4th inch diameter) about 1/16th inch deep to the design. These are the locations of your screws. Make sure they won’t interfere with any cutpaths and that they will be in a good position to secure the stock.
  3. Export just these circles as a cut path and cut them.
  4. When finished, add screws in these locations (The black circles in the image below)
    image
  5. Delete these added circles from the design
  6. Cut your design file as normal.

This method works great, however if the stock is bowed or there are small clearances in the cutpath of your design, or if you aren’t using tabs to support interior pieces this method might not work for you so try the other ones listed below.

Masking Tape and Cyanoacrylate (CA) Glue (Super Glue):

I stole idea this from a few places. Machining metal parts you can straight-up super glue them into place on your vice. Make sure the faces are clean of oil and debris first of course. When finished, you can simply dissolve the glue with a heat gun to remove your part.

The problem with wood is that if you superglue it, it can make it all nasty looking for the next few steps of the project. And what if you wanted a nice natural finish? The solution is to use masking tape. You’ll lay down a piece of wide masking tape to the spoilboard, then apply another to the stock material. Lay down a line of CA glue on the piece on the spoilboard and spray the piece on your stick with CA activator. As soon as you touch the two that piece is going to stay in place pretty well.

This method works best with smaller material that isn’t very tall. It also allows you to cut pieces on top of the tape without the need for tabs.

Masking Tape and Hot Glue:

For larger pieces of stock I’ve found the use of wide masking tape and hot glue to hold large sheets fairly well. You might think hot glue isn’t a good choice, but I’ve used hot glue to hold down guitar body blanks on my large planing jig while I router-planed them to thickness without any issue. These were solid poplar about 1 and 3/4 inch thick. I simply use a high temp glue gun and a harder (rather than flexible) glue.  I’ve also used it to mount 1/4” plywood on my CNC machine for tons of engravings and through cuts to great success.

On the CNC machine, I used masking tape to lay down on the spoilboard since I was doing a bunch of cuts. After a few pieces of plywood were cut the glue makes it hard to get a flat surface so you can just pull it up and put down new tape to glue to. The masking tape sticks to my spoilboard on my machine making an outline of where the wood will go with a bit of overlap so that the wood lays on top of about 1/2 the wide of the tape. Align the tape with the router head, not the machine itself. Move the router 10 inches at a time and make sure the middle of the tape is right under the bit. Here you can see the 1.5-2inch wide masking tape just under the wood:

image

The Endmill (the Bit):

An additional tip for keeping the material flat is to always use Down Cut endmills or compression bits on pretty much all plywood cuts. These endmills have the spirals cut backwards such that the normal spinning of the bit puts pressure in a downward motion as opposed to upward. Compression bits actually have regular flutes on the top, but reverse flutes the rest of the way up to give a nice finish on the both sides of the cut. This isn’t a great thing to use for deep narrow pockets, but for plywood stuff it works very well for making sure the material doesn’t raise up when you are cutting.

Can you think of any other tips or tricks I haven’t listed here? Leave a comment and let me know about it!

Making Guitar Body Blanks for Cheap

I’ve wanted to use my CNC machine to build some guitars, but I didn’t want to spend a fortune on body blanks to ruin while learning and perfecting the process. I decided the cheapest option was to make a bunch myself. (Video at the end)

I went to Wurth wood in Charlotte. I had decided on poplar as a species due to its cost. Wurth has rough-cut wood which comes in various lengths, widths, and an odd way of measuring thickness. I wanted my body blanks to be about 1.75” thick, about 20 inches tall and about 15 inches wide.  I knew I’d have to glue two pieces together to get the width I wanted.  When I say that the wood from a saw mill comes in various widths, I mean it. There’s no standard width. Any random width they could cut from a tree is what you get.

They also count thicknesses funny. Everything is measures as 1/4 in increments. This is normal for 1/4”, 1/2”, and 3/4” but gets weird beyond that. A 1 inch thick board is called 4/4 for instance. I knew I’d have to plane the wood down to get the desired thickness of 1.75” so I went with a couple 8/4 boards.

They price the wood by the “board foot” which is a volume measurement. For instance, if you have a 1-inch thick panel of 1ft x 1ft, then you have 1 board-feet of wood there. The formula for board-feet is

(width in inches x Length in inches x thickness in inches) / 144 = board-feet

With the wood I got, it was just over 7 inches wide, 8/4 thick and in all was 160-ish inches long. For this I spent about $65. I calculated that I could make 6 guitar body blanks from this. That’s a bit more than $10 each which is FAR cheaper than anything I found online anywhere!

The next step (after getting the wood home of course) was to cut and flatten it. I cross-cut the wood with my circular saw to about 20″ in tall pieces. To make them flat and smooth I had to plane them, but I don’t own (nor can I afford) a planer. The solution is simple. Build a sled and use a router to face off the surface of the wood. The process is simple. Starting with the leftmost picture, you can see the rough wood is warped and cupped a bit. I’ll use my router to flatten the top (2nd pic from the left). Then I’ll flip it so the flat side is down, and use my router to again plane it flat on the other side (rightmost pic). You can’t do this just by eye though. I needed to build a jig to hold the wood and a planing sled to hold my router.

image

To build the sled, I used some scrap pieces of stuff I had laying around. It was just big enough to fit the wood into it. I used a 2ft by 2ft-ish piece of 1/2 inch plywood and four straight and flat pieces of 1×2. I used wood glue and tacked the 1x2s into place with brads to make two walls. The walls height needed to be higher than the wood was planing.

Next I had a piece of scrap 1/2” MDF. I drilled a hole in the middle a bit bigger than my planing bit on my router, and 3 mounting holes in the pattern that matched my router base. The size of this piece of MDF isn’t terribly important except that it needs to be long enough that the router can be all the way on one side of the jig and the MDF still spans the entire jig. Here’s what I mean:

image

Here you can see the rough wood blank height (which is about 2 and 1/8th inches thick) is just smaller than the right-side wall of the jig (which I made  2 and 1/4 inches tall).  You can see that the bottom edge of the rough wood is hot glued to the jig so it won’t move. I did this with the two shortest edges and that was all I needed.

image

I found that going vertical allowed me to see the depth of cut.  I took about 1/16th to 1/8th of an inch depth cut per complete pass, lowering the router in its base each successive pass if needed.  Once I planed down one side, I used a chisel to remove the hot glue holding the board to the jig.

image

Once I finished one side, I left the router at its current height and sat it to the side while flipping the board. This kept the router at the correct height to start on the other side. I then used a chisel to carefully release the hot glue holding the piece down and flipped it. This method will flatten any board on both sides. You can also rout the edges of the board using this jig to get 90 degree angles on 3 side before flipping the piece. Here’s  video describing the process:

I actually used the scariest router bit in the world on my router table to get the edges straight though.

image

Once the edges are straight, I slathered on some wood glue and clamped them together. I had to use tie-down straps as clamps. To keep the straps from getting glued to the wood I put paper towel between the strap and the wood where the seam was.

image

The next step was to rout the guitar body shape on the CNC machine about 1/4 inch deep, and then rout the cavities for the neck pocket and the electronics. I’d then use my bandsaw to cut the path of the body blank and use the scariest router bit in the world to clean the edges up. I actually hadn’t do this yet. In fact, I made these blanks in 2017 and they have sat in the garage since.

Things that stopped me are:

  1. My bandsaw is garbage and can’t cut a straight vertical line to save its life, regardless of how tight the blade is or how slow I go.
  2. I’m scared of the router bit. Routers are a lot like honey badgers in that they don’t give a ….  well you know the rest. They’ll cut chunks out of you much faster than you can imagine and with the giant  2.5″ bit I had, it could easily be deadly.
  3. You have to build the guitar based on a neck and I’ve never bought a neck to design it around
  4. I sold the CNC machine… But that’s no real excuse, I could use the Shopbot at Charlotte Latin if needed, or just do it by hand. HOnestly, doing it by hand is how most folks do it and it is a lot faster than me figuring out how to CNC it. I’m terrible with CAD…
  5. I’m lazy and this was so much work that I don’t want to screw up all 6 of them then have to do all this again. I simply don’t have the time to.

PCB Milling Software Survey

FacAcademy had used a great tool designed in-house for PCB milling making it stupid easy.  I should be able to mill some PCBs at home right? Ha!

Method 1 Carbide Copper (web-based): Carbide Copper (Formally Rapid PCB)is by far the simplest solution for PCBs. A simple step by step process takes your Gerber and Excellon files and generates great g-code for your machine to run. Check it out below:

Method 2 Easel (web-based): Easel is the online CAM tool from Inventables, the makers of Xcarve. It has a lot of good settings in it and the interface is great. I just hate storing all my files online. Honestly I’m kinds sick of all these online “apps” that change settings and user interfaces elements all the time. Makes it impossible to follow a video tutorial after 6 months since nothing looks or works the same (looking at you AutoDesk!)

Method 3 FlatCAM: Once  you create your PCB, you need to run a CAM process inside your PCB tool (such as EagleCAD or KiCAD, etc) to export the gerber and excellon files of your design. Gerber files basically throw all bottom traces into one file, all top traces into another, all drill files into another, etc. Then to view these, you need a Gerber viewer.  Once you do that, you can use a CAM software to generate the tooling for making the board. This is where FlatCAm comes in. You import your gerber files and FlatCAM will help you create the path the PCBmill will need to move to create your circuit.  I must say, I found FlatCAm’s user interface frustrating. YOu bring in your gerber of the bottom traces for instance, then click another tab to set up the tooling, then that creates another file in your project in which you must then select and select another tab (again) to finally generate the g code for your machine.  You have to do the same with the top traces file, the drills file, and the dimension file. This seems convoluted and frustrated me.

Method 4 MakerCam: This method works well for Fritzing. You can export an SVG from Fritzing, then import that into inkscape for touch-ups, then on to MakerCAM to generate the final product.

Method 5 FabModules: The older linux-based Fabmodules won’t work for me, I’m not installing a bunch of junk on my PC just to run fab modules. Luckily, there’s a new web-based version at http://fabmodules.org  The new version doesn’t seem to be as good as the old version in creating the output files. Here’s a basic intro to making PCBs with it:

Method 6 Fusion 360: While the newest version of Eagle has a plugin to send the PCB design to Fusion360, you can’t do anything useful with it (such as extrude the traces easily). It seems you have to redraw or trace the traces onto a Fusion360 sketch. While using “Smart snapping” can simplify this, it’s still something that should be automated. (Correct me in the comments if I am mistaken about this method). However, a friend of mine worked out a method that seems to have worked well for him. You export the EagleCAD as an PNG, then import the PNG to fabmodules to create an SVG of the outline of the traces, then import this SVG into fusion and extrude and generate toolpaths.

The workflow is similar to the video above for the fabmodules. Once you bring your SVG into Fusion360, extrude all the traces up about 0.2mm (could be time consuming) and extrude the remainder of the PCB downward -1.5mm and select a teeny-tiny endmill. If you have to, simply create this as  a new tool. 1/64″ (0.39-0.4mm) is what FabAcademy uses typically. Then create a 2D contour around all the traces.