Commit Graph

64 Commits

Author SHA1 Message Date
terjeio
e350ea501e Fix for copy paste error introduced in build 20251130 causing alarms to be ignored.
Increased $680, stepper enable delay limit to 500ms.
2025-12-02 07:35:07 +07:00
terjeio
13145a4a46 Updated to allow Bluetooth serial streams to be used for MPG/pendants.
Parking mode improvements.
Removed requirement for external encoder for spindle sync if stepper spindle is enabled.
Improved handling of $680 stepper enable delay.
2025-12-01 17:55:53 +07: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
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
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
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
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
fc7ec7e219 Completed core support for additional probes (toolsetter, probe 2).
Switched to universal use of aux I/O for many signals, includes reset/ESTop, feed hold and cycle start.
2025-05-29 13:02:10 +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
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
e1ea957ca4 Added wrappers/veneers for hal.port functions, plugin code should be changed to use
these instead of calling via hal.port functions or accessing hal.port properties.
Improved the ioports API, updated core code to make use of it.
Flagged some calls and (part of) some stuctures as deprecated.
2025-04-13 20:54:09 +02:00
Terje Io
b737687743 Reduced default step pulse length to 5 microseconds.
Added HAL parameter for minimum step pulse length set by driver, used for validation of $0 setting.
Changed HAL API signature for outputting step pulses, optimized to allow drivers to only change direction outputs when there is an actual direction change.
Improved handling of overrides at end of program when all motion is buffered. Possible fix for issue #714.
Some optimizations to allow higher step rates.
2025-03-28 18:02:56 +01:00
Terje Io
9ed8d488f8 Added vfs_chmod() to VFS (Virtual File System), for setting basic file attributes.
Changed signature of vfs.on_mount() event.
Added grbl.on_cycle_start() event, fired on cycle start signal asserted or on cycle start real time command received.
2025-02-25 20:55:59 +01:00
Terje Io
c7c7d5a4cf Added $SDS command for outputting Stepper Driver Status. 2025-01-20 13:11:00 +01:00
Terje Io
6cbbc63e2b Delayed execution of startup scripts $N0 and $N1 till after any startup tasks has completed. 2025-01-10 13:33:26 +01:00
Terje Io
8dc30ad89c Improved handling of real-time clock (RTC). 2024-12-23 10:37:14 +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
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
7e40bf2402 A bit of refactoring related to spindles as a first step for a coming settings structure revision, "hardened" some code. 2024-11-20 19:03:27 +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
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
0a86e57ddc Fixed incorrect implementation of EXISTS function. Ref. issue #527.
Added missing clear of parser tool change state when cycle start signal is asserted.
Affects tool change mode 'Normal' ($341=0).
2024-06-04 12:57:17 +07: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
c6aeef14cf Added config to enable NGC parameter reporting, default on. 2024-04-27 23:33:33 +02:00
Terje Io
3a7a65ea7c Now reports WCO along with radius/diameter mode changes. Ref. issue #500. 2024-04-25 20:49:03 +02: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
b200199612 Internal changes that may affect developers, see the changelog for details. 2024-01-26 11:14:39 +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
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
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
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
1d7872fc5c Added grbl.on_tool_changed event and removed help for disabled $-commands. 2023-08-25 17:14:28 +02:00
Terje Io
e6c044908c Added setting $484, Unlock required after E-stop cleared by reset, default on. From issue #337.
Fixed typo, added event grbl.on_parser_init.
2023-08-15 11:48:18 +02:00
Terje Io
e2df2fb101 Fix for issue #340, CoreXY kinematics does not update position for axes A+.
Adds auto reporting state to realtime report sent on MPG mode change to off.
2023-08-10 12:01:28 +02:00
Terje Io
280dd953c3 Fix for ioSender issue 319, improved handling of sycle start input signal had side-effects. 2023-07-29 07:20:36 +02:00
Terje Io
8f5fa900be Improved handling of critical events for adding |$C=1 to full realtime report. 2023-07-11 08:10:13 +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
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
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
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
4ac1b036e3 duplicated $ESG entry 2022-09-16 16:36:04 -03: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
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
dae7d56ab5 Changed spindle handling to allow dynamic spindle registration and support for multiple spindles selectable at run-time.
See the changelog for more info.
2022-03-25 23:01:56 +01:00
Terje Io
27a3d3e1fe See the changelog for details. 2022-01-23 11:10:30 +01:00