Making Procedurally Generating Spalting Patterns

I did this a while back, but someone had an interest in this on hackaday so I tried to dig up my old code.

The goal is to generate wood grain patterns for laser cutting/CNC of plywood. Mainly, I wanted to have something similar to spalted maple laser etched onto the plain birch veneered plywood. The thing that inspired this project was this post of speaker boxes on imgur I came across. The design looked really cool, and while spalted maple is expensive, birch plywood is relatively cheap.

My first step was to procedurally create a random pattern.  Similar to the imgur post, I looked at creating camouflage. I found a great example code on openprocessing by ThingOnItsOwn that used perlin noise to create a camouflage pattern. I tweaked the values a bit experimentally, then stretched the entire design to make the final design look more like woodgrain.

The next step was to just capture the edges of these blob shapes from the first pattern. I came across this example from Richard Bourne It is forked from this example from R. Luke DuBois.   Honestly I was being lazy because I had written edge detection code in college as it is standard image processing, but I knew someone else had it already in processing. Instead of using for loops, this version manually calculates out the kernel.

This leaves me with a result that looks pretty realistic.

Camo:

Spalting:

This creates a PNG filetype which can be used to add texture to a 3D print in the slicer. The slicer will adjust the print to incorporate the texture in 3D giving it a woodgrain-like effect. You technically could use this as-is on a laser cutter to create spalting like my inspiration, however being raster data, it would take the laser a long time. It’d have to scan the laser (the thickness of a human hair) across the entire area of the panel you are applying the texture on. To make this faster, you can vectorize the PNG in inkscape or other software to outline the dark areas of the PNG.  This will cut fast as it is a vector (the laser would just have to draw the lines the same way your hand would. That would save a lot of time.

If anyone wants to add vectorizing to my code, please do! You can clone my github and put it on P5.js. I was going to add it, but I got lazy again. I even asked ChatGPT3 to help combine this code with something like potrace or imagetracerjs but it produced code that looked great, some even compiled after a few tweaks, but never worked.

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

3Doodler Pen Fix

3D pens are great, especially for kids to get out their creativity. I was one of the first backers for the original 3Doodler on kickstarter years ago, so when I saw they had shifted to really low temp filament and focused on kids, I had to get our little one into the 3D scene. I bought the 3Doodler 3D, which has no motor and is hand-cranked.  If you use old filament, it can get clogged and stop working. Since you can’t make it any hotter, you’re kind of stuck.  Due to the feeding mechanism, you can force the plastic through by hand to some extent, but it eventually clogged irreparably after about a year. You cannot open this one to fix it without destroying it because it is ultrasonically welded together.

So after destroying the hand-cranked version, I got motorized pen version called the 3Doodler Start. This is a big upgrade on manually cranking as you can get more intricate results with what you are making.  However almost immediately after opening the 3Doodler Start pen, it stopped working. We had used some freshly bought, but apparently expired filament sticks from the local hobby store. Luckily this model is MUCH easier to take apart and put back together. Here’s how to do that!

 

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.

Thoughts on a Self-hosted (local) 3D File Graphical Library

I’ve got a few problem with 3D printer file websites…

I’m kind of tired of finding a cool 3D print I’d like to make and putting it in my “saved”  list on the website, only to forget which of the 50 sites it was that I found it at when I finally get around to printing it. Also, each of these sites is changing and features are added/removed/broken and folks complain about them all the time. (lookin’ at you Thingiverse…)

I’m also tired of not being able to preview the STL files in windows as icons, etc since the downloads often have useless names.  I think I’ve come up with an idea for a good solution.

It’d be a Chrome webApp (no installing extra software on the computer like a server or docker image or anything stupid like that since everything we need is built into Chrome) that will:

  1. Allow you to scrape any 3D printer project from the file hosting site (thingiverse, cults, etc.) with the click of a button, hotkey, or right-click option. This would allow you to get description, images, license, and files from whatever website and save them locally. It also embeds a link to the original source into the description. I’d be able to have differently labeled categories or tags and I can add the object to more than one tag. Extra points if it adds a note if the editable source files are in the file download and what program’s can edit them (STEP, SCAD, etc).
  2. Store this data in indexedDB.
  3. Host a webpage interface which previews the STL files using javascript, categorized, all the text and data form the original source with a link to the original source if you want to check for updates (could possibly add this as an automatic feature later), comments, etc. Most importantly, you can search through all your saved files and see them previewed.—all local!~
  4. Can launch the slicer of your choice for any particular STL file with the click of a button a’la External Application Button
  5. Until Persistent data is implemented, you can export the indexedDB data.

Thoughts? Anyone else see the need for this type of thing?