Hard limits, homing direction, pull-off limits after homing, status reports in mm or inches, system alarm, and more.

- Thank you statement added for Alden Hart of Synthetos.

- Hard limits option added, which also works with homing by pulling off
the switches to help prevent unintended triggering. Hard limits use a
interrupt to sense a falling edge pin change and immediately go into
alarm mode, which stops everything and forces the user to issue a reset
(Ctrl-x) or reboot.

- Auto cycle start now a configuration option.

- Alarm mode: A new method to kill all Grbl processes in the event of
something catastrophic or potentially catastropic. Just works with hard
limits for now, but will be expanded to include g-code errors (most
likely) and other events.

- Updated status reports to be configurable in inches or mm mode. Much
more to do here, but this is the first step.

- New settings: auto cycle start, hard limit enable, homing direction
mask (which works the same as the stepper mask), homing pulloff
distance (or distance traveled from homed machine zero to prevent
accidental limit trip).

- Minor memory liberation and calculation speed ups.
This commit is contained in:
Sonny Jeon
2012-10-16 21:29:45 -06:00
parent 34f6d2eb4b
commit df5bb70b25
11 changed files with 193 additions and 83 deletions

12
main.c
View File

@ -19,6 +19,10 @@
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
/* A big thanks to Alden Hart of Synthetos, supplier of grblshield and TinyG, who has
been integral throughout the development of the higher level details of Grbl, as well
as being a consistent sounding board for the future of accessible and free CNC. */
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "config.h"
@ -46,7 +50,9 @@ int main(void)
memset(&sys, 0, sizeof(sys)); // Clear all system variables
sys.abort = true; // Set abort to complete initialization
// TODO: When Grbl system status is installed, need to set position lost state upon startup.
for(;;) {
// Execute system reset upon a system abort, where the main program will return to this loop.
@ -87,9 +93,9 @@ int main(void)
// Set system runtime defaults
// TODO: Eventual move to EEPROM from config.h when all of the new settings are worked out.
// Mainly to avoid having to maintain several different versions.
#ifdef CYCLE_AUTO_START
if (bit_istrue(settings.flags,BITFLAG_AUTO_START)) {
sys.auto_start = true;
#endif
}
// TODO: Install G20/G21 unit default into settings and load appropriate settings.
}