38 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
terjeio
779d41b8d8 Fix for regression causing loss of tool offset on soft reset when $676 option is to keep offsets. 2026-01-07 08:49:16 +07:00
Greg Cormier
c5d888fdee Fix Z home movement when XY already at TLS position
When X and Y coordinates are already at the tool length sensor (TLS)
position during tool change restore, Z was incorrectly not moving to
the home position after probing.

The issue was in the restore() function where Z movement was only
executed inside a conditional block that checked if XY needed to move.
This caused Z to remain at the probed position when starting from the
TLS XY location.

Fixed by decoupling Z home movement from XY position comparison,
ensuring Z always returns to home after probing (unless $346
disables full position restore).
2025-12-20 11:39:46 -05:00
Terje Io
adba5d031c Refactored M70-M73 modal state handling, should now be fully compatible with LinuxCNC behaviour.
Added ADC/DAC resolution to $pinstate command, changed reported values to integer for ADC/DAC devices and float formatted for PWM devices.
Numeric settings can now be set via G65P1Q<n>S<value>, <n> is the setting number, <value> is the new value.
Changed alarm code for Modbus exceptions (communication errors) from 14 to 19.
Refactored MPG stream code to allow plugins to hook into MPG streams (via event handler).
Added _free memory system parameter, returns value in KBytes or -1 if not available from driver.
Changed basic stream data type from char to uint8_t, added HAL function and core API for releasing/closing UART streams.
2025-11-08 07:52:01 +01:00
Terje Io
e35af1abc1 Added setting flag to $675 (Macro ATC options) for enabling error on M6 if tc.macro is not found in the filing system.
Changed $I NEWOPT "ATC" element to ATC=1 when ATC is online and ATC=0 when offline.
For macro based ATC code this is set to ATC=0 if tc.macro is not found and the new $675 flag is set.
2025-06-26 07:25:58 +02:00
Terje Io
5614f505fb Refactored tool table API/HAL, now supports tool > tool rack/carousel pocket mapping.
Named system parameters _current_pocket and _selected_pocket updated to return the correct values.
Moved handling of keeping last tool number over reboot from template plugin to the core.
Added named system parameters _homed_state and _homed_axes.
Fix for failure to claim auxiliary ports in some configurations.
2025-06-19 07:09:49 +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
837398221b Fixed regression introduced with PR#673.
Added G30 as optional position for tool change.
Moved new tool change mode from PR#673 to $346 - Tool change options.
Moved Modbus RTU code from spindle plugin to the core.
Fixed bug in delayed task handler, might occasionally hang the controller.
2025-04-19 14:08:46 +02:00
Terje Io
4f883b92d5 Merge pull request #673 from Expatria-Technologies/PR_FAST_SEMIAUTO
Proposed PR for faster semi-automatic toolchanges.
2025-02-25 09:40:21 +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
andrew_marles
ade39fb608 Proposed PR for faster semi-automatic toolchanges. 2025-02-06 09:44:11 -08:00
Terje Io
0462c97dc9 Changed core tool change routine to play nice with plugins subscribing to probe event. 2025-01-26 07:13:37 +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
c7c5b63447 Added suppression of door open signal when in manual or semi-automatic tool change mode. 2024-12-14 15:08:07 +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
Terje Io
8b9b7859ee Limited tool change probe moves to be within machine limits. Ref. issue #542.
Added setting $358 to enable experimental functionality for fast rotary 'rewind' to stored G28 position.
Return move should complete in half a rotation or less.
For developers: added option to redirect debug via driver provided function when DEBUGOUT is set to -1 in config.h. Ref. issue #545.
2024-07-19 09:49:46 +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
299eab7f27 Added experimental support for M70-M73, save and restore of modal state.
Added experimental support of LinuxCNC style subroutines.
Available for gcode run from local filesystem such as on a SD card or in littlefs.
Improved handling of G92 when G92 offset is changed while motion is ongoing. Ref. issue #241.
Fix for issue #521, crash when running G65 macro on ESP32.
"Hardened" stream switching code, likely fix for discussion #456.
2024-05-26 17:12:08 +07: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
b200199612 Internal changes that may affect developers, see the changelog for details. 2024-01-26 11:14:39 +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
1d7872fc5c Added grbl.on_tool_changed event and removed help for disabled $-commands. 2023-08-25 17:14:28 +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
28711ee512 Enhanced API, reduced planner RAM footprint. Changed rotary fix implementation. 2023-02-27 07:19:39 +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
e2ba6db69c Fixed regression in tool change handling related to refactoring of config.h in build 20230125. 2023-01-29 04:30:42 +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
893f0de66a Fix for issue #191, allow homing of rotary axes with infinite rotation (max travel = 0)
Added spindle type property to HAL, "hardened" code.
Added new setting $346 for action to take after tool change: either return controlled point (tool tip) back to the same position as before the M6 command (default) or move spindle to Z home.
2022-10-21 11:50:00 +02:00
Terje Io
b55cca15f9 Changed kinematics API and implementations (corexy and wallplotter) to allow backlash compensation. Ref [ESP32 issue 25](https://github.com/grblHAL/ESP32/issues/25).
Fixed feed rate handling for corexy kinematics. Ref issue #147.
Fixed tool table/tool change bugs. Ref. [ioSender issue 228](https://github.com/terjeio/ioSender/issues/228).
2022-06-12 20:07:20 +02:00
Terje Io
d80c095936 Fixed tool change and spindle stop on reset/stop commands regressions. 2022-01-31 17:38:03 +01:00
Terje Io
27a3d3e1fe See the changelog for details. 2022-01-23 11:10:30 +01:00
Terje Io
fb61a7f4ae Added new core event triggered during looping when executing a millisecond delay.
Added `ISR_FUNC` macro for placing time critical functions in RAM.
2022-01-11 19:13:18 +01:00
Terje Io
465cdd32a3 Improved grbl.on_probe_fixture event signature, some minor fixes 2021-10-15 09:54:33 +02:00
Terje Io
79882cf094 Added enum and associated get function for system defined named parameters.
Added core event handler function pointers and calls if provided.
Some other minor changes.
2021-10-11 13:16:58 +02:00
Terje Io
2068165e62 Moved HAL entry point for realtime commands enqueueing to stream struct,
added some crossbar pin definitions and limited $TPW retract to Z home.
Moved some common driver code to the core and update of current position on steps/mm changes.
2021-07-26 15:35:55 +02:00
Terje Io
cdca5ad55c test check in 2021-02-22 12:29:17 +01:00