Skip to content

Commit af29d13

Browse files
committed
Fix for spindle sync PID $-settings not showing up when spindle sync option is enabled.
Made $392 for configuring spindle spin up delay available when spindle driver supports spindle at speed functionality.
1 parent dcdc3ef commit af29d13

File tree

4 files changed

+40
-12
lines changed

4 files changed

+40
-12
lines changed

changelog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
## grblHAL changelog
22

3+
Build 20211226:
4+
5+
Core:
6+
7+
* Fix for spindle sync PID $-settings not showing up when spindle sync option is enabled.
8+
* Made `$392` \(spindle spin up delay\) available when spindle driver supports spindle at speed functionality.
9+
10+
Drivers:
11+
12+
* iMRX1062, STM32F4xx, STM32F7xx and MSP432: Fix for changes to spindle sync PID $-settings requiring a hard reset to take effect.
13+
14+
---
15+
316
Build 20211223:
417

518
Core:

crossbar.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ typedef enum {
5959
Input_QEI_Select,
6060
Input_QEI_Index,
6161
Input_SpindleIndex,
62+
Input_SpindlePulse,
6263
Input_Aux0,
6364
Input_Aux1,
6465
Input_Aux2,
@@ -184,6 +185,7 @@ PROGMEM static const pin_name_t pin_names[] = {
184185
{ .function = Input_QEI_Select, .name = "QEI select" },
185186
{ .function = Input_QEI_Index, .name = "QEI index" },
186187
{ .function = Input_SpindleIndex, .name = "Spindle index" },
188+
{ .function = Input_SpindlePulse, .name = "Spindle pulse" },
187189
{ .function = Input_MotorWarning, .name = "Motor warning" },
188190
{ .function = Input_MotorFault, .name = "Motor fault" },
189191
{ .function = Input_Aux0, .name = "Aux input 0" },

grbl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#else
3535
#define GRBL_VERSION "1.1f"
3636
#endif
37-
#define GRBL_BUILD 20211223
37+
#define GRBL_BUILD 20211226
3838

3939
// The following symbols are set here if not already set by the compiler or in config.h
4040
// Do NOT change here!

settings.c

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ static status_code_t set_g92_disable_persistence (setting_id_t id, uint_fast16_t
370370
static float get_float (setting_id_t setting);
371371
static uint32_t get_int (setting_id_t id);
372372
static bool is_setting_available (const setting_detail_t *setting);
373+
static bool is_group_available (const setting_detail_t *setting);
373374

374375
static char control_signals[] = "Reset,Feed hold,Cycle start,Safety door,Block delete,Optional stop,EStop,Probe connected,Motor fault";
375376
static char spindle_signals[] = "Spindle enable,Spindle direction,PWM";
@@ -469,15 +470,15 @@ PROGMEM static const setting_detail_t setting_detail[] = {
469470
{ Setting_LinearSpindlePiece3, Group_Spindle, "Spindle linearisation, third point", NULL, Format_String, "x30", NULL, "30", Setting_IsExtendedFn, set_linear_piece, get_linear_piece, NULL },
470471
{ Setting_LinearSpindlePiece4, Group_Spindle, "Spindle linearisation, fourth point", NULL, Format_String, "x30", NULL, "30", Setting_IsExtendedFn, set_linear_piece, get_linear_piece, NULL },
471472
#endif
472-
{ Setting_SpindlePGain, Group_Spindle_ClosedLoop, "Spindle P-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.p_gain, NULL, is_setting_available },
473-
{ Setting_SpindleIGain, Group_Spindle_ClosedLoop, "Spindle I-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.i_gain, NULL, is_setting_available },
474-
{ Setting_SpindleDGain, Group_Spindle_ClosedLoop, "Spindle D-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.d_gain, NULL, is_setting_available },
475-
{ Setting_SpindleMaxError, Group_Spindle_ClosedLoop, "Spindle PID max error", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.max_error, NULL, is_setting_available },
476-
{ Setting_SpindleIMaxError, Group_Spindle_ClosedLoop, "Spindle PID max I error", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.i_max_error, NULL, is_setting_available },
477-
{ Setting_PositionPGain, Group_Spindle_Sync, "Spindle sync P-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.position.pid.p_gain, NULL, is_setting_available },
478-
{ Setting_PositionIGain, Group_Spindle_Sync, "Spindle sync I-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.position.pid.i_gain, NULL, is_setting_available },
479-
{ Setting_PositionDGain, Group_Spindle_Sync, "Spindle sync D-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.position.pid.d_gain, NULL, is_setting_available },
480-
{ Setting_PositionIMaxError, Group_Spindle_Sync, "Spindle sync PID max I error", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.position.pid.i_max_error, NULL, is_setting_available },
473+
{ Setting_SpindlePGain, Group_Spindle_ClosedLoop, "Spindle P-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.p_gain, NULL, is_group_available },
474+
{ Setting_SpindleIGain, Group_Spindle_ClosedLoop, "Spindle I-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.i_gain, NULL, is_group_available },
475+
{ Setting_SpindleDGain, Group_Spindle_ClosedLoop, "Spindle D-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.d_gain, NULL, is_group_available },
476+
{ Setting_SpindleMaxError, Group_Spindle_ClosedLoop, "Spindle PID max error", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.max_error, NULL, is_group_available },
477+
{ Setting_SpindleIMaxError, Group_Spindle_ClosedLoop, "Spindle PID max I error", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.spindle.pid.i_max_error, NULL, is_group_available },
478+
{ Setting_PositionPGain, Group_Spindle_Sync, "Spindle sync P-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.position.pid.p_gain, NULL, is_group_available },
479+
{ Setting_PositionIGain, Group_Spindle_Sync, "Spindle sync I-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.position.pid.i_gain, NULL, is_group_available },
480+
{ Setting_PositionDGain, Group_Spindle_Sync, "Spindle sync D-gain", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.position.pid.d_gain, NULL, is_group_available },
481+
{ Setting_PositionIMaxError, Group_Spindle_Sync, "Spindle sync PID max I error", NULL, Format_Decimal, "###0.000", NULL, NULL, Setting_IsExtended, &settings.position.pid.i_max_error, NULL, is_group_available },
481482
{ Setting_AxisStepsPerMM, Group_Axis0, "?-axis travel resolution", "step/mm", Format_Decimal, "#####0.000", NULL, NULL, Setting_IsLegacyFn, set_axis_setting, get_float, NULL },
482483
{ Setting_AxisMaxRate, Group_Axis0, "?-axis maximum rate", "mm/min", Format_Decimal, "#####0.000", NULL, NULL, Setting_IsLegacyFn, set_axis_setting, get_float, NULL },
483484
{ Setting_AxisAcceleration, Group_Axis0, "?-axis acceleration", "mm/sec^2", Format_Decimal, "#####0.000", NULL, NULL, Setting_IsLegacyFn, set_axis_setting, get_float, NULL },
@@ -508,6 +509,8 @@ PROGMEM static const setting_detail_t setting_detail[] = {
508509
#ifdef ENABLE_SAFETY_DOOR_INPUT_PIN
509510
{ Setting_DoorSpindleOnDelay, Group_SafetyDoor, "Spindle on delay", "s", Format_Decimal, "#0.0", "0.5", "20", Setting_IsExtended, &settings.safety_door.spindle_on_delay, NULL, NULL },
510511
{ Setting_DoorCoolantOnDelay, Group_SafetyDoor, "Coolant on delay", "s", Format_Decimal, "#0.0", "0.5", "20", Setting_IsExtended, &settings.safety_door.coolant_on_delay, NULL, NULL },
512+
#else
513+
{ Setting_DoorSpindleOnDelay, Group_Spindle, "Spindle on delay", "s", Format_Decimal, "#0.0", "0.5", "20", Setting_IsExtended, &settings.safety_door.spindle_on_delay, NULL, is_setting_available },
511514
#endif
512515
};
513516

@@ -625,7 +628,9 @@ PROGMEM static const setting_descr_t setting_descr[] = {
625628
{ Setting_AxisBacklash, "Backlash distance to compensate for." },
626629
#endif
627630
{ Setting_AxisAutoSquareOffset, "Offset between sides to compensate for homing switches inaccuracies." },
628-
{ Setting_SpindleAtSpeedTolerance, "Spindle at speed" },
631+
{ Setting_SpindleAtSpeedTolerance, "Spindle at speed tolerance as percentage deviation from programmed speed, set to 0 to disable.\\n"
632+
"If not within tolerance when checked after spindle on delay ($392) alarm 14 is raised."
633+
},
629634
{ Setting_ToolChangeMode, "Normal: allows jogging for manual touch off. Set new position manually.\\n\\n"
630635
"Manual touch off: retracts tool axis to home position for tool change, use jogging or $TPW for touch off.\\n\\n"
631636
"Manual touch off @ G59.3: retracts tool axis to home position then to G59.3 position for tool change, use jogging or $TPW for touch off.\\n\\n"
@@ -645,6 +650,8 @@ PROGMEM static const setting_descr_t setting_descr[] = {
645650
#ifdef ENABLE_SAFETY_DOOR_INPUT_PIN
646651
{ Setting_DoorSpindleOnDelay, "Delay to allow spindle to spin up after safety door is opened." },
647652
{ Setting_DoorCoolantOnDelay, "Delay to allow coolant to restart after safety door is opened." },
653+
#else
654+
{ Setting_DoorSpindleOnDelay, "Delay to allow spindle to spin up when spindle at speed tolerance is > 0." },
648655
#endif
649656
};
650657

@@ -1380,7 +1387,7 @@ char *setting_get_value (const setting_detail_t *setting, uint_fast16_t offset)
13801387

13811388
static bool is_setting_available (const setting_detail_t *setting)
13821389
{
1383-
bool available = false; // settings_is_group_available(setting->group);
1390+
bool available = false;
13841391

13851392
if(setting) switch(normalize_id(setting->id)) {
13861393

@@ -1406,6 +1413,7 @@ static bool is_setting_available (const setting_detail_t *setting)
14061413
break;
14071414

14081415
case Setting_SpindleAtSpeedTolerance:
1416+
case Setting_DoorSpindleOnDelay:
14091417
available = hal.driver_cap.spindle_at_speed;
14101418
break;
14111419

@@ -1632,6 +1640,11 @@ inline static bool is_available (const setting_detail_t *setting)
16321640
return setting->is_available == NULL || setting->is_available(setting);
16331641
}
16341642

1643+
static bool is_group_available (const setting_detail_t *setting)
1644+
{
1645+
return settings_is_group_available(setting->group);
1646+
}
1647+
16351648
bool settings_is_group_available (setting_group_t group)
16361649
{
16371650
bool available = false;

0 commit comments

Comments
 (0)