67 Commits

Author SHA1 Message Date
Terje Io
b435b48ec1 Changed real time reporting to allow per connection status for which report elements to output.
Added pragmas to shut up warning from the ESP32 compiler.
2026-02-04 11:28:20 +01:00
Terje Io
64c35930c7 Refactored offset handling, for improved readability and in preparation for rotation support.
Added experimental support for G66 (modal macro call) and G67 (end modal macro call).
Made axis letter to axis/motor assignment for axes ABCUVW freely changeable at compile time.
Fix for some G65 arguments being incorrectly validated for normal use (sign, range).
Added repeat support to G65 macro call via the optional L parameter word.
Changed default setting for ABC-axes to rotary.
Changed defaults for jerk settings to 10x acceleration settings.
Disabled jerk for jog, probe and spindle synchronized motion.
Added _active_probe system parameter, returns -1 if no probe inputs available.
Minor bug fix, G5.1 and G33.1 motion commands were not coverted to the correct string equivalent in $G output.
2026-01-25 07:51:44 +01:00
Terje Io
106f5fd573 Refactored assignment of of auxiliary I/O for "standard" inputs and outputs to make it more robust and easier to follow for developers.
Moved probe signal handling from drivers to the core, improved handling of probe disconnected signal.
NOTE: The changes above are quite large, please verify probe operation after installation.
2025-10-16 17:22:32 +02:00
Terje Io
132159a6b6 Workaround for some compilers configured to treat warnings as errors causing compilation failure.
Added $PORTS command for listing serial ports, later I will update all drivers to provide the optional information.
Potential fix for polar kinematics not handling axes > 3 correctly, needs testing. Ref. issue #820.
2025-10-04 20:17:22 +02:00
Terje Io
e37572fe02 Improved M70-M73 modal state save and restore, should now handle overrides correctly.
Added lightweight JSON serializer outputting directly to file.
Fix for event handler sometimes called too early. Ref. issue #818.
For developers: added optional device filing system that can redirect file read/write to serial streams.
2025-10-02 15:18:28 +02:00
Terje Io
ee1cd5a745 Improved ioport remapping of auxiliary pins (used by plasma plugin).
Changed signature of limit check functions, grbl.travel_limits() et. al.
to include a pointer to the work envelope to use.
Updated spindle off handling to check for "at speed" on deceleration when spindle is "at speed" capable.
2025-08-06 18:32:29 +02:00
Terje Io
f40d5db74a Changed backlash feed rate to be the same as the current motion. Ref. issue #751.
Minor fix for probe availability report in $I output.
2025-05-30 08:53:48 +02:00
Terje Io
6948b0e117 Added initial/enhanced support for toolsetter and second probe input.
Moved inbuilt G65 macros to the core and added macro G65P5Q<n> for selecting probe.
Added probe id to real time report: |P:<n> will be reported on probe select when more than one probe is available.
Fix for WCO and Ov real time status report elements not beeing reported as they should in some circumstances.
2025-05-15 06:23:17 +02:00
Terje Io
390c11bb7e Updated $N0 and $N1 startup commands to allow multi-block (line) gcode commands by using | (vertical bar) as the separator.
No longer configures auxiliary output pins claimed for basic functions in order to avoid affecting any previously set alternate pin function.
2025-04-25 17:13:42 +02:00
Terje Io
b41018543b Moved part of the driver based spindle sync code to the core.
Spindle sync now has to be enabled in grbl/config.h.
2025-04-24 22:38:55 +02:00
Terje Io
55a9f6a197 "Hardened" new optimized code to ensure initial motion is going in the correct direction.
Fix for feedhold during G33 and G76 synchronized motion not beeing delayed until motion completed.
2025-03-29 09:29:31 +01:00
Terje Io
29f10397cb Improved/fixed soft reset handling related to position lost if reset was executed during motion.
Added setting $676 with flags to control soft reset actions. See the changelog for details.
Workaround for Microsoft C adding a non-standard reserved keyword...
2025-02-22 00:18:41 +01:00
Terje Io
472012e137 Changed $65 setting to flags for allowing feed rate overrides during probing and limiting probe motion to be within machine workspace.
Improved handling of stop realtime command (0x19) for faster motion halt without losing position.
Optimized RAM usage. Fixed regression related to losing current coordinate system and tool offset over a stop.
2025-02-20 10:46:04 +01:00
Terje Io
6b4bab82ad Added new handling for spindle spin up and coolant start delays. See the changelog for details. 2025-01-03 23:16:08 +01:00
Terje Io
a41790dada Revised core setting structures, changed from 8-bit to 16-bit CRC checksums for improved detection of corruption/version mismatches.
Added option to homing enable setting ($22) for per axis homing feedrates.

!! Backup and restore settings over an update is recommended since all settings will be reset to default. Any odometer data will also be lost.
2024-12-09 19:24:20 +01:00
Terje Io
5825b36ef6 Fix for M62 - M68 regression. Ref. issue #600.
Fixed incorrect handling of G65 call parameters, axis words had offsets added. Ref. issue #594.
Refactored handling of multiple spindles. There are still some limitations but should work better now. Disabled override delays for now, needs investigation. Ref. issue #598.
NOTE: Please report any erratic behaviour after installing this version since it is a rather major change.
2024-10-06 20:24:34 +07:00
Chris
4e73d9f211 Update motion_control.c
changed to ternary
2024-08-05 20:53:44 +02:00
Chris
277fb75b31 Update motion_control.c
Bugfix mc_arc multi turns clockwise
2024-08-04 18:15:12 +02:00
Terje Io
d2c476deaf Added option bit for enabling realtime reporting while homing to $10, Status report options. Ref. issue #551. 2024-08-01 19:24:00 +02:00
Terje Io
9a060d7ea0 Renamed grbl.on_probe_fixture event to grbl.on_probe_toolsetter and added pointer to toolsetter coordinates as an additional parameter.
Increased backlash parameters precision to 5 decimals. Ref issue #452.
Some bug fixes in NGC parameters and flow control handling.
2024-06-19 20:37:30 +02:00
Terje Io
ec209ecba7 Fixed polar kinematics feed rate handling, some tuning. Ref. issue #475.
Allowed plugins to inject commands when controller is in alarm state.
2024-04-04 16:40:07 +02:00
Terje Io
d9ed1bd89c Added missing null spindle handler for ESP32, issue #473.
Fix for unable to set $484 to 0, issue #466.
Added setting $673 for setting coolant on delay after feedhold. Available when safety door handling is not enabled.
Fixed obscure bug carried over from legacy Grbl related to this. Issue #467.
Enabled setting $394 for spindle on delay after feedhold. Available when safety door handling is not enabled.
2024-03-28 14:55:05 +01:00
Terje Io
e10acc689d Fixes for issue #470 and #472, index overflows. 2024-03-26 20:52:02 +01:00
Terje Io
7cf86877f0 Changed signature of grbl.on_homing complete event to include the cycle flags.
Added definitions for up to four additional digital aux I/O ports.
Added real time report of selected spindle in multi spindle configurations. Reported on changes only.
Removed limits override input invert config, for safety reasons it is always active low.
Added HAL entry points for second RGB channel, renamed first from hal.rgb to hal.rgb0.
Added option to setting $22 to force use of limit switches for homing when homing inputs are available in the driver/board combo.
Improved handling of aux I/O pins when claimed for core functions.
Added flag to $9 for disabling laser mode capability for primary PWM spindle. Allows leaving laser mode enabled when a secondary PWM spindle is available and this is used to control a laser.
Added some generic setting definitions for stepper drivers, currently used by the motors plugin.
2024-03-19 20:32:40 +01:00
Terje Io
6afe6d1a7c Fix for issue #426, decreasing the $30 setting value (max spindle RPM) causes incorrect PWM output.
Implemented handling of single block, block delete and optional stop disable control signal events.
Added help for $S (single block), $B (block delete) and $O (optional stop disable) commands.
Added optional HAL entry point for outputting WRGB values to lights such as neopixels.
Improved $-commands registration to make it easier to add help text.
2024-01-12 13:49:36 +01:00
Terje Io
5bd4835b69 Refactored canned cycles to better match how LinuxCNC actually implements them. Ref. ioSender issue 348.
NOTE: The implementation may still be incorrect - use with care!
2023-12-16 16:11:46 +01:00
Terje Io
2c58f0de09 Spindle handling refactoring for improved management and configuration of multiple spindles.
NOTE: this is a relatively large change and may have introduced bugs and/or unintended side-effects. Please report any issues!

Added setting $519 for binding spindle encoder to given spindle in multi spindle configurations.

Added machine readable spindle enumeration report, $SPINDLESH.

Increased default value for setting $398 (number of planner blocs) from 35 to 100 for faster laser engraving.
NOTE: the $398 setting value will not change on an upgrade!
NOTE: STM32F103 builds for the 128K flash variants does not have enough free RAM and will keep 35 as the default value.

Increased allowed number of decimal places from 3 to 5 for $10x stepper step/mm settings. Ref. ioSender issue 346.

Added setting $650 for filing system options. Ref. issue 397.
Currently the following bits are available (depending on the configuration):
0 - Auto mount SD card on startup (1).
1 - Do not add littlefs files when listing the root directory (2).

Added build option for lathe UVW mode.
When enabled UVW words can be used to command relative moves for XYZ without switching to relative mode with G91.
NOTE: This permanently sets lathe mode and disables the $32 mode setting.

There are signature changes to some spindle, ioports enumeration and VFS filing system mount functions.

Added events to allow plugin code to handle tool table data, possibly stored on a SD card.
2023-12-12 09:51:59 +01:00
Terje Io
742eed9254 Added setting option to $21 Hard limit enable to allow exception for rotary axes. 2023-09-19 20:22:04 +02:00
Terje Io
c3fd2db2e2 Added faster soft limits check for arcs when work envelope is a cuboid, fixed some related obscure bugs.
New/modified core entry points for soft limit checking.
More delta robot tuning, added setting warning in $DELTA output if some settings are inconsistent such as steps/rad, acceleration etc.
Fix for issue #361, HOME status is not reported or reported late when auto reporting is enabled with setting $481.
2023-09-14 08:20:25 +02:00
Terje Io
049f0f13e4 Delta robot kinematics tuning: soft limits checks, extended $DELTA command++. 2023-09-07 18:27:34 +02:00
Terje Io
e0fa78cb87 The method for constraining continuous multi-axis jogs (XYZ) (when enabled by `$40=1\) will now use clipping of the motion vector to the work envelope. 2023-09-05 15:42:46 +02:00
Terje Io
43691fca19 Changed handling of homing inputs from limit switches.
Some drivers will now only disable hard limits (if enabled) for axes that are homing, this includes max/min limit switches.
HAL entry points and core handlers/events has been added and some have changed signatures in order to better support kinematics implementations.
More work on delta kinematics: new and changed settings, some improved functionality. Still in progress.
2023-09-03 14:50:36 +02:00
Terje Io
d361ef1c9d Delta kinematics improvements. Added setting for base > floor distance, $DELTA command for work envelope info. Still WIP.
Changed signature of grbl.on_homing_completed event.
2023-08-20 19:02:24 +02:00
Terje Io
244bbb3454 More fixes for issue #332: setting tool table data cleared current coordinate system offset, incomplete handling of G10 L10 and L11.
Added free memory to $I output when available, example: [FREE MEMORY:102K]
Changed reported position for failed probe to target. Parameters #5061 - #5069 returns position in coordinate system used when probing.
2023-08-08 18:42:59 +02:00
Terje Io
6a89bd2712 Fix for issue #332, incorrect NGC parameter values returned for last probed position. 2023-08-05 14:30:01 +02:00
Terje Io
750f60ce74 Fixed typos and added grbl.on_gcode_comment event. 2023-05-01 12:01:57 +02:00
Terje Io
c652eee852 Now allows some $-commands while critical events are active or in sleep mode.
Added work envelope data to global sys struct, used by soft limits and jog limit handling.
2023-04-29 15:53:46 +02:00
Terje Io
d4f5b3b664 Fix for issue #279 - pin name typo.
Added HAL capability flags for limit switches supported.
Improved motor pins preprocessor code.
2023-04-01 22:10:14 +02:00
Terje Io
f793b4a8c8 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. 2023-03-21 20:16:32 +01:00
Terje Io
c7a6f049e4 Minor fix for the grbl.on_state_changed event - incorrect state published following stop signal when streaming gcode.
Added core event for real-time report elements beeing forced++
2023-03-06 20:39:12 +01:00
Terje Io
5b546aef58 Fix for Grbl [issue #1823](https://github.com/grbl/grbl/issues/1823) - some full circle arcs beeing ignored. 2023-02-19 08:20:33 +01:00
Terje Io
04ce2c5c8c Large spindle handling refactoring and enhancement++, see the changelog for more. 2023-02-13 22:14:48 +01:00
Terje Io
fb60b493b5 Added settings, updated settings version to 22. See changelog for details.
Merged defaults.h with config.h, deleted defaults.h and harmonized settings defines.
2023-01-25 21:11:21 +01:00
Terje Io
1402e7b368 Added single axis homing commands for U and V, remapping of ABC homing commands to UVW when configured. 2022-11-06 09:51:16 +01:00
Erik Morbach
4a39c852bf bug on single axis home
When Using single axis home, after homing the status remains 'Home'. Inverting the logic resolves.
2022-11-03 11:50:48 -03:00
Terje Io
b0d9e9e78a Fix for issue #209, incorrect handling of homing of more than one auto squared axis in each pass.
Error 55 will now be returned.
2022-10-23 07:27:20 +02:00
Terje Io
180f9fa9fc Added $RTC system command for outputting or setting current real time clock date and time. Uses ISO8601 format.
Driver developers: check the changelog!
2022-09-07 21:08:11 +02:00
luz paz
90fd6ca410 Fix various typos
Found via`codespell -q 3 -L iterm,nd`
2022-08-07 18:56:52 -04:00
Terje Io
4b36ffbfbf Added core event "on_homing_completed", some sanity checks on MPG stream registration. 2022-07-31 11:14:15 +02:00
Terje Io
b4c896e2ad Added support for G5.1 (quadratic spline) and multi turn arc option for G2 and G3 via P-word.
Some additions to data structures used by plugins.
2022-07-19 21:51:46 +02:00