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

DIY Soldermask Showdown

banner

Once you fabricate a PCB, it pretty much instantly begins to oxidize. PCBs created in industry are coated with a couple of things to protect them from this oxidation and short circuits. The first is called a soldermask, which is a type of epoxy that literally coats the entire circuit board. If you’ve ever seen a circuit board, you’ve seen the soldermask. It is typically GREEN but can be different colors. For example, official arduinos typically have a Teal BLUE soldermask. Sparkfun uses RED. OSHPark uses Purple.

You can see below just how badly the copper oxidizes after being touched an exposed over time.

unprotected

There are multiple ways to add a soldermask to a PCB. My new favorite method is using Kapton tape (explained at the end of this page), but I have tried and compared a lot of different solutions below.

Epoxy-based:
In industry, they use a specially designed paint or epoxy that is cured with ultraviolet light. This allows them to cover all the traces (the wires) but leave the pads visible so you can solder components on the board. Some folks have tutorials out there showing how to do this, but it is messy and uses nasty chemicals.

Dry-Film Soldermask:
You can also buy sheets of “dry film soldermask” which has the epoxy deposited as a flexible sheet that you adhere to the PCB, then use a photolithography method to harden it with UV light.  This allows you to remove the softer material on the pads you will solder the components to. This material is not readily available, but you can find it from electronics suppliers online. Here’s an excellent tutorial on how to do this process at home.

Tinning Traces:
Another option to protect the traces from oxidizing is to tin them. Tin doesn’t oxidize as badly as copper. Essentially you can deposit tin on all the copper surfaces using a chemical deposition (electroless). This is actually done to the solder pads on commercial PCBs, but it can be done to the entire PCB. The biggest issue with this method is that it doesn’t prevent short circuits because it doesn’t add a layer of insulation to the traces. Again, it uses nasty chemicals.

Conformal Coating:
There is a conformal coating that can be painted or sprayed on a PCB after soldering the components.  It coats everything. While it has been formulated for electrical characteristics, etc. I personally don’t like this option. There are Acrylic, polyurethane, and silicone based products, which you can solder through, but it only comes in clear (you though you can see it in UV light).

DIY – Nail Polish:
When I did FabAcademy in 2014, I milled a ton of PCBs. They always oxidized really badly. Some would be useless within a month.  I began painting finished boards with fingernail polish. I only painted the traces in case I needed to resolder the components. (The soldered areas do not oxidize like the copper traces). This option isn’t great because fingernail polish isn’t designed for electronics, or being touched with a soldering iron, but it works and I have boards that are almost 10 years old that look brand new. This is probably one of the easiest solutions due to availability and color selection.

Lacquer:
Another thing I tried more recently was to spray the PCB with colored lacquer, then using either a laser to etch off the lacquer on the solder pads with a laser, or to just solder it directly (the lacquer melts only when touched with a soldering iron).  I don’t really know the chemistry here so when you laser it or solder it, I don’t know how safe it is. I don’t see how much different it can be from the conformal coating you can buy. A bonus with Lacquer is that you can get lots of colors, though I recommend avoiding anything with glitter, pearl, or metal flakes in it.

Both nail polish and lacquer do allow multiple colors, but neither are designed for electronics. Here you can see the left board is almost 8 years old but has had its traces painted with clear nail polish for protection. The red board is from my previous article in 2021.

paint and lacquer

 

The best solution I’ve come up with is to mill or etch a circuit board, then export the pads layer of the design to an SVG. From here it can be cut by a laser or a vinyl cutting machine into Kapton tape. Once cut, the tape can be applied to the PCB and pressed down hard. Since kapton tape is heat resistant, it can withhold under a bit of soldering. It also has excellent electrical properties (resistance, capacitance, and inductance).  It is actually used for a substrate material for flexible electrical circuits.

UV Curable Dry Film Conformal Coating Nail Polish Lacquer Kapton Tape
Cheap

Availability

Safety

Designed for
Electronics

Ease of Use

Clean

Speed

Special Equipment

Ok, so Kapton tape wins. How do you cut and apply the kapton? We tried a couple of things and both worked.

Firstly, I told Garrett (who is taking FabAcademy in our lab this semester) about my idea and asked if he’d play with the kapton tape and the laser to find out what settings to use. He set about finding the best settings. He first used it to make a solderpaste stencil for his own project. Apparently on a 120 watt epilog, for the size holes we needed, about 6-7% power worked well.

We tried a couple of methods. First we placed the tape on cardboard, cut it, then peeled and stuck it to the PCB. This worked fine, but was a little tough to unstick and weed. This is likely the method I’ll use in the future though.

The second attempt we got cocky and just stuck the tape on the PCB and lasered it directly.

kapton1    kapton weeded

It is easier to line up with the cameras on the laser, but even when we placed the PCB directly under the camera (to avoid aberration of the fisheye lens) we still didn’t get the best alignment. It was good enough to solder though. You can see the finished product at the top of this page.

offset      stuffed1

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.

 

 

How to export to a CNC from KiCAD and Fab Mods

So, while working on a new board design I decided to learn KiCAD a bit more. I’ve detailed the board design and files in an upcoming post so keep an eye out for that one. Here’s I’m just documenting the process to make a board by exporting the design from KicAD and generating cut files in Fab Mods.

I came across a LOT of different methods looking at other Fab Academy students. Some had weird scaling issues or other problems.  I’m showing how to use two different methods for producing and SVG file.  Export–>SVG and plot as an SVG.  I also show two ways of generating cut files, whether you are making Gcode for a generic CNC or you’re making an RML file for a Roland SRM-20.  Note, I’m using KiCAD 5.4 on Windows 10 here.

In the examples below I’m using Quintin’s SAMD11C board found here.

 

Method 1: Export SVG directly from KiCAD to Mods

 

Method 2: Export an SVG using the “plot” function then convert to PNG for Mods:

 

Caveats and other important details:

I have rebuilt my shapeoko V1 as a PCB mill and so the difference between this and an SRM -20 Roland PCB mill is just what program you select from mods when you are creating the cut file.

If you aren’t running the websocket for fab Mods, you’ll need to replace the “websocket” module of the Roland programs with a “file save” as shown below:

 

Once you’ve exported the file you can follow this procedure on a Roland or other CNC machine to mill the board.

 

Once you populate the board, you can program this particular one with an Atmel ICE. Here’s the connections for that:

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.

Pin 1 is Target Voltage (Vcc), pin 2 is SWDIO, pin 3 is GND, and pin 4 is SWDCLK. Pin 10 (Reset) is the back corner you can’t see.

Getting Started with 3D printers (Detailed Guide to Everything You Need to Know to 3d Print Successfully)

image

Learning how to 3d print really is a process of trial and error. I started this page to keep notes on tips and tricks I discovered while learning about 3d printing.

I was given a RepRapGuru 3D printer a couple of years ago. This is a basic prusa i3 clone like the Anet A6, A8, Geetechm and other low cost models you see everywhere for pretty cheap. My first prints were only about 1cm high with  terrible results. I didn’t have time then to fiddle around with the machine, so it wasn’t used. Now due to COVID-19 I’m saving about 10 hours a week since I’m not longer commuting and working from home,  Given I’ve had a little more time, I’ve worked on making my 3d prints better. This page documents the stuff I couldn’t find on other “beginner 3d printing” videos and blog tutorials. When figuring out how to 3D print something, a lot of tutorials only apply when everything goes right. This wasn’t my experience. Is it easy to 3d print? Well, there’s lots of twiddling and tweaking required. I’m hoping my detailed guide will help give you what you need to 3d print successfully.

The Basics of 3D Printing (non noobs can skip this part)

Firstly, understand some basic 3D printer concepts. (Feel free to skip this section if you’re not new to this):

Step 1: 3D files are created in computer aided design (CAD) software. From here you export the files as a format called STL.

Step 2: You will bring these files into a software called a slicer which basically breaks down the 3D design into slices as thin as a piece of paper. Stacking these slices will generate the same shape as your 3D design in the STL file.  The slicer outputs these slices as a format called Gcode. Gcode is what your printer’s controller board understands. Gcode code is the same language that CNC routers and PCB milling machines. Actually a 3D printer is technically a type of CNC machine.

Step 3: You send the Gcode to the printer. Some slicers like Cura can do this process built in. Some other slicers do too. Some software are only Gcode senders (they can’t slice themselves). I like to use Cura because it has the ability to slice and send, as well as a lot of other great features and best of all it’s free! You can actually send the Gcode over a USB cable or put it on a an SD card and have the printer print it by itself.

Step 4: The 3D printer reads the Gcode from the USB cable or the SD card and executes the commands, squirting out the exact right amount of melted plastic at the right places for each slice in the model.

Step 5: You rejoice in your successful 3D print!

Actually I lied. Step 4 is where things go off the rails typically. That’s where you run into problems not discussed in other 3D printer articles. Here’s the real info you need to get started 3D printing…

Understand 3D Printing in More Detail (non noobs can skip this section too):

3D printers have 3 axes, X, Y, and Z. The Z axis always point vertically (up). The X and Y axis can be switched given your machine settings. On mine, my extruder rides on the X axis, and the entire X axis is lifted up and down by the Z axis. My Y axis is a bed that moves front and back. Each axis typically has a little switch on one side which is used to being the printer to a “home” position. When a homing switch on an axis is pressed, that axis knows that the machine is at location 0 for that axis. The home position for the machine is at the coordinates 0,0,0.

The motors are STRONG. If you get your finger or hand caught between the axis and where it is moving to, it will hurt… a lot! You can injure yourself pretty badly in fact. so while it is moving, be careful.

The extruder of a printer takes plastic filament and shoves it through a device called a hot end. The hot end is where the plastic melts. Your slicer software writes the Gcode command to tell the hot end what temperature to be. the temperature depends on what plastic you are using. Different materials will require different melting temperatures. Typically, the lower the temperature a material melts, the fewer ultrafine particles it gives off.  (ultrafine particles are really nasty to breathe in). I use PLA  and it usually has a melting temperature of about 195 degreed Celsius.

The force of the filament being shoved into the hot end will force the melted plastic out of the nozzle at the bottom.  The filament has a diameter of about 1.75mm, but the nozzle only has about a 0.4mm hole in it.  If all goes well, your filament will extrude out of the nozzle the exact amount needed to fully cover an area but not too much that it splurges out everywhere.

Typically you will also have a heated bed on the printer. My heated bed is made of a circuit board PCB material, but they can also be made of silicone. The bed doesn’t heat anywhere near as hot as the extruder head. Typically only to about 50 or 60 degrees Celsius.  Heating the bed is important because it will help the molten plastic to stick. For plastics that have significant shrinkage when it cools (and no, it was not in the pool…). ABS shrinks so much that as the printer moves to higher layers, the bottom of the print can shrink enough to detach from the bed of the printer all together causing failed prints. PLA sticks better with a heated bed as well, though it doesn’t shrink quite as much.

On top of my heated bed, I have a piece of borosilicate glass. When heated, PLA sticks beautifully, but when the prints over and the bed turns off, PLA detaches with very little effort.  This is perfect for stiction and since it is glass it is hard to damage with normal use. Many 3D printers come with a printing surface made of some plastic. I haven’t used them personally, but it seems that over time the surface wears a bit and it might need to be replaced.

Making a print stick well doesn’t just rely on heat. It also depends on the level of the bed. Printer beds usually have a screw and spring assembly at each corner, allowing you to raise or lower them. This helps create a flat surface for the extruder head to travel over. For your print to stick, the first layer is critical. Getting this layer to stick requires some precision. You move the head of the extruder to one corner of the bed, then lower it on the Z axis slowly (0.1mm at a time) until it can barely pinch a piece of paper between the bed and itself.  Once you have done this, move to another corner and do the same. Only adjust one screw at a time.  You can manually adjust the bed and twiddle those screws for a while before getting it just right. There are some bed level prints people have made to help you see if your bed is level. I’ve never had the patience to level the whole thing.   Depending on your printer, sometimes all the corners will be perfect, but there’s a hill or a sag in the center of your build plate. This is where bed leveling comes in. More on how to do this further down the page. Usually a sensor is used to probe the bed at different spots, building a 3D map, then the Z axis values of the Gcode are adjusted as your print something based on these measurements.  There are different sensors for this, but since my printer didn’t have a metal bed, I couldn’t use inductive sensors. I only had to use a touch-based sensor. I explain it in detail below.

Things to buy to make 3D Printing Easier:

There’s a lot of tools that make 3d printing better, so here are some things I’ve purchased along the way. It doesn’t hurt to have some spare parts…. In fact it is essential as things WILL break. Here’s what I ended up getting:

  • Switch and fuse for power supply Instead of unplugging from the wall and causing a spark when the motors are on, this switch and fuse box gives an extra element of safety to the printer.
  • Silicone hot-end covers Help keep the heat where it should be. this helps the hot-end get to temp and stay to temp well. I didn’t think i needed them at first, but this was the cause of a lot of my issues when I had a fan shroud running.
  • Extra hot ends are almost a requirement. At some point, something bad will happen to your hot end so be prepared. Anything form leaks, to accidentally slamming the  print head into the bed and bending the tube, to just failed prints that create a massive gob of plastic that encompasses the hot end that you can’t get off…. I wish I had these on hand when it happened, but now I always keep extra.
  • Extra extruder Again, something bad WILL happen to your extruder eventually so be prepared. I wasn’t and had to wait for this to ship when I broke my extruder. I always try to have 1 extra. They are also handy for different materials. I have one I use for PLA/TPU temperatures, and one I have on hand for ABS or ASA, and one for PETE. I just swap them out as needed instead of dealing with clogs due to different temp plastics burning, etc.
  • You’ll soon be wondering how to clean a 3D printing nozzle. Some folks will say to use chemical solvents, but those are really bad things to be around. The simplest solution is the best. Brass brushes are the best way to clean a 3d printer nozzle. The method is simple. Heat the hot end up to your plastic’s melting temp, then brush it clean with the brass brush. Don’t use other metals as steel can damage the nozzle and of course plastic would generally be a bad idea. Some heat-resistant gloves can help here as well.
  • Left-hand extruder lever If you want to do dual extrusion, having the left-hand extruder lever allows you to place the hot ends as close as possible to each other. This might not seem important, but the closer they are to one another, the more of your bed you can access. If you have the two heads far apart, Cura will show you dark areas it knows the print heads can’t reach, and it won’t allow you to put stuff in those areas.
  • Extra power supply –  I blew up the first one by fiddling with the circuit while it was plugged in. this is dangerous and down-right deadly actually so don’t do it! I was lucky when my screwdriver shorted something I didn’t get shocked. But, this kills the power supply…  So have another one on hand.
  • External heater Module The MOSFET on the RAMPS controller board is kinda puny and can cause you bed to take too long to heat up. Marlin firmware has a safety feature that will turn off power to EVERYTHING if it reads that the temperatures don’t reach their expected values. (This is a safety measure to help you not burn down your house by mistake).  This external heating module can handle plenty of power to your heated bed allowing it to heat up as fast as possible while still being safe.
  • M3 Phillips head variety screw set This has saved me SOOO many trips to the hardware store! It has all the normal length screws that’ll fit the RepRap Guru
  • Extra fans While I eventually took off all the fans, These were essential in the beginning to get good prints. Find a fan mount on thingiverse and you’re set.
  • You’ll need some filament.  I’ve tried a hand full of different brands and types and I’ve liked them all so far. Good quality filament results in good quality prints.
    • I started with Matterhackers PLA since quarantine had basically shut down amazon’s shipping at the time. This was the first stuff I used and my prints came out great.
    • Hatchbox has great filament. Once amazon got more in stock
    • Sainsmart has really great flexible TPU that prints almost the same temp as PLA. I highly recommend getting some of this stuff to play around with once you’ve tuned your PLA prints well. It is a lot of fun. Make a squishy lizard that feels like a real lizard.
    • I was interested in the whole “MasterSpool” concept and ended up getting this 2-pack black and white filament here. It only comes with one masterspool, but you can make or buy another one if you want to use both.
    • If you’re tight on cash but want to have more than one color of filament, there’s nothing better than having white or clear filament and some sharpie markers because you can make a filament color blender that can give some great results. You don’t even need to print anything for this method to work, simply modify a sharpie for great results! There’s a pic further down on the page of the one I used of the one I made.

The tips and tricks below are a cleaned up copy of my running notes as I was setting up and starting with my 3Dprinter. I hope it saves you countless hours and frustration I expreienced:

Thumbnail Previews of STLs in Windows

If you download an STL file from somewhere online like thingiverse or Cults3D, you have no idea what the file actually is until you open it in your slicer.  Windows doesn’t preview STL files like it does pictures.  I’m tired of not knowing what an STL is until after the 5 minutes it takes Cura to load. I found this windows app which will preview the STLs as a thumbnail icons. This makes it easy to see what I’m looking for. You have to make sure you view as medium or large icons.

image

Here’s a similar thumbnail previewer for SVG files which you can see I was using as well.   This is actually how the “test3.svg” and the “fox string art” are being previewed in the screenshot above. (The fox is hard to see because it is red lines on grey background but it’s there…)

Marlin 1.x Firmware Tweaks:

You may need to tweak your firmware a bit to get the results you want. You will definitely have to tweak it to add another extruder or a touch leveling sensor. I’ve done this a few times and I always cringe at having to do it. It is kind of an art. For folks who don’t know how to code, you can always find a youtube maestro who can show you step by step what they did with a similar setup. I’m putting down the basics of what I condensed form multiple tutorials below:

My 3D printer runs on Marlin firmware. To understand how to tweak this, you’ll need to know that pretty much all user-settable changes are made in two files. Configuration.h and Configuration_adv.h These will set up your machine or configure it for multiple extruders, different kinds of Z probes, bed levelling, etc. I put all the version of Marlin I used on my gitHub repo so I can always go back to it.   The machines comes with Marlin 1.x, but I upgraded to 2.x. Both are available on my repository though.

In the original Marlin 1.x version of the firmware the came with the printer. To edit this code, you’ll only ever change things in Configureation.h and Configuration_adv.h.  You can download the code from Marlin’s website and with the older version (1.x) you can edit it using the Arduino IDE. To edit the code, you’re typically going to either comment something out (my putting “//” to the left of the code) or uncomment (removing the “//” from the left of the code) or maybe change a number here or there.   Marlin 2.x is different and I documented that below as well. I made the following tweaks to my Marlin 1.x:

Let’s start with an easy one. I didn’t like the direction the menus updated when I turned the knob. You can change the knob direction on line 1289 by uncommenting

#define REVERSE_ENCODER_DIRECTION

Once you make this change, you can compile and upload the firmware to your printer. After it is done you can see whether or not you like that change. If not, no worries, just go comment that line back and upload the firmware again.

Add EEPROM setting storing in firmware.

This allows certain tweaks and tuned values to be stored in long-term memory on the arduino so you won’ t have to add the values back every time the machine is turned on. line 1025 and line 1027

#define EEPROM_SETTINGS // Enable for M500 and M501 commands
#define EEPROM_CHITCHAT   // Give feedback on EEPROM commands. Disable to save PROGMEM. Then flash this to the arduino.

AutoTune PIDs for the hot end and heated bed

PID is a method of controlling the heat. When the controller is set to 190 degrees Celsius, the PID algorithm makes it heat up tot hat level as fast as possible, and keeps it that temp regardless of external factor such as the filament taking away some of the heat as it extrudes, fans blowing on the hot end or bed, etc. This needs to be tuned to work for every different printer, and even different environments or weather. I have my printer in the garage and these values should be changed on warm days and cold days. Tuning a PID by hand is time consuming and a bit of an art requiring understanding of how it works, and some calculus concepts, but luckily, Marlin can autotune these for us.

Set up PID tuning abilities by uncommenting  the following in configurations.h somewhere near line 367 in Marlin 1.x

#define PIDTEMPBED

Run M503 to get all the current settings:

12:33:41.303 : echo:PID settings:
12:33:41.305 : echo:  M301 P22.20 I1.08 D114.00
12:33:41.305 : echo:  M304 P10.00 I0.02 D305.40
12:21:30.271 : echo:PID settings:
12:21:30.274 : echo:  M301 P22.20 I1.08 D114.00

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

Then to autotune the hot end you’ll go to the arduino terminal and enter:

M303 E0 S190 C8

Then autotune the heated bed:

M303 E-1 S50 C8

Which will tune the hotbed (extruder-1 here) by ramping up to 50degrees Celsius (S50) 8 times (C8)
Use the resulting values and paste them into the configurations.h file of Marlin and then send this code to the arduino.

Then I ran an autotune on my extruder:

 
M303 E0 S190  C8

/*
* Run M503 to get a read of all the current PID values of the machine.
* it will give you two values, one for hot-end and one for bed:
* 12:33:41.303 : echo:PID settings:
* 12:33:41.305 : echo:  M301 P22.20 I1.08 D114.00
* 12:33:41.305 : echo:  M304 P10.00 I0.02 D305.40
*
* THEN
*  I ran PID autotune with the stock numbers for the bed and got the following result:
*  command I ran in console of repetier host:   M303 E-1 S50 C8
*  12:41:36.525 : PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h
*  12:41:36.525 : #define  DEFAULT_bedKp 379.31
*  12:41:36.525 : #define  DEFAULT_bedKi 59.36
*  12:41:36.528 : #define  DEFAULT_bedKd 605.94
*
*  Default values were as follows
*  #define  DEFAULT_bedKp 10.00
*  #define  DEFAULT_bedKi .023
*  #define  DEFAULT_bedKd 305.4
*/

For my extruder here’s the resulting updated values:

13:11:32.964 : PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h
13:11:32.968 : #define  DEFAULT_Kp 12.61
13:11:32.968 : #define  DEFAULT_Ki 0.51
13:11:32.968 : #define  DEFAULT_Kd 78.02

I can manually enter these in my slicer something to prepend to all Gcode it creates, but honestly, I’ll uninstall,/reinstall and forget to do this at some point and be super frustrated. I prefer to save these in the Printer’s EEPROM, but you shouldn’t do it using the M-codes for Marlin directly. If you are using octoprint to control yourprinter, there’s plugin to edit the Marlin EEPROM you should use instead.

M301 P12.61 I0.51 D78.02

But the better thing to do is to put these in the arduino code itself.
These belong on lines 339-341 but in my firmware that’s tagged as “ultimaker”  which doesn’t make sense, so I changed the comment there as well.

References:
https://www.youtube.com/watch?v=CJtARpxLlj8
https://www.youtube.com/watch?v=YpWCKNagjuI
https://marlinfw.org/docs/gcode/M301.html

Calibrate and Adjust steps/mm for each axis, including the extruder:

To do this you will need the ability to talk to the serial port on the printer. You can run the Arduino IDE’s serial port. Simply plug your printer to your computer, open Arduino.exe then open the serial terminal. If you have the baud rate correct you’ll be greeted with some legible text. If not, you will be greeted by garbled random characters. I think my baud was 115200.

Next you’ll need to make sure your power supply is turned on since we’ll be moving the motors.

Then we want to move the Z axis height to about the middle of its range. If it isn’t already, then you should measure approximately how far the Xcarriage is from the middle of the Z range in millimeters and enter this into the terminal. If your machine sis at the home position, this is about 100mm.  The G0 command tells the machine to do a linear move, and Z100 tell is how many what axis to move and by how many mm. If the machine starts moving in a way you don’t like or it might break itself, then you can turn off the power supply by unplugging it from the wall outlet. I added a power socket with a fuse and a switch to make this process easier.

G0 Z100

Insert the filament into the extruder head, and send the command to heat up the extruder to PLA temperature (I use about 190 degrees C). You can do this from the Marlin menu on the LCD or by sending the following command:

M104 S190

Once this is hot, press the extruder lever and manually feed the filament into the extruder until you can see it squirt out the bottom of the extruder.

Calibrate the Extruder first. To do this, you’ll use a marker to mark the filament

This allows me to mark my filament at 120mm from the top of my extruder with a marker, then send the command to extrude 100mm. Measure again and use the formula to calculate the true steps/mm of the extruder. Use the G21 command to make machine use mm units, then use the M92 command to set the steps/mm (of course make sure the machine is in mm mode first) https://marlinfw.org/docs/gcode/M092.html

G21
M92 E95.74

The same can be done for each axis in turn by moving them a known value, then tweaking this number. Print this XYZ Cube and measure each dimension with calibers. It should be exactly 20mm x 20mm x 20mm (X, Y, Z) If it isn’t you’ll recalculate the number for “steps per mm” for that particular axis using the formula below:

(Expected size / Measured size) * Step/mm setting = new steps/mm setting.

For example, if I printed the cube and got 19.5mm in the x axis, and I had used 200steps/mm as my setting in the firmware, I would recalculate the X steps/mm to be:

(20mm / 19.8mm) * 200mm = 202.02steps / mm.

Then set this in your controller via serial port:

M92 X202.02

 

You’re going to tell the machine to move a certain distance, then measure what it actually does. These values will help determine REAL values for your steps/mm setting of your controller. Enter your values below to calculate a new step/mm value.

 

Current Steps/mm Distance you told it to move (mm) Distance Traveled by machine (mm) New step/mm value

 

image

You’ll print 20mm calibration cubes and get those dialed in before moving to the benchy here. You can see my progression of calibration cubes at the very top of this page. My first results were horrible and boogery. I was using clear Dremel PLA. The Benchy tests things like overhangs whcih is important to get a feel for as well. It takes about an hour or so to print the benchy with default speeds.  The worse thing you can do is to use clear PLA to test with. Once I changed to blue PLA issues became more obvious. This site was very helpful in troubleshooting different 3d printing issues with pictures showing you what each problem looks like.

One issue that I scanned the interwebs for help with (since reddit’s 3d print community was not responding to my plea for help) was that the weird boogeryness on the front of the benchy was due to too high temp with too little cooling. I reduced temp to 195C and tried printing a fan shroud. I came across a couple different ones to try, but ended up using one, then janking the thing up by attaching a larger fan that was supposed to be on it. I had to  hack something together using a 60mm fan I had on hand (having fried my only 5v 40mm fan plugging 12 v to it like the genius I am…).and since it was designed for a different printer, had to rig something up to make it stay on my extruder…

I got the following half-benchy before the spaghetti monster appeared.

image

image

More Tweaks and Whatnot:

The first thing I fiddled with was the extrusion speed. Default speed in Cura is 60mm/s but I kept hearing my extruder slipping on the PLA, so I backed that off to 50, and ultimately 40mm/s. Benchy now takes 1.5 hours but came out fairly acceptable. Would I like better quality than this?  Of course I would. but I can’t stand this fiddly-tweaky fine tuning.

First useful print once somewhat calibrated

Surely you’re wondering now that you have a printer, what to 3D print. After the calibration prints mentioned above, the very fist things to print should be upgrades to your machine! Your print quality will increase greatly. Even if you have a CR-10, Ender, Anet, or any other 3D printer, you can find great upgrades freely available online at the usual suspects.

Here you can see my upgrades:

Understanding Fans and Heat flow for the Hot end in General:

There are two different areas and reasons to have fans on a 3D printer. to be cheap, lots of places try to combine these and use a single fan, but that’s not very effective.

Firstly, most 3D printers have a fan that cools the PLA before it enters the hot  end to make sure it is strong enough to be shoved into the hot end.  This allows the extruder motor to be able to shove the filament into the hot end without the filament getting soft and floppy like cooked spaghetti. If it is cool, all the force from the motor is linear.

Secondly, in order to get a clean print, you likely need to cool the filament immediately after it has been extruded. At first, I didn’t know what to do about this and I printed probably 5 or 6 fan shrouds. Some used the original fan mentioned above and simply diverted some of the flow to cool the extruded material. These didn’t work well. I added some external fans as well, but had issues with those too. Some fans were so strong that they cooled the bed so much that the printer couldn’t reach the programmed temperature. This causes a “thermal runaway” or “bed heating:” failure.   To fix this, I tried several methods with varying success:

1. Get a small 5150 radial fan and wire it directly to 12volts. This should be on 100% of the time the machine is on.

2. Print a good fan shroud for this.

This fan shroud uses a portion of this airflow to cool the PLA after it has printed. This creates better overhangs and prevents droopiness. I actually printed several version. The best one I found was this one. I had to be careful because adding a second 60mm fan just to cool the PLA was so strong it prevented the bed from reaching the appropriate temp.

Prevent Leakage on the Hot end:

After building a couple hot ends, I kept having an issue where the plastic would seep from the threads on either the nozzle or the heat-break side as shown here. This is really hard to clean up and you get burned a few times. Once I flicked hot PLA into my eye… The fix is to simply build the hot end correctly:

  1. Install the nozzle into the heat block
  2. back it off by about 1 whole thread at least. You don’t want it fully seated.
  3. Install the heat break (tube part) on the other side until it toughed the nozzle
  4. wrench down on the nozzle to tighten it the rest of the way.  This compresses the teflon tube inside the heat-break and prevents leaks.

image

Bed Leveling:

  1. Home the X and Y so you’ll be at one corner of the bed.
  2. I made sure that all the screws adjusting the bed level were about halfway screwed down. This gave me maximum play in up or down when tweaking. This may need to be adjusted iteratively.
  3. Make sure that if you home the Z you’ll be above the bed. Use a piece of paper (I used 2 or 3 post-it notes) and home the Z axis. Put post-its under the Z and manually adjust the Z homing screw until you feel a little pressure on the post-its but can still pull them out from under the the Z axis without depressing the bed springs.
  4. Raise Z and move to the opposite Y corner, home the Z at this corner. Adjust bed screw until same pressure on post-its is felt.
  5. Move to opposite X axis, do the same, only adjusting bed screw
  6. Move to opposite Y axis (last corner) and do the same.

I print a series of tests as well to make sure the adhesion is good on different parts of the bed. Here’s a great video describing how to as well as the files to print. The video shows examples of the prints showing when the bed being too high, too low, and perfect.

What to 3D print (continued):

Some of my favorite services are listed below:

  • Yeggi.com searches multiple sites for your keywords. It is pretty good to get an overview, but there are better specific sites to use.
  • Cults3D is my favorite 3D printing community. The quality of the ideas are great. Also, you can sell your own design
  • The best way to search Thingiverse is this custom google search for thingiverse some guy posted on reddit. It’s1000 times better than the built-in search. I bookmarked it and always use this.

Sites I avoid:

  • STLfinder… It is an aggregator like Yeggi, but every time I want to open the link to the project, it instead opens the image file from the search. I avoid it like the plague.
  • GrabCAD has files from CAD software or video games, Neither are things I personally want to print

You can make your own 3D designs in CAD software. I’ve played with a bunch… Here’s what I recommend to start with:

  1. TinkerCAD.com is a free browser-based 3d modeling tool designed for children. It is great to start with.
  2. I haven’t found a good next step that doesn’t breed bad CAD habits. I think the closest next step is Sketchup which has a free version you can use. It is really intuitive and quick to learn, but it is best if you skip it and move to a real CAD paradigm.
  3. Autodesk Fusion 360 (free for personal use) is a full CAD software you can do everything in from concept, 2D, 3D cad, molding parts almost like clay, sheet metal design, stress calculations, realistic photo quality rendering, to actual machining or 3D printing. It’s a one-stop shop for all parts and assemblies.
  4. Blender is a free 3D software used for anything from 3d CAD to video game design, to making movies. Check out my mans Joe to learn how to set it up and use it for 3D printing.
  5. Solidworks, CREO, Inventor, etc. These are professional CAD software packages used by engineers. You can take an online (or preferably a local community college class) to learn these.  The issues are they don’t have great licenses for personal use.

How to use the Flexible Filament:

I was surprised that I was able to print TPU flexible filament using the stock RepRapGuru without any hardware modifications. I ended up getting Sainsmart TPU which is pretty great stuff. It’s melting temp is really close to my PLA which works out well if I want to use them both on the same project. I’ve added my Cura material profiles, Printing settings, and my printer setup screenshots in my github repository.

On these new cheap geeetech extruders, I had to add an extension to the hot end tube so it didn’t give the filament a change to bunch up or bend. You can see it sticking up under the gear on the right hot-end in the pic below. It is made of a broken hot-end “heat break” that I cut shorter and screwed in from the top.

I also tested a method of coloring white filament with sharpies as seen on the left extruder.

I also just ordered a 3dTouch which I can add to the carriage to get really accurate height measurements. I will have to tweak firmware for it to work and I haven’t gotten that far yet.  The next big step is designing and printing a new carriage to accommodate this and better fit the dual extruders.

image

Marlin 2.0 Firmware update Jan-2021:

I printed a new carriage and things were working well for a couple of months. Also, to better level my bed, I printed this indicator holder and this flexure gauge.  I even had good success with TPU (Flexible ) Filament.  I had found some Cura material profiles for sainsmart TPU online and tweaked them until it worked very well at 30mm/s speed. I have a cura profile for it that I found online somewhere that works good.

It’s been printing fine for a while, however I really want a dual extrusion printer. Since I have the RAMPS 1.4 board, that already had an extra stepper driver installed I didn’t have to buy another one.  I bought an additional geeetech MK8 extruder. I also bought several new hot ends and the left-hand version of the extruder lever portion.

I printed this dual carriage to hold both extruders. Luckily I had the correct screws from the original carriage.

While I’m at it, I might as well upgrade the firmware right?

I downloaded the Marlin 2.x firmware.  This does not compile in Arduino anymore, so I had to install vscode and then the Platform.io plugin.  This messed up my VScode IDE for other languages I was using such as javascript and python projects. Installing python libraries using PIP now installs them into platform.io’s settings folder which breaks things so as soon as I was done with this firmware upgrade, I uninstalled it. I’ll find a fix to allow them to coexist later.

I also downloaded the “Infitary 508” sample configuration since this seemed to look close to the RepRapGuru.  I assume a Geeetech or Anet A8 model would work as well.

I tried to go through my old firmware and note the changes made to the configuration.h and configuration_advance.h files. I even copied the PID values.  I’ll recalculate these later.

In the Marlin code, I had to change my MOTHERBOARD to ramps EEB instead of EFB to allow the second extruder to be connected correctly.

I also had to change a couple of lines with regards to the extruder.  It was actually MUCH easier that I expected. This video had a few details.

NUMBER OF EXTRUDERS becomes 2

Temp Sensor Type I left default I believe….

MAX TEMP

Next I had to create a new custom printer profile in Cura to handle both extruders. This was easy using their wizard.  I measured the distance between then two extruder tips and entered this as a rough starting value for the X offset in Cura. I will calibrate it better later on, I just needed to get it printing first. Now, you *can* enter this offset into the Marlin firmware, but I prefer to do it in cura as sometimes it changes a bit and I like to be able to quickly make corrections without having to upgrade the firmware.

In Cura, it is very easy to use both extruders. Right click the object and select the extruder you want. You can set the different materials as well using the tabs provided at the top.  The output options now also has a tabbed interface, one for each extruder.  Be sure to update the options in both tabs!

I then had to recalibrate each axis again, including the extruders. The formula is a ratio of the distance you told the motor to travel, and the distance it actually traveled multiplied by the steps it was told to move in the Marlin memory. You see what Marlin already has by opening the Arduino Serial terminal (because the baud rate is like 250000 which is kind of weird… and Arduino seems to connect it) and entering “M92

New M92 value = Desired movement / Actual movement * Current M92 value

To set a value you’ll reissue the M92 command buy with the axis and the new value eg.

M92 X82.57

To calibrate the extruders I marked the filament at 120mm form the extruder’s top and told them to extrude 100mm using the LCD screen then measured the result. Using the same formula, I calculated the steps and set these with the M92 command. To get the X, Y and Z calibration I printed the standard 20mm cube with each individual extruder.

To store the new steps/mm in memory, you must issue the M500 command.

It is too hard to calibrate the heights of the extruders perfectly without a flat bar or plate to align the hot ends, so I have ordered a few things to help with this and will update when I make progress.

I ordered some pieces to help align the extruders, but though they looked like the same gold anodized aluminum as my extruders, the hole pattern was quite different. I ended up drilling my own holes and using it anyway. The extruders are closer now than my 3dprinted dual extruder holder. Luckily I have the OpenSCAD file for it and can edit it.

To adjust the heights, I’m trying to screw the hot ends in the same height, but it is never perfect so I’m using folded pieces of aluminum foil to shim the two stepper assemblies until they are even.

X and Y Offsets

There’s two methods of setting up the offsets for dual extruders. One is to do it in the firmware, so Marlin would be edited to know the distances in X and Y pf the two print heads. The advantage  here is that any slider you use will work with minimal setup.  The disadvantage is that if these values change for any reason (you mad e a different Xcarriage mount for instance), you have to reflash the firmware… which is a pain.

The second method is to set up the offset between the two extruders in the slicer software. Advantages are that you have less firmware editing. Disadvantages are that you’ll need enter the offset numbers into each slicer you use. If you loose your printer profile in Cura for some reason, you have to make sure to re-enter these values so keep them written down somewhere.. like a blog no one reads 🙂 In the picture below, my #1 extruder is on the left, so that’s being treated like it’s the 0,0.  My right-side extruder is extruder 2 (because it matched the tab layout in Cura this way) and had the offsets of (-34.17, -0.07). I have since used a sharpie to write the extruder #1 or #2 on the physical extruders so I can glance and see which is which. Oddly, These are labeled “T0 and T1 respectively in Octoprint’s settings.

Octoprint will ask for these numbers too for some reason. I haven’t figured out what to do about that just yet. Also, you must update your Octoprint printer profile to have 2 extruders, or it will throw and error and only print stuff with extruder #1…

Adding Automatic Bed levelling with a 3Dtouch or BLtouch

I added the 3D touch to the design. The only place I could mount it was the back of the X carriage. I made a custom mount in openScad and you can find it here if you are interested.

I updated to Marlin 2.0 and have it set up with dual extrusion and am now using a 3Dtouch for my z axis. On my github repo, I have the 2.x firmware with the dual extruders turned on. You can turn this off by going into Configuratin.h and changing the line

#define EXTRUDERS 2

to

#define EXTRUDERS 1

Additionally, I have the 3dtouch firmware added as well in its own folder.

I’m not really happy with the results of the 3Dtouch being mounted where it is. Not sure how I’m going to fit it yet. You can use a program such as Meld to compare the changes in the Configuration.h and Configuration_adv.h files of the two versions of Marlin I posted on github.