53 Commits

Author SHA1 Message Date
Terje Io
64c35930c7 Refactored offset handling, for improved readability and in preparation for rotation support.
Added experimental support for G66 (modal macro call) and G67 (end modal macro call).
Made axis letter to axis/motor assignment for axes ABCUVW freely changeable at compile time.
Fix for some G65 arguments being incorrectly validated for normal use (sign, range).
Added repeat support to G65 macro call via the optional L parameter word.
Changed default setting for ABC-axes to rotary.
Changed defaults for jerk settings to 10x acceleration settings.
Disabled jerk for jog, probe and spindle synchronized motion.
Added _active_probe system parameter, returns -1 if no probe inputs available.
Minor bug fix, G5.1 and G33.1 motion commands were not coverted to the correct string equivalent in $G output.
2026-01-25 07:51:44 +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
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
5d48dd5c43 For developers: added function for getting standardized UART pin descriptions. 2025-10-06 07:44:51 +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
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
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
95011b570b Added new ioport capabilities.
Added registration scheme for 3rd party I/O expander plugins.
Fixed minor bug in ioport numbering (P<n>/E<n>) for plugin based ioports.
2025-04-09 11:49:10 +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
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
efe4245a06 "hardened" task deregistration code and changed signature of setting available and ioport_find_free() calls.
Some low-level ioport improvements, added definition for virtual pins/ports.
Deprecated direct access to number of the different ioport ports in hal.port struct, use ioports_unclaimed() instead.
2025-01-14 17:13:56 +01:00
Terje Io
e8a0aeea26 Fix for laser incorrectly enabled in laser mode when M3S<n> commanded in G0 and G80 modal states. Ref. issue #644.
Added optional support for 3rd order acceleration (jerk) and G187 gcode. Ref. pull request #593.
2024-12-31 08:48:33 +01:00
Terje Io
50a7507f6f Added preprocessor support for moving coolant outputs to auxiliary pool. Some minor bug fixes and code cleanup.
Those who have custom board maps must update pin assignments accordingly when updating to this or later versions.
2024-12-17 16:10:20 +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
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
1444c08997 Added generic passthru support for programming external MCU via USB > UART bridge.
Requires driver support if to be used. Adds $PTRGH system command when available.
2024-11-10 11:39:21 +01: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
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
06f442643a Tentative fix for lathe CSS/feed per rev modes (G96/G95), ref discussion #450.
Fixed incorrect reporting of feed rate modes in $G response.
Added some ioPorts call wrappers, full support for reconfiguring output auxillary pins for PWM output.
2024-02-28 17:36:17 +01:00
Terje Io
8fa4535444 Fixed typo preventing lathe mode UVW builds.
Added initial support for using auxillary output pin pool for spindle and coolant pins.
2024-02-26 21:11:48 +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
4a7090d70a Fixed regression mainly affecting WebUI enabled builds. Some internal changes. 2024-01-27 20:17:42 +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
57243a0fc2 Fixed regression that prevented builds with compatibiliy level set > 1.
Added [SIGNALS:xxx] element to the $I output.
2023-12-29 19:33:27 +01:00
Terje Io
5bd4835b69 Refactored canned cycles to better match how LinuxCNC actually implements them. Ref. ioSender issue 348.
NOTE: The implementation may still be incorrect - use with care!
2023-12-16 16:11:46 +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
5249bc66fa Expanded ioports API with some configuration and PWM related functions. 2023-05-25 08:57:10 +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
2779c833fd Added compile time symbols and names for remaining control inputs, rephrased two alarm messages.
No functional changes.
2023-02-17 07:43:39 +01:00
Terje Io
04c9a50a13 Merge pull request #197 from dresco/canbus
Add support for CAN bus plugin
2022-09-29 15:16:23 +02:00
Terje Io
34699b725c Added crossbar support for UART RTS handshake output signal. 2022-09-29 14:58:06 +02:00
Jon Escombe
4a25254bd7 Add support for CAN bus plugin 2022-09-26 10:21:10 +01:00
Terje Io
ea51f156a3 Added new configuration options. See the changelog for details. 2022-09-19 15:20:41 +02: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
af29d13c2b Fix for spindle sync PID $-settings not showing up when spindle sync option is enabled.
Made $392 for configuring spindle spin up delay available when spindle driver supports spindle at speed functionality.
2021-12-27 07:54:39 +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
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
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
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
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
Terje Io
b685e18411 Added shared files for driver motor pins allocation and options handling.
Expanded HAL stream I/O functions. Added doxygen documentation to parts of the code.
A number of minor changes to simplify code.
2021-06-27 20:55:00 +02:00
Terje Io
7dbd285a0f Workaround for #26 2021-06-09 08:21:22 +02:00
Terje Io
3a84b58d30 Added some HAL entry points and properties for pin handling, $pins system command (not all drivers) and some minor bug fixes. 2021-06-06 22:27:47 +02:00