Merge branch 'master' into more-axis

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

View File

@ -1,7 +1,8 @@
![GitHub Logo](https://github.com/gnea/gnea-Media/blob/master/Grbl%20Logo/Grbl%20Logo%20250px.png?raw=true)
***
_Click the `Release` tab to download pre-compiled `.bin` files or just [click here](https://github.com/cprezzi/grbl-LPC/releases)_
Old releases are in the `Release` tab. See [cprezzi's branch](https://github.com/cprezzi/grbl-LPC) for more recent releases.
Note: cprezzi's branch disables current control and has defaults more suitable for other boards.
***
This is GRBL 1.1 ported to the LPC1769. It can run on Smoothieboard.
@ -12,23 +13,20 @@ Usage notes:
* Only tested with lasers with PWM. Non-PWM spindle control not ported.
* These are defaults for easy-to-change config values.
* WPos enabled for LaserWeb compatability ($10=0)
* Maximum S value: 1000.0 ($30)
* Laser mode: ON ($32)
* Minimum S value: 0.0 ($31)
* Laser mode: 1 ($32)
* New configuration settings
* $33 is PWM frequency in Hz
* $34 is PWM off value in %
* $35 is PWM min value in %
* $36 is PWM max value in %
* $140 is X current (amps)
* $141 is Y current (amps)
* $142 is Z current (amps)
* Currents default to 0.0 amps to avoid burning out your motors/drivers
* Your motors will likely stall if you don't set these!
* Maximum S value: 1.0 ($30)
* Hard limits not yet ported
* Control inputs not yet ported (e.g. Cycle Start and Safety Door switches)
New configuration settings
* $33 is PWM frequency in Hz
* $34 is PWM off value in %
* $35 is PWM min value in %
* $36 is PWM max value in %
* $140, $141, $142 are X, Y, Z current (amps)
* Default to 0.0 A to avoid burning out your motors
* Your motors will likely stall if you don't set these!
Build notes:
* Include ```make``` and the ```arm-none-eabi-*``` tools in your path.

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);