Fix for stepper spindle in polling mode causing alarm 14 when used for spindle synced motion (G33, G76).

This commit is contained in:
Terje Io
2025-09-27 06:37:21 +02:00
parent 17a4648a1d
commit d96d3c488e
4 changed files with 25 additions and 17 deletions

View File

@@ -1,10 +1,20 @@
## grblHAL changelog
<a name="20250927">Build 20250927
Core:
* Fix for stepper spindle in polling mode causing alarm 14 when used for spindle synced motion \(G33, G76\).
Ref. iMXRT1062 discussion [#100](https://github.com/grblHAL/iMXRT1062/discussions/100).
---
<a name="20250926">Build 20250926
Core:
* Updated motion in units per revolution mode (G95) to handle spindle RPM changes. Changed initial wait for two index pulses to check RPM > 0 before starting such motion.
* Updated motion in units per revolution mode (G95) to handle spindle RPM changes.
Changed initial wait for two index pulses to check RPM > 0 before starting such motion.
---
@@ -35,6 +45,8 @@ Plugins:
* Misc, eventout: added _Motion_ event \(trigged by RUN, JOG and HOMING states\) and toggle events for optional stop, single step and block delete signals.
Ref. discussion [#813](https://github.com/grblHAL/core/discussions/813).
---
<a name="20250910">Build 20250910
Core:

2
grbl.h
View File

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

View File

@@ -171,7 +171,7 @@ static float tool_offset (ngc_param_id_t id)
{
uint_fast8_t axis = id % 10;
return _convert_pos(axis <= N_AXIS ? gc_state.tool_length_offset[axis] : 0.0f, axis);
return axis <= N_AXIS ? gc_state.tool_length_offset[axis] : 0.0f;
}
static float g28_home (ngc_param_id_t id)
@@ -183,7 +183,7 @@ static float g28_home (ngc_param_id_t id)
if(axis <= N_AXIS && settings_read_coord_data(CoordinateSystem_G28, &data.xyz))
value = data.xyz[axis - 1];
return _convert_pos(value, axis);
return value;
}
static float g30_home (ngc_param_id_t id)
@@ -195,13 +195,13 @@ static float g30_home (ngc_param_id_t id)
#if COMPATIBILITY_LEVEL > 1
if(id <= CoordinateSystem_G59) {
#endif
if(axis <= N_AXIS && settings_read_coord_data(CoordinateSystem_G30, &data.xyz))
if (axis <= N_AXIS && settings_read_coord_data(CoordinateSystem_G30, &data.xyz))
value = data.xyz[axis - 1];
#if COMPATIBILITY_LEVEL > 1
}
#endif
return _convert_pos(value, axis);
return value;
}
static float coord_system (ngc_param_id_t id)
@@ -220,7 +220,7 @@ static float coord_system_offset (ngc_param_id_t id)
if (axis > 0 && axis <= N_AXIS && settings_read_coord_data((coord_system_id_t)id, &data.xyz))
value = data.xyz[axis - 1];
return _convert_pos(value, axis);
return value;
}
static float g92_offset_applied (ngc_param_id_t id)
@@ -232,7 +232,7 @@ static float g92_offset (ngc_param_id_t id)
{
uint_fast8_t axis = id % 10;
return _convert_pos(axis <= N_AXIS ? gc_state.g92_coord_offset[axis - 1] : 0.0f, axis);
return axis <= N_AXIS ? gc_state.g92_coord_offset [axis - 1] : 0.0f;
}
static float work_position (ngc_param_id_t id)
@@ -677,7 +677,7 @@ static char *ngc_name_tolower (char *s)
static char name[NGC_MAX_PARAM_LENGTH + 1];
uint_fast8_t len = 0;
char c, *s1 = s, *s2 = name;
char c, *s1 = s, *s2 = name;
while((c = *s1++) && len <= NGC_MAX_PARAM_LENGTH) {
if(c > ' ') {
@@ -687,7 +687,7 @@ static char *ngc_name_tolower (char *s)
}
*s2 = '\0';
return name;
return name;
}
bool ngc_named_param_get (char *name, float *value)
@@ -999,7 +999,7 @@ uint_fast8_t ngc_call_level (void)
uint8_t ngc_float_decimals (void)
{
return settings.flags.report_inches ? N_DECIMAL_COORDVALUE_INCH : N_DECIMAL_COORDVALUE_MM;
return settings.flags.report_inches ? N_DECIMAL_COORDVALUE_INCH : N_DECIMAL_COORDVALUE_MM;
}
static status_code_t macro_get_setting (void)

View File

@@ -272,6 +272,8 @@ void state_set (sys_state_t new_state)
while(index != block->spindle.hal->get_data(SpindleData_Counters)->index_count) {
grbl.on_execute_realtime(sys_state);
if(hal.get_elapsed_ticks() - ms > 5000) {
system_raise_alarm(Alarm_Spindle);
return;
@@ -283,12 +285,6 @@ void state_set (sys_state_t new_state)
}
// TODO: allow real time reporting?
}
if(block->spindle.hal->get_data(SpindleData_RPM)->rpm == 0.0f) {
system_raise_alarm(Alarm_Spindle);
return;
}
} else if(block->spindle.hal->get_data(SpindleData_RPM)->rpm == 0.0f) {
system_raise_alarm(Alarm_Spindle);
return;