Commit Graph

59 Commits

Author SHA1 Message Date
Terje Io
8c3d44bfca Added helper code for plugins claiming auxiliary ports to make plugin coding easier and behaviour consistent.
Some minor bug fixes such as incorrect error code returned for unknown $-commands and temporary incorrect position reporting on in-flight G92 offset changes.
2025-10-11 18:28:21 +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
2f9ba98040 Added G65P6 for disabling spindle on/off delay for the next spindle command (M3, M4 and M5).
For programmers: added grbl.on_control_signals_changed event, fired on some signals: optional stop, single step, block delete and cycle start.
Fix for incorrect handling of arcs when negative scaling is enabled with G51.
2025-09-25 08:29:01 +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
070f80cc5c Updated changelog. Renamed OpenPNP custom command M143. 2025-05-19 21:39:16 +02:00
Terje Io
b10b3317d2 Fix for custom M-code commands claiming all axis words even when not using any.
Added setting $680 for configuring delay from stepper enable to first dir/step pulse.
Adds to fixed ~2ms delay provided by most drivers.
2025-05-18 08:03:51 +02:00
Terje Io
bbd3b69939 Added new mid/low level HAL/API to ioports (auxiliary ports).
Added '$709' setting for second PWM spindle when available - PWM options.
Added properties to PWM spindles to allow "overdriving" PWM output when _RPM controls spindle enable signal is enabled with '$9' or '$709'.
Optimized Modbus CRC calculation, may fix issue with a compiler generating different code compared to most others. Ref. issue #723.
2025-04-05 17:20:44 +02:00
Terje Io
3d7cb52d98 Hardened" task handler code, reseved some realtime control characters for macro plugins.
Added missing file to CMakeLists.txt and made private function public for plugin use.
2025-03-20 11:25:25 +01:00
Terje Io
99fdc8f199 Added definition for LinuxCNC M190 gcode, required by plasma plugin. No functional change. 2025-02-22 17:40:04 +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
525a7d322a Fixed issue where aux output commands syncronized with motion was sometimes lost.
Added spindle capability flag for plasma torch and disable of spindle spin up/down delay if set.
2025-02-01 21:50:06 +01:00
Terje Io
fd3438da34 Added API call for overriding jerk settings, symbol for M201.3 gcode. 2025-01-29 15:51:25 +01:00
Terje Io
efe4245a06 "hardened" task deregistration code and changed signature of setting available and ioport_find_free() calls.
Some low-level ioport improvements, added definition for virtual pins/ports.
Deprecated direct access to number of the different ioport ports in hal.port struct, use ioports_unclaimed() instead.
2025-01-14 17:13:56 +01:00
Terje Io
e8a0aeea26 Fix for laser incorrectly enabled in laser mode when M3S<n> commanded in G0 and G80 modal states. Ref. issue #644.
Added optional support for 3rd order acceleration (jerk) and G187 gcode. Ref. pull request #593.
2024-12-31 08:48:33 +01:00
Dietz0r
84657b4f69 Cleaned up the Switchcase coder after the debugging mess (thanks terje!) added the line for initilizing the acceleration_factor, renamed acceleration_profiles variable to acceleration_factor to match the rest of the code 2024-12-27 17:44:54 +01:00
Dietz0r
efcdf3f6da Update gcode.h 2024-12-26 22:09:07 +01:00
Dietz0r
075d5cec57 Merge branch 'master' into master 2024-12-10 21:28:16 +01:00
Terje Io
8fee2930f5 Added (or rather repurposed) field for build date to settings structure in preparation for coming changes.
Added code guards in order to free some memory for STM32F103 variants with 128K flash.
Changed Stop (0x19) real-time command behaviour, active tool offset and coordinate system will now be kept. Ref. issue #610.
2024-11-29 18:17:26 +01:00
Terje Io
43d694917c Added basic core support for toolsetter probe, changes $6 (probe input inversion) and $19
(probe input pullup disable) settings from boolean to bitfield when driver support is available.
Added a few default values for settings in config.h, overridable from the compiler command line.
Added core support for per axis pulloff distance, needs plugin for configuring them.
Added HAL flags for disabling settings for MCU input pins pullup disable, may be set by
drivers/boards that has buffered (optocoupled) inputs that is not possible to change.
2024-11-13 17:32:36 +01:00
Terje Io
9a98243fd3 Changed _vminor named parameter to contain build date in YYMMDD format, previously value was 0.
Added support for LinuxCNC style (ABORT,<msg>) comment, requires expressions enabled. Terminates gcode program, outputs message and returns error 253.
Added PRM[<setting>] and PRM[<setting>,<bit>] functions to expressions, returns $-setting value or value of bit in integer type setting.
"hardened" flow control code, fixed bug in repeat...continue handling.
Changed signature of grbl.on_gcode_comment event, now returns status code.
2024-10-27 07:27:25 +07:00
Terje Io
f0eac9d0aa Improved expression and parameter handling, simplified gcode parser related to this. Fixed typo in OR statement decode.
Added clear of return value on CALL statement and added optional return value expression support to ENDSUB.
Improved handling of multiple simultaneous spindles. Still work in progress.
For developers: moved user M-code entry point hooks from the HAL structure to the core handlers and changed signature of the check() function to better support valueless words (letters) when parameter support is enabled. Removed deprecated parameter from the validate() call signature.
2024-10-14 19:02:30 +07: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
Dietz0r
e17d78293f Merge branch 'grblHAL:master' into master 2024-09-29 21:03:31 +02:00
Terje Io
3ef6763cec Build 20240921
Added generic HAL timer API and function for getting which G65 parameter words were supplied.
2024-09-21 18:25:00 +07:00
Terje Io
c8c77c35e0 Added some new plugin init calls and setting ids.
Added defaults for RGB strip lengths.
2024-09-04 18:27:41 +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
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
Dietz0r
0b69f6fb40 Merge branch 'grblHAL:master' into master 2024-05-23 13:41:43 +02:00
Terje Io
c3aace735b Fixed symbol issue with Arduino Due blocking compilation of NGC parameter support. 2024-04-02 23:55:46 +02:00
Dietz0r
2ec344e750 Merge branch 'grblHAL:master' into master 2024-04-02 16:50:35 +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
Dietz0r
fa6d5089ac Merge branch 'grblHAL:master' into master 2024-02-25 15:05:45 +01:00
Terje Io
f0ef77435e Enhanced RGB and ioports APIs.
Allowed use of unused (by the core) axis words (ABCUVW) in M-code commands implemented by plugin code.
Added $PINSTATE command, for outputting auxillary pin states, modes and capabilities. Machine readable formatting.
2024-01-24 18:38:08 +01:00
Terje Io
cf98ec7778 Added RGB API to the HAL, with crossbar definitions for number of devices (LEDs, NeoPixels).
Refactored some inconsistent parts of the ioports/crossbar interfaces.
2024-01-19 17:43:07 +01:00
Dietz0r
4cc7aaf171 Added compiletime check for added acceleration profile code 2024-01-04 00:30:18 +01:00
Dietz0r
4c28e42078 Implemented preliminary G187 support for up to 5 Profiles 2024-01-02 15:35:18 +01:00
Terje Io
57243a0fc2 Fixed regression that prevented builds with compatibiliy level set > 1.
Added [SIGNALS:xxx] element to the $I output.
2023-12-29 19:33:27 +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
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
1d7872fc5c Added grbl.on_tool_changed event and removed help for disabled $-commands. 2023-08-25 17:14:28 +02:00
Terje Io
f1b1776bdc Some tweaks for new Web Builder options++ 2023-07-18 11:47:09 +02:00
Terje Io
c2450947ae Skip calling tool change code if current and selected tool number is the same.
Added 5s timeout/abort handling when waiting for index pulses prior to startiong spindle synchronized motion.
Added definitions for M401 (deploy probe) and M402 (stow probe) for plugin use.
Added support for probe protected message and alarm. Requires driver support for interrupt handled probe input.
2023-07-04 15:40:47 +02:00
Terje Io
0a8c51ebe9 Added initial support for macro based automatic tool changes (ATC).
Currently macros has to be stored on a SD card or in littlefs and expression support has to be enabled.
2023-06-07 19:16:53 +02:00
Terje Io
ce7c3592b4 Added experimental support for program flow control, mainly available for use in G65 macros stored on SD card or in littlefs. 2023-05-29 00:46:05 +02:00
Terje Io
af2a922915 Added experimental support for G65 and M99, call and return from macro. 2023-05-11 10:58:01 +02:00
Terje Io
6163f2e30a Fix for Arduino compiler issue with build 20230227. Added core event and removed redundant code. 2023-02-27 23:14:07 +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
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