2012-11-01 16:37:27 +01:00
|
|
|
/*
|
|
|
|
report.c - reporting and messaging methods
|
2015-02-16 01:36:08 +01:00
|
|
|
Part of Grbl
|
2012-11-01 16:37:27 +01:00
|
|
|
|
2015-01-15 06:14:52 +01:00
|
|
|
Copyright (c) 2012-2015 Sungeun K. Jeon
|
2012-11-01 16:37:27 +01:00
|
|
|
|
|
|
|
Grbl is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Grbl is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
This file functions as the primary feedback interface for Grbl. Any outgoing data, such
|
|
|
|
as the protocol status messages, feedback messages, and status reports, are stored here.
|
|
|
|
For the most part, these functions primarily are called from protocol.c methods. If a
|
|
|
|
different style feedback is desired (i.e. JSON), then a user can change these following
|
|
|
|
methods to accomodate their needs.
|
|
|
|
*/
|
|
|
|
|
2015-02-10 16:25:09 +01:00
|
|
|
#include "grbl.h"
|
2012-11-01 16:37:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
// Handles the primary confirmation protocol response for streaming interfaces and human-feedback.
|
|
|
|
// For every incoming line, this method responds with an 'ok' for a successful command or an
|
|
|
|
// 'error:' to indicate some error event with the line or some critical system error during
|
|
|
|
// operation. Errors events can originate from the g-code parser, settings module, or asynchronously
|
|
|
|
// from a critical error, such as a triggered hard limit. Interface should always monitor for these
|
|
|
|
// responses.
|
|
|
|
// NOTE: In silent mode, all error codes are greater than zero.
|
|
|
|
// TODO: Install silent mode to return only numeric values, primarily for GUIs.
|
|
|
|
void report_status_message(uint8_t status_code)
|
|
|
|
{
|
|
|
|
if (status_code == 0) { // STATUS_OK
|
|
|
|
printPgmString(PSTR("ok\r\n"));
|
|
|
|
} else {
|
|
|
|
printPgmString(PSTR("error: "));
|
2015-02-24 02:45:26 +01:00
|
|
|
#ifdef REPORT_GUI_MODE
|
|
|
|
print_uint8_base10(status_code);
|
|
|
|
#else
|
|
|
|
switch(status_code) {
|
|
|
|
case STATUS_EXPECTED_COMMAND_LETTER:
|
|
|
|
printPgmString(PSTR("Expected command letter")); break;
|
|
|
|
case STATUS_BAD_NUMBER_FORMAT:
|
|
|
|
printPgmString(PSTR("Bad number format")); break;
|
|
|
|
case STATUS_INVALID_STATEMENT:
|
|
|
|
printPgmString(PSTR("Invalid statement")); break;
|
|
|
|
case STATUS_NEGATIVE_VALUE:
|
|
|
|
printPgmString(PSTR("Value < 0")); break;
|
|
|
|
case STATUS_SETTING_DISABLED:
|
|
|
|
printPgmString(PSTR("Setting disabled")); break;
|
|
|
|
case STATUS_SETTING_STEP_PULSE_MIN:
|
|
|
|
printPgmString(PSTR("Value < 3 usec")); break;
|
|
|
|
case STATUS_SETTING_READ_FAIL:
|
|
|
|
printPgmString(PSTR("EEPROM read fail. Using defaults")); break;
|
|
|
|
case STATUS_IDLE_ERROR:
|
|
|
|
printPgmString(PSTR("Not idle")); break;
|
|
|
|
case STATUS_ALARM_LOCK:
|
|
|
|
printPgmString(PSTR("Alarm lock")); break;
|
|
|
|
case STATUS_SOFT_LIMIT_ERROR:
|
|
|
|
printPgmString(PSTR("Homing not enabled")); break;
|
|
|
|
case STATUS_OVERFLOW:
|
2015-02-25 16:29:56 +01:00
|
|
|
printPgmString(PSTR("Line overflow")); break;
|
|
|
|
#ifdef MAX_STEP_RATE_HZ
|
|
|
|
case STATUS_MAX_STEP_RATE_EXCEEDED:
|
|
|
|
printPgmString(PSTR("Step rate > 30kHz")); break;
|
|
|
|
#endif
|
2015-02-24 02:45:26 +01:00
|
|
|
// Common g-code parser errors.
|
|
|
|
case STATUS_GCODE_MODAL_GROUP_VIOLATION:
|
|
|
|
printPgmString(PSTR("Modal group violation")); break;
|
|
|
|
case STATUS_GCODE_UNSUPPORTED_COMMAND:
|
|
|
|
printPgmString(PSTR("Unsupported command")); break;
|
|
|
|
case STATUS_GCODE_UNDEFINED_FEED_RATE:
|
|
|
|
printPgmString(PSTR("Undefined feed rate")); break;
|
|
|
|
default:
|
|
|
|
// Remaining g-code parser errors with error codes
|
|
|
|
printPgmString(PSTR("Invalid gcode ID:"));
|
|
|
|
print_uint8_base10(status_code); // Print error code for user reference
|
|
|
|
}
|
|
|
|
#endif
|
2012-11-01 16:37:27 +01:00
|
|
|
printPgmString(PSTR("\r\n"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-15 01:36:29 +01:00
|
|
|
// Prints alarm messages.
|
|
|
|
void report_alarm_message(int8_t alarm_code)
|
|
|
|
{
|
|
|
|
printPgmString(PSTR("ALARM: "));
|
2015-02-24 02:45:26 +01:00
|
|
|
#ifdef REPORT_GUI_MODE
|
|
|
|
print_uint8_base10(alarm_code);
|
|
|
|
#else
|
|
|
|
switch (alarm_code) {
|
|
|
|
case ALARM_HARD_LIMIT_ERROR:
|
|
|
|
printPgmString(PSTR("Hard limit")); break;
|
|
|
|
case ALARM_SOFT_LIMIT_ERROR:
|
|
|
|
printPgmString(PSTR("Soft limit")); break;
|
|
|
|
case ALARM_ABORT_CYCLE:
|
|
|
|
printPgmString(PSTR("Abort during cycle")); break;
|
|
|
|
case ALARM_PROBE_FAIL:
|
|
|
|
printPgmString(PSTR("Probe fail")); break;
|
|
|
|
case ALARM_HOMING_FAIL:
|
|
|
|
printPgmString(PSTR("Homing fail")); break;
|
|
|
|
}
|
|
|
|
#endif
|
G38.2 probe feature rough draft installed. Working but needs testing.
- 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.
2014-03-01 06:03:26 +01:00
|
|
|
printPgmString(PSTR("\r\n"));
|
2013-01-19 01:02:44 +01:00
|
|
|
delay_ms(500); // Force delay to ensure message clears serial write buffer.
|
2012-11-15 01:36:29 +01:00
|
|
|
}
|
2012-11-01 16:37:27 +01:00
|
|
|
|
|
|
|
// Prints feedback messages. This serves as a centralized method to provide additional
|
2012-11-15 01:36:29 +01:00
|
|
|
// user feedback for things that are not of the status/alarm message protocol. These are
|
|
|
|
// messages such as setup warnings, switch toggling, and how to exit alarms.
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
// NOTE: For interfaces, messages are always placed within brackets. And if silent mode
|
2012-11-02 02:48:55 +01:00
|
|
|
// is installed, the message number codes are less than zero.
|
2012-11-01 16:37:27 +01:00
|
|
|
// TODO: Install silence feedback messages option in settings
|
2012-11-15 01:36:29 +01:00
|
|
|
void report_feedback_message(uint8_t message_code)
|
2012-11-01 16:37:27 +01:00
|
|
|
{
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
printPgmString(PSTR("["));
|
2012-11-01 16:37:27 +01:00
|
|
|
switch(message_code) {
|
2012-11-06 05:40:52 +01:00
|
|
|
case MESSAGE_CRITICAL_EVENT:
|
2012-11-15 01:36:29 +01:00
|
|
|
printPgmString(PSTR("Reset to continue")); break;
|
|
|
|
case MESSAGE_ALARM_LOCK:
|
|
|
|
printPgmString(PSTR("'$H'|'$X' to unlock")); break;
|
|
|
|
case MESSAGE_ALARM_UNLOCK:
|
|
|
|
printPgmString(PSTR("Caution: Unlocked")); break;
|
2012-11-06 05:40:52 +01:00
|
|
|
case MESSAGE_ENABLED:
|
|
|
|
printPgmString(PSTR("Enabled")); break;
|
|
|
|
case MESSAGE_DISABLED:
|
2013-10-30 02:10:39 +01:00
|
|
|
printPgmString(PSTR("Disabled")); break;
|
2015-02-12 05:19:00 +01:00
|
|
|
case MESSAGE_SAFETY_DOOR_AJAR:
|
|
|
|
printPgmString(PSTR("Check Door")); break;
|
Critical M0/2/30 fix. Homing updates.
- Critical fix for M0 program pause. Due to its recent change, it would
cause Grbl to suspend but wouldn’t notify the user of why Grbl was not
doing anything. The state would show IDLE and a cycle start would
resume it. Grbl now enters a HOLD state to better indicate the state
change.
- Critical fix for M2 and M30 program end. As with M0, the state
previously would show IDLE while suspended. Grbl now does not suspend
upon program end and leaves job control to the GUI. Grbl simply reports
a `[Pgm End]` as a feedback message and resets certain g-code modes.
- M2/30 g-code reseting fix. Previously Grbl would soft-reset after an
M2/30, but this was not complaint to the (linuxcnc) g-code standard. It
simply resets [G1,G17,G90,G94,G40,G54,M5,M9,M48] and keeps all other
modes the same.
- M0/M2/M30 check-mode fix. It now does not suspend the machine during
check-mode.
- Minor bug fix related to commands similar to G90.1, but not G90.1,
not reporting an unsupported command.
- Homing cycle refactoring. To help reduce the chance of users
misunderstanding their limit switch wiring, Grbl only moves a short
distance for the locate cycles only. In addition, the homing cycle
pulls-off the limit switch by the pull-off distance to re-engage and
locate home. This should improve its accuracy.
- HOMING_FORCE_ORIGIN now sets the origin to the pull-off location,
rather than where the limit switch was triggered.
- Updated default junction deviation to 0.01mm. Recent tests showed
that this improves Grbl’s cornering behavior a bit.
- Added the ShapeOko3 defaults.
- Added new feedback message `[Pgm End]` for M2/30 notification.
- Limit pin reporting is now a $10 status report option. Requested by
OEMs to help simplify support troubleshooting.
2015-05-17 21:25:36 +02:00
|
|
|
case MESSAGE_PROGRAM_END:
|
|
|
|
printPgmString(PSTR("Pgm End")); break;
|
2015-06-18 17:23:17 +02:00
|
|
|
case MESSAGE_RESTORE_DEFAULTS:
|
|
|
|
printPgmString(PSTR("Restoring defaults")); break;
|
2012-11-01 16:37:27 +01:00
|
|
|
}
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
printPgmString(PSTR("]\r\n"));
|
2012-11-01 16:37:27 +01:00
|
|
|
}
|
|
|
|
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
|
2012-11-01 16:37:27 +01:00
|
|
|
// Welcome message
|
|
|
|
void report_init_message()
|
|
|
|
{
|
2014-01-05 18:27:34 +01:00
|
|
|
printPgmString(PSTR("\r\nGrbl " GRBL_VERSION " ['$' for help]\r\n"));
|
2012-11-01 16:37:27 +01:00
|
|
|
}
|
|
|
|
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
// Grbl help message
|
2012-11-01 16:37:27 +01:00
|
|
|
void report_grbl_help() {
|
2015-02-24 02:45:26 +01:00
|
|
|
#ifndef REPORT_GUI_MODE
|
|
|
|
printPgmString(PSTR("$$ (view Grbl settings)\r\n"
|
|
|
|
"$# (view # parameters)\r\n"
|
|
|
|
"$G (view parser state)\r\n"
|
|
|
|
"$I (view build info)\r\n"
|
|
|
|
"$N (view startup blocks)\r\n"
|
|
|
|
"$x=value (save Grbl setting)\r\n"
|
|
|
|
"$Nx=line (save startup block)\r\n"
|
|
|
|
"$C (check gcode mode)\r\n"
|
|
|
|
"$X (kill alarm lock)\r\n"
|
|
|
|
"$H (run homing cycle)\r\n"
|
|
|
|
"~ (cycle start)\r\n"
|
|
|
|
"! (feed hold)\r\n"
|
|
|
|
"? (current status)\r\n"
|
|
|
|
"ctrl-x (reset Grbl)\r\n"));
|
|
|
|
#endif
|
2012-11-02 02:48:55 +01:00
|
|
|
}
|
|
|
|
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
// Grbl global settings print out.
|
|
|
|
// NOTE: The numbering scheme here must correlate to storing in settings.c
|
2012-11-02 02:48:55 +01:00
|
|
|
void report_grbl_settings() {
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
// Print Grbl settings.
|
2015-02-24 02:45:26 +01:00
|
|
|
#ifdef REPORT_GUI_MODE
|
|
|
|
printPgmString(PSTR("$0=")); print_uint8_base10(settings.pulse_microseconds);
|
|
|
|
printPgmString(PSTR("\r\n$1=")); print_uint8_base10(settings.stepper_idle_lock_time);
|
|
|
|
printPgmString(PSTR("\r\n$2=")); print_uint8_base10(settings.step_invert_mask);
|
|
|
|
printPgmString(PSTR("\r\n$3=")); print_uint8_base10(settings.dir_invert_mask);
|
|
|
|
printPgmString(PSTR("\r\n$4=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_ST_ENABLE));
|
|
|
|
printPgmString(PSTR("\r\n$5=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_LIMIT_PINS));
|
|
|
|
printPgmString(PSTR("\r\n$6=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_PROBE_PIN));
|
|
|
|
printPgmString(PSTR("\r\n$10=")); print_uint8_base10(settings.status_report_mask);
|
|
|
|
printPgmString(PSTR("\r\n$11=")); printFloat_SettingValue(settings.junction_deviation);
|
|
|
|
printPgmString(PSTR("\r\n$12=")); printFloat_SettingValue(settings.arc_tolerance);
|
|
|
|
printPgmString(PSTR("\r\n$13=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_REPORT_INCHES));
|
|
|
|
printPgmString(PSTR("\r\n$20=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_SOFT_LIMIT_ENABLE));
|
|
|
|
printPgmString(PSTR("\r\n$21=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_HARD_LIMIT_ENABLE));
|
|
|
|
printPgmString(PSTR("\r\n$22=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE));
|
|
|
|
printPgmString(PSTR("\r\n$23=")); print_uint8_base10(settings.homing_dir_mask);
|
|
|
|
printPgmString(PSTR("\r\n$24=")); printFloat_SettingValue(settings.homing_feed_rate);
|
|
|
|
printPgmString(PSTR("\r\n$25=")); printFloat_SettingValue(settings.homing_seek_rate);
|
|
|
|
printPgmString(PSTR("\r\n$26=")); print_uint8_base10(settings.homing_debounce_delay);
|
|
|
|
printPgmString(PSTR("\r\n$27=")); printFloat_SettingValue(settings.homing_pulloff);
|
|
|
|
printPgmString(PSTR("\r\n"));
|
|
|
|
#else
|
|
|
|
printPgmString(PSTR("$0=")); print_uint8_base10(settings.pulse_microseconds);
|
|
|
|
printPgmString(PSTR(" (step pulse, usec)\r\n$1=")); print_uint8_base10(settings.stepper_idle_lock_time);
|
|
|
|
printPgmString(PSTR(" (step idle delay, msec)\r\n$2=")); print_uint8_base10(settings.step_invert_mask);
|
|
|
|
printPgmString(PSTR(" (step port invert mask:")); print_uint8_base2(settings.step_invert_mask);
|
|
|
|
printPgmString(PSTR(")\r\n$3=")); print_uint8_base10(settings.dir_invert_mask);
|
|
|
|
printPgmString(PSTR(" (dir port invert mask:")); print_uint8_base2(settings.dir_invert_mask);
|
|
|
|
printPgmString(PSTR(")\r\n$4=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_ST_ENABLE));
|
|
|
|
printPgmString(PSTR(" (step enable invert, bool)\r\n$5=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_LIMIT_PINS));
|
|
|
|
printPgmString(PSTR(" (limit pins invert, bool)\r\n$6=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_PROBE_PIN));
|
|
|
|
printPgmString(PSTR(" (probe pin invert, bool)\r\n$10=")); print_uint8_base10(settings.status_report_mask);
|
|
|
|
printPgmString(PSTR(" (status report mask:")); print_uint8_base2(settings.status_report_mask);
|
|
|
|
printPgmString(PSTR(")\r\n$11=")); printFloat_SettingValue(settings.junction_deviation);
|
|
|
|
printPgmString(PSTR(" (junction deviation, mm)\r\n$12=")); printFloat_SettingValue(settings.arc_tolerance);
|
|
|
|
printPgmString(PSTR(" (arc tolerance, mm)\r\n$13=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_REPORT_INCHES));
|
|
|
|
printPgmString(PSTR(" (report inches, bool)\r\n$20=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_SOFT_LIMIT_ENABLE));
|
|
|
|
printPgmString(PSTR(" (soft limits, bool)\r\n$21=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_HARD_LIMIT_ENABLE));
|
|
|
|
printPgmString(PSTR(" (hard limits, bool)\r\n$22=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE));
|
|
|
|
printPgmString(PSTR(" (homing cycle, bool)\r\n$23=")); print_uint8_base10(settings.homing_dir_mask);
|
|
|
|
printPgmString(PSTR(" (homing dir invert mask:")); print_uint8_base2(settings.homing_dir_mask);
|
|
|
|
printPgmString(PSTR(")\r\n$24=")); printFloat_SettingValue(settings.homing_feed_rate);
|
|
|
|
printPgmString(PSTR(" (homing feed, mm/min)\r\n$25=")); printFloat_SettingValue(settings.homing_seek_rate);
|
|
|
|
printPgmString(PSTR(" (homing seek, mm/min)\r\n$26=")); print_uint8_base10(settings.homing_debounce_delay);
|
|
|
|
printPgmString(PSTR(" (homing debounce, msec)\r\n$27=")); printFloat_SettingValue(settings.homing_pulloff);
|
|
|
|
printPgmString(PSTR(" (homing pull-off, mm)\r\n"));
|
|
|
|
#endif
|
|
|
|
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
// Print axis settings
|
|
|
|
uint8_t idx, set_idx;
|
|
|
|
uint8_t val = AXIS_SETTINGS_START_VAL;
|
|
|
|
for (set_idx=0; set_idx<AXIS_N_SETTINGS; set_idx++) {
|
|
|
|
for (idx=0; idx<N_AXIS; idx++) {
|
|
|
|
printPgmString(PSTR("$"));
|
|
|
|
print_uint8_base10(val+idx);
|
|
|
|
printPgmString(PSTR("="));
|
|
|
|
switch (set_idx) {
|
|
|
|
case 0: printFloat_SettingValue(settings.steps_per_mm[idx]); break;
|
|
|
|
case 1: printFloat_SettingValue(settings.max_rate[idx]); break;
|
|
|
|
case 2: printFloat_SettingValue(settings.acceleration[idx]/(60*60)); break;
|
|
|
|
case 3: printFloat_SettingValue(-settings.max_travel[idx]); break;
|
|
|
|
}
|
2015-02-24 02:45:26 +01:00
|
|
|
#ifdef REPORT_GUI_MODE
|
|
|
|
printPgmString(PSTR("\r\n"));
|
|
|
|
#else
|
|
|
|
printPgmString(PSTR(" ("));
|
|
|
|
switch (idx) {
|
|
|
|
case X_AXIS: printPgmString(PSTR("x")); break;
|
|
|
|
case Y_AXIS: printPgmString(PSTR("y")); break;
|
|
|
|
case Z_AXIS: printPgmString(PSTR("z")); break;
|
|
|
|
}
|
|
|
|
switch (set_idx) {
|
|
|
|
case 0: printPgmString(PSTR(", step/mm")); break;
|
|
|
|
case 1: printPgmString(PSTR(" max rate, mm/min")); break;
|
|
|
|
case 2: printPgmString(PSTR(" accel, mm/sec^2")); break;
|
|
|
|
case 3: printPgmString(PSTR(" max travel, mm")); break;
|
|
|
|
}
|
|
|
|
printPgmString(PSTR(")\r\n"));
|
|
|
|
#endif
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
}
|
|
|
|
val += AXIS_SETTINGS_INCREMENT;
|
|
|
|
}
|
2012-11-01 16:37:27 +01:00
|
|
|
}
|
|
|
|
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
|
G38.2 probe feature rough draft installed. Working but needs testing.
- 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.
2014-03-01 06:03:26 +01:00
|
|
|
// Prints current probe parameters. Upon a probe command, these parameters are updated upon a
|
|
|
|
// successful probe or upon a failed probe with the G38.3 without errors command (if supported).
|
|
|
|
// These values are retained until Grbl is power-cycled, whereby they will be re-zeroed.
|
|
|
|
void report_probe_parameters()
|
|
|
|
{
|
|
|
|
uint8_t i;
|
|
|
|
float print_position[N_AXIS];
|
|
|
|
|
|
|
|
// Report in terms of machine position.
|
2015-01-15 06:14:52 +01:00
|
|
|
printPgmString(PSTR("[PRB:"));
|
G38.2 probe feature rough draft installed. Working but needs testing.
- 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.
2014-03-01 06:03:26 +01:00
|
|
|
for (i=0; i< N_AXIS; i++) {
|
2015-01-15 06:14:52 +01:00
|
|
|
print_position[i] = system_convert_axis_steps_to_mpos(sys.probe_position,i);
|
2014-07-05 00:08:15 +02:00
|
|
|
printFloat_CoordValue(print_position[i]);
|
G38.2 probe feature rough draft installed. Working but needs testing.
- 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.
2014-03-01 06:03:26 +01:00
|
|
|
if (i < (N_AXIS-1)) { printPgmString(PSTR(",")); }
|
2014-09-23 05:32:47 +02:00
|
|
|
}
|
|
|
|
printPgmString(PSTR(":"));
|
|
|
|
print_uint8_base10(sys.probe_succeeded);
|
G38.2 probe feature rough draft installed. Working but needs testing.
- 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.
2014-03-01 06:03:26 +01:00
|
|
|
printPgmString(PSTR("]\r\n"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Prints Grbl NGC parameters (coordinate offsets, probing)
|
|
|
|
void report_ngc_parameters()
|
2012-11-02 02:48:55 +01:00
|
|
|
{
|
|
|
|
float coord_data[N_AXIS];
|
|
|
|
uint8_t coord_select, i;
|
|
|
|
for (coord_select = 0; coord_select <= SETTING_INDEX_NCOORD; coord_select++) {
|
|
|
|
if (!(settings_read_coord_data(coord_select,coord_data))) {
|
|
|
|
report_status_message(STATUS_SETTING_READ_FAIL);
|
|
|
|
return;
|
|
|
|
}
|
2012-11-20 01:39:40 +01:00
|
|
|
printPgmString(PSTR("[G"));
|
2012-11-02 02:48:55 +01:00
|
|
|
switch (coord_select) {
|
2014-05-26 00:05:28 +02:00
|
|
|
case 6: printPgmString(PSTR("28")); break;
|
|
|
|
case 7: printPgmString(PSTR("30")); break;
|
|
|
|
default: print_uint8_base10(coord_select+54); break; // G54-G59
|
|
|
|
}
|
|
|
|
printPgmString(PSTR(":"));
|
2012-11-02 02:48:55 +01:00
|
|
|
for (i=0; i<N_AXIS; i++) {
|
2014-07-05 00:08:15 +02:00
|
|
|
printFloat_CoordValue(coord_data[i]);
|
2012-11-02 02:48:55 +01:00
|
|
|
if (i < (N_AXIS-1)) { printPgmString(PSTR(",")); }
|
|
|
|
else { printPgmString(PSTR("]\r\n")); }
|
|
|
|
}
|
|
|
|
}
|
2012-11-20 01:39:40 +01:00
|
|
|
printPgmString(PSTR("[G92:")); // Print G92,G92.1 which are not persistent in memory
|
2012-11-02 02:48:55 +01:00
|
|
|
for (i=0; i<N_AXIS; i++) {
|
2014-07-05 00:08:15 +02:00
|
|
|
printFloat_CoordValue(gc_state.coord_offset[i]);
|
2012-11-02 02:48:55 +01:00
|
|
|
if (i < (N_AXIS-1)) { printPgmString(PSTR(",")); }
|
|
|
|
else { printPgmString(PSTR("]\r\n")); }
|
|
|
|
}
|
2014-07-06 23:20:20 +02:00
|
|
|
printPgmString(PSTR("[TLO:")); // Print tool length offset value
|
|
|
|
printFloat_CoordValue(gc_state.tool_length_offset);
|
|
|
|
printPgmString(PSTR("]\r\n"));
|
G38.2 probe feature rough draft installed. Working but needs testing.
- 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.
2014-03-01 06:03:26 +01:00
|
|
|
report_probe_parameters(); // Print probe parameters. Not persistent in memory.
|
2012-11-02 02:48:55 +01:00
|
|
|
}
|
2012-11-01 16:37:27 +01:00
|
|
|
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
|
2012-11-16 05:53:11 +01:00
|
|
|
// Print current gcode parser mode state
|
2012-11-02 02:48:55 +01:00
|
|
|
void report_gcode_modes()
|
|
|
|
{
|
2014-10-02 04:22:16 +02:00
|
|
|
printPgmString(PSTR("["));
|
|
|
|
|
2014-05-26 00:05:28 +02:00
|
|
|
switch (gc_state.modal.motion) {
|
2014-10-02 04:22:16 +02:00
|
|
|
case MOTION_MODE_SEEK : printPgmString(PSTR("G0")); break;
|
|
|
|
case MOTION_MODE_LINEAR : printPgmString(PSTR("G1")); break;
|
|
|
|
case MOTION_MODE_CW_ARC : printPgmString(PSTR("G2")); break;
|
|
|
|
case MOTION_MODE_CCW_ARC : printPgmString(PSTR("G3")); break;
|
|
|
|
case MOTION_MODE_NONE : printPgmString(PSTR("G80")); break;
|
2015-03-16 04:57:21 +01:00
|
|
|
default:
|
|
|
|
printPgmString(PSTR("G38."));
|
|
|
|
print_uint8_base10(gc_state.modal.motion - (MOTION_MODE_PROBE_TOWARD+2));
|
2012-11-02 02:48:55 +01:00
|
|
|
}
|
2012-11-01 16:37:27 +01:00
|
|
|
|
2012-11-02 02:48:55 +01:00
|
|
|
printPgmString(PSTR(" G"));
|
2014-05-26 00:05:28 +02:00
|
|
|
print_uint8_base10(gc_state.modal.coord_select+54);
|
2012-11-02 02:48:55 +01:00
|
|
|
|
2014-05-26 00:05:28 +02:00
|
|
|
switch (gc_state.modal.plane_select) {
|
|
|
|
case PLANE_SELECT_XY : printPgmString(PSTR(" G17")); break;
|
|
|
|
case PLANE_SELECT_ZX : printPgmString(PSTR(" G18")); break;
|
|
|
|
case PLANE_SELECT_YZ : printPgmString(PSTR(" G19")); break;
|
|
|
|
}
|
2012-11-02 02:48:55 +01:00
|
|
|
|
2014-05-26 00:05:28 +02:00
|
|
|
if (gc_state.modal.units == UNITS_MODE_MM) { printPgmString(PSTR(" G21")); }
|
|
|
|
else { printPgmString(PSTR(" G20")); }
|
2012-11-02 02:48:55 +01:00
|
|
|
|
2014-05-26 00:05:28 +02:00
|
|
|
if (gc_state.modal.distance == DISTANCE_MODE_ABSOLUTE) { printPgmString(PSTR(" G90")); }
|
2012-11-02 02:48:55 +01:00
|
|
|
else { printPgmString(PSTR(" G91")); }
|
|
|
|
|
2014-05-26 00:05:28 +02:00
|
|
|
if (gc_state.modal.feed_rate == FEED_RATE_MODE_INVERSE_TIME) { printPgmString(PSTR(" G93")); }
|
2012-11-02 02:48:55 +01:00
|
|
|
else { printPgmString(PSTR(" G94")); }
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
|
2014-05-26 00:05:28 +02:00
|
|
|
switch (gc_state.modal.program_flow) {
|
2012-11-02 02:48:55 +01:00
|
|
|
case PROGRAM_FLOW_RUNNING : printPgmString(PSTR(" M0")); break;
|
|
|
|
case PROGRAM_FLOW_PAUSED : printPgmString(PSTR(" M1")); break;
|
|
|
|
case PROGRAM_FLOW_COMPLETED : printPgmString(PSTR(" M2")); break;
|
|
|
|
}
|
|
|
|
|
2014-05-26 00:05:28 +02:00
|
|
|
switch (gc_state.modal.spindle) {
|
2014-02-19 15:48:09 +01:00
|
|
|
case SPINDLE_ENABLE_CW : printPgmString(PSTR(" M3")); break;
|
|
|
|
case SPINDLE_ENABLE_CCW : printPgmString(PSTR(" M4")); break;
|
|
|
|
case SPINDLE_DISABLE : printPgmString(PSTR(" M5")); break;
|
2012-11-02 02:48:55 +01:00
|
|
|
}
|
|
|
|
|
2014-05-26 00:05:28 +02:00
|
|
|
switch (gc_state.modal.coolant) {
|
2012-11-02 02:48:55 +01:00
|
|
|
case COOLANT_DISABLE : printPgmString(PSTR(" M9")); break;
|
|
|
|
case COOLANT_FLOOD_ENABLE : printPgmString(PSTR(" M8")); break;
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
#ifdef ENABLE_M7
|
|
|
|
case COOLANT_MIST_ENABLE : printPgmString(PSTR(" M7")); break;
|
|
|
|
#endif
|
2012-11-02 02:48:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
printPgmString(PSTR(" T"));
|
2014-05-26 00:05:28 +02:00
|
|
|
print_uint8_base10(gc_state.tool);
|
2012-11-02 02:48:55 +01:00
|
|
|
|
|
|
|
printPgmString(PSTR(" F"));
|
2014-07-05 00:08:15 +02:00
|
|
|
printFloat_RateValue(gc_state.feed_rate);
|
2014-09-18 00:56:25 +02:00
|
|
|
|
|
|
|
#ifdef VARIABLE_SPINDLE
|
|
|
|
printPgmString(PSTR(" S"));
|
|
|
|
printFloat_RateValue(gc_state.spindle_speed);
|
|
|
|
#endif
|
2012-11-16 05:53:11 +01:00
|
|
|
|
2012-11-20 01:39:40 +01:00
|
|
|
printPgmString(PSTR("]\r\n"));
|
2012-11-02 02:48:55 +01:00
|
|
|
}
|
2012-11-01 16:37:27 +01:00
|
|
|
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
// Prints specified startup line
|
|
|
|
void report_startup_line(uint8_t n, char *line)
|
|
|
|
{
|
2014-05-26 00:05:28 +02:00
|
|
|
printPgmString(PSTR("$N")); print_uint8_base10(n);
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
printPgmString(PSTR("=")); printString(line);
|
|
|
|
printPgmString(PSTR("\r\n"));
|
|
|
|
}
|
2012-11-01 16:37:27 +01:00
|
|
|
|
2014-01-05 18:27:34 +01:00
|
|
|
|
|
|
|
// Prints build info line
|
|
|
|
void report_build_info(char *line)
|
|
|
|
{
|
|
|
|
printPgmString(PSTR("[" GRBL_VERSION "." GRBL_VERSION_BUILD ":"));
|
|
|
|
printString(line);
|
|
|
|
printPgmString(PSTR("]\r\n"));
|
2015-03-28 01:13:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Prints the character string line Grbl has received from the user, which has been pre-parsed,
|
|
|
|
// and has been sent into protocol_execute_line() routine to be executed by Grbl.
|
|
|
|
void report_echo_line_received(char *line)
|
|
|
|
{
|
|
|
|
printPgmString(PSTR("[echo: ")); printString(line);
|
|
|
|
printPgmString(PSTR("]\r\n"));
|
2014-01-05 18:27:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(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.
2012-11-03 18:32:23 +01:00
|
|
|
// Prints real-time data. This function grabs a real-time snapshot of the stepper subprogram
|
|
|
|
// and the actual location of the CNC machine. Users may change the following function to their
|
|
|
|
// specific needs, but the desired real-time data report must be as short as possible. This is
|
|
|
|
// requires as it minimizes the computational overhead and allows grbl to keep running smoothly,
|
|
|
|
// especially during g-code programs with fast, short line segments and high frequency reports (5-20Hz).
|
2012-11-01 16:37:27 +01:00
|
|
|
void report_realtime_status()
|
|
|
|
{
|
2012-11-15 01:36:29 +01:00
|
|
|
// **Under construction** Bare-bones status report. Provides real-time machine position relative to
|
|
|
|
// the system power on location (0,0,0) and work coordinate position (G54 and G92 applied). Eventually
|
|
|
|
// to be added are distance to go on block, processed block id, and feed rate. Also a settings bitmask
|
|
|
|
// for a user to select the desired real-time data.
|
Critical M0/2/30 fix. Homing updates.
- Critical fix for M0 program pause. Due to its recent change, it would
cause Grbl to suspend but wouldn’t notify the user of why Grbl was not
doing anything. The state would show IDLE and a cycle start would
resume it. Grbl now enters a HOLD state to better indicate the state
change.
- Critical fix for M2 and M30 program end. As with M0, the state
previously would show IDLE while suspended. Grbl now does not suspend
upon program end and leaves job control to the GUI. Grbl simply reports
a `[Pgm End]` as a feedback message and resets certain g-code modes.
- M2/30 g-code reseting fix. Previously Grbl would soft-reset after an
M2/30, but this was not complaint to the (linuxcnc) g-code standard. It
simply resets [G1,G17,G90,G94,G40,G54,M5,M9,M48] and keeps all other
modes the same.
- M0/M2/M30 check-mode fix. It now does not suspend the machine during
check-mode.
- Minor bug fix related to commands similar to G90.1, but not G90.1,
not reporting an unsupported command.
- Homing cycle refactoring. To help reduce the chance of users
misunderstanding their limit switch wiring, Grbl only moves a short
distance for the locate cycles only. In addition, the homing cycle
pulls-off the limit switch by the pull-off distance to re-engage and
locate home. This should improve its accuracy.
- HOMING_FORCE_ORIGIN now sets the origin to the pull-off location,
rather than where the limit switch was triggered.
- Updated default junction deviation to 0.01mm. Recent tests showed
that this improves Grbl’s cornering behavior a bit.
- Added the ShapeOko3 defaults.
- Added new feedback message `[Pgm End]` for M2/30 notification.
- Limit pin reporting is now a $10 status report option. Requested by
OEMs to help simplify support troubleshooting.
2015-05-17 21:25:36 +02:00
|
|
|
uint8_t idx;
|
2013-01-09 23:22:45 +01:00
|
|
|
int32_t current_position[N_AXIS]; // Copy current state of the system position variable
|
2012-11-15 01:36:29 +01:00
|
|
|
memcpy(current_position,sys.position,sizeof(sys.position));
|
2013-01-09 23:22:45 +01:00
|
|
|
float print_position[N_AXIS];
|
2012-11-15 01:36:29 +01:00
|
|
|
|
2012-11-16 05:53:11 +01:00
|
|
|
// Report current machine state
|
|
|
|
switch (sys.state) {
|
2012-11-20 01:39:40 +01:00
|
|
|
case STATE_IDLE: printPgmString(PSTR("<Idle")); break;
|
2015-02-12 05:19:00 +01:00
|
|
|
case STATE_MOTION_CANCEL: // Report run state.
|
2012-11-20 01:39:40 +01:00
|
|
|
case STATE_CYCLE: printPgmString(PSTR("<Run")); break;
|
|
|
|
case STATE_HOLD: printPgmString(PSTR("<Hold")); break;
|
|
|
|
case STATE_HOMING: printPgmString(PSTR("<Home")); break;
|
|
|
|
case STATE_ALARM: printPgmString(PSTR("<Alarm")); break;
|
|
|
|
case STATE_CHECK_MODE: printPgmString(PSTR("<Check")); break;
|
2015-02-12 05:19:00 +01:00
|
|
|
case STATE_SAFETY_DOOR: printPgmString(PSTR("<Door")); break;
|
2012-11-16 05:53:11 +01:00
|
|
|
}
|
2012-11-01 16:37:27 +01:00
|
|
|
|
2014-08-22 16:31:24 +02:00
|
|
|
// If reporting a position, convert the current step count (current_position) to millimeters.
|
2014-08-22 16:32:55 +02:00
|
|
|
if (bit_istrue(settings.status_report_mask,(BITFLAG_RT_STATUS_MACHINE_POSITION | BITFLAG_RT_STATUS_WORK_POSITION))) {
|
2015-01-15 06:14:52 +01:00
|
|
|
system_convert_array_steps_to_mpos(print_position,current_position);
|
2014-08-22 16:31:24 +02:00
|
|
|
}
|
|
|
|
|
2012-11-15 01:36:29 +01:00
|
|
|
// Report machine position
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_MACHINE_POSITION)) {
|
|
|
|
printPgmString(PSTR(",MPos:"));
|
Critical M0/2/30 fix. Homing updates.
- Critical fix for M0 program pause. Due to its recent change, it would
cause Grbl to suspend but wouldn’t notify the user of why Grbl was not
doing anything. The state would show IDLE and a cycle start would
resume it. Grbl now enters a HOLD state to better indicate the state
change.
- Critical fix for M2 and M30 program end. As with M0, the state
previously would show IDLE while suspended. Grbl now does not suspend
upon program end and leaves job control to the GUI. Grbl simply reports
a `[Pgm End]` as a feedback message and resets certain g-code modes.
- M2/30 g-code reseting fix. Previously Grbl would soft-reset after an
M2/30, but this was not complaint to the (linuxcnc) g-code standard. It
simply resets [G1,G17,G90,G94,G40,G54,M5,M9,M48] and keeps all other
modes the same.
- M0/M2/M30 check-mode fix. It now does not suspend the machine during
check-mode.
- Minor bug fix related to commands similar to G90.1, but not G90.1,
not reporting an unsupported command.
- Homing cycle refactoring. To help reduce the chance of users
misunderstanding their limit switch wiring, Grbl only moves a short
distance for the locate cycles only. In addition, the homing cycle
pulls-off the limit switch by the pull-off distance to re-engage and
locate home. This should improve its accuracy.
- HOMING_FORCE_ORIGIN now sets the origin to the pull-off location,
rather than where the limit switch was triggered.
- Updated default junction deviation to 0.01mm. Recent tests showed
that this improves Grbl’s cornering behavior a bit.
- Added the ShapeOko3 defaults.
- Added new feedback message `[Pgm End]` for M2/30 notification.
- Limit pin reporting is now a $10 status report option. Requested by
OEMs to help simplify support troubleshooting.
2015-05-17 21:25:36 +02:00
|
|
|
for (idx=0; idx< N_AXIS; idx++) {
|
|
|
|
printFloat_CoordValue(print_position[idx]);
|
|
|
|
if (idx < (N_AXIS-1)) { printPgmString(PSTR(",")); }
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
}
|
2012-11-15 01:36:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Report work position
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_WORK_POSITION)) {
|
|
|
|
printPgmString(PSTR(",WPos:"));
|
Critical M0/2/30 fix. Homing updates.
- Critical fix for M0 program pause. Due to its recent change, it would
cause Grbl to suspend but wouldn’t notify the user of why Grbl was not
doing anything. The state would show IDLE and a cycle start would
resume it. Grbl now enters a HOLD state to better indicate the state
change.
- Critical fix for M2 and M30 program end. As with M0, the state
previously would show IDLE while suspended. Grbl now does not suspend
upon program end and leaves job control to the GUI. Grbl simply reports
a `[Pgm End]` as a feedback message and resets certain g-code modes.
- M2/30 g-code reseting fix. Previously Grbl would soft-reset after an
M2/30, but this was not complaint to the (linuxcnc) g-code standard. It
simply resets [G1,G17,G90,G94,G40,G54,M5,M9,M48] and keeps all other
modes the same.
- M0/M2/M30 check-mode fix. It now does not suspend the machine during
check-mode.
- Minor bug fix related to commands similar to G90.1, but not G90.1,
not reporting an unsupported command.
- Homing cycle refactoring. To help reduce the chance of users
misunderstanding their limit switch wiring, Grbl only moves a short
distance for the locate cycles only. In addition, the homing cycle
pulls-off the limit switch by the pull-off distance to re-engage and
locate home. This should improve its accuracy.
- HOMING_FORCE_ORIGIN now sets the origin to the pull-off location,
rather than where the limit switch was triggered.
- Updated default junction deviation to 0.01mm. Recent tests showed
that this improves Grbl’s cornering behavior a bit.
- Added the ShapeOko3 defaults.
- Added new feedback message `[Pgm End]` for M2/30 notification.
- Limit pin reporting is now a $10 status report option. Requested by
OEMs to help simplify support troubleshooting.
2015-05-17 21:25:36 +02:00
|
|
|
for (idx=0; idx< N_AXIS; idx++) {
|
2014-08-22 16:31:24 +02:00
|
|
|
// Apply work coordinate offsets and tool length offset to current position.
|
Critical M0/2/30 fix. Homing updates.
- Critical fix for M0 program pause. Due to its recent change, it would
cause Grbl to suspend but wouldn’t notify the user of why Grbl was not
doing anything. The state would show IDLE and a cycle start would
resume it. Grbl now enters a HOLD state to better indicate the state
change.
- Critical fix for M2 and M30 program end. As with M0, the state
previously would show IDLE while suspended. Grbl now does not suspend
upon program end and leaves job control to the GUI. Grbl simply reports
a `[Pgm End]` as a feedback message and resets certain g-code modes.
- M2/30 g-code reseting fix. Previously Grbl would soft-reset after an
M2/30, but this was not complaint to the (linuxcnc) g-code standard. It
simply resets [G1,G17,G90,G94,G40,G54,M5,M9,M48] and keeps all other
modes the same.
- M0/M2/M30 check-mode fix. It now does not suspend the machine during
check-mode.
- Minor bug fix related to commands similar to G90.1, but not G90.1,
not reporting an unsupported command.
- Homing cycle refactoring. To help reduce the chance of users
misunderstanding their limit switch wiring, Grbl only moves a short
distance for the locate cycles only. In addition, the homing cycle
pulls-off the limit switch by the pull-off distance to re-engage and
locate home. This should improve its accuracy.
- HOMING_FORCE_ORIGIN now sets the origin to the pull-off location,
rather than where the limit switch was triggered.
- Updated default junction deviation to 0.01mm. Recent tests showed
that this improves Grbl’s cornering behavior a bit.
- Added the ShapeOko3 defaults.
- Added new feedback message `[Pgm End]` for M2/30 notification.
- Limit pin reporting is now a $10 status report option. Requested by
OEMs to help simplify support troubleshooting.
2015-05-17 21:25:36 +02:00
|
|
|
print_position[idx] -= gc_state.coord_system[idx]+gc_state.coord_offset[idx];
|
|
|
|
if (idx == TOOL_LENGTH_OFFSET_AXIS) { print_position[idx] -= gc_state.tool_length_offset; }
|
|
|
|
printFloat_CoordValue(print_position[idx]);
|
|
|
|
if (idx < (N_AXIS-1)) { printPgmString(PSTR(",")); }
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns the number of active blocks are in the planner buffer.
|
|
|
|
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_PLANNER_BUFFER)) {
|
|
|
|
printPgmString(PSTR(",Buf:"));
|
|
|
|
print_uint8_base10(plan_get_block_buffer_count());
|
|
|
|
}
|
|
|
|
|
|
|
|
// Report serial read buffer status
|
|
|
|
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_SERIAL_RX)) {
|
|
|
|
printPgmString(PSTR(",RX:"));
|
|
|
|
print_uint8_base10(serial_get_rx_buffer_count());
|
2012-11-15 01:36:29 +01:00
|
|
|
}
|
|
|
|
|
G38.2 probe feature rough draft installed. Working but needs testing.
- 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.
2014-03-01 06:03:26 +01:00
|
|
|
#ifdef USE_LINE_NUMBERS
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
// Report current line number
|
|
|
|
printPgmString(PSTR(",Ln:"));
|
|
|
|
int32_t ln=0;
|
|
|
|
plan_block_t * pb = plan_get_current_block();
|
|
|
|
if(pb != NULL) {
|
|
|
|
ln = pb->line_number;
|
|
|
|
}
|
|
|
|
printInteger(ln);
|
G38.2 probe feature rough draft installed. Working but needs testing.
- 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.
2014-03-01 06:03:26 +01:00
|
|
|
#endif
|
2014-02-25 21:19:52 +01:00
|
|
|
|
2014-07-05 00:08:15 +02:00
|
|
|
#ifdef REPORT_REALTIME_RATE
|
Settings refactoring. Bug fixes. Misc new features.
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.
2014-07-26 23:01:34 +02:00
|
|
|
// Report realtime rate
|
|
|
|
printPgmString(PSTR(",F:"));
|
|
|
|
printFloat_RateValue(st_get_realtime_rate());
|
|
|
|
#endif
|
2014-07-05 00:08:15 +02:00
|
|
|
|
Critical M0/2/30 fix. Homing updates.
- Critical fix for M0 program pause. Due to its recent change, it would
cause Grbl to suspend but wouldn’t notify the user of why Grbl was not
doing anything. The state would show IDLE and a cycle start would
resume it. Grbl now enters a HOLD state to better indicate the state
change.
- Critical fix for M2 and M30 program end. As with M0, the state
previously would show IDLE while suspended. Grbl now does not suspend
upon program end and leaves job control to the GUI. Grbl simply reports
a `[Pgm End]` as a feedback message and resets certain g-code modes.
- M2/30 g-code reseting fix. Previously Grbl would soft-reset after an
M2/30, but this was not complaint to the (linuxcnc) g-code standard. It
simply resets [G1,G17,G90,G94,G40,G54,M5,M9,M48] and keeps all other
modes the same.
- M0/M2/M30 check-mode fix. It now does not suspend the machine during
check-mode.
- Minor bug fix related to commands similar to G90.1, but not G90.1,
not reporting an unsupported command.
- Homing cycle refactoring. To help reduce the chance of users
misunderstanding their limit switch wiring, Grbl only moves a short
distance for the locate cycles only. In addition, the homing cycle
pulls-off the limit switch by the pull-off distance to re-engage and
locate home. This should improve its accuracy.
- HOMING_FORCE_ORIGIN now sets the origin to the pull-off location,
rather than where the limit switch was triggered.
- Updated default junction deviation to 0.01mm. Recent tests showed
that this improves Grbl’s cornering behavior a bit.
- Added the ShapeOko3 defaults.
- Added new feedback message `[Pgm End]` for M2/30 notification.
- Limit pin reporting is now a $10 status report option. Requested by
OEMs to help simplify support troubleshooting.
2015-05-17 21:25:36 +02:00
|
|
|
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_LIMIT_PINS)) {
|
2015-02-07 04:02:34 +01:00
|
|
|
printPgmString(PSTR(",Lim:"));
|
2015-05-23 19:57:30 +02:00
|
|
|
print_unsigned_int8(limits_get_state(),2,N_AXIS);
|
Critical M0/2/30 fix. Homing updates.
- Critical fix for M0 program pause. Due to its recent change, it would
cause Grbl to suspend but wouldn’t notify the user of why Grbl was not
doing anything. The state would show IDLE and a cycle start would
resume it. Grbl now enters a HOLD state to better indicate the state
change.
- Critical fix for M2 and M30 program end. As with M0, the state
previously would show IDLE while suspended. Grbl now does not suspend
upon program end and leaves job control to the GUI. Grbl simply reports
a `[Pgm End]` as a feedback message and resets certain g-code modes.
- M2/30 g-code reseting fix. Previously Grbl would soft-reset after an
M2/30, but this was not complaint to the (linuxcnc) g-code standard. It
simply resets [G1,G17,G90,G94,G40,G54,M5,M9,M48] and keeps all other
modes the same.
- M0/M2/M30 check-mode fix. It now does not suspend the machine during
check-mode.
- Minor bug fix related to commands similar to G90.1, but not G90.1,
not reporting an unsupported command.
- Homing cycle refactoring. To help reduce the chance of users
misunderstanding their limit switch wiring, Grbl only moves a short
distance for the locate cycles only. In addition, the homing cycle
pulls-off the limit switch by the pull-off distance to re-engage and
locate home. This should improve its accuracy.
- HOMING_FORCE_ORIGIN now sets the origin to the pull-off location,
rather than where the limit switch was triggered.
- Updated default junction deviation to 0.01mm. Recent tests showed
that this improves Grbl’s cornering behavior a bit.
- Added the ShapeOko3 defaults.
- Added new feedback message `[Pgm End]` for M2/30 notification.
- Limit pin reporting is now a $10 status report option. Requested by
OEMs to help simplify support troubleshooting.
2015-05-17 21:25:36 +02:00
|
|
|
}
|
2015-03-14 16:27:48 +01:00
|
|
|
|
|
|
|
#ifdef REPORT_CONTROL_PIN_STATE
|
2015-02-07 04:02:34 +01:00
|
|
|
printPgmString(PSTR(",Ctl:"));
|
|
|
|
print_uint8_base2(CONTROL_PIN & CONTROL_MASK);
|
|
|
|
#endif
|
|
|
|
|
2014-02-25 21:19:52 +01:00
|
|
|
printPgmString(PSTR(">\r\n"));
|
|
|
|
}
|