Prepping a CNC for kids
I was updating a nice home built CNC machine in the process of being lent out to a local school.
The machine was running LinuxCNC from a desktop PC via. a parallel port cable.
As part of the lending process I needed to write a user manual for primary school kids and their teachers.
LinuxCNC great for engineers un-great for kids
I found that while being very technically capable LinuxCNC is quite … let’s say elaborate end engineering focused. I found it difficult to describe how to use it for people with no prior experience.
I was also quite unhappy about the boat-anchor of a PC needed to control it.
GRBL is a great CNC controller firmware for Arduino. I figured that if I could replace the PC and parallel port with a Arduino board I could just run one of the many GRBL GUI tools that let you control the machine then I could pick a more user friendly user interface.
CNC brain surgery
The actual motor controller for the machine was a single board 3-axis stepper controller
Adding a Arduino running GRBL was simple
I wanted to retain compatibility with the legacy LinuxCNC system so I just made a plug-in replacement.
User interfaces
With the machine updated and GRBL calibrated I set out to find the perfect user interface that was easy to understand and good for kids. I was sure there was plenty of great project out there ready to go.
I was wrong.
Most of the GRBL streamers I could find were quirky and really hard to use.
The error messaging and state of the machine were almost always unclear and often the different streamers would just stop working.
There were massive confusion about what version of GRBL was supported and many projects were either OS specific or based on Java.
What I wanted
What I wanted was a system that was OS agnostic, required little or no installation and would be friendly to users with little experience.
Students and teachers are rarely in charge of their own computers and are typically not allowed to install stuff themselves.
G-code streaming
The software for controlling a typical homebuilt CNC really just needs to do a few basic things.
You need to be able to move the machine around, set the zero point where coordinates are in respect to your workpiece and then start sending a list of pre generated commands for moving the tool around (G-code).
It is nice to have various visualization of what state the machine is in and what it is doing but at the end of the day the three tings above is the bare minimum.
With GRBL all this is controlled over a USB-Serial connection. This means that with the proliferation of WebSerialAPI a browser application can now talk directly to a GRBL controller.
A UI for a CNC machine can be completely hosted online and require no installation on a users computer.
The layout and capabilities of the UI can be changed easily as new needs are discovered.
What I made
The first version of the UI still has a pretty traditional layout. The underlaying machine control and state handling is now a solved problem so the user interface can be changed just by changing the single .html file containing the whole system.
I added the option to CNC basic shapes like holes, drilling and squares directly in the UI without G-code. I also added the option to makes arrays of these shapes
Caveats
A lot of home built machines does not include end stop or homing switches. Many users are simply ok with the machine position being relative to a arbitrary starting position. It is much easier to build and the machine and works just fine for most simple applications.
Many cheap ready built machines from the shops of the internet comes with a barely calibrated GRBL controller and no reference switches.
I have however made the decision that the machine should be properly referenced. The machines becomes much more useful and the UI can be much more intuitive. If a tool breaks or power is lost you can continue your work and you can repeat operations easily.
I have also made the decision that the GRBL controller must be properly set up with automatic homing enabled and the machine boundaries properly set up.
I recommend everyone to do this, it is really worth the effort.
Often it is not that big of a deal to put a couple of switches on the axes.
Try it here
Try the UI if you have a properly calibrated GRBL based machine with automatic homing and the machine dimensions set correctly (It does work without but not the same experience).
That got me going
I have a lot of CNC machines in the lab.
This one I use for PCB prototypes. I built the cabinet decades ago and one day it simply collapsed.
It was originally running MACH3 on a windows7 machine which did not seem very sustainable.
When upgrading this machine I opted for FluidNC which is a GRBL compatible firmware for ESP32 that has built in webserver for the UI.
I adapted my g-code streamer UI to be hosted on the FluidNC controller so that literally all you have to do to use the machine was to connect to it with a browser.
I wanted to build a more interesting enclosure
This on was all ready to go just needed to remove the computer and add GRBL:
Future work
I want to keep developing the UI so that it is super easy to use, even without much experience.
I want to allow the user to make many simple operations directly in the UI without having to first produce g-code in another tool.
Having the whole system in HTML+JS really opens up for a configurable and flexible way to interact with a CNC machine.
You could have multiple interfaces for the same machine depending on the task and do away with confusing and distracting functions that does not make sense for the process.
Having interactive help directly where needed is also something I want to develop further.










