mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-26 07:44:33 +02:00
@@ -312,11 +312,6 @@ void kinematics_post_homing() {
|
|||||||
memcpy(gc_state.position, last_cartesian, n_axis * sizeof(last_cartesian[0]));
|
memcpy(gc_state.position, last_cartesian, n_axis * sizeof(last_cartesian[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is used used by Limits.cpp to see if the range of the machine is exceeded.
|
|
||||||
bool limitsCheckTravel(float* target) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void user_m30() {}
|
void user_m30() {}
|
||||||
|
|
||||||
// ================ Local Helper functions =================
|
// ================ Local Helper functions =================
|
||||||
|
@@ -1483,8 +1483,10 @@ Error gc_execute_line(char* line, uint8_t client) {
|
|||||||
// and absolute and incremental modes.
|
// and absolute and incremental modes.
|
||||||
pl_data->motion.rapidMotion = 1; // Set rapid motion flag.
|
pl_data->motion.rapidMotion = 1; // Set rapid motion flag.
|
||||||
if (axis_command != AxisCommand::None) {
|
if (axis_command != AxisCommand::None) {
|
||||||
|
limitsCheckSoft(gc_block.values.xyz);
|
||||||
cartesian_to_motors(gc_block.values.xyz, pl_data, gc_state.position);
|
cartesian_to_motors(gc_block.values.xyz, pl_data, gc_state.position);
|
||||||
}
|
}
|
||||||
|
limitsCheckSoft(coord_data);
|
||||||
cartesian_to_motors(coord_data, pl_data, gc_state.position);
|
cartesian_to_motors(coord_data, pl_data, gc_state.position);
|
||||||
memcpy(gc_state.position, coord_data, sizeof(gc_state.position));
|
memcpy(gc_state.position, coord_data, sizeof(gc_state.position));
|
||||||
break;
|
break;
|
||||||
@@ -1513,9 +1515,11 @@ Error gc_execute_line(char* line, uint8_t client) {
|
|||||||
if (axis_command == AxisCommand::MotionMode) {
|
if (axis_command == AxisCommand::MotionMode) {
|
||||||
GCUpdatePos gc_update_pos = GCUpdatePos::Target;
|
GCUpdatePos gc_update_pos = GCUpdatePos::Target;
|
||||||
if (gc_state.modal.motion == Motion::Linear) {
|
if (gc_state.modal.motion == Motion::Linear) {
|
||||||
|
limitsCheckSoft(gc_block.values.xyz);
|
||||||
cartesian_to_motors(gc_block.values.xyz, pl_data, gc_state.position);
|
cartesian_to_motors(gc_block.values.xyz, pl_data, gc_state.position);
|
||||||
} else if (gc_state.modal.motion == Motion::Seek) {
|
} else if (gc_state.modal.motion == Motion::Seek) {
|
||||||
pl_data->motion.rapidMotion = 1; // Set rapid motion flag.
|
pl_data->motion.rapidMotion = 1; // Set rapid motion flag.
|
||||||
|
limitsCheckSoft(gc_block.values.xyz);
|
||||||
cartesian_to_motors(gc_block.values.xyz, pl_data, gc_state.position);
|
cartesian_to_motors(gc_block.values.xyz, pl_data, gc_state.position);
|
||||||
} else if ((gc_state.modal.motion == Motion::CwArc) || (gc_state.modal.motion == Motion::CcwArc)) {
|
} else if ((gc_state.modal.motion == Motion::CwArc) || (gc_state.modal.motion == Motion::CcwArc)) {
|
||||||
mc_arc(gc_block.values.xyz,
|
mc_arc(gc_block.values.xyz,
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
// Grbl versioning system
|
// Grbl versioning system
|
||||||
const char* const GRBL_VERSION = "1.3a";
|
const char* const GRBL_VERSION = "1.3a";
|
||||||
const char* const GRBL_VERSION_BUILD = "20210816";
|
const char* const GRBL_VERSION_BUILD = "20210825";
|
||||||
|
|
||||||
//#include <sdkconfig.h>
|
//#include <sdkconfig.h>
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
@@ -416,3 +416,12 @@ bool limitsSwitchDefined(uint8_t axis, uint8_t gang_index) {
|
|||||||
bool __attribute__((weak)) user_defined_homing(uint8_t cycle_mask) {
|
bool __attribute__((weak)) user_defined_homing(uint8_t cycle_mask) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void limitsCheckSoft(float* target) {
|
||||||
|
if (soft_limits->get()) {
|
||||||
|
// NOTE: Block jog state. Jogging is a special case and soft limits are handled independently.
|
||||||
|
if (sys.state != State::Jog && sys.state != State::Homing) {
|
||||||
|
limits_soft_check(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -57,3 +57,5 @@ bool limitsCheckTravel(float* target);
|
|||||||
|
|
||||||
// check if a switch has been defined
|
// check if a switch has been defined
|
||||||
bool limitsSwitchDefined(uint8_t axis, uint8_t gang_index);
|
bool limitsSwitchDefined(uint8_t axis, uint8_t gang_index);
|
||||||
|
|
||||||
|
void limitsCheckSoft(float* target);
|
||||||
|
@@ -45,14 +45,7 @@ bool mc_line(float* target, plan_line_data_t* pl_data) {
|
|||||||
bool submitted_result = false;
|
bool submitted_result = false;
|
||||||
// store the plan data so it can be cancelled by the protocol system if needed
|
// store the plan data so it can be cancelled by the protocol system if needed
|
||||||
sys_pl_data_inflight = pl_data;
|
sys_pl_data_inflight = pl_data;
|
||||||
// If enabled, check for soft limit violations. Placed here all line motions are picked up
|
|
||||||
// from everywhere in Grbl.
|
|
||||||
if (soft_limits->get()) {
|
|
||||||
// NOTE: Block jog state. Jogging is a special case and soft limits are handled independently.
|
|
||||||
if (sys.state != State::Jog) {
|
|
||||||
limits_soft_check(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// If in check gcode mode, prevent motion by blocking planner. Soft limits still work.
|
// If in check gcode mode, prevent motion by blocking planner. Soft limits still work.
|
||||||
if (sys.state == State::CheckMode) {
|
if (sys.state == State::CheckMode) {
|
||||||
sys_pl_data_inflight = NULL;
|
sys_pl_data_inflight = NULL;
|
||||||
@@ -222,6 +215,7 @@ void mc_arc(float* target,
|
|||||||
position[axis_1] = center_axis1 + r_axis1;
|
position[axis_1] = center_axis1 + r_axis1;
|
||||||
position[axis_linear] += linear_per_segment;
|
position[axis_linear] += linear_per_segment;
|
||||||
pl_data->feed_rate = original_feedrate; // This restores the feedrate kinematics may have altered
|
pl_data->feed_rate = original_feedrate; // This restores the feedrate kinematics may have altered
|
||||||
|
limitsCheckSoft(position);
|
||||||
cartesian_to_motors(position, pl_data, previous_position);
|
cartesian_to_motors(position, pl_data, previous_position);
|
||||||
previous_position[axis_0] = position[axis_0];
|
previous_position[axis_0] = position[axis_0];
|
||||||
previous_position[axis_1] = position[axis_1];
|
previous_position[axis_1] = position[axis_1];
|
||||||
@@ -233,6 +227,7 @@ void mc_arc(float* target,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ensure last segment arrives at target location.
|
// Ensure last segment arrives at target location.
|
||||||
|
limitsCheckSoft(target);
|
||||||
cartesian_to_motors(target, pl_data, previous_position);
|
cartesian_to_motors(target, pl_data, previous_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,6 +414,7 @@ GCUpdatePos mc_probe_cycle(float* target, plan_line_data_t* pl_data, uint8_t par
|
|||||||
}
|
}
|
||||||
// Setup and queue probing motion. Auto cycle-start should not start the cycle.
|
// Setup and queue probing motion. Auto cycle-start should not start the cycle.
|
||||||
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Found");
|
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Found");
|
||||||
|
limitsCheckSoft(target);
|
||||||
cartesian_to_motors(target, pl_data, gc_state.position);
|
cartesian_to_motors(target, pl_data, gc_state.position);
|
||||||
// Activate the probing state monitor in the stepper module.
|
// Activate the probing state monitor in the stepper module.
|
||||||
sys_probe_state = Probe::Active;
|
sys_probe_state = Probe::Active;
|
||||||
|
Reference in New Issue
Block a user