Consumer CNC machines and open source firmwares have come a long way in a short amount of time but still lack some features that I wanted after obtaining my first CNC. Although MPG handwheels are common on machines running Mach or LinuxCNC, they were mostly missing from USB based CNC machines. They are also typically driven by laptop machines instead of single purpose industrial devices. I began this project in order to use a MPG with Grbl but it quickly grew into a full fledged CNC control panel.
The hardware consists of a 10" resistive touchscreen, hardware led cycle start, feed hold, and cycle stop buttons, custom macro buttons, spindle on and spindle off, analog jog joystick, jog control knobs, feed override and spindle override knobs, an emergency stop, and of course a MPG handwheel. The hardware inputs all feed into an ATmega328P microcontroller. The digital inputs are passed through 3 daisy chained 8-bit shift registers. The ATmega328P sends the state of all the buttons, touchscreen, knobs, etc to the Raspberry Pi at regular intervals over the Pi's hardware serial pins. The entire board sits on top if the Pi as a Hat.
After selecting components, the PCB design was laid out in KiCAD and a couple of weeks later the PCBs arrived with an aluminum SMT stencil. The stencil made it was easy to solder all the surface mount components in a toaster oven based reflow oven.
The enclosure was cut from a single 12"x24" 1/4" ABS sheet on the CNC. The CAM work for it was performed using the FreeCAD Path workbench. Having both CAD and CAM in the same application allowed for design parameter changes to also automatically update the tool paths. The Path workbench supports most common machining operations as well as adaptive clearing and dressups.
The software is written in C++ with a heavily utilization of Qt. The software reads the touchscreen events from the microcontroller and submits them to the Linux kernel by creating a uinput device with libevdev. This allows the resistive touchscreen to be seen as a normal input device to the application.
The application has page navigation buttons on the left and an status widget on the right that is available on all pages. It features a DRO and buttons for the features most commonly used.
The Visual window shows a 3D preview of the tool paths. Feeds are in green and rapids are red. The cursor shows the current machine position.
While running, visual feedback is given on the current feedrate and spindle RPM as blue bar that shows the current value with respect to the max.
The MDI window allows for manual commands and viewing the information going to and from the machine.
The program window shows the G-Code loaded into the program.
Modern platforms such as iOS and Android, that were originally designed around a touchscreen, integrate the onscreen keyboard so well that it's mostly taken for granted. Since classic platforms such as Windows and Linux/X were designed long before touchscreens were common, their integration of onscreen keyboards is often non-intuitive by comparison. On these platforms, the keyboard usually has to be manually brought up by clicking a button in the toolbar before typing can begin. Since the platforms were not designed with onscreen keyboards in mind, most applications are not written to send the special signals to notify the system that the keyboard...Read more »