diff --git a/README.md b/README.md index 3b8c5bb..e0d6677 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Grbl includes full acceleration management with look ahead. That means the contr *** _**Master Branch:**_ -* [Grbl v0.9j Atmega328p 16mhz 115200baud with generic defaults](http://bit.ly/1I8Ey4S) _(2015-12-18)_ +* [Grbl v0.9j Atmega328p 16mhz 115200baud with generic defaults](http://bit.ly/1I8Ey4S) _(2016-03-03)_ - **IMPORTANT INFO WHEN UPGRADING TO GRBL v0.9 :** - Baudrate is now **115200** (Up from 9600). - Homing cycle updated. Located based on switch trigger, rather than release point. diff --git a/doc/log/commit_log_v0.9j.txt b/doc/log/commit_log_v0.9j.txt index 3bf71bb..8c66a42 100644 --- a/doc/log/commit_log_v0.9j.txt +++ b/doc/log/commit_log_v0.9j.txt @@ -1,3 +1,19 @@ +---------------- +Date: 2015-12-18 +Author: Sonny Jeon +Subject: Minor bug fixes. + +- Planner was under-estimating maximum speeds through straight +junctions in certain cases. The calculations have been updated to be +more accurate. + +- Type declaration fix in probe.c. + + - Commit log for v0.9j generated separately from v0.9i’s. + +- Incremented version and updated pre-built firmware link. + + ---------------- Date: 2015-09-30 Author: Sonny Jeon diff --git a/grbl/config.h b/grbl/config.h index e8a600b..bd9c0d6 100644 --- a/grbl/config.h +++ b/grbl/config.h @@ -126,8 +126,8 @@ #define MESSAGE_PROBE_COORDINATES // Enabled by default. Comment to disable. // Enables a second coolant control pin via the mist coolant g-code command M7 on the Arduino Uno -// analog pin 5. Only use this option if you require a second coolant control pin. -// NOTE: The M8 flood coolant control pin on analog pin 4 will still be functional regardless. +// analog pin 4. Only use this option if you require a second coolant control pin. +// NOTE: The M8 flood coolant control pin on analog pin 3 will still be functional regardless. // #define ENABLE_M7 // Disabled by default. Uncomment to enable. // This option causes the feed hold input to act as a safety door switch. A safety door, when triggered, @@ -157,6 +157,14 @@ // the CONTROL_INVERT_MASK definition in cpu_map.h files. // #define INVERT_ALL_CONTROL_PINS // Default disabled. Uncomment to enable. +// Inverts select limit pin states based on the following mask. This effects all limit pin functions, +// such as hard limits and homing. However, this is different from overall invert limits setting. +// This build option will invert only the limit pins defined here, and then the invert limits setting +// will be applied to all of them. This is useful when a user has a mixed set of limit pins with both +// normally-open(NO) and normally-closed(NC) switches installed on their machine. +// NOTE: PLEASE DO NOT USE THIS, unless you have a situation that needs it. +// #define INVERT_LIMIT_PIN_MASK ((1< diff --git a/grbl/limits.c b/grbl/limits.c index 9742a32..90f49ba 100644 --- a/grbl/limits.c +++ b/grbl/limits.c @@ -70,12 +70,15 @@ uint8_t limits_get_state() { uint8_t limit_state = 0; uint8_t pin = (LIMIT_PIN & LIMIT_MASK); + #ifdef INVERT_LIMIT_PIN_MASK + pin ^= INVERT_LIMIT_PIN_MASK; + #endif if (bit_isfalse(settings.flags,BITFLAG_INVERT_LIMIT_PINS)) { pin ^= LIMIT_MASK; } if (pin) { - uint8_t idx; - for (idx=0; idx SPINDLE_RPM_RANGE ) { rpm = SPINDLE_RPM_RANGE; } // Prevent integer overflow - } - current_pwm = floor( rpm*(PWM_MAX_VALUE/SPINDLE_RPM_RANGE) + 0.5); - #ifdef MINIMUM_SPINDLE_PWM - if (current_pwm < MINIMUM_SPINDLE_PWM) { current_pwm = MINIMUM_SPINDLE_PWM; } - #endif - OCR_REGISTER = current_pwm; // Set PWM pin output + if (rpm <= 0.0) { spindle_stop(); } // RPM should never be negative, but check anyway. + else { + #define SPINDLE_RPM_RANGE (SPINDLE_MAX_RPM-SPINDLE_MIN_RPM) + if ( rpm < SPINDLE_MIN_RPM ) { rpm = 0; } + else { + rpm -= SPINDLE_MIN_RPM; + if ( rpm > SPINDLE_RPM_RANGE ) { rpm = SPINDLE_RPM_RANGE; } // Prevent integer overflow + } + current_pwm = floor( rpm*(PWM_MAX_VALUE/SPINDLE_RPM_RANGE) + 0.5); + #ifdef MINIMUM_SPINDLE_PWM + if (current_pwm < MINIMUM_SPINDLE_PWM) { current_pwm = MINIMUM_SPINDLE_PWM; } + #endif + OCR_REGISTER = current_pwm; // Set PWM pin output - // On the Uno, spindle enable and PWM are shared, unless otherwise specified. - #if defined(CPU_MAP_ATMEGA2560) || defined(USE_SPINDLE_DIR_AS_ENABLE_PIN) + // On the Uno, spindle enable and PWM are shared, unless otherwise specified. + #if defined(CPU_MAP_ATMEGA2560) || defined(USE_SPINDLE_DIR_AS_ENABLE_PIN) + #ifdef INVERT_SPINDLE_ENABLE_PIN + SPINDLE_ENABLE_PORT &= ~(1<