- All pins, which include limits, control command, and probe pins, can
now all be configured to trigger as active-low or active-high and
whether the pin has its internal pull-up resistor enabled. This should
allow for just about all types of NO and NC switch configurations.
- The probe pin invert setting hasn’t been added to the Grbl settings,
like the others, and will have to wait until v1.0. But for now, it’s
available as a compile-time option in config.h.
- Fixed a variable spindle bug.
- Rudimentary CoreXY kinematics support. Didn’t test, but homing and
feed holds should work. See config.h. Please report successes and
issues as we find bugs.
- G40 (disable cutter comp) is now “supported”. Meaning that Grbl will
no longer issue an error when typically sent in g-code program header.
- Refactored coolant and spindle state setting into separate functions
for future features.
- Configuration option for fixing homing behavior when there are two
limit switches on the same axis sharing an input pin.
- Created a new “grbl.h” that will eventually be used as the main
include file for Grbl. Also will help simply uploading through the
Arduino IDE
- Separated out the alarms execution flags from the realtime (used be
called runtime) execution flag variable. Now reports exactly what
caused the alarm. Expandable for new alarms later on.
- Refactored the homing cycle to support CoreXY.
- Applied @EliteEng updates to Mega2560 support. Some pins were
reconfigured.
- Created a central step to position and vice versa function. Needed
for non-traditional cartesian machines. Should make it easier later.
- Removed the new CPU map for the Uno. No longer going to used. There
will be only one configuration to keep things uniform.
This is likely the last major change to the v0.9 code base before push
to master. Only two minor things remain on the agenda (CoreXY support,
force clear EEPROM, and an extremely low federate bug).
- NEW! Grbl is now compile-able and may be flashed directly through the
Arduino IDE. Only minor changes were required for this compatibility.
See the Wiki to learn how to do it.
- New status reporting mask to turn on and off what Grbl sends back.
This includes machine coordinates, work coordinates, serial RX buffer
usage, and planner buffer usage. Expandable to more information on user
request, but that’s it for now.
- Settings have been completely renumbered to allow for future new
settings to be installed without having to constantly reshuffle and
renumber all of the settings every time.
- All settings masks have been standardized to mean bit 0 = X, bit 1 =
Y, and bit 2 = Z, to reduce confusion on how they work. The invert
masks used by the internal Grbl system were updated to accommodate this
change as well.
- New invert probe pin setting, which does what it sounds like.
- Fixed a probing cycle bug, where it would freeze intermittently, and
removed some redundant code.
- Homing may now be set to the origin wherever the limit switches are.
Traditionally machine coordinates should always be in negative space,
but when limit switches on are on the opposite side, the machine
coordinate would be set to -max_travel for the axis. Now you can always
make it [0,0,0] via a compile-time option in config.h. (Soft limits
routine was updated to account for this as well.)
- Probe coordinate message immediately after a probing cycle may now
be turned off via a compile-time option in config.h. By default the
probing location is always reported.
- Reduced the N_ARC_CORRECTION default value to reflect the changes in
how circles are generated by an arc tolerance, rather than a fixed arc
segment setting.
- Increased the incoming line buffer limit from 70 to 80 characters.
Had some extra memory space to invest into this.
- Fixed a bug where tool number T was not being tracked and reported
correctly.
- Added a print free memory function for debugging purposes. Not used
otherwise.
- Realtime rate report should now work during feed holds, but it hasn’t
been tested yet.
- Updated the streaming scripts with MIT-license and added the simple
streaming to the main stream.py script to allow for settings to be sent.
- Some minor code refactoring to improve flash efficiency. Reduced the
flash by several hundred KB, which was re-invested in some of these new
features.
- Denoted bit_true_atomic only for sys.execute bit settings. All other
bit_true type calls are for local variables only and don’t need atomic
access. Still looking into other ways of setting these flags without
requiring atomic access, but this is a patch for now.
- G38.2 straight probe now supported. Rough draft. May be tweaked more
as testing ramps up.
- G38.2 requires at least one axis word. Multiple axis words work too.
When commanded, the probe cycle will move at the last ‘F’ feed rate
specified in a straight line.
- During a probe cycle: If the probe pin goes low (normal high), Grbl
will record that immediate position and engage a feed hold. Meaning
that the CNC machine will move a little past the probe switch point, so
keep federates low to stop sooner. Once stopped, Grbl will issue a move
to go back to the recorded probe trigger point.
- During a probe cycle: If the probe switch does not engage by the time
the machine has traveled to its target coordinates, Grbl will issue an
ALARM and the user will be forced to reset Grbl. (Currently G38.3 probe
without error isn’t supported, but would be easy to implement later.)
- After a successful probe, Grbl will send a feedback message
containing the recorded probe coordinates in the machine coordinate
system. This is as the g-code standard on probe parameters specifies.
- The recorded probe parameters are retained in Grbl memory and can be
viewed with the ‘$#’ print parameters command. Upon a power-cycle, not
a soft-reset, Grbl will re-zero these values.
- Moved ‘$#’ command to require IDLE or ALARM mode, because it accesses
EEPROM to fetch the coordinate system offsets.
- Updated the Grbl version to v0.9d.
- The probe cycle is subject to change upon testing or user-feedback.
- Added a grbl planner simulation tool that was written in Matlab and
Python. It was used to visualize the inner workings of the planner as a
program is streamed to it. The simulation assumes that the planner
buffer is empty, then filled, and kept filled. This is mainly for users
to see how the planner works.
- Updated some of the compile-time ifdefs when enabling line numbers.
The leaving the un-used line numbers in the function calls eats a
non-neglible amount of flash memory. So the new if-defs remove them.
- Changed line number integer types from unsigned to signed int32.
G-code mandates values cannot exceed 99999. Negative values can be used
to indicate certain modes.
- Homing cycle line number changed to -1, as an indicator.
- Fixed a reporting define for the spindle states that was broken by
the last merge.
WARNING: Bugs may still exist. This branch is a work in progress and
will be pushed to the edge branch when at beta stability. Use at your
own risk.
- Homing freezing issue fixed. Had to do with the cycle stop flag being
set incorrectly after the homing cycles and before the pull-off
maneuver. Now resets the stepper motors before this can happen.
- Fixed an issue with a rare feed hold failure. Had to do with feed
hold ending exactly at the end of a block. The runtime protocol now
sets the QUEUED and IDLE states appropriately when this occurs. Still
need to clean this code up however, as it’s patched rather than written
well.
- Updated version build via $I command.
- Forgot to comment on a new feature for the last commit. Since steps
are integers and millimeters traveled are floats, the old step segment
generator ignored the step fraction differences in generating the
segment velocities. Didn’t see like it would be much of a big deal, but
there were instances that this would be a problem, especially for very
slow feed rates. The stepper algorithm now micro-adjusts the segment
velocities based on the step fractions not executed from the previous
segment. This ensures that Grbl generates the velocity profiles EXACTLY
and noticeably improves overall acceleration performance.
WARNING: There are still some bugs to be worked out. Please use caution
if you test this firmware.
- Feed holds work much better, but there are still some failure
conditions that need to be worked out. This is the being worked on
currently and a fix is planned to be pushed next.
- Homing cycle refactoring: Slight adjustment of the homing cycle to
allow for limit pins to be shared by different axes, as long as the
shared limit pins are not homed on the same cycle. Also, removed the
LOCATE_CYCLE portion of the homing cycle configuration. It was
redundant.
- Limit pin sharing: (See above). To clear up one or two limit pins for
other IO, limit pins can now be shared. For example, the Z-limit can be
shared with either X or Y limit pins, because it’s on a separate homing
cycle. Hard limit will still work exactly as before.
- Spindle pin output fixed. The pins weren’t getting initialized
correctly.
- Fixed a cycle issue where streaming was working almost like a single
block mode. This was caused by a problem with the spindle_run() and
coolant_run() commands and issuing an unintended planner buffer sync.
- Refactored the cycle_start, feed_hold, and other runtime routines
into the runtime command module, where they should be handled here
only. These were redundant.
- Moved some function calls around into more appropriate source code
modules.
- Fixed the reporting of spindle state.
- Added a new source and header file called system. These files contain
the system commands and variables, as well as all of the system headers
and standard libraries Grbl uses. Centralizing some of the code.
- Re-organized the include headers throughout the source code.
- ENABLE_M7 define was missing from config.h. Now there.
- SPINDLE_MAX_RPM and SPINDLE_MIN_RPM now defined in config.h. No
uncommenting to prevent user issues. Minimum spindle RPM now provides
the lower, near 0V, scale adjustment, i.e. some spindles can go really
slow so why use up our 256 voltage bins for them?
- Remove some persistent variables from coolant and spindle control.
They were redundant.
- Removed a VARIABLE_SPINDLE define in cpu_map.h that shouldn’t have
been there.
- Changed the DEFAULT_ARC_TOLERANCE to 0.002mm to improve arc tracing.
Before we had issues with performance, no longer.
- Fixed a bug with the hard limits and the software debounce feature
enabled. The invert limit pin setting wasn’t honored.
- Fixed a bug with the homing direction mask. Now is like it used to
be. At least for now.
- Re-organized main.c to serve as only as the reset/initialization
routine. Makes things a little bit clearer in terms of execution
procedures.
- Re-organized protocol.c as the overall master control unit for
execution procedures. Not quite there yet, but starting to make a
little more sense in how things are run.
- Removed updating of old settings records. So many new settings have
been added that it’s not worth adding the code to migrate old user
settings.
- Tweaked spindle_control.c a bit and made it more clear and consistent
with other parts of Grbl.
- Tweaked the stepper disable bit code in stepper.c. Requires less
flash memory.
- Variable spindle speed output as a configuration option. Thanks
@EliteEng! When enabled, the Z-limit (D11) and spindle enable(D12) pins
switch to allow access to the hardware PWM output on pin D11.
Otherwise, everything should work as it does.
- Removed option for inverting the spindle and coolant enable pins.
This is a safety hazard, especially for the spindle. When Grbl
initializes, all pins are momentarily low until it finishes booting. If
an invert is enabled, this means the spindles can be energized briefly
during this time. If users need signal inversion, it’s recommended to
just wire in an inversion circuit instead.
- Cleared out references to spindle variable output in terms of step
signal. This isn’t complete and requires more deliberation before
installing.
- Cleared up and cleaned up some code and config comments.
- Homing travel calculations fixed. It was computing the min travel
rather than max.
- Auto-start disable and pausing after spindle or dwell commands.
Related to plan_synchronize() function call. Now fixed, but still need
to work on the system state.
- Pushed a fix to make this branch more Arduino IDE compatible. Removed
extern call in nuts_bolts.c
- Updated the stepper configuration option of enabling or disabling the
new Adaptive Multi-Axis Step Smoothing Algorithm. Now works either way.
- Updated some copyright info.
- NEW! An active multi-axis step smoothing algorithm that automatically
adjusts dependent on step frequency. This solves the long standing
issue to aliasing when moving with multiple axes. Similar in scheme to
Smoothieware, but more advanced in ensuring a more consistent CPU
overhead throughout all frequencies while maintaining step exactness.
- Switched from Timer2 to Timer0 for the Step Port Reset Interrupt.
Mainly to free up hardware PWM pins.
- Seperated the direction and step pin assignments, so we can now move
them to seperate ports. This means that we can more easily support 4+
axes in the future.
- Added a setting for inverting the limit pins, as so many users have
request. Better late than never.
- Bug fix related to EEPROM calls when in cycle. The EEPROM would kill
the stepper motion. Now protocol mandates that the system be either in
IDLE or ALARM to access or change any settings.
- Bug fix related to resuming the cycle after a spindle or dwell
command if auto start has been disabled. This fix is somewhat temporary
or more of a patch. Doesn’t work with a straight call-response
streaming protocol, but works fine with serial buffer pre-filling
streaming that most clients use.
- Renamed the pin_map.h to cpu_map.h to more accurately describe what
the file is.
- Pushed an auto start bug fix upon re-initialization.
- Much more polishing to do!
- Revamped and improved homing cycle. Now tied directly into the main
planner and stepper code, which enables much faster homing seek rates.
Also dropped the compiled flash size by almost 1KB, meaning 1KB more
for other features.
- Refactored config.h. Removed obsolete defines and configuration
options. Moved lots of “advanced” options into the advanced area of the
file.
- Updated defaults.h with the new homing cycle. Also updated the
Sherline 5400 defaults and added the ShapeOko2 defaults per user
submissions.
- Fixed a bug where the individual axes limits on velocity and
acceleration were not working correctly. Caused by abs() returning a
int, rather than a float. Corrected with fabs(). Duh.
- Added build version/date to the Grbl welcome message to help indicate
which version a user is operating on.
- Max travel settings were not being defaulted into the settings EEPROM
correctly. Fixed.
- To stop a single axis during a multi-axes homing move, the stepper
algorithm now has a simple axis lock mask which inhibits the desired
axes from moving. Meaning, if one of the limit switches engages before
the other, we stop that one axes and keep moving the other.
- Pushed limit switch active high option (i.e. NC switches).
- Updated defaults.h to be in-line with the new settings.
- Refactored feed hold handling and step segment buffer to be more
generalized in effort to make adding feedrate overrides easier in the
future. Also made it a little more clean.
- Fixed G18 plane select issue. Now ZX-plane, rather than XZ-plane, per
right hand rule.
- Cleaned some of the system settings by more accurately renaming some
of the variables and removing old obsolete ones.
- Declared serial.c rx_buffer_tail to be volatile. No effect, since
avr-gcc automatically does this during compilation. Helps with porting
when using other compilers.
- Updated version number to v0.9b.
- Updates to README.md
NOTE: This push is a work-in-progress and there are known bugs that
need to be fixed, like homing acceleration being incompatible. Released
for testing. Settings will definitely be overwritten, as new settings
were needed.
- Acceleration independence installed in planner. Each axis can now
have different accelerations and Grbl will maximize the accelerations
depending on the direction its moving. Very useful for users like on
the ShapeOko with vastly different Z-axis properties.
- More planner optimizations and re-factoring. Slightly improved some
of the older calculations, but new acceleration calculations offset
these improvements. Overall no change in processing speed.
- Removed planner nominal length checks. It was arguable whether or not
this improved planner efficiency, especially in the worst case scenario
of arcs.
- Updated readme and changed to markdown format.
- The homing sequence is now a compile-time option, where a user can
choose which axes(s) move in sequence during the search phase. Up to 3
sequences. Works with the locating phase and the pull-off maneuver.
- New defaults.h file to store user generated default settings for
different machines. Mainly to be used as a central repo, but each set
may be select to be compiled in as a config.h define.
- Refactored system states to be more clear and concise. Alarm locks
processes when position is unknown to indicate to user something has
gone wrong.
- Changed mc_alarm to mc_reset, which now manages the system reset
function. Centralizes it.
- Renamed '$X' kill homing lock to kill alarm lock.
- Created an alarm error reporting method to clear up what is an alarm:
message vs a status error: message. For GUIs mainly. Alarm codes are
negative. Status codes are positive.
- Serial baud support upto 115200. Previous baudrate calc was unstable
for 57600 and above.
- Alarm state locks out all g-code blocks, including startup scripts,
but allows user to access settings and internal commands. For example,
to disable hard limits, if they are problematic.
- Hard limits do not respond in an alarm state.
- Fixed a problem with the hard limit interrupt during the homing
cycle. The interrupt register is still active during the homing cycle
and still signal the interrupt to trigger when re-enabled. Instead,
just disabled the register.
- Homing rate adjusted. All axes move at homing seek rate, regardless
of how many axes move at the same time. This is unlike how the stepper
module does it as a point to point rate.
- New config.h settings to disable the homing rate adjustment and the
force homing upon powerup.
- Reduced the number of startup lines back down to 2 from 3. This
discourages users from placing motion block in there, which can be very
dangerous.
- Startup blocks now run only after an alarm-free reset or after a
homing cycle. Does not run when $X kill is called. For satefy reasons
- Added some more notes to config.h.
- Added the ability to override some of the #defines around Grbl in
config.h, like planner buffer size, line buffer size, serial
send/receive buffers. Mainly to centralize the configurations to be
able to port to different microcontrollers later.
(All v0.8 features installed. Still likely buggy, but now thourough
testing will need to start to squash them all. As soon as we're done,
this will be pushed to master and v0.9 development will be started.
Please report ANY issues to us so we can get this rolled out ASAP.)
- User startup script! A user can now save one (up to 5 as compile-time
option) block of g-code in EEPROM memory. This will be run everytime
Grbl resets. Mainly to be used as a way to set your preferences, like
G21, G54, etc.
- New dry run and check g-code switches. Dry run moves ALL motions at
rapids rate ignoring spindle, coolant, and dwell commands. For rapid
physical proofing of your code. The check g-code switch ignores all
motion and provides the user a way to check if there are any errors in
their program that Grbl may not like.
- Program restart! (sort of). Program restart is typically an advanced
feature that allows users to restart a program mid-stream. The check
g-code switch can perform this feature by enabling the switch at the
start of the program, and disabling it at the desired point with some
minimal changes.
- New system state variable. This state variable tracks all of the
different state processes that Grbl performs, i.e. cycle start, feed
hold, homing, etc. This is mainly for making managing of these task
easier and more clear.
- Position lost state variable. Only when homing is enabled, Grbl will
refuse to move until homing is completed and position is known. This is
mainly for safety. Otherwise, it will let users fend for themselves.
- Moved the default settings defines into config.h. The plan is to
eventually create a set of config.h's for particular as-built machines
to help users from doing it themselves.
- Moved around misc defines into .h files. And lots of other little
things.
(NOTE: This push is likely buggy so proceed with caution. Just
uploading to let people know where we're going.)
- New report.c module. Moved all feedback functions into this module to
centralize these processes. Includes realtime status reports, status
messages, feedback messages.
- Official support 6 work coordinate systems (G54-G59), which are
persistently held in EEPROM memory.
- New g-code support: G28.1, G30.1 stores current machine position as a
home position into EEPROM. G10 L20 Px stores current machine position
into work coordinates without needing to explicitly send XYZ words.
- Homing performed with '$H' command. G28/G30 no longer start the
homing cycle. This is how it's supposed to be.
- New settings: Stepper enable invert and n_arc correction installed.
- Updated and changed up some limits and homing functionality. Pull-off
travel will now move after the homing cycle regardless of hard limits
enabled. Fixed direction of pull-off travel (went wrong way).
- Started on designing an internal Grbl command protocol based on the
'$' settings letter. Commands with non numeric characters after '$'
will perform switch commands, homing cycle, jogging, printing
paramters, etc. Much more to do here.
- Updated README to reflect all of the new features.
- Installed a new 'alarm' method to centralize motion kills across
alarm or reset events. Right now, this is controlled by system abort
and hard limits. But, in the future, a g-code parser error may call
this too as a safety feature.
- Re(re)organized status messages to just print all errors, regardless
from where it was called. This centralizes them into one place.
- Misc messages method installed for any user feedback that is not a
confirmation or error. Mainly so that there is a place to perform
warnings and such.
- New stuff installed and still made the flash size smaller by saving
flash space from clearing out repeated '\r\n' pgmstrings.
- Fixed a bug where hard limits message would print everytime a system
abort was sent.
- Fixed a bug that would not disable the steppers if a user issues a
system abort during a homing cycle.
- Updated the hard limit interrupt to be more correct and to issue a
shutdown for the right situations when the switch has been triggered.
- Added a status message to indicate to the user what happened and what
to do upon a hard limit trigger.
- Thank you statement added for Alden Hart of Synthetos.
- Hard limits option added, which also works with homing by pulling off
the switches to help prevent unintended triggering. Hard limits use a
interrupt to sense a falling edge pin change and immediately go into
alarm mode, which stops everything and forces the user to issue a reset
(Ctrl-x) or reboot.
- Auto cycle start now a configuration option.
- Alarm mode: A new method to kill all Grbl processes in the event of
something catastrophic or potentially catastropic. Just works with hard
limits for now, but will be expanded to include g-code errors (most
likely) and other events.
- Updated status reports to be configurable in inches or mm mode. Much
more to do here, but this is the first step.
- New settings: auto cycle start, hard limit enable, homing direction
mask (which works the same as the stepper mask), homing pulloff
distance (or distance traveled from homed machine zero to prevent
accidental limit trip).
- Minor memory liberation and calculation speed ups.
- Allowed status_message function to be called by others. This is to
centralize all feedback into protocol.c.
- Fixed a bug where line number words 'N' were causing the parser to
error out.
- Allowed homing routine feed rates to move slower than the
MINIMUM_STEP_RATE parameter in config.h.
- Homing performs idle lock at the end of the routine.
- Stepper idle lock time will now not disable the steppers when the
value is set at 255. This is accomodate users who prefer to keep their
axes enabled at all times.
- Moved some defines around to where they need to be.
- Homing cycle will now cycle twice (spec more/less in config) to
improve repeatability and accuracy by decreasing overshoot.
- New Grbl settings added: Enable/disable homing cycles, homing seek
and feed rates, switch debounce delay, and stepper idle lock time.
- Please note that these settings may change upon the next push, since
there will be more added soon. Grbl *should* not re-write your old
settings, just re-write the new ones. So, make sure you keep these
written down somewhere in case they get lost from a code bug.
- Refactored settings migration to be a little smaller and managable
going forward.
- Limit pin internal pull-resistors now enabled. Normal high operation.
This will be the standard going forward.
- Updated all of the 'double' variable types to 'float' to reflect what
happens when compiled for the Arduino. Also done for compatibility
reasons to @jgeisler0303 's Grbl simulator code.
- G-code parser will now ignore 'E' exponent values, since they are
reserved g-code characters for some machines. Thanks @csdexter!
- The read_double() function was re-written and optimized for use in
Grbl. The strtod() avr lib was removed.
- Added acceleration to the homing routine.
- Homing now accounts for different step rates when moving multiple
axes without exceeding acceleration limits.
- Homing now updates all internal positioning variables to machine zero
after completion.
- "Poor-man's" debounce delay added.
- Updated the delay_us() function to perform faster and more accurate
microsecond delays. Previously, the single increments would add
noticeable time drift for larger delays.
- Fix a bug in the stepper.c prescalar calculations that was changed in
the last commit.
- Other minor fixes.
- Updated makefile to be more universally compatible by not requiring
grep or ruby.
- Edited XON/XOFF flow control usage, noting that FTDI-based Arduinos
are known to work, but not Atmega8U2-based Arduino. Still officially
not supported, but added for advanced users.
- Minor edits.
- G54 work coordinate system support. Up to 6 work coordinate systems
(G54-G59) available as a compile-time option.
- G10 command added to set work coordinate offsets from machine
position.
- G92/G92.1 position offsets and cancellation support. Properly follows
NIST standard rules with other systems.
- G53 absolute override now works correctly with new coordinate systems.
- Revamped g-code parser with robust error checking. Providing user
feedback with bad commands. Follows NIST standards.
- Planner module slightly changed to only expected position movements
in terms of machine coordinates only. This was to simplify coordinate
system handling, which is done solely by the g-code parser.
- Upon grbl system abort, machine position and work positions are
retained, while G92 offsets are reset per NIST standards.
- Compiler compatibility update for _delay_us().
- Updated README.
- Grbl now tracks both home and work (G92) coordinate systems and does
live updates when G92 is called.
- Rudimentary home and work position status reporting. Works but still
under major construction.
- Updated the main streaming script. Has a disabled periodic timer for
querying status reports, disabled only because the Python timer doesn't
consistently restart after the script exits. Add here only for user
testing.
- Fixed a bug to prevent an endless serial_write loop during status
reports.
- Refactored the planner variables to make it more clear what they are
and make it easier for clear them.
- ALPHA status. - Multitasking ability with run-time command executions
for real-time control and feedback. - Decelerating feed hold and resume
during operation. - System abort/reset, which immediately kills all
movement and re-initializes grbl. - Re-structured grbl to easily allow
for new features: Status reporting, jogging, backlash compensation. (To
be completed in the following releases.) - Resized TX/RX serial buffers
(32/128 bytes) - Increased planner buffer size to 20 blocks. - Updated
documentation.