Software
Machines That Make Machines
jonathan (dot) ward (at) cba (dot) mit (dot) edu

machine:

MTM SNAP

links:

ARDUINO
GRBL
GCTRL
KOKOMPE
PROCESSING
Screen
UBUNTU

MTM Snap Desktop Milling Machine Motion Control w/ Arduino, GRBL, and GCTR

Mac OS X

Install CrossPack for avr-gcc, AVR Libc, avrdude, etc.
Install Processing.
If using an Arduino Duemilanove or other FTDI-based board, install the FTDI drivers (if you haven't already). If using an Arduino Uno, no drivers are needed.
Optional: install git.

Ubuntu

apt-get install avrdude gcc-avr avr-libc screen git

Install Processing. If you're using an Arduino Uno, you'll also need to download Arduino and replace processing-1.5.1/modes/java/libraries/serial/library/RXTXcomm.jar with arduino-0022/lib/RXTXcomm.jar. Otherwise the serial communication doesn't work.

grbl (g-code interpreter for Arduino)

MTM Snap version: git clone https://github.com/damellis/grbl.git grbl

The Makefile is currently setup for an Uno on Mac OS X. If you're using another operating system, you'll need to replace /dev/tty.usb* with the serial port of your Arduino. (On Linux, this is likely /dev/ttyACM0 for an Uno and /dev/ttyUSB0 for other boards. On Windows, look in the Device Manager to determine the COM port.) If you're using an Arduino Duemilanove, you'll need to change the baud rate from 115200 to 57600.

to compile grbl:
make clean
make

to load grbl on to the Arduino:
make flash

to configure grbl settings (e.g. feed rate):
screen /dev/ttyUSB0 9600
(use "ctrl-a, k" to quit screen)

gctrl (grbl gui, written in Processing)

git clone https://github.com/damellis/gctrl.git gctrl

Open in Processing and click the run (play) button. Instructions are in the application's window.

One small bug is that if you want to select a serial port in gctrl, you need to press and hold down 'p' for a long time to get the available ports. We'll fix this in the next release.

Be sure to zero the machine before streaming a g-code file!

kokompe (for generating toolpaths and g-code)







grbl/Makefile

PROGRAMMER = -c stk500v1 -P /dev/ttyACM0 -b 115200

grbl/config.h

#define STEPPING_DDR DDRB
#define STEPPING_PORT PORTB
#define X_STEP_BIT 4
#define Y_STEP_BIT 2
#define Z_STEP_BIT 0
#define X_DIRECTION_BIT 5
#define Y_DIRECTION_BIT 3
#define Z_DIRECTION_BIT 1

grbl/settings.h

// steps per revolution * revolutions per inch / mm per inch
#define DEFAULT_X_STEPS_PER_MM (400.0 * 10.0 / 25.4)
#define DEFAULT_Y_STEPS_PER_MM (400.0 * 10.0 / 25.4)
#define DEFAULT_Z_STEPS_PER_MM (400.0 * 10.0 / 25.4)
#define DEFAULT_STEP_PULSE_MICROSECONDS 10
#define DEFAULT_MM_PER_ARC_SEGMENT 0.1
#define DEFAULT_RAPID_FEEDRATE 500.0 // in millimeters per minute
#define DEFAULT_FEEDRATE 600.0
//#define DEFAULT_ACCELERATION (DEFAULT_FEEDRATE/100.0)
#define DEFAULT_ACCELERATION (25.0)
#define DEFAULT_MAX_JERK 225.0
#define DEFAULT_STEPPING_INVERT_MASK 0