56 Commits

Author SHA1 Message Date
Terje Io
69cdfb76c8 Added field for programmed timer period to HAL timer struct. 2025-11-05 07:54:32 +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
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
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
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
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
790cff7036 Increased max number of digital ioports to 24, added some crossbar capabilities (external, async, entry point for setting pin function). 2025-04-07 19:36:50 +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
c7c7d5a4cf Added $SDS command for outputting Stepper Driver Status. 2025-01-20 13:11:00 +01:00
Terje Io
ff0903fd87 Added HAL support for stepper driver status signals (warning and fault) and
new HAL entry point for querying/resetting driver status.
Added driver capability flags and settings, $742 - $745, for enabling and inverting motor warning and fault input signals (per axis).
Improved jerk acceleration. Ref. PR #660.
2025-01-18 21:18:30 +01:00
Terje Io
8dc30ad89c Improved handling of real-time clock (RTC). 2024-12-23 10:37:14 +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
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
323dd84b79 Added (PRINT, <msg>) support and parameter formatting for DEBUG and PRINT commands.
Added named parameters for getting absolute (G53) position: _abs_x, abs_y, ...
Available when expression support is enabled.

Changed stepper enable HAL signature to allow current reduction when idle.
Added reference id to spindle registration in order to allow configuring default spindle, and possibly additional spindles, at compile time.
2024-09-29 12:38:49 +07: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
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
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
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
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
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
70ffca3c0a Hardened" serial stream registration, now allows empty descriptor.
Now returns no data for alarm and error enums when firmware is compiled for 128K versions of the STM32F1xx MCU.
This frees up some flash space for plugins etc.
2023-09-26 09:54:10 +02: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
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
d4f5b3b664 Fix for issue #279 - pin name typo.
Added HAL capability flags for limit switches supported.
Improved motor pins preprocessor code.
2023-04-01 22:10:14 +02:00
Terje Io
cad1dc8476 Fix for issue #269 - setting of piecewise spindle linearisation values not working. 2023-03-17 06:56:06 +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
4e7f313271 Some internal changes to allow homing feed rate overrides from plugins, reserved setting numbers for per axis homing feedrate settings (not used by the core). 2023-01-28 10:45:14 +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
6e22a074c8 Added optional string pointers to HAL for driver and board URLs. If present they are announced by the SSDP protocol. 2022-10-07 10:17:07 +02:00
Terje Io
e38c1ddaf1 Added optional HAL entry point for getting free memory (ideally sum of free blocks on the heap), used by WebUI.
"hardened" settings API function.
2022-09-15 08:44:53 +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
e009f47116 Added optional RTC (Real Time Clock) support to the HAL. VFS improvements. 2022-09-04 20:56:33 +02:00
luz paz
90fd6ca410 Fix various typos
Found via`codespell -q 3 -L iterm,nd`
2022-08-07 18:56:52 -04:00
Terje Io
1e7670846e Added MCU frequency variable to the HAL struct - to be set by the various drivers later on. 2022-08-01 09:08: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
d86015b154 Added generic stream switcher functions for driver use, to avoid duplicated code.
Some minor fixes.
2021-12-13 12:42:19 +01:00
Terje Io
a5dfb953f8 Updated settings and HAL version numbers++, see changelog for details.. 2021-11-21 16:40:37 +01:00
Terje Io
0c47a688b5 Enhanced ioports API, fix for issue #87 ++ 2021-11-17 07:22:35 +01:00
Terje Io
f306bfa598 Renamed default hostnames and device names, added some HAL extensions and hardened code a bit. 2021-11-09 15:24:52 +01:00
Terje Io
82d42f4fa4 Fixed variable name typo, renamed hal.stream.disable to hal.stream.disable_rx 2021-11-01 08:40:55 +01:00
Terje Io
6f5d1cd31c Added entries for motor driver chip select lines to crossbar.h, enums for aux I/O pin types.
No funtional changes.
2021-08-10 13:28:54 +02:00
Terje Io
6c0bd647a5 Added optional HAL entry point for stepper motor enumeration, improved optional driver support files. 2021-08-08 12:47:41 +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
222ba55724 See changelog for details. 2021-07-07 19:19:15 +02:00