Commit Graph

63 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
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
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
24d802e573 Fix for bug preventing disabling of AMASS, changed the ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING symbol so it can be overridden via compiler argument.
For developers: added output function parameter to signature of report_realtime_status() call to allow routing output to a given stream (or streams).
2025-09-04 08:36:48 +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
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
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
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
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
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
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
5a05201041 Fix for coolant issue when resetting from feed hold state. 2025-01-02 13:31:41 +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
ee8eb2c1eb Fixed some odd bugs in NGC flow control, prepared for file based named O-call subroutines.
Fixed incorrect comment string passed to passed to grbl.on_gcode_comment event.
Added generic redirector for temporarily changing input stream to read from a file. Supports nesting.
2024-10-23 20:18:34 +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
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
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
5afac36157 Added capability flags to HAL for all coolant outputs.
Hide related settings when no spindle and/or coolant outputs are available. From PR #479.
Fixed typo related to Modbus direction signal. Ref. issue #478.
Fixed typo in handling of aux output port settings. Ref issue #476.
2024-03-30 21:08:48 +01: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
a912ce47c7 This build has moved the probe input to the ioPorts pool of inputs and will be allocated from it when configured.
The change is major and potentially dangerous, it may damage your probe, so please verify correct operation after installing.

Fix for STM32F4xx issue 161, Ethernet connection unresponsive if USB port not powered.

Enhanced ioPorts interface: New debounce option for input pins that are interrupt capable, currently only possible to enable via plugin code - later to be made available via a $-setting.
Added some wrapper functions for simpler plugin code++

Added simple task scheduler to the core, allows interrupt routines to dispatch jobs to the foreground process, delayed tasks and repeating tasks attached to the 1 ms system timer.
Some drivers and plugins now uses the scheduler for input pin debouncing, regular polling etc. The core uses it for stepper disabling and sleep monitoring.
2024-02-23 22:54:00 +01:00
Terje Io
e5d088eda7 Added core support for new MPG mode that claims one serial stream and uses the 0x8B real-time command character for switching mode.
Moved RGB API definitions to separate file and added some utilities for drivers and plugins. Fixed minor bug.
stream_open_instance(), signature change - added optional description string.
2024-02-05 23:39:27 +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
49b43a5fe1 Some minor fixes and changes. 2023-12-22 13:35:27 +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
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
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
44e4dc4ea3 Extended handling of legacy printable real-time commands due to ESP32 RTOS issue.
Internal changes to crossbar definitions, improved stream handling and sleep handling.
2023-05-19 19:17:32 +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
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
20aa4ec941 Added event definition for SD card file open, fix for issue #118. 2023-03-13 10:05:44 +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
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
fbef120e94 Fix for old regression, issue #204.
Now hides spindle PWM related settings if no PWM spindle is available.
2022-10-22 21:15:56 +02: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
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
45b0e10589 Delayed calling hal.driver_reset until alarm and abort state has been established. 2022-06-16 08:45:10 +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
4ff8f1c5e7 Added a MPG mode option for using input pin for mode switching when enabled together with keypad plugin.
Added pin descriptions for UART pins used for MPG.
2022-02-17 09:01:02 +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
22e0fcba1c Added optional spindle select event to core events, for dual spindle enabled configurations (VFD + PWM spindle).
Attempted fix for weird issue with VFD spindle when spindle at speed tolerance is set > 0 with $340.
2022-01-09 22:11:57 +01:00
Terje Io
0aeb53883b Moved and enhanced handling of pendant serial stream (MPG) to core. Added some new stream handling functions.
Added real time command character 0x8B for toggling MPG stream on/off.
Fix for issue #104
2022-01-05 20:13:41 +01:00
Terje Io
acf66542ee Added flags for WebUI reconnect handling and core support for enabling debug stream. 2021-12-04 12:12:28 +01:00