Simple Spiral G-code

Download Gcode
Tool Details
Tool Type:Pen
Extra Tool Details:
Robot Version
Works with micRo: v1.1 vX v2 v3 m2 m3
Created
Author: rturner
Date: Fri, 2010-07-02 17:12

Return to Gcode Library

Here's an example of a simple spiral along the X and Y axes.. It draws a spiral with size and shape according to the global variables.... It was made in response to some talk in the micro thread a while back.. It is made so that you can actually run it, that is, drive it to the middle of your work envelope, put a pen in your holder, bring it down so that it touches the top off your work surface and press play (It'll raise and pause for you to position paper underneath, if you desire.)

Astute programmers will notice that this program calculates the next point on the spiral (given the variables, and the machine position) and then makes a coordinated move towards it. Variables are provided to adjust the spiral size, number of spiral overlaps (for lack of a better term), resolution for both the degrees and distance between moves, and it allows for adjusting the starting radius and the starting degrees. For what it's worth, this is an Archimedean spiral, meaning that the distance between each successive arm/layer is the same as the one before and after it.

I'm casually working on a spherical spiral/helix, but after a bit of fiddling it became obvious that it demanded a different approach from how this was done (at the very least, the true finished radius needs to be known, as well as the distance from the center for each point along the helix- things that would require a significant re-write to accomplish..) I'd like to add that I'm proud that I was able to remember enough Trigonometry to pull it off... It's been a while since I've taken a math class, and I'm not sure if I ever paid attention.

© Copyright Grayson Sigler 2003-2011 All Rights Reserved.