Hello Guest it is November 26, 2026, 10:43:11 AM

Author Topic: [RELEASE] SafCNC – open-source Mach3 USB motion plugin for Arduino Uno / Nano  (Read 294 times)

0 Members and 1 Guest are viewing this topic.

[RELEASE] SafCNC – open-source Mach3 USB motion plugin for Arduino Uno / Nano

Hi all,

I'm the developer of SafCNC, an open-source Mach3 motion plugin. I wrote most of the code myself, both the Mach3 plugin and the Arduino firmware. It turns a cheap Arduino Uno or Nano (or an STM32 board) into a USB step/direction motion controller for Mach3, so you can run a small machine without a parallel port. The firmware is published in the official Arduino IDE Library Manager, so it can be installed in a few clicks.

As far as I know it is one of the very few Mach3 motion plugins for plain Arduino boards, and it is written in Pascal (Lazarus / Free Pascal) rather than C++. I have deliberately kept the source code clear and easy to follow, so anyone who wants to learn how a Mach3 motion plugin works can read it, study it and build on it.

What it does
* 3-axis step/direction output, GRBL 1.1 / CNC Shield V3 pinout, so existing shields work as-is
* Step rate: up to 32 kHz on Arduino, up to 100 kHz on STM32
* The card reports its speed limit to the plugin; if the Motor Tuning velocities exceed it, the plugin warns you and does not link the card until they are lowered
* Sequence counter and checksum on every packet, 200 ms link watchdog (motion stops if the PC/USB link is lost)
* Limits, probe and E-Stop are handled on the card itself, independently of the PC

Installation
1. Flash the firmware: in the Arduino IDE open the Library Manager, search for "SafCNC", install it and upload the example sketch (File > Examples > SafCNC).
2. Copy SafCNC.dll into Mach3\PlugIns.
3. Start Mach3 and select SafCNC under Config > Control the Motion Device.
4. Connect the board over USB; the plugin finds it automatically.

Links
* Plugin (English source): https://github.com/fikretpalas/SafCNC_Mach3Plugin_en
* Firmware: https://github.com/fikretpalas/SafCNC_Arduino
* Arduino Library Manager: search for "SafCNC" in the Arduino IDE

Please note
This is a new project. Test it with the motors disconnected or the machine in a safe state first, and always have a working hardware E-Stop.

Feedback, bug reports and test results on different machines are very welcome, either here or on GitHub.

Fikret Palas
Developer of SafCNC
https://github.com/fikretpalas
safcnc@tutamail.com

Offline Tweakie.CNC

*
  • *
  •  9,379 9,379
  • Super Kitty
My congratulations, you have certainly done a lot of time consuming and excellent work on this project.

I no longer use Mach3 so cannot test this but I hope your motion controller it is a great success.

Although Mach3 is now obsolescent and no longer supported by its developers I am sure Mach3 will continue to be used by many well into the future.

Good fortune with your project.

Tweakie.
PEACE
For me, Mach3, Mach4 and MachPro are no longer necessary software.

Some time ago I asked the Mach company for the Mach4 SDK. They asked me some questions and I answered them, but they never gave me the SDK and I have not received any reply since then.

So I decided to write my own software. It is a hybrid of a CAD program and a CNC control program in one. Even MachPro does not have this.

Note: my English is not very good, so please excuse any mistakes.