SkillAgentSearch skills...

UCNC

µCNC - Universal CNC firmware for microcontrollers

Install / Use

/learn @Paciente8159/UCNC

README

<p align="center"> <img src="https://github.com/Paciente8159/uCNC/blob/master/docs/logo.png?raw=true"> </p>

µCNC

µCNC - Universal CNC firmware for microcontrollers

Building µCNC

To configure µCNC to fit your hardware you can use µCNC config builder web tool to generate the config override files. Although most of the options are configurable via the web tool, some options might be missing and you might need to add them manually (regarding tools or addon modules mostly).

Useful Links

Some useful links with detailed information about µCNC Jump to section

VERSION 1.16+ NOTES

Version 1.16 introduces the following changes:

  • several AVR core improvements, now with better ISR pseudo priority preemption
  • general ARM ISR priority revisions
  • Grbl message pattern improvements to allow better compatibility with senders
  • improvements to the encoder module

IMPORTANT NOTE

The default behavior for µCNC will be as described:

  • All control inputs (Emergency stop, Safety door, Hold, Cycle start-resume), limit switches and probe input are held high by the MCU internal weak pull ups and will be active if left unconnected. If Emergency Stop is active the board will remain in Alarm mode and will not allow you to do much (besides querying the current board status via ?). There are a few ways you can reconfigure µCNC to enable normal operation here
    • On first time flashing the board, or if the settings structure is modified, the board will be (and remain) in Alarm mode until a full settings reset is performed ($RST=*). This forces the user to acknowledge that the settings were modified and that the current parameters are known. This is a safety feature that prevents users to start using the machine with the default values of the settings accidentally (for example if using the SD card as a settings storage source and some sort of reading error occurs). You can revert this behavior to the Grbl default by enabling DISABLE_SAFE_SETTINGS option.

Also beware that the main branch contain the latest changes, including bug fixes and some intermediate changes. Some of theses changes are very extent and can come with issues and although new PR are tested, they might have unexpected errors or behavior. If you find and issue please report. Also prefer the latest release version over the master branch.

About µCNC

Heavily inspired by Grbl and LinuxCNC, µCNC started to take shape in the second half of 2019, in an attempt to come out with a G-Code interpreter/controller software/firmware that is both compact and powerful as Grbl and flexible and modular as LinuxCNC, with the following goals in mind:

  1. µCNC is written in C (GNU99 compliant). This gives the advantage of being supported for a large number of CPU/MCU and compilers available.
  2. Modular library based:
    • Independent hardware. All MCU/hardware operations are written in a single translation unit that acts like a standardized HAL interface, leaving the CNC controlling code independent of the MCU architecture has long has it has the necessary abilities to execute code and respond to interrupts in a predictable away. Porting µCNC for a different MCU should be fairly straight forward.
    • Independent kinematics. Another dimension of the HAL is the possibility of defining how the translation between machine coordinates and the motions is translated back and forth. This should theoretically allow µCNC to be easily adaptable to several types of machines like cartesian, coreXY, deltas and others. µCNC supports up to 6 axis.
    • As of version 1.2.0 the addition of a HAL config that allow the user to build link inputs and outputs of the controller to specific functions or modules (like using a generic input has an encoder input or a PWM output has a servo controller with a PID module)
    • As of version 1.3.0 a new dimension to the HAL was added. The tool HAL. This allow to add multiple tools that can perform different task with µCNC.
    • As of version 1.4.0 a special kind of PIN type dedicated to servo motors control was added µCNC.
    • As of version 1.4.0 a new module extension system was introduced. It's now possible to add hooks in the core code and attach multiple listeners to execute additional code further expanding µCNC original capabilities. Modules can be enabled and disabled in the config file to enable feature on per need basis.
  3. Compatible with already existing tools and software for Grbl. There is no point in trying to reinvent the wheel (the whole wheel at least :-P). For that reason µCNC uses protocol compatible with Grbl. This allows it to easily integrate with Grbl ecosystem.

You can navigate the project wiki to find out more on how to use it.

You can expand µCNC using via modules. The available modules are at the µCNC-modules repository.

A new µCNC configuration webapp tool is now available (still in test mode) and will support version 1.12+ and allows you to generate/store your project configuration. For previous versions, the old configuration webapp tool will continue to remain avaliable.

You can also reach me at µCNC discord channel

µCNC discord channel

Supporting the project

µCNC is a completely free software. It took me a considerable amount of hours and effort to develop and debug so any help is appreciated. Building docs, testing and debugging, whatever. Also if you really like it and want help me keep the project running, you can help me to buy more equipment. Recently I have saved some extra money and bought a laser engraver. This hardware was fundamental to develop and testing version 1.2.0 and beyond. Currently this machine is being used to work on other projects and is running µCNC smoothly. Or you may just want to simply buy me a coffee or two for those extra long nights putting out code ;-)

paypal

Current µCNC status

µCNC current major version is v1.16. You can check all the new features, changes and bug fixes in the CHANGELOG.

Version 1.16 improved AVR, ARM for more stability and performance. Encoder module was also improved and enhanced. This allowed huge improvements to G33 parser module. A special thanks to @HuubBuis for all the help and testing.

Version 1.15 added the following new major features.

  • added new embroidery tool mode and new embroidery tool based on a stepper motor to control the needle. This tool mode is able to run the needle motor and the axis with different speed profiles to target specific motion needs of this type of tool.
  • added new encoder module enhancements with support for I2C and SSI encoders
  • new hooks/callbacks to allow the creation and usage of custom ATC (automatic tool change) modules. A new ATC module will also be made available.
  • added new planner event to allow last minute modifications to motions blocks being sent to the step generator.

Version 1.14 added the following new major features.

  • new atomic primitives (similar to C11) including atomic CAS and basic semaphores.
  • ring buffer non-blocking methods.
  • new Grbl compatibility level (level 3) that is even less restrctive. This should improve Grbl GUI initial connection to the controller since this does not block as much. The Emergency Stop input behavior is also modified (change state only) and does not lock out if active.
  • new embroidary tool type support.
  • improved support for encoders (still in development)

Version 1.13 added the following new major features.

  • added initial suport for ESP32-S3 and ESP-C3 variants. This is support is not yet complete, as some features are missing (like BLE support). Other features like I2S support for custom IO shifters are still under test.

Version 1.12 added the following new major features.

  • added suport for STM32H7 single core MCU family. This is support is not yet complete, as some features are missing (like analog inputs, DMA support for SPI and EEPROM emulation)
    • complete code refactoring for ESP8266 core allowing to amke use of the new shift register to expand IO capabilities on this MCU (output and input) via SPI
    • new shift register that now also supports 74HC165 (along with the 74HC595 previously integrated)
    • slight refactoring of IO HAL to support the new shift register
    • re-introduction of boards friendly names for configuration in Arduino IDE and makefiles

Version 1.11 added the following new major features.

  • self implemented subset/custom of stdio printf helpers. It's now possible to print formated messages via protocol. No need to do specific calls t

Related Skills

View on GitHub
GitHub Stars426
CategoryDevelopment
Updated12h ago
Forks87

Languages

C

Security Score

100/100

Audited on Mar 19, 2026

No findings