Commit Graph

53 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
e272f773b5 Refactored the tool table HAL API a bit to improve functionality.
Added tool name, pocket number and some lathe specific data fields to the $# tool output when available from the tool table.
If name is available it will be output as a push message on M6 if there is no message in the same block.
Added support for directory up, .., to VFS.
Added new option to $650 - File systems options to enable hierarchical listing of files and directories via $F and $F+ commands.
2025-11-11 16:51:08 +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
b5b236ca3f Updated some pointer casts to get warning free compilation for 64-bit targets.
A few tweaks to get rid of warnings for some driver/board/configuration combinations.
2025-10-20 08:10:58 +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
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
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
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
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
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
Terje Io
b80cd2f3f8 Changed error code reported when file not found for G65 macro or named O-sub calls from 39 to 84.
Removed IDLE state requirement for executing G65 macros, an error will no longer be returned and the macro will be run.
Added event handler for outputting welcome message on "native" USB connect for drivers that provides the linestate changed event.
2025-01-05 08:18:52 +01:00
Terje Io
81fe93adb8 Removed deprecated stream flags, added stream event for line state (RTS, DTR) changes - initially for USB streams. 2024-11-07 20:44:16 +01:00
Terje Io
d2c476deaf Added option bit for enabling realtime reporting while homing to $10, Status report options. Ref. issue #551. 2024-08-01 19:24:00 +02: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
5cff12e660 Added printf style debug output function and corresponding macro.
Added grbl.on_report_ngc_parameters event.
Fixed silly mistakes in CAN code.
2024-07-09 19:34:31 +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
Terje Io
4f14f1acf6 Fix for stream regression, improved MPG stream handling. Ref. issue #509.
Added NGC parameter 5599, debug output enabled status.
2024-05-09 22:40:54 +02: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
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
04a5edcf83 Extended secondary stepper driver code and improved debug stream handling. 2023-10-05 07:11:10 +02: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
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
9e2d7b46b2 Fixed regression related to CSS (Constant Surface Speed for lathes) mode.
Improved stream handling for native USB streams.
2023-06-06 12:45:14 +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
750f60ce74 Fixed typos and added grbl.on_gcode_comment event. 2023-05-01 12:01:57 +02:00
Terje Io
b6e43d6c19 Fix for issue #236, dual axis offsets.
Changes to allow use of M4 for laser capable spindles in laser mode even if direction control is not available.
2023-04-11 20:47:45 +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
28711ee512 Enhanced API, reduced planner RAM footprint. Changed rotary fix implementation. 2023-02-27 07:19:39 +01: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
99bf98e409 Added setting definitions for WebUI client inactivity timeout and real time report auto interval. 2022-09-16 15:11:05 +02:00
Terje Io
4b36ffbfbf Added core event "on_homing_completed", some sanity checks on MPG stream registration. 2022-07-31 11:14:15 +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
d80c095936 Fixed tool change and spindle stop on reset/stop commands regressions. 2022-01-31 17:38:03 +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
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
dcdc3ef1ed Added function for connecting via specified serial port.
Changed internals to allow further VFD spindle drivers to be added.
2021-12-23 13:21:41 +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
acf66542ee Added flags for WebUI reconnect handling and core support for enabling debug stream. 2021-12-04 12:12:28 +01:00
Terje Io
f88b154b96 See changelog for details. 2021-11-28 16:52:00 +01:00
Terje Io
0c47a688b5 Enhanced ioports API, fix for issue #87 ++ 2021-11-17 07:22:35 +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
415886e53b Improved HAL/core stream handling etc. 2021-09-09 19:19:09 +02:00
Terje Io
384fda6e3a Added $376 setting for designating ABC-axes individually as rotational.
Added `$ESG` and `$ESH` system commands for outputting current setting definitions.
Added setting descriptions to most settings. Work in progress.
Added/updated preprocessor code for leaner board map files++
2021-08-20 18:53:20 +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