Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
dba26ef
implemented a mixture of Sonny's MATLAB and my previous grbl planner
jgeisler0303 Feb 20, 2013
87864cc
added counter for planner steps
jgeisler0303 Feb 20, 2013
40d8b8b
Update README.md
chamnit Feb 20, 2013
67608a5
Merge pull request #188 from jgeisler0303/new_planner
chamnit Feb 20, 2013
ea09ddb
changed atomic access for updating the acceleration profile
jgeisler0303 Feb 22, 2013
a85e1b8
Push additional updates from @jgeisler0303
chamnit Feb 22, 2013
74bdc32
Added some prelimary notes to new changes.
chamnit Feb 22, 2013
b75e95c
integrating soft limits
rustyoz Feb 26, 2013
a0f430d
bugfix: uninitiallized curr_block->new_entry_speed_sqr lead to step loss
jgeisler0303 Feb 26, 2013
7951b83
Merge pull request #193 from bungao/soft_limts
chamnit Feb 26, 2013
74b2af3
Minor changes and added notes to soft limits routines.
chamnit Mar 1, 2013
b06643a
Bug fix to-do note on soft limit checks. Not yet completed.
chamnit Mar 1, 2013
1fa3dad
Updates to edge/dev. Line buffer increased/planner buffer decreased. …
chamnit Apr 5, 2013
7a175bd
Push old dev_2 draft to work on other things.
chamnit Aug 19, 2013
805f0f2
Protected buffer works! Vast improvements to planner efficiency. Man…
chamnit Oct 9, 2013
8a10654
New stepper subsystem bug fixes.
chamnit Oct 12, 2013
0cb5756
Fine tuning of new stepper algorithm with protected planner. Adaptive…
chamnit Oct 15, 2013
f7429ec
Cleaned up stepper and planner code.
chamnit Oct 25, 2013
27297d4
Updated comments. Changed stepper variable names to be more understan…
chamnit Oct 29, 2013
0ac6c87
Planner function call fix. More clean up.
chamnit Oct 30, 2013
4f9bcde
Merge branch 'dev_2' into dev
chamnit Oct 30, 2013
4402a9f
Merge branch 'dev_2' into dev
chamnit Oct 30, 2013
b8f0a23
Merge fixes.
chamnit Oct 30, 2013
2eb5aca
Another merge fix.
chamnit Oct 30, 2013
b36e30d
Yet another major stepper algorithm and planner overhaul.
chamnit Nov 23, 2013
2f6663a
Reinstated feed holds into new stepper algorithm and planner. Rough d…
chamnit Dec 5, 2013
a87f257
Pushed limits active high option. Updated defaults.h. Misc bug fixes.…
chamnit Dec 7, 2013
b562845
Deceleration to zero speed improvements. Update defaults.
chamnit Dec 8, 2013
3054b2d
Revamped homing cycle. Axis limits and max travel bug fixes. Build in…
chamnit Dec 11, 2013
eefc25b
Hard Limits configured for active high.
scottrcarlson Dec 27, 2013
8550d2c
Merge pull request #312 from scottrcarlson/dev
chamnit Dec 27, 2013
903b462
Merge branch 'dev' of https://github.com/grbl/grbl into dev
chamnit Dec 30, 2013
bfb8639
Merge branch 'dev' of https://github.com/grbl/grbl into dev
chamnit Dec 30, 2013
5ab2bb7
Incomplete dev code push, but working. Lots of updates/fixes/improvem…
chamnit Dec 30, 2013
47cd40c
Incomplete push but working. Lots more stuff. More to come.
chamnit Dec 31, 2013
f10bad4
Minor bug fixes: Homing travel calculations. Cycle resuming after spi…
chamnit Dec 31, 2013
c038179
PWM Spindle Control and Invert Spindle & Coolant Pins
Jan 2, 2014
f8dd8fa
Fix for M7/8/9 modal group checks. Updated AMASS frequency cutoffs an…
chamnit Jan 2, 2014
ce5f94d
Update spindle_control.c
EliteEng Jan 2, 2014
e7cd94e
Merge pull request #318 from EliteEng/dev
chamnit Jan 3, 2014
1c40973
Update to fix compile error
Jan 3, 2014
0104cad
Merge pull request #322 from EliteEng/dev
chamnit Jan 3, 2014
8b5f306
Cleaned up variable spindle output (PWM). Code and config comments.
chamnit Jan 4, 2014
1baff78
Variable spindle output. Resolved conflicts in last push.
chamnit Jan 4, 2014
3c3382f
New build info feature. (per @Analogreality request)
chamnit Jan 5, 2014
7a85ab8
Updates to some stepper algorithm commenting
chamnit Jan 5, 2014
cc9afdc
Lots of re-organization and cleaning-up. Some bug fixes.
chamnit Jan 11, 2014
6fdb35a
Initial line number reporting
robgrz Feb 6, 2014
cd71a90
Made line number reporting optional via config.h
robgrz Feb 6, 2014
50fbc6e
Refactoring and lots of bug fixes. Updated homing cycle.
chamnit Feb 9, 2014
5e9d60e
Merge pull request #1 from grbl/dev
Feb 14, 2014
3df61e0
Homing and feed hold bug fixes.
chamnit Feb 15, 2014
2307563
Merge commit 'cd71a90ce8a770e0030ed6c9bac805b89724e275' into dev
robgrz Feb 19, 2014
b332d6e
Commenting updates. Minor bug fix with exit of soft limit event.
chamnit Feb 19, 2014
9c95c14
Merge pull request #356 from robgrz/dev
chamnit Feb 19, 2014
1fd4579
Minor updates to line number feature.
chamnit Feb 19, 2014
0a46dfe
Minimal probing cycle working. Supports both G38.2 for error and G38…
robgrz Feb 25, 2014
8f8d8e2
Added grbl planner Matlab simulator for test reference. Updated line …
chamnit Feb 26, 2014
387a1b9
Merge pull request #362 from robgrz/dev
chamnit Feb 28, 2014
4d7ca76
Probe cycle line numbers ifdef fixes to get it to compile.
chamnit Feb 28, 2014
76ab1b6
G38.2 probe feature rough draft installed. Working but needs testing.
chamnit Mar 1, 2014
3d053d8
Probing command gets stuck in hold if several g38.2 are submitted
henols Mar 7, 2014
2168bb1
Merge pull request #368 from henols/dev
chamnit Mar 7, 2014
d3bf28f
Probing command gets stuck in hold if several g38.2 are submitted
henols Mar 7, 2014
60dd609
Added Probing to Mega2560 and fixed Shapeoko2 compile error
EliteEng Mar 11, 2014
5310055
Merge pull request #373 from EliteEng/dev
chamnit Mar 13, 2014
06432c9
Comment corrections and function call update.
chamnit Mar 13, 2014
c4a8e19
Merge pull request #3 from grbl/dev
Apr 10, 2014
8cad156
working for 2560
Apr 11, 2014
78225ca
improved structure organization, possibly.
May 2, 2014
5a588d3
trying to figure out homing
May 7, 2014
28db85e
thinking about ways to simplify homing, allow it on per-axis basis
May 8, 2014
bf67959
remapped for my machine, limit reporting, individual axis homing
May 14, 2014
532c359
Major g-code parser overhaul. 100%* compliant. Other related updates.
chamnit May 25, 2014
92a3cad
line number of last line executed, + 4-axis fix
May 28, 2014
9439e43
Fixed spindle/coolant/dwell state check.
chamnit May 29, 2014
8ed8005
Various minor g-code parser fixes.
chamnit Jun 1, 2014
79e0e45
Arc error-checking update.
chamnit Jun 1, 2014
a517972
keyme board
Jun 5, 2014
ce12d9a
single stepish mode
Jun 5, 2014
239a4a3
Homing uses limit interrupt instead of tight loop.
Jun 26, 2014
c022465
Merge branch 'limitrework' into 4axis-limit
Jun 26, 2014
553b0f5
break cpu_map into diffable files
Jun 27, 2014
8d4febf
fix compiler warning
Jun 27, 2014
286f3b5
no limit interrupts
Jun 27, 2014
9d3d3d5
use GPIO General Purpose Register for volatile exec flag for atomic o…
Jun 27, 2014
94afdd7
raise alarm if limits not found during homing
Jun 30, 2014
1654287
dont try to home inactive limits
Jun 30, 2014
1ef5a45
Minor bug fixes and updates. Line number tracking.
chamnit Jul 2, 2014
b7576ef
some small work with changing homing configuration and a compile flag
mdicicco Jul 3, 2014
92d6c2b
G-code parser G0/G1 bug fix.
chamnit Jul 4, 2014
8c9f3bc
Total rework of simulator for dev branch. Create separate thread for…
Jul 4, 2014
d3322cc
reduce diffs with dev branch
Jul 4, 2014
ed41722
Realtime rate reporting. Updated decimal places.
chamnit Jul 4, 2014
8207562
minor tweaks for mingw.
Jul 5, 2014
df2fd60
Don't need kbhit.h
Jul 5, 2014
aa95cb6
Update readme.md
Jul 5, 2014
1b66c9c
formatting
Jul 5, 2014
e455faa
New G43.1/G49 gcodes. Not working yet!!
chamnit Jul 5, 2014
21850ce
Merge grbl-sim updates for v0.9.
chamnit Jul 5, 2014
57eb860
Merge branch 'ashelly-sim-update' into dev
chamnit Jul 5, 2014
dab4535
G43.1/G49 tool length offset installed. Minor bug fix.
chamnit Jul 6, 2014
145cea2
Syntax fix for gcode.c
chamnit Jul 6, 2014
7e6eea2
Merge branch 'official-dev' into 4axis
Jul 7, 2014
67c377c
Merge branch '4axis-limit' into 4axis
Jul 7, 2014
63d393e
Fixed limit timeout, set position to 0 at home, merge cleanup
Jul 7, 2014
6c4ff61
Merge branch '4axis' of https://github.com/ashelly/grbl into 4axis
Jul 7, 2014
ab1e029
sim updates for wdt and io port access - in progress
Jul 8, 2014
30b3423
sim watchdog file
Jul 8, 2014
dc4cfe6
my machine is in positive space
Jul 8, 2014
49ee18c
remove debug prints
Jul 8, 2014
aac2072
fix merge error which broke gcode parser
Jul 9, 2014
b127be0
fixed timer errors, port monitor, initial simulate limits implementation
Jul 10, 2014
a27d17d
merge conflict resolved
mdicicco Jul 10, 2014
f6d9241
checkpoint output
Jul 11, 2014
288b583
fixed limits for atmega2560
Jul 11, 2014
fb7b561
port g0 high for enable
Jul 11, 2014
74a378e
Added support for keyme-specific pins
Jul 12, 2014
bfa556f
initial FM defaults
Jul 14, 2014
54fc4f4
rebuilt all
Jul 14, 2014
f42f0b6
Merge branch '4axis' of github.com:ashelly/grbl into 4axis
Jul 14, 2014
8028bd8
added support for non-critical limits for carousel
Jul 15, 2014
e95086a
Fix to report done for 0 length moves
Jul 18, 2014
dec4f2e
handle file errors, rate is float.
Jul 21, 2014
141fe6b
Merge branch '4axis' of github.com:ashelly/grbl into 4axis
Jul 21, 2014
e924264
Changes for a default board, removing any keyme specific defines
Jul 21, 2014
871656c
Lowered default baud rate, set defaults for keyme board.
Jul 22, 2014
538082b
Updated reporting to include counts, clear line number after move, bi…
Jul 24, 2014
f2b5031
Merge branch '4axis' into 4axis-into-edge. on the way to master
Aug 26, 2014
f068d32
fixed filename
Aug 27, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
*.elf
*.DS_Store
*.d
*~
*.out

14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,20 @@
# is connected.
# FUSES ........ Parameters for avrdude to flash the fuses appropriately.

DEVICE ?= atmega328p
#DEVICE ?= m328p
DEVICE ?= atmega2560
CLOCK = 16000000
#PROGRAMMER ?= -c avrisp2 -P /dev/ttyACM0
PROGRAMMER ?= -carduino -P/dev/ttyACM0
PROGRAMMER ?= -c avrisp2 -P /dev/ttyACM0
OBJECTS = main.o motion_control.o gcode.o spindle_control.o coolant_control.o serial.o \
protocol.o stepper.o eeprom.o settings.o planner.o nuts_bolts.o limits.o \
print.o report.o
print.o probe.o report.o system.o counters.o
# FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x24:m
FUSES = -U hfuse:w:0xd2:m -U lfuse:w:0xff:m
# update that line with this when programmer is back up:
# FUSES = -U hfuse:w:0xd7:m -U lfuse:w:0xff:m

# Tune the lines below only if you know what you are doing:

#AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) -B 10 -F
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE)
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) -B 10 -F -D
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -I. -ffunction-sections

# symbolic targets:
Expand Down Expand Up @@ -87,7 +84,7 @@ main.elf: $(OBJECTS)
grbl.hex: main.elf
rm -f grbl.hex
avr-objcopy -j .text -j .data -O ihex main.elf grbl.hex
avr-size -C --mcu=$(DEVICE) main.elf
avr-size --format=berkeley main.elf
# If you have an EEPROM section, you must also create a hex file for the
# EEPROM and add it to the "flash" target.

Expand All @@ -100,4 +97,3 @@ cpp:

# include generated header dependencies
-include $(OBJECTS:.o=.d)

29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
#Grbl - An embedded g-code interpreter and motion-controller for the Arduino/AVR328 microcontroller
#Grbl
------------

Grbl is a no-compromise, high performance, low cost alternative to parallel-port-based motion control for CNC milling. It will run on a vanilla Arduino (Duemillanove/Uno) as long as it sports an Atmega 328.
This branch serves only as a developmental platform for working on new ideas that may eventually be installed into Grbl's edge branch. Please do not use as there is no guarantee this code base is up-to-date or working.

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 m aintain more than 30kHz of stable, jitter free control pulses.
------------

Grbl is a no-compromise, high performance, low cost alternative to parallel-port-based motion control for CNC milling. It will run on a vanilla Arduino (Duemillanove/Uno) as long as it sports an Atmega 328. (Other AVR CPUs are unofficially supported as well.)

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, other basic functional g-code commands. Functions and variables are not currently supported, but may be included in future releases in a form of a pre-processor.
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, other basic functional g-code commands. Although canned cycles, functions, and variables are not currently supported (may in the future), GUIs can be built or modified easily to translate to straight g-code for Grbl.

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

##Changelog for v0.9 from v0.8
- **ALPHA status: Under heavy development.**
- New stepper algorithm: Based on the Pramod Ranade inverse time algorithm, but modified to ensure steps are executed exactly. This algorithm performs a constant timer tick and has a hard limit of 30kHz maximum step frequency. It is also highly tuneable and should be very easy to port to other microcontroller architectures. Overall, a much better, smoother stepper algorithm with the capability of very high speeds.
- Planner optimizations: Multiple changes to increase planner execution speed and removed redundant variables.
- New stepper algorithm: Complete overhaul of the handling of the stepper driver to simplify and reduce task time per ISR tick. Much smoother operation with the new Adaptive Multi-Axis Step Smoothing (AMASS) algorithm which does what its name implies. Users should audibly hear significant differences in how their machines move and see improved overall performance!
- Planner optimizations: Planning computations improved four-fold or more by optimizing end-to-end operations. Changes include streaming optimizations by ignoring already optimized blocks and removing redundant variables and computations and offloading them to the stepper algorithm to compute on an ad-hoc basis.
- Planner stability: Previous Grbl planners have all had a corruption issue in rare circumstances that becomes particularly problematic at high step frequencies and when jogging. The new planner is robust and incorruptible, meaning that we can fearlessly drive Grbl to it's highest limits. Combined with the new stepper algorithm and planner optimizations, this means 5x to 10x performance increases in our testing! This is all achieved through the introduction of an intermediary step segment buffer that "checks-out" steps from the planner buffer in real-time.
- Acceleration independence: Each axes may be defined with different acceleration parameters and Grbl will automagically calculate the maximum acceleration through a path depending on the direction traveled. This is very useful for machine that have very different axes properties, like the ShapeOko z-axis.
- Maximum velocity independence: As with acceleration, the maximum velocity of individual axes may be defined. All seek/rapids motions will move at these maximum rates, but never exceed any one axes. So, when two or more axes move, the limiting axis will move at its maximum rate, while the other axes are scaled down.
- Significantly improved arc performance: Arcs are now defined in terms of chordal tolerance, rather than segment length. Chordal tolerance will automatically scale all arc line segments depending on arc radius, such that the error does not exceed the tolerance value (default: 0.005 mm.) So, for larger radii arcs, Grbl can move faster through them, because the segments are always longer and the planner has more distance to plan with.
- Significantly improved arc performance: Arcs are now defined in terms of chordal tolerance, rather than segment length. Chordal tolerance will automatically scale all arc line segments depending on arc radius, such that the error does not exceed the tolerance value (default: 0.002 mm.) So, for larger radii arcs, Grbl can move faster through them, because the segments are always longer and the planner has more distance to plan with.
- Soft limits: Checks if any motion command exceeds workspace limits. Alarms out when found. Another safety feature, but, unlike hard limits, position does not get lost, as it forces a feed hold before erroring out.
- CPU pin mapping: In an effort for Grbl to be compatible with other AVR architectures, such as the 1280 or 2560, a new cpu_map.h pin configuration file has been created to allow Grbl to be compiled for them. This is currently user supported, so your mileage may vary. If you run across a bug, please let us know or better send us a fix! Thanks in advance!
- New Grbl SIMULATOR by @jgeisler: A completely independent wrapper of the Grbl main source code that may be compiled as an executable on a computer. No Arduino required. Simply simulates the responses of Grbl as if it was on an Arduino. May be used for many things: checking out how Grbl works, pre-process moves for GUI graphics, debugging of new features, etc. Much left to do, but potentially very powerful, as the dummy AVR variables can be written to output anything you need.
- Homing routine updated: Sets workspace volume in all negative space regardless of limit switch position. Common on pro CNCs. Also reduces soft limits CPU overhead.
- Feedrate overrides: In the works, but planner has begun to be re-factored for this feature.
- Jogging controls: Methodology needs to be to figured out first. Could be dropped due to flash space concerns. Last item on the agenda.
- Homing routine updated: Sets workspace volume in all negative space regardless of limit switch position. Common on pro CNCs. Now tied directly into the main planner and stepper modules to reduce flash space and allow maximum speeds during seeking.
- Combined limit pins capability: Limit switches can be combined to share the same pins to free up precious I/O pins for other purposes. When combined, users must adjust the homing cycle mask in config.h to not home the axes on a shared pin at the same time.
- Variable spindle speed output: Available only as a compile-time option through the config.h file. Enables PWM output for 'S' g-code commands. Enabling this feature will swap the Z-limit D11 pin and spindle enable D12 pin to access the hardware PWM on pin D12. The Z-limit pin, now on D12, should work just as it did before.
- Increased serial baud rate: Default serial baudrate is now 115200, because the new planner and stepper allows much higher processing and execution speeds that 9600 baud was just not cutting it.
- Feedrate overrides: (Slated for v1.0 release) The framework to enable feedrate overrides is in-place with v0.9, but the minor details has not yet been installed.
- Jogging controls: (Slated for v1.0 release) Methodology needs to be to figured out first. Could be dropped due to flash space concerns.

_The project was initially inspired by the Arduino GCode Interpreter by Mike Ellery_
Loading