Fix for issue #271 - unwanted motion after soft reset when feed hold was active, reported for canned cycle but may occur for other commands as well.

This commit is contained in:
Terje Io
2023-03-21 20:16:32 +01:00
parent d3b97d7cac
commit f793b4a8c8
9 changed files with 58 additions and 22 deletions

View File

@@ -1,11 +1,30 @@
## grblHAL changelog
<a name="20230321"/>Build 20230321
Core:
* Fix for issue #271 - unwanted motion after soft reset when feed hold was active, reported for canned cycle but may occur for other commands as well.
* Added function for properly initializing planner struct, updated core to use it.
Plugins:
* Embroidery: switched to new function for initializing planner struct.
Templates:
* HPGL: switched to new function for initializing planner struct.
---
<a name="20230320"/>Build 20230320
Core:
* Another fix for issue #269 - setting of piecewise spindle linearisation values not working.
Fix for incorrect reporting of SD card size.
* Fix for incorrect reporting of SD card size.
Drivers:

2
grbl.h
View File

@@ -42,7 +42,7 @@
#else
#define GRBL_VERSION "1.1f"
#endif
#define GRBL_BUILD 20230320
#define GRBL_BUILD 20230321
#define GRBL_URL "https://github.com/grblHAL"

View File

@@ -141,11 +141,12 @@ static bool limits_pull_off (axes_signals_t axis, float distance)
{
uint_fast8_t n_axis = 0, idx = N_AXIS;
coord_data_t target = {0};
plan_line_data_t plan_data = {
.condition.system_motion = On,
.condition.no_feed_override = On,
.line_number = DEFAULT_HOMING_CYCLE_LINE_NUMBER
};
plan_line_data_t plan_data;
plan_data_init(&plan_data);
plan_data.condition.system_motion = On;
plan_data.condition.no_feed_override = On;
plan_data.line_number = DEFAULT_HOMING_CYCLE_LINE_NUMBER;
system_convert_array_steps_to_mpos(target.values, sys.position);
@@ -249,11 +250,12 @@ static bool limits_homing_cycle (axes_signals_t cycle, axes_signals_t auto_squar
limit_signals_t limits_state;
squaring_mode_t squaring_mode = SquaringMode_Both;
coord_data_t target;
plan_line_data_t plan_data = {
.condition.system_motion = On,
.condition.no_feed_override = On,
.line_number = DEFAULT_HOMING_CYCLE_LINE_NUMBER
};
plan_line_data_t plan_data;
plan_data_init(&plan_data);
plan_data.condition.system_motion = On;
plan_data.condition.no_feed_override = On;
plan_data.line_number = DEFAULT_HOMING_CYCLE_LINE_NUMBER;
// Initialize plan data struct for homing motion.
memcpy(&plan_data.spindle, &gc_state.spindle, sizeof(spindle_t));

View File

@@ -139,8 +139,7 @@ bool mc_line (float *target, plan_line_data_t *pl_data)
plan_line_data_t pl_backlash;
memset(&pl_backlash, 0, sizeof(plan_line_data_t));
plan_data_init(&pl_backlash, 0);
pl_backlash.condition.rapid_motion = On;
pl_backlash.condition.backlash_motion = On;
pl_backlash.line_number = pl_data->line_number;

View File

@@ -678,3 +678,9 @@ void plan_feed_override (override_t feed_override, override_t rapid_override)
}
}
}
void plan_data_init (plan_line_data_t *plan_data)
{
memset(plan_data, 0, sizeof(plan_line_data_t));
plan_data->spindle.hal = gc_state.spindle.hal ? gc_state.spindle.hal : spindle_get(0);
}

View File

@@ -143,4 +143,6 @@ bool plan_check_full_buffer (void);
void plan_feed_override (override_t feed_override, override_t rapid_override);
void plan_data_init (plan_line_data_t *plan_data);
#endif

View File

@@ -267,8 +267,10 @@ bool protocol_main_loop (void)
if(state_get() == STATE_CHECK_MODE)
hal.delay_ms(CHECK_MODE_DELAY, NULL);
#endif
grbl.report.status_message(gc_state.last_error);
if(ABORTED)
break;
else
grbl.report.status_message(gc_state.last_error);
// Reset tracking data for next line.
keep_rt_commands = false;

View File

@@ -126,7 +126,7 @@ static bool initiate_hold (uint_fast16_t new_state)
spindle_num_t spindle_num = N_SYS_SPINDLE;
if (settings.parking.flags.enabled) {
memset(&park.plan_data, 0, sizeof(plan_line_data_t));
plan_data_init(&park.plan_data);
park.plan_data.condition.system_motion = On;
park.plan_data.condition.no_feed_override = On;
park.plan_data.line_number = PARKING_MOTION_LINE_NUMBER;

View File

@@ -114,8 +114,9 @@ static void reset (void)
// Restore coolant and spindle status, return controlled point to original position.
static bool restore (void)
{
plan_line_data_t plan_data = {0};
plan_line_data_t plan_data;
plan_data_init(&plan_data);
plan_data.condition.rapid_motion = On;
target.values[plane.axis_linear] = tool_change_position;
@@ -132,7 +133,7 @@ static bool restore (void)
sync_position();
coolant_sync(gc_state.modal.coolant);
spindle_restore(spindle_get(0), gc_state.modal.spindle.state, gc_state.spindle.rpm);
spindle_restore(plan_data.spindle.hal, gc_state.modal.spindle.state, gc_state.spindle.rpm);
if(!settings.flags.no_restore_position_after_M6) {
previous.values[plane.axis_linear] += gc_get_offset(plane.axis_linear);
@@ -179,7 +180,7 @@ static void execute_probe (sys_state_t state)
#if COMPATIBILITY_LEVEL <= 1
bool ok;
coord_data_t offset;
plan_line_data_t plan_data = {0};
plan_line_data_t plan_data;
gc_parser_flags_t flags = {0};
if(probe_fixture)
@@ -188,6 +189,7 @@ static void execute_probe (sys_state_t state)
// G59.3 contains offsets to position of TLS.
settings_read_coord_data(CoordinateSystem_G59_3, &offset.values);
plan_data_init(&plan_data);
plan_data.condition.rapid_motion = On;
target.values[plane.axis_0] = offset.values[plane.axis_0];
@@ -353,7 +355,9 @@ static status_code_t tool_change (parser_state_t *parser_state)
previous.values[plane.axis_linear] -= gc_get_offset(plane.axis_linear);
plan_line_data_t plan_data = {0};
plan_line_data_t plan_data;
plan_data_init(&plan_data);
plan_data.condition.rapid_motion = On;
// TODO: add?
@@ -462,7 +466,7 @@ status_code_t tc_probe_workpiece (void)
bool ok;
gc_parser_flags_t flags = {0};
plan_line_data_t plan_data = {0};
plan_line_data_t plan_data;
#if COMPATIBILITY_LEVEL <= 1
if(probe_fixture)
@@ -473,6 +477,8 @@ status_code_t tc_probe_workpiece (void)
system_convert_array_steps_to_mpos(target.values, sys.position);
flags.probe_is_no_error = On;
plan_data_init(&plan_data);
plan_data.feed_rate = settings.tool_change.seek_rate;
target.values[plane.axis_linear] -= settings.tool_change.probing_distance;