An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on a straight Arduino https://github.com/gnea/grbl/wiki
  • C 98%
  • C++ 1.1%
  • Makefile 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-12-04 19:41:15 +01:00
build Git fix for empty directory. Makefile updated. 2015-02-10 22:10:03 -07:00
doc Update log. 2019-08-30 07:13:51 -04:00
grbl Add support for PORT_4 and PORT_5 2024-12-04 19:41:15 +01:00
.gitignore Merge branch 'edge' 2015-03-15 22:01:10 -06:00
COPYING Grbl v1.0e huge beta release. Overrides and new reporting. 2016-09-21 19:08:24 -06:00
Makefile Implement M64 + M65 g-code commands 2024-10-10 18:44:54 +02:00
README.md Add support for PORT_4 and PORT_5 2024-12-04 19:41:15 +01:00


Click the Release tab to download pre-compiled .hex files or just click here


This repository is a heavily modified grbl 1.1 adapted to be used as motor and GPIO controller for Four Thieves Winegar Collective Microlab.

Microlab uses stepper motors to control pumps and various pins on Arduino CNC Shield as GPIO to control relays.

DO NOT USE THIS REPOSITORY TO CONTROL YOUR CNC MACHINE - YOUR MACHINE WILL MOST LIKELY GET DAMAGED!!

  • Licensing: Grbl is free software, released under the GPLv3 license.

Pin mapping

Arduino CNC Shield pins are remapped to change their original behaviour:

CNC Shield pin Arduino Uno pin Microlab name
Endstop Z+/Z- 11 OUTPUT_1
Endstop Y+/Y- 10 OUTPUT_2
Endstop X+/X- 9 OUTPUT_3
SpnEn (Spindle Enable) 12 OUTPUT_4
SpnDir (Spindle Direction) 13 OUTPUT_5

Compiling

Arduino IDE

Open grbl/examples/GrblUpload.ino in Arduino IDE and compile + upload it from the editor.

For this to work you need to copy grbl directory into Arduino IDE libraries dir.

Linux command line / WSL2

Install compiler:

sudo apt-get install gcc-avr binutils-avr avr-libc gdb-avr avrdude

Compile:

make

Uploading firmware

Use avrdude for uploading hex file to the board. Avrdude supports native Arduino USB bootloader to program the board. Both Linux and Windows versions work fine.

On Debian/Ubuntu/etc install using: sudo apt-get install avrdude

Command line example:

avrdude -c arduino -P COM8 -b 115200 -p atmega328p -D -U flash:w:grbl.hex:i

GPIO control

Microlab-grbl implements M64-M65 g-code commands (turn on/off digital output immediately) to preserve compatibility with other CNC boards/firmware that may be used in the future with microlab.

M64 P1 - switch OUTPUT_1 high

M65 P1 - switch OUTPUT_1 low