Skip to content

Instantly share code, notes, and snippets.

View wolfmanjm's full-sized avatar

Jim Morris wolfmanjm

View GitHub Profile
# issue probe commands to smoothie
require 'optparse'
require 'ostruct'
require 'rubyserial'
class Optparse
def self.parse(args)
options = OpenStruct.new
options.verbose = false
// this is the time it should take to execute this cartesian move, it is approximate
// as it does not take into account accel/decel
float secs = distance / rate_mm_s;
// check per-actuator speed limits by looking at the minimum time each axis can move its specified amount
// this is regardless of wether it is mm/sec or deg/sec for a rotary axis
for (size_t actuator = 0; actuator < n_motors; actuator++) {
// actual distance moved for this actuator
// NOTE for a rotary axis this will be degrees turned not distance
float d = fabsf(actuator_pos[actuator] - actuators[actuator]->get_last_milestone());
@wolfmanjm
wolfmanjm / cnc.rb
Created March 20, 2019 11:23
example turtle cnc script
job= CNC.build 'plate' do
@safe_z= 2
@tool_dia= (1.0/8)*25.4 # 1/8" end mill
@doc= 0.2
@feedrate= 1000
@laser= false
# size of plate
w = 100.0
l = 25.0
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Upload Files</title>
</head>
<body>
<h2>File Upload</h2>
Select file
( Made using CamBam - http://www.cambam.co.uk )
( circle-diamond-square 6/11/2016 6:23:25 PM )
( T0 : 6.35 )
G21 G90 G40
G0 F1800
G0 Z3.0
( T0 : 6.35 )
T0 M6
( Pocket1 )
G17
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
/****************************************************************************
* configs/bambino-200e/scripts/spificonfig.ld
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <[email protected]>
* Alan Carvalho de Assis [email protected] [nuttx] <[email protected]>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
[switch]
fan.enable = false # Enable this module
fan.input_on_command = M106 # Command that will turn this switch on
fan.input_off_command = M107 # Command that will turn this switch off
fan.output_pin = 2.6 # Pin this module controls
fan.output_type = pwm # PWM output settable with S parameter in the input_on_comand
misc.enable = false # Enable this module
misc.input_on_command = M42 # Command that will turn this switch on
misc.input_off_command = M43 # Command that will turn this switch off
/* This is a simple version of setjmp and longjmp.
Nick Clifton, Cygnus Solutions, 13 June 1997. */
//#include "acle-compat.h"
/* ANSI concatenation macros. */
#define CONCAT(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a##b
[general]
second_usb_serial_enable = false # This enables a second USB serial port
kill_button_enable = true # Set to true to enable a kill button
kill_button_pin = 2.12 # Kill button pin. default is same as pause button 2.12 (2.11 is another good choice)
uart0.baud_rate = 115200 # Baud rate for the default hardware ( UART ) serial port
leds_disable = true # Disable using leds after config loaded
play_led_disable = true # Disable the play led
[motion control]
default_feed_rate = 4000 # Default speed (mm/minute) for G1/G2/G3 moves