Buggy gCode

December 20, 2012

I came downstairs to check in on a print and found this Leptocoris trivittatus chilling on my laptop screen.

buggy

Advertisements

His nibs.

October 19, 2012

I started using a Wacom Intuos 2 tablet in 1999 after struggling with a mouse-induced repetitive stress injury. I’ve been holding the same stylus pretty much every day, for hours a day, for the last twelve years.

Over time, the nibs eventually wear out, and I’m left wondering where I left that tiny bag of replacement nibs I bought from Wacom three years ago to replace the tiny bag of replacement nibs I lost six years ago.

Now I have a Replicator, and I can print my own highly precise pieces of plastic. I’m a big believer in Taking It Just A Little Too Far, so I’ve designed a nib based on the slicing end of a Shaolin spade.

The Shaolin spade (月牙铲, or yuèyáchǎn for my fellow xuésheng) was the favored weapon of drunken monk Lu Zhishen, made famous to those without an interest in classical Chinese literature by Max Brooks’ Zombie Survival Guide and the fine Kurt Russell vehicle Big Trouble in Little China.


The nib should work for any Wacom stylus. Here it’s pictured in my Bamboo, which I use for work when I’m traveling.

My original plan was to include the Shaolin spade in the Zheng3 Cocktail Arsenal, but the tip is too wide to be thrusting through maraschino cherries. It should make a dandy calligraphic nib for those so inclined.

If you’re the kind of person who cares enough about the quality of a digital brush stroke to 3D print custom nibs for a Wacom tablet, you deserve a step-by-step tutorial on how to do it.

This is a really precise, but very simple print. The nib’s shaft needs to be sized so that it fits the bore of the Wacom pen and can be removed with the tiniest effort, but not so loose that it falls out when one begins to draw with the stylus.

I did a lot of trial and error to get the nib diameter correct, because my four-dollar hardware store calipers produced a measurement that was way, way too thick to fit into the pen. A radius of .065 cm seems to do it when printing with the following method. I’m assuming there’s some contraction/expansion/plastic real-world-weirdness that doesn’t show up when the design isn’t all vertices and electrons.

Note that I’m printing with PLA.

ReplicatorG Settings:
HBP: 45° C
100% infill
Layer Height: .2
Number of shells: 1
Feedrate: 25 mm/sec
Travel Feedrate: 55

This print is so small and delicate that any extruder-induced jiggling of the Replicator is likely to shift the plastic off your platform. I got good results by slowing the print heads down. Here’s how I did it:

Generate your gCode from within ReplicatorG using the above settings. Then do a couple of find/replaces in your favorite text editor:

Replace F750.0 with F100.0
also replace F1500.0 with F100.0

There’s probably a way to do this from the GUI but for some reason I’m more comfortable mucking around in the ASCII.

Run the print. Your instinct will be to pull that new nib off the build platform and jam it into your stylus ASAP. Don’t. Give it a few minutes to cool so it doesn’t warp upon removal.

It’s easy to remove a fresh nib from a Wacom stylus. Just grab it with some pliers and pull gently. Scissors are useful for removing a worn nib; cut slightly into the plastic of the nib with the blades and then pull it out.

Download it from Thingiverse.


Seej Pillar

August 30, 2012

My Seej fortifications have been looking a little mundane lately so I designed this seven-piece fluted column to add a little bit of architectural elegance to my battles. It handily interlocks with existing Seej bloxen, and collapses spectacularly when hit with a penny from a Seej engine.

It’s pictured here with a Riveted Bloxen for scale.

This post was originally going to be about how to adjust your gCode by hand-tweaking it to get a good raftless PLA print, but then I went ahead and downloaded ReplicatorG 037. Editing gCode wasn’t necessary, except to set the HBP temperature to 65°.

Perfect print the first time out, even with a relatively complicated model like this one. No hocus-pocus required.

1.75mm Blue PLA (available at Amazon)
Infill 10%
Layer Height .20mm
Shells: 1
Feedrate 25mm/s
Travel Feedrate 55mm/s
Print Temperature 190°
HBP Temperature: 65°

Download the STL from Thingiverse.


Raftless Printing with PLA

August 8, 2012

I’m no expert at 3D printing, but through a lot of trial and error I’ve discovered a few nuggets of information that I wish I’d known a few months ago.

A few weeks ago I said I was chasing a raftless print. I’ve finally got it, at least with PLA and ABS, printing Seej bloxen.

This comparison isn’t entirely fair, since the bloxen are sourced from different models, but the difference between a hot, rafted print on the left and a cool, raftless print on the right should be pretty clear. Both of these are printed from the same roll of 1.75mm PLA.


Here’s what I’ve learned.

PLA likes a cool build platform, somewhere around 45° C: My MakerBot Replicator ships with a heated build platform, and ABS plastic seems to stick nicely around 115°.

When I first started printing with PLA I just assumed it was more or less like ABS. When prints started shifting off the platform I kept cranking up the temperature on the HBP, eventually resorting to elaborate raft structures with painters’ tape.

It never occurred to me that lowering the HBP platform temperature was the solution.

Changing the build temperature in gCode is easy: just find a line that looks like:

M109 S100 T0 (set HBP temperature)

And change S100 to S45. This assumes that you’re using ReplicatorG to generate your gCode.

There’s one other change that seems to be helping: print a nice, gooey first layer of PLA, and then back off the printing temperature to maintain the model’s integrity through the rest of the print. The gCode for this isn’t much more complicated, but you have to get it in the right place. First, set the extruder temperature at the beginning of the print, close to the top of the gCode:

M104 S240 T0 (set extruder temperature)

Change 240 (or whatever it is in your gCode) to 210.

The last step is to find the point in the gCode where the first layer stops and the second layer begins, and back off the temperature a bit.

In the other two instances there are existing M codes that tell the machine to wait for the extruder or bed to reach the specified temperature before proceeding. You’ll have to put those codes in yourself for this line.

Find the first example of:

M73 P1 (display progress)

and add these lines after the next <layer> tag:

(*custom gCode here*)
M104 S190 T1 (set extruder temperature)
M6 T1 (wait for toolhead, and HBP to reach temperature)
(*end custom gCode*)

That should drop the extruder temperature down to 190° and then resume printing. The delay can be a little unexpected the first time your Replicator just seems to stop printing abruptly, but then your forebrain will kick in and you’ll realize it’s just doing what you told it to do.

The usual warnings about bricking your Replicator or burning down your apartment building apply. Use this code at your own risk, and you should probably own couple of fire extinguishers anyways.


The Perfect is the Enemy of the Good

August 1, 2012

This happens to me all the time. I start looking for information on some technical subject and I end up wading through ancient forum posts and forgotten wikis in a fruitless search for clues. A lot of this stuff seems to be written by and for people smarter than I am. It can be very frustrating.

I usually just want to do X, where X is something straightforward like “pause the print, move the Replicator’s extruder head out of the way, wait for user input, and then resume the print.”

After a few hours of of data forensics and a fair amount of trial and error I have a gCode solution for X. Keep reading.

This is the beginning of a Seej Tournament Bloxen print.

I found the need for this script when I started printing with PLA a week or so ago. I haven’t got the temperatures quite down yet, so my rafts curl up a bit at the edges and sooner or later end up taking the whole print for a joyride around the build platform.

I’m still looking for that perfect raftless print, but along the way I’ve got to actually produce some printed models. So I’ve taken to printing a raft, pausing, and then using painters’ tape to bind the raft down to the build platform.

I’m a huge fan of having a bag of popsicle sticks around any hobby project. They’re cheap, disposable, and can be quickly modified into a variety of simple tools (gaffs, hooks, spreaders, etc) with a pocketknife. They’re also great for evenly applying painters’ tape to rafts.

It’s kludgey, but it works. The only problem I’ve had so far is getting around the print heads to get the tape down on the raft, but with this new script the Replicator moves the nozzles out of the way before pausing the print.

Fair warning: this worked on my Replicator, but there are no guarantees it will work on yours. If this code crashes your extruder head, slags your controller board, or burns your house down and torches all you hold dear and dry-humps the ashes, it’s not my fault.

That said, it’s pretty vanilla gCode and I don’t expect you’ll have many problems with it, assuming your gCode is using millimeters and absolute positioning, which I think is the default output from ReplicatorG.

The first lines you’ll need to look for are:

(<raftLayerEnd> </raftLayerEnd>)
M73 P6 (display progress)

This indicates the end of your raft’s print. The next significant line you’ll see is one that begins with G1:

It should look something like G1 X-4.8 Y-4.68 Z12.6 F3300.0

This is telling your Replicator to start extruding the first layer of your model. In between these two significant lines, you’ll have to add this code:

G91 (*set to relative positioning*)
G1 X-60 (*move the print heads -60mm in X, assuming the print is using mm*)
M71 P60 (Press button to resume print)
G1 X60 (*move the print heads back 60mm in X*)
G90 (*return to absolute positioning*)
M73 P6 (display progress)

Be careful with your X move values. I don’t see anything keeping you from accidentally ramming your extruder heads into the side of your Replicator with too large a value.

I’m sure there’s a more elegant way to write this code, but I’m never one to let perfection be the enemy of the good. It’s done, it works, and I can improve upon it later.

This code also seems to disable the Pause button once the user has pressed it, which is irritating but I can’t bring myself to spend the energy tracking that particular bugaboo down. I’d also like to find a way to get the nozzle’s current position, move the heads, and then return to that position. I’ve found tantalizing hints on just how to do that, but that’s a hack for a different day.