Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganization for ArduinoIDE 1.8.x #965

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
*.elf
*.DS_Store
*.d
*.idea

README.md
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SOURCE = main.c motion_control.c gcode.c spindle_control.c coolant_control.c
protocol.c stepper.c eeprom.c settings.c planner.c nuts_bolts.c limits.c jog.c\
print.c probe.c report.c system.c
BUILDDIR = build
SOURCEDIR = grbl
SOURCEDIR = grbl/src
# FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x24:m
FUSES = -U hfuse:w:0xd2:m -U lfuse:w:0xff:m

Expand Down
681 changes: 681 additions & 0 deletions grbl/COPYING

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions grbl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
![GitHub Logo](https://github.com/gnea/gnea-Media/blob/master/Grbl%20Logo/Grbl%20Logo%20250px.png?raw=true)

***
_Click the `Release` tab to download pre-compiled `.hex` files or just [click here](https://github.com/gnea/grbl/releases)_
***
Grbl is a no-compromise, high performance, low cost alternative to parallel-port-based motion control for CNC milling. This version of Grbl runs on an Arduino with a 328p processor (Uno, Duemilanove, Nano, Micro, etc).

The controller is written in highly optimized C utilizing every clever feature of the AVR-chips to achieve precise timing and asynchronous operation. It is able to maintain up to 30kHz of stable, jitter free control pulses.

It accepts standards-compliant g-code and has been tested with the output of several CAM tools with no problems. Arcs, circles and helical motion are fully supported, as well as, all other primary g-code commands. Macro functions, variables, and most canned cycles are not supported, but we think GUIs can do a much better job at translating them into straight g-code anyhow.

Grbl includes full acceleration management with look ahead. That means the controller will look up to 16 motions into the future and plan its velocities ahead to deliver smooth acceleration and jerk-free cornering.

* [Licensing](https://github.com/gnea/grbl/wiki/Licensing): Grbl is free software, released under the GPLv3 license.

* For more information and help, check out our **[Wiki pages!](https://github.com/gnea/grbl/wiki)** If you find that the information is out-dated, please to help us keep it updated by editing it or notifying our community! Thanks!

* Lead Developer: Sungeun "Sonny" Jeon, Ph.D. (USA) aka @chamnit

* Built on the wonderful Grbl v0.6 (2011) firmware written by Simen Svale Skogsrud (Norway).

***

### Official Supporters of the Grbl CNC Project
![Official Supporters](https://github.com/gnea/gnea-Media/blob/master/Contributors.png?raw=true)


***

## Update Summary for v1.1
- **IMPORTANT:** Your EEPROM will be wiped and restored with new settings. This is due to the addition of two new spindle speed '$' settings.

- **Real-time Overrides** : Alters the machine running state immediately with feed, rapid, spindle speed, spindle stop, and coolant toggle controls. This awesome new feature is common only on industrial machines, often used to optimize speeds and feeds while a job is running. Most hobby CNC's try to mimic this behavior, but usually have large amounts of lag. Grbl executes overrides in realtime and within tens of milliseconds.

- **Jogging Mode** : The new jogging commands are independent of the g-code parser, so that the parser state doesn't get altered and cause a potential crash if not restored properly. Documentation is included on how this works and how it can be used to control your machine via a joystick or rotary dial with a low-latency, satisfying response.

- **Laser Mode** : The new "laser" mode will cause Grbl to move continuously through consecutive G1, G2, and G3 commands with spindle speed changes. When "laser" mode is disabled, Grbl will instead come to a stop to ensure a spindle comes up to speed properly. Spindle speed overrides also work with laser mode so you can tweak the laser power, if you need to during the job. Switch between "laser" mode and "normal" mode via a `$` setting.

- **Dynamic Laser Power Scaling with Speed** : If your machine has low accelerations, Grbl will automagically scale the laser power based on how fast Grbl is traveling, so you won't have burnt corners when your CNC has to make a turn! Enabled by the `M4` spindle CCW command when laser mode is enabled!

- **Sleep Mode** : Grbl may now be put to "sleep" via a `$SLP` command. This will disable everything, including the stepper drivers. Nice to have when you are leaving your machine unattended and want to power down everything automatically. Only a reset exits the sleep state.

- **Significant Interface Improvements**: Tweaked to increase overall performance, include lots more real-time data, and to simplify maintaining and writing GUIs. Based on direct feedback from multiple GUI developers and bench performance testing. _NOTE: GUIs need to specifically update their code to be compatible with v1.1 and later._

- **New Status Reports**: To account for the additional override data, status reports have been tweaked to cram more data into it, while still being smaller than before. Documentation is included, outlining how it has been changed.
- **Improved Error/Alarm Feedback** : All Grbl error and alarm messages have been changed to providing a code. Each code is associated with a specific problem, so users will know exactly what is wrong without having to guess. Documentation and an easy to parse CSV is included in the repo.
- **Extended-ASCII realtime commands** : All overrides and future real-time commands are defined in the extended-ASCII character space. Unfortunately not easily type-able on a keyboard, but helps prevent accidental commands from a g-code file having these characters and gives lots of space for future expansion.
- **Message Prefixes** : Every message type from Grbl has a unique prefix to help GUIs immediately determine what the message is and parse it accordingly without having to know context. The prior interface had several instances of GUIs having to figure out the meaning of a message, which made everything more complicated than it needed to be.

- New OEM specific features, such as safety door parking, single configuration file build option, EEPROM restrictions and restoring controls, and storing product data information.

- New safety door parking motion as a compile-option. Grbl will retract, disable the spindle/coolant, and park near Z max. When resumed, it will perform these task in reverse order and continue the program. Highly configurable, even to add more than one parking motion. See config.h for details.

- New '$' Grbl settings for max and min spindle rpm. Allows for tweaking the PWM output to more closely match true spindle rpm. When max rpm is set to zero or less than min rpm, the PWM pin D11 will act like a simple enable on/off output.

- Updated G28 and G30 behavior from NIST to LinuxCNC g-code description. In short, if a intermediate motion is specified, only the axes specified will move to the stored coordinates, not all axes as before.

- Lots of minor bug fixes and refactoring to make the code more efficient and flexible.

- **NOTE:** Arduino Mega2560 support has been moved to an active, official Grbl-Mega [project](http://www.github.com/gnea/grbl-Mega/). All new developments here and there will be synced when it makes sense to.


```
List of Supported G-Codes in Grbl v1.1:
- Non-Modal Commands: G4, G10L2, G10L20, G28, G30, G28.1, G30.1, G53, G92, G92.1
- Motion Modes: G0, G1, G2, G3, G38.2, G38.3, G38.4, G38.5, G80
- Feed Rate Modes: G93, G94
- Unit Modes: G20, G21
- Distance Modes: G90, G91
- Arc IJK Distance Modes: G91.1
- Plane Select Modes: G17, G18, G19
- Tool Length Offset Modes: G43.1, G49
- Cutter Compensation Modes: G40
- Coordinate System Modes: G54, G55, G56, G57, G58, G59
- Control Modes: G61
- Program Flow: M0, M1, M2, M30*
- Coolant Control: M7*, M8, M9
- Spindle Control: M3, M4, M5
- Valid Non-Command Words: F, I, J, K, L, N, P, R, S, T, X, Y, Z
```

-------------
Grbl is an open-source project and fueled by the free-time of our intrepid administrators and altruistic users. If you'd like to donate, all proceeds will be used to help fund supporting hardware and testing equipment. Thank you!

[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CUGXJHXA36BYW)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
OPT: Code, Build-Option Description,State
V,Variable spindle,Enabled
N,Line numbers,Enabled
M,Mist coolant M7,Enabled
C,CoreXY,Enabled
P,Parking motion,Enabled
Z,Homing force origin,Enabled
H,Homing single axis commands,Enabled
T,Two limit switches on axis,Enabled
A,Allow feed rate overrides in probe cycles,Enabled
D,Use spindle direction as enable pin,Enabled
0,Spindle enable off when speed is zero,Enabled
S,Software limit pin debouncing,Enabled
R,Parking override control,Enabled
+,Safety door input pin,Enabled
*,Restore all EEPROM command,Disabled
$,Restore EEPROM `$` settings command,Disabled
#,Restore EEPROM parameter data command,Disabled
I,Build info write user string command,Disabled
E,Force sync upon EEPROM write,Disabled
W,Force sync upon work coordinate offset change,Disabled
L,Homing initialization auto-lock,Disabled
OPT: Code, Build-Option Description,State
V,Variable spindle,Enabled
N,Line numbers,Enabled
M,Mist coolant M7,Enabled
C,CoreXY,Enabled
P,Parking motion,Enabled
Z,Homing force origin,Enabled
H,Homing single axis commands,Enabled
T,Two limit switches on axis,Enabled
A,Allow feed rate overrides in probe cycles,Enabled
D,Use spindle direction as enable pin,Enabled
0,Spindle enable off when speed is zero,Enabled
S,Software limit pin debouncing,Enabled
R,Parking override control,Enabled
+,Safety door input pin,Enabled
*,Restore all EEPROM command,Disabled
$,Restore EEPROM `$` settings command,Disabled
#,Restore EEPROM parameter data command,Disabled
I,Build info write user string command,Disabled
E,Force sync upon EEPROM write,Disabled
W,Force sync upon work coordinate offset change,Disabled
L,Homing initialization auto-lock,Disabled
2,Dual axis motors,Enabled
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
"Error Code in v1.1+","Error Message in v1.0-","Error Description"
"1","Expected command letter","G-code words consist of a letter and a value. Letter was not found."
"2","Bad number format","Missing the expected G-code word value or numeric value format is not valid."
"3","Invalid statement","Grbl '$' system command was not recognized or supported."
"4","Value < 0","Negative value received for an expected positive value."
"5","Setting disabled","Homing cycle failure. Homing is not enabled via settings."
"6","Value < 3 usec","Minimum step pulse time must be greater than 3usec."
"7","EEPROM read fail. Using defaults","An EEPROM read failed. Auto-restoring affected EEPROM to default values."
"8","Not idle","Grbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job."
"9","G-code lock","G-code commands are locked out during alarm or jog state."
"10","Homing not enabled","Soft limits cannot be enabled without homing also enabled."
"11","Line overflow","Max characters per line exceeded. Received command line was not executed."
"12","Step rate > 30kHz","Grbl '$' setting value cause the step rate to exceed the maximum supported."
"13","Check Door","Safety door detected as opened and door state initiated."
"14","Line length exceeded","Build info or startup line exceeded EEPROM line length limit. Line not stored."
"15","Travel exceeded","Jog target exceeds machine travel. Jog command has been ignored."
"16","Invalid jog command","Jog command has no '=' or contains prohibited g-code."
"17","Setting disabled","Laser mode requires PWM output."
"20","Unsupported command","Unsupported or invalid g-code command found in block."
"21","Modal group violation","More than one g-code command from same modal group found in block."
"22","Undefined feed rate","Feed rate has not yet been set or is undefined."
"23","Invalid gcode ID:23","G-code command in block requires an integer value."
"24","Invalid gcode ID:24","More than one g-code command that requires axis words found in block."
"25","Invalid gcode ID:25","Repeated g-code word found in block."
"26","Invalid gcode ID:26","No axis words found in block for g-code command or current modal state which requires them."
"27","Invalid gcode ID:27","Line number value is invalid."
"28","Invalid gcode ID:28","G-code command is missing a required value word."
"29","Invalid gcode ID:29","G59.x work coordinate systems are not supported."
"30","Invalid gcode ID:30","G53 only allowed with G0 and G1 motion modes."
"31","Invalid gcode ID:31","Axis words found in block when no command or current modal state uses them."
"32","Invalid gcode ID:32","G2 and G3 arcs require at least one in-plane axis word."
"33","Invalid gcode ID:33","Motion command target is invalid."
"34","Invalid gcode ID:34","Arc radius value is invalid."
"35","Invalid gcode ID:35","G2 and G3 arcs require at least one in-plane offset word."
"36","Invalid gcode ID:36","Unused value words found in block."
"37","Invalid gcode ID:37","G43.1 dynamic tool length offset is not assigned to configured tool length axis."
"Error Code in v1.1+","Error Message in v1.0-","Error Description"
"1","Expected command letter","G-code words consist of a letter and a value. Letter was not found."
"2","Bad number format","Missing the expected G-code word value or numeric value format is not valid."
"3","Invalid statement","Grbl '$' system command was not recognized or supported."
"4","Value < 0","Negative value received for an expected positive value."
"5","Setting disabled","Homing cycle failure. Homing is not enabled via settings."
"6","Value < 3 usec","Minimum step pulse time must be greater than 3usec."
"7","EEPROM read fail. Using defaults","An EEPROM read failed. Auto-restoring affected EEPROM to default values."
"8","Not idle","Grbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job."
"9","G-code lock","G-code commands are locked out during alarm or jog state."
"10","Homing not enabled","Soft limits cannot be enabled without homing also enabled."
"11","Line overflow","Max characters per line exceeded. Received command line was not executed."
"12","Step rate > 30kHz","Grbl '$' setting value cause the step rate to exceed the maximum supported."
"13","Check Door","Safety door detected as opened and door state initiated."
"14","Line length exceeded","Build info or startup line exceeded EEPROM line length limit. Line not stored."
"15","Travel exceeded","Jog target exceeds machine travel. Jog command has been ignored."
"16","Invalid jog command","Jog command has no '=' or contains prohibited g-code."
"17","Setting disabled","Laser mode requires PWM output."
"20","Unsupported command","Unsupported or invalid g-code command found in block."
"21","Modal group violation","More than one g-code command from same modal group found in block."
"22","Undefined feed rate","Feed rate has not yet been set or is undefined."
"23","Invalid gcode ID:23","G-code command in block requires an integer value."
"24","Invalid gcode ID:24","More than one g-code command that requires axis words found in block."
"25","Invalid gcode ID:25","Repeated g-code word found in block."
"26","Invalid gcode ID:26","No axis words found in block for g-code command or current modal state which requires them."
"27","Invalid gcode ID:27","Line number value is invalid."
"28","Invalid gcode ID:28","G-code command is missing a required value word."
"29","Invalid gcode ID:29","G59.x work coordinate systems are not supported."
"30","Invalid gcode ID:30","G53 only allowed with G0 and G1 motion modes."
"31","Invalid gcode ID:31","Axis words found in block when no command or current modal state uses them."
"32","Invalid gcode ID:32","G2 and G3 arcs require at least one in-plane axis word."
"33","Invalid gcode ID:33","Motion command target is invalid."
"34","Invalid gcode ID:34","Arc radius value is invalid."
"35","Invalid gcode ID:35","G2 and G3 arcs require at least one in-plane offset word."
"36","Invalid gcode ID:36","Unused value words found in block."
"37","Invalid gcode ID:37","G43.1 dynamic tool length offset is not assigned to configured tool length axis."
"38","Invalid gcode ID:38","Tool number greater than max supported value."
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1953,17 +1953,17 @@ Date: 2013-03-13
Author: Bertus Kruger
Subject: Update planner.c

Removed inline from all functions.
If this is really needed is there another way that we can get
Removed inline from all functions.

If this is really needed is there another way that we can get
around using it? (The Arduino IDE does not recognize it) 

----------------
Date: 2013-03-13
Author: Bertus Kruger
Subject: Update nuts_bolts.c

Removed __floatunsisf and used normal casting on line 81.
Removed __floatunsisf and used normal casting on line 81.
This makes it compatible with the Arduino IDE.

----------------
Expand Down Expand Up @@ -2005,7 +2005,7 @@ Date: 2013-03-12
Author: Bertus Kruger
Subject: Update gcode.c

home_select defined out of scope. Moved it outside the switch
home_select defined out of scope. Moved it outside the switch
so the rest of the switch can see it properly. 

----------------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 14 additions & 14 deletions doc/log/commit_log_v1.1.txt → grbl/doc/log/commit_log_v1.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -639,17 +639,17 @@ Date: 2016-10-22
Author: Will Winder
Subject: Minor VARIABLE_SPINDLE feature toggle refactoring (#16)

* Modify code CSV format.
- Wrap value in quotes to avoid issue with embedded commas. This occurs
in one of the alarm codes.
- Change header row format to allow same parsing code as data rows.
* VARIABLE_SPINDLE feature flag experiment.
- Use a macro for 'spindle_set_speed' and 'spindle_sync' to reduce the
number of required VARIABLE_SPINDLE checks.
* Modify code CSV format.

- Wrap value in quotes to avoid issue with embedded commas. This occurs
in one of the alarm codes.

- Change header row format to allow same parsing code as data rows.

* VARIABLE_SPINDLE feature flag experiment.

- Use a macro for 'spindle_set_speed' and 'spindle_sync' to reduce the
number of required VARIABLE_SPINDLE checks.


----------------
Expand Down Expand Up @@ -753,9 +753,9 @@ Date: 2016-10-17
Author: Will Winder
Subject: Modify code CSV format. (#10)

- Wrap value in quotes to avoid issue with embedded commas. This occurs
in one of the alarm codes.
- Wrap value in quotes to avoid issue with embedded commas. This occurs
in one of the alarm codes.

- Change header row format to allow same parsing code as data rows.

----------------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions grbl/library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "GRBL",
"keywords": "grbl, cnc",
"description": "Control a CNC machine interface.",
"repository":
{
"type": "git",
"url": "https://github.com/gnea/grbl.git"
},
"version": "1.1",
"exclude": "doc",
"frameworks": "arduino",
"platforms": ["atmelavr"]
}
9 changes: 9 additions & 0 deletions grbl/library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name=GRBL
version=1.1
author=GithubCommunity
maintainer=GithubCommunity
sentence=Arduino GRBL Library
paragraph=Control a CNC machine interface.
category=Other
url=https://github.com/gnea/grbl
architectures=avr,megaavr
1 change: 1 addition & 0 deletions grbl/config.h → grbl/src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
// If doing so, simply comment out these two defines and see instructions below.
#define DEFAULTS_GENERIC
#define CPU_MAP_ATMEGA328P // Arduino Uno CPU
// #define CPU_MAP_ATMEGA328P_NANO_V4 // Arduino Nano CPU - shield v4

// Serial baud rate
// #define BAUD_RATE 230400
Expand Down
File renamed without changes.
File renamed without changes.