Skip to content

Instantly share code, notes, and snippets.

View ryansturmer's full-sized avatar

Ryan Sturmer ryansturmer

View GitHub Profile
@ryansturmer
ryansturmer / topo.py
Last active August 29, 2015 14:24
DEM Converter
import re
class Topo(object):
def __init__(self, array, xscale=1.0, yscale=1.0):
self.array = array
self.w = len(array[0])
self.h = len(array)
minz = min(map(min, array))
self.maxz = max(map(max, array))-minz
self.minz = 0.0
@ryansturmer
ryansturmer / macro_3.sbp
Created April 16, 2015 13:23
Homing Routine
' HOMING ROUTINE
' RYAN STURMER
' WRITTEN FOR FABMO PLATFORM FOR A HANDIBOT
&approach_speed_fast = 1.0
&approach_speed_slow = 0.25
&search_distance_x = -8.0
&search_distance_y = -6.0
&backoff_x = 0.25
&backoff_y = 0.25
@ryansturmer
ryansturmer / TinyGv2.inf
Created March 19, 2015 18:54
TinyGv2.inf (Fixed for Windows 8.1)
[Strings]
DriverPackageDisplayName="TinyG USB Driver"
ManufacturerName="Synthetos (www.synthetos.com)"
ServiceName="USB RS-232 Emulation Driver"
due.bossa.name="Bossa Program Port"
due.programming_port.name="Arduino Due Programming Port"
due.sketch01.name="TinyG v2 (Control Channel)"
due.sketch02.name="TinyG v2 (Data Channel)"
due.original.name="Arduino (broken TinyGv2)"
util = require('util');
Interpreter = require('gcode').Interpreter;
var GCodeAnalyzer = function() {
Interpreter.call(this);
this.x = 0.0;
this.y = 0.0;
this.z = 0.0;
this.min_dist = 100000000000;
@ryansturmer
ryansturmer / mb_analyze.py
Last active August 29, 2015 14:15
Analyzer for output of mb.gdb
import re
import sys
STATES = {
0 : 'EMPTY',
1 : 'PLANNING',
2 : 'QUEUED',
3 : 'PENDING',
4 : 'RUNNING'
}
@ryansturmer
ryansturmer / mb.gdb
Created February 8, 2015 18:34
gdb script to print out the state of the G2 motion buffer pool
set logging on
set logging file mb.txt
print &mb.bf[0]
print mb.bf[0]
print &mb.bf[1]
print mb.bf[1]
print &mb.bf[2]
print mb.bf[2]
print &mb.bf[3]
print mb.bf[3]
{
"gun": 0,
"gco": 2,
"1ma": 0,
"2ma": 1,
"3ma": 2,
"4ma": 3,
"5ma": 4,
"6ma": 5,
"1sa": 1.8,
@ryansturmer
ryansturmer / catplex.nc
Created February 3, 2015 14:34
G-code file for failed run
G17
G0Z0.8000
G0X0.0000Y0.0000S14000
M4
G0X3.8614Y4.8938Z0.2000F360.0
G1Z-0.2500F60.0
G1X3.7793Y4.9581F180.0
G1X3.7101Y5.0093F180.0
G1X3.6951Y4.9906F180.0
G1X3.6832Y4.9711F180.0
@ryansturmer
ryansturmer / one_circle_segments.nc
Created January 30, 2015 20:31
Cut a simple circle with g-code segments
G17
G0Z0.8000
G0X0.0000Y0.0000S14000
M3
M8
G0X0.5000Y1.5000Z0.4500F240.0
G1Z0.1500F60.0
G1X0.5001Y1.4839F120.0
G1X0.5005Y1.4677F120.0
G1X0.5012Y1.4513F120.0
@ryansturmer
ryansturmer / one_circle_arcs.nc
Created January 30, 2015 20:30
Cut a simple circle using 4 arcs
G17
G0Z0.8000
G0X0.0000Y0.0000S14000
G0X0.5000Y1.5000Z0.4500F240.0
G1Z0.1500F60.0
G3X1.5000Y0.5000I1.0000J0.0000F120.0
G3X2.5000Y1.5000I0.0000J1.0000F120.0
G3X1.5000Y2.5000I-1.0000J0.0000F120.0
G3X0.5000Y1.5000I0.0000J-1.0000F120.0
G0Z0.4500F240.0