Merge branch 'master' into more-axis

This commit is contained in:
cprezzi
2017-05-26 20:23:51 +02:00
5 changed files with 31 additions and 23 deletions

View File

@ -37,6 +37,7 @@
// If doing so, simply comment out these two defines and see instructions below.
#define CPU_MAP_LPC1769 // NXP LPC1769 boards (like Smoothieboard, Cohesion3D, MKS SBase)
#define BOARD_C3D // For boards without i2c stepper current chip (like Cohesion3D).
//#define DEFAULTS_GENERIC
#define DEFAULTS_K40
//#define DEFAULTS_FABKIT
@ -133,6 +134,9 @@
// define to force Grbl to always set the machine origin at the homed location despite switch orientation.
// #define HOMING_FORCE_SET_ORIGIN // Uncomment to enable.
// Uncomment this define to force Grbl to always set the machine origin at bottom left.
#define HOMING_FORCE_POSITIVE_SPACE // Uncomment to enable.
// Number of blocks Grbl executes upon startup. These blocks are stored in EEPROM, where the size
// and addresses are defined in settings.h. With the current settings, up to 2 startup blocks may
// be stored and executed in order. These startup blocks would typically be used to set the g-code

View File

@ -307,9 +307,17 @@ void limits_go_home(uint8_t cycle_mask)
set_axis_position = 0;
#else
if ( bit_istrue(settings.homing_dir_mask,bit(idx)) ) {
set_axis_position = lround((settings.max_travel[idx]+settings.homing_pulloff)*settings.steps_per_mm[idx]);
#ifdef HOMING_FORCE_POSITIVE_SPACE
set_axis_position = 0; //lround(settings.homing_pulloff*settings.steps_per_mm[idx]);
#else
set_axis_position = lround((settings.max_travel[idx]-settings.homing_pulloff)*settings.steps_per_mm[idx]);
#endif
} else {
set_axis_position = lround(-settings.homing_pulloff*settings.steps_per_mm[idx]);
#ifdef HOMING_FORCE_POSITIVE_SPACE
set_axis_position = lround(-settings.max_travel[idx]*settings.steps_per_mm[idx]);
#else
set_axis_position = lround(-settings.homing_pulloff*settings.steps_per_mm[idx]);
#endif
}
#endif

View File

@ -71,7 +71,6 @@ static void report_util_setting_string(uint8_t n) {
case 30: printPgmString(PSTR("rpm max")); break;
case 31: printPgmString(PSTR("rpm min")); break;
case 32: printPgmString(PSTR("laser")); break;
case 33: printPgmString(PSTR("spindle_pwm_freq")); break;
default:
n -= AXIS_SETTINGS_START_VAL;
uint8_t idx = 0;
@ -97,11 +96,6 @@ static void report_util_uint8_setting(uint8_t n, int val) {
print_uint8_base10(val);
report_util_line_feed(); // report_util_setting_string(n);
}
static void report_util_uint32_setting(uint8_t n, int val) {
report_util_setting_prefix(n);
print_uint32_base10(val);
report_util_line_feed(); // report_util_setting_string(n);
}
static void report_util_float_setting(uint8_t n, float val, uint8_t n_decimal) {
report_util_setting_prefix(n);
printFloat(val,n_decimal);

View File

@ -345,7 +345,11 @@ uint8_t system_check_travel_limits(float *target)
}
#else
// NOTE: max_travel is stored as negative
if (target[idx] > 0 || target[idx] < settings.max_travel[idx]) { return(true); }
#ifdef HOMING_FORCE_POSITIVE_SPACE
if (target[idx] < 0 || target[idx] > -settings.max_travel[idx]) { return(true); }
#else
if (target[idx] > 0 || target[idx] < settings.max_travel[idx]) { return(true); }
#endif
#endif
}
return(false);