3D printed "Magic Spring"

I made a "Magic Spring"(slinky) on a 3d printer.

Similar projects worth following
I wrote a java program to produce the g-code.
printed on "printrbot simple metal"
current print is "sainsmart dark wood fill"(210c)
has been printed with "hatchbox glow in the dark"(180c)
output file is named "auto0.g" because printer will automatically print a file with that name on the micro SD card.
Basically, the printer "zigzags" between an inner radius, and an outer radius while constantly increasing the height.
The factors have been tweaked such that every layer lays on top of the previous one with minimal adhesion(unlike a normal print where settings are optimized for maximal adhesion).
The finished helix sits quite rigid, until the layers are forced apart(fingernail works!)
If anyone tries this print, I recommend cancelling after 4-5 layers and double checking that it will separate, it is frustrating to have a completed print that wont come apart.
I hope the google drive link works(uploaded entire project folder, g-cod


standalone version of java program. it's a first step towards not needing to compile every time to change parameters. "java -jar magspring.jar" for people like me that don't know how to get command line java running.

Java Archive - 10.15 kB - 03/10/2017 at 17:57


current code, tested, works

Java Source File - 4.99 kB - 03/10/2017 at 13:36



tiny(ir12.5 or17.5) slinky 1mm layer height .35 fudge factor

g - 2.38 MB - 03/10/2017 at 13:25



tiny(ir12.5 or17.5) slinky 0.47mm layer height 0.45 fudge factor

g - 5.10 MB - 03/10/2017 at 13:25



test print with fudge factor of .33 0.7mm layer height

g - 3.38 MB - 03/10/2017 at 13:25


View all 13 files

  • Accomodations

    mpclauser03/11/2017 at 04:49 0 comments

    To anyone who would like to try this print, but has a printer with special needs, post in the comments, and i will be happy to try and adjust my code for your printer.

    some things that i know may cause issues:

    my vertical axis is Z, some printers label the vertical axis Y. I find this annoying about minecraft, but understand the design logic of Z coming out of a blackboard, rather than off a sheet of paper. I'm happy to create a y-vertical version of the code if people show an interest. In the meantime, the currently available code should be easy to adjust for this type of printer: open the code in editor of choice, find-replace ALL no quotes "Y" with "Q", than "Z" with "Y" and finally "Q" with "Z".

    my zero point is at a corner, and all axis move positively away from that point, i believe some printers(i know the makerbot for one) have 0,0,0 in the center of the buildplate, and x and y can both be posative or negative. for smaller springs, this still works, and just shifts where the print is positioned. for larger springs, this may attempt to push past the boundries of the printer. the solution is a simple edit in the source code, removing the offsets, however editing the pre-produced gcode would be a nightmare(unless you made a scrypt to read values and subtract the offset back out)

    any other discrepancies between the way my code operates, and the way your printer is designed, I make no promises, but i'll be happy to look into possible modifications.

  • "Layer height"

    mpclauser03/10/2017 at 16:02 0 comments

    A note on what i refer to as layer height;

    Cura would say my print is 1 layer tall(it only checks comments for layer:X)

    Repetier-Host will say my print is tens of thousands of layers tall(it counts every increse in Z as a layer(i assume for the printers with y as vertical, it coutns Y))

    I say my print is 150 layer tall(i count a layer as a full rotation of the helix, or one separate cross section)

    so, when I say my layer height is .47, I mean that if one "layer" of the slinky is measured it should ideally be .47mm tall(i'm getting a bit more than that, it's not completely flat across the layer)

    The plastic is actually adhering to the path extruded immediately before it, and not(hopefully) to the previous "layer", so maybe Repetier is the most right, and my layer height is actually 0.000648mm

    I have printed 1.5mm tall layers of the slinky with a 0.6mm nozzle and it looks good

    so, even though the layer height seems a bit extreme for the nozzle size, nothing about this print conforms to traditional slicer logic.

  • Confession Time

    mpclauser03/10/2017 at 13:58 0 comments

    So, while it's a good idea to clean up code, and add comments before letting the public criticize it, it is a BAD idea to write the code from scratch, and and upload it for the public before you have tested it.

    I have uploaded the fixed code to the files here, I have updated my google drive.

    I have uploaded multiple example codes, most of which i have tested(at least for the first 4-5 rounds) and they separate with little to no trouble.

    SORRY to all those that wasted filament on my broken code.

    here are 3 tiny test prints when i was working on the fudge factor. from left to right they are 1.0, 0.5, 0.33

    they have all been printed at 0.7mm layer height, average radius of 20mm and width of 3mm, and delta of 1

    1.0 has been lost, but i believe it measured more like 6mm width, no chance of sepparation

    0.5 is a touch oversize 3.5mm, separated well

    0.33 (actually calculated/3, but close enough) too small 2.4mm width, separated as i pulled it off build plate.

    the fact that my calculated extrusion factor is so much more than necessary leads me to believe there is a large error somewhere in my code, but for now i'll just stick to a fudge factor of 0.45 and go on with life.

  • printed large spring

    mpclauser03/09/2017 at 16:20 0 comments

    last night I printed this behemoth. it was still printing this morning, but the printer was much closer to the max height than repetier thought it was, I'm wondering if I need to calibrate the printer.

    there are some flaws noticeable in the photo, but overall it printed fairly nice.

    width should be 4mm(inner radius 36, outer radius 40) but actually measures just over 3 for most of the print. i'm blaming this on too small of an extrusion factor, it's clearly moving 4mm, but edges are pulling back.

View all 4 project logs

Enjoy this project?



Juan Garcia wrote 05/20/2017 at 13:28 point

I noticed the default value assigned to your extrusion factor variable `extr`  at the top isn't being used anywhere since you reassign `extr` with `ecalc * fudge`.

Just wondering if that default value was old code, or if it's meant to be used somewhere before being overwritten later, and maybe that was deleted by accident?

  Are you sure? yes | no

mpclauser wrote 05/20/2017 at 15:17 point

extr setting was old code, that's the value that printed my first slinky. Poor coding to leave it there, but it brings back memories of twerking it every time till it was just right. And fudge is always under .5, because my calculations assume a radial progression with every movement(triangle wave), while the actual code only progresses every other movement(sawtooth wave).

  Are you sure? yes | no

Juan Garcia wrote 05/27/2017 at 11:58 point

Cool, thanks!

Side question: I'm trying to understand the extrusion value for `G1`. After reading the docs I was under the impression that the extrusion amount would be a fixed value, calculated by the length of the segment zigging or zagging between `ir` and `or` (the the amount of plastic to lay down from the previous G1's end to the end of the current G1). But in your source and other gcode examples, it's steadily increasing for each `G1`.

Clearly it works (already have a bunch of slinkys printed), so I'm not debating that. I guess I'm just looking for insight since it seems counter-intuitive to me.

  Are you sure? yes | no

Chris Mitchell wrote 03/10/2017 at 11:44 point

Wow ok my 1st, 2nd and 3rd attempt at this does not look like your article pic :(

Actually it's just all fused together and no where near as smooth as yours. if i back off the extrusion multiplier it starts curling up and printing rough. more experimentation (and beer) required!
What kind of printer / material did you use ?
Do you normally print first & subsequent layers at 0.47mm ?
What's you nozzle width?

  Are you sure? yes | no

Chris Mitchell wrote 03/10/2017 at 11:49 point

Oops, after re-reading your project need to reiterate printer / material hehe.

But i am still curious about the nozzle width and your normal layer height that you print at. 0.47 seems a bit extreme but i guess you came to that figure after *some* experimentation :)

  Are you sure? yes | no

mpclauser wrote 03/10/2017 at 14:15 point

I posted bad code SORRY! new files uploaded, old ones are still here as a monument to my stupidity. 

the height of .47 was actually worked out from my original code(before the bad code i uploaded), had layer height set at "0.7", but was using separate numbers for angle per zigzag, and zigzags per layer, my calculations were off(0.5 degrees and 1080 per layer) obviously this gave me 2/3 of my intended layer height.  at the time, it worked because i was just adjusting factors until i got what i wanted, but it would confuse anyone who tried to read through my code. the new code calculates movements per layer based on degrees per movement.

0.47 may seem like too big a layer height(especially when i was originally printing with a 0.4mm nozzle) but remember that most of the plastic is intended to stick to the previous movement, and not the previous layer.

Now that I am using a calculated extrusion factor rather than an absolute factor, that constantly needed adjustment, I have printed a whopping 2mm layer height that looks great(with the 0.6mm nozzle)

think of it less as a 0.47mm layer height, and more as a 0.47/720 layer height, with only 2 movements per layer.

  Are you sure? yes | no

Chris Mitchell wrote 03/11/2017 at 02:15 point

All good buddy :)
I know how these things tend to go hehe, it's been a fun experiment so far with some encouraging results. I'll check out the new code and files, thanks for updating the project :)
I might just have see what it does with a 0.8mm nozzle too

  Are you sure? yes | no

mpclauser wrote 03/07/2017 at 16:19 point

thank you for the info Clayton, the link was helpful

I've tried several more attempts with PETG, I believe my filament has absorbed moisture, the print is brittle(partially due to low print temp) , and makes snapping sounds when printing. I'm going to put this one on the back burner while until I can get it dry. Onward to adjusting the parameters for a bigger PLA slinky.

  Are you sure? yes | no

Clayton G. Hobbs wrote 03/06/2017 at 17:46 point

Pretty neat!  I accidentally made something like this once.  My first PET test print was a hollow cylinder, sliced with the spiral vase setting.  The temperature was too low, so the layers separated, leaving me with a nice little Slinky.  Cool to see someone doing it on purpose!

  Are you sure? yes | no

mpclauser wrote 03/06/2017 at 18:00 point

What temp were you printing? I've tried PETG a couple times, it's fused together quite securely(of course, when I want PETG to fuse, it will not)

  Are you sure? yes | no

Clayton G. Hobbs wrote 03/06/2017 at 19:11 point

I don't remember with any certainty, as it was a couple years ago.  It
might've been 212 °C though, looking at the correction to a typo on
Taulman's website:

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates