mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-31 10:01:48 +02:00
Turn off soft limits with max travel (#836)
https://github.com/bdring/Grbl_Esp32/issues/831
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
// Grbl versioning system
|
||||
const char* const GRBL_VERSION = "1.3a";
|
||||
const char* const GRBL_VERSION_BUILD = "20210319";
|
||||
const char* const GRBL_VERSION_BUILD = "20210320";
|
||||
|
||||
//#include <sdkconfig.h>
|
||||
#include <Arduino.h>
|
||||
|
@@ -392,13 +392,14 @@ float limitsMinPosition(uint8_t axis) {
|
||||
|
||||
// Checks and reports if target array exceeds machine travel limits.
|
||||
// Return true if exceeding limits
|
||||
// Set $<axis>/MaxTravel=0 to selectively remove an axis from soft limit checks
|
||||
bool limitsCheckTravel(float* target) {
|
||||
uint8_t idx;
|
||||
auto n_axis = number_axis->get();
|
||||
for (idx = 0; idx < n_axis; idx++) {
|
||||
float max_mpos, min_mpos;
|
||||
|
||||
if (target[idx] < limitsMinPosition(idx) || target[idx] > limitsMaxPosition(idx)) {
|
||||
if ((target[idx] < limitsMinPosition(idx) || target[idx] > limitsMaxPosition(idx)) && axis_settings[idx]->max_travel->get() > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -301,7 +301,7 @@ void make_settings() {
|
||||
}
|
||||
for (axis = MAX_N_AXIS - 1; axis >= 0; axis--) {
|
||||
def = &axis_defaults[axis];
|
||||
auto setting = new FloatSetting(GRBL, WG, makeGrblName(axis, 130), makename(def->name, "MaxTravel"), def->max_travel, 1.0, 100000.0);
|
||||
auto setting = new FloatSetting(GRBL, WG, makeGrblName(axis, 130), makename(def->name, "MaxTravel"), def->max_travel, 0, 100000.0);
|
||||
setting->setAxis(axis);
|
||||
axis_settings[axis]->max_travel = setting;
|
||||
}
|
||||
|
Reference in New Issue
Block a user