Commit Graph

184 Commits

Author SHA1 Message Date
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
18d6272060 Fix for regression causing MPG mode switch malfunction. Ref. issue #846. 2025-11-08 20:27:11 +01: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
ed2a392dd7 Added _probe2_state system parameter, returns -1 if probe 2 is not available, 1 if triggered and 0 if not.
Fix for hang when G65 sub call level is > 2.
Fix for crash when selecting a tool (with the T command) outside the tool table range.
2025-10-18 20:28:02 +02: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
b829928674 Fix for crash when multiple G95 mode motions are commanded. 2025-09-28 07:53:18 +02:00
Terje Io
17a4648a1d Updated motion in units per revolution mode (G95) to handle spindle RPM changes.
Changed initial wait for two index pulses to check RPM > 0 before starting such motion.
2025-09-26 09:57:05 +02:00
Terje Io
e3803a252a Fixed typo in parameter access for G59 coordinate. Ref. issue #814. 2025-09-25 20:40:49 +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
a61e5e1089 Added setting options for clearing rapids and feed overrids on soft reset to $676, defaults to on. Ref. issue #803.
Added realtime report of distance-to-go. Ref. PR #802.
2025-09-10 21:34:20 +02:00
Terje Io
0d4337b75e Fix for laser enable not restored after feedhold. Ref. issue #798.
Fix for incorrect direction of motion via second stepper driver used for step injection (plasma THC) and stepper spindle.
2025-08-29 12:43:48 +02:00
Terje Io
f081b9f37e Added function for clearing LED strips. 2025-08-25 22:17:58 +02:00
Terje Io
43fa98d93b Fix for grbl.on_tool_changed event raised too early when tool change code is in tc.macro. 2025-08-08 20:46:34 +02:00
Terje Io
5aff8fe767 Fix for optional control signals not respecting $14 inversion setting. Ref. issue #780.
Added core on_spindle_at_speed event. This must be verified with actual VFD spindles, I only have a simulator available.
Improved handling of "iterated" settings, can now be fully implemented by plugins.
2025-07-24 08:25:25 +02:00
Terje Io
d380335d97 Added early (on startup) configuration of secondary PWM spindles. 2025-07-18 15:12:19 +02:00
Terje Io
5dae16ad83 "hardened" code related to ioports claiming and PWM2 spindle configuration.
Added API call and expanded one.
2025-07-16 10:58:31 +02:00
Terje Io
7467c07567 Force settings write on serial stream format change. 2025-07-07 07:31:30 +02:00
Terje Io
74eb456533 Added ioports API call for remapping port numbers.
Added HAL support for setting serial stream format.
Added setting $681 for configuring Modbus RTU stream parity, available when the underlying driver supports format setting.
2025-07-05 14:17:11 +02:00
Terje Io
df55d7cb91 Fix for incorrect reporting of spindle capabilities when more than one spindle configured.
Ref. issue #770.
2025-07-02 07:55:03 +02: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
081f24f663 Added option flag to $22 (Homing cycle) to run startup scripts only on homing completed.
Added API call modbus_isbusy() for checking if Modbus transaction is ongoing.
2025-06-25 08:52:15 +02:00
Terje Io
e03e594ca5 Fix for typecast issue causing compile failure with some compilers. Ref issue #761. 2025-06-21 07:05:50 +02:00
Terje Io
596576763e Fix for hardfault due to recent control pins handling change - affects at least RP2040/RP2350 MCUs.
No longer outputs settings/settings data for $14 (inversion) and $17 (pullup disable) if no control inputs are configured.
2025-06-11 22:37:53 +02:00
Terje Io
d43e6a9a72 No longer retries Modbus commands if there is a pending reset.
Added $MODBUSSTATS and $MODBUSSTATS=R commands, outputs communication statistics such as number of sent commands, retries etc.
$MODBUSSTATS=R clears the statistics after outputting it.
Ref. issue #753.
2025-06-05 10:24:10 +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
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
77b65c6fdd Fixed long standing "bug" where settings $370 and $372 for auxiliary ports where
applied before the underlying GPIO pins were initialized by the driver.
Improved handling of same settings for external (I2C, ModBus, ...) ports.
2025-04-15 14:57:18 +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
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
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
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
8e2847a6c6 Some ioports HAL wrapper functions refactored. Fixes persisting issue with coprocessor control pins mentioned here.
Changed some parts to no longer reference deprecated code.
Added some display driver symbols (for plugin use).
2025-03-11 19:18:08 +01:00
Terje Io
c547f540f7 Fixed ioports enumeration issue affecting remapped ports used by the ESP-AT plugin and stream passthru mode.
Changed stream passtrhu mode to not enter coprocessor MCU bootloader mode when turned on.
2025-03-05 10:44:29 +01:00
Terje Io
2d54e34339 Refactored I2C interface definitions, added capabilities flags for run time discovery. 2025-02-28 23:38:55 +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
99fdc8f199 Added definition for LinuxCNC M190 gcode, required by plasma plugin. No functional change. 2025-02-22 17:40:04 +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
46d2b0d367 Fixed issue with restoring spindle status for spindles making use optional spindle status flags. Ref. PR #673. 2025-02-16 17:54:45 +01:00
Terje Io
1cec3d2711 Added availability check for axis settings so plugins can hide unused/meaningless settings. 2025-02-08 07:17:15 +01:00
Terje Io
10673744e3 Updated changelog. 2025-02-05 20:57:17 +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
d25d2eaa42 Fixed some typos causing compilation failure in some configurations.
No longer copies spindle on delay from door setting ($392) to the new general setting ($340) on update from pre 20250103 builds.
Fixed missed code change when general spindle on delay was implemented causing the delay to be inserted on a simple RPM change with the S word.
2025-01-31 19:15:53 +01:00
Terje Io
dfa1b262a4 Added setting definition for macro ATC options.
Now hides core toolchange settings when macro based ATC is active to avoid confusion.
"hardened" parser tool change code a bit.
2025-01-28 09:22:00 +01:00
Terje Io
4dc17753bb Fixed $help topic search failing if target contains spaces. Ref. issue #664.
Improved default serial port mapping when both MPG mode and keypad plugin are enabled to ensure the port is shared.
Delayed status report output on MPG mode change a few milliseconds to avoid awakening the ESP32 guru that sometimes reboots the controller.
2025-01-24 21:01:56 +01:00