Uriah Ligget Turns a Raspberry Pi and ATmega328P Into a Detailed Touchscreen CNC Interface

With a custom-built HAT and some clever software, Liggett has seriously upgraded his consumer-grade CNC machine.

Gareth Halfacree
4 years ago β€’ HW101 / Robotics / Displays

Uriah Liggett, unsatisfied with the state of the art in hobbyist CNC control options, has built a touchscreen interface of his own for Grbl-compatible machines β€” and it's based on the Raspberry Pi, with added Microchip ATmega328P powers.

"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," Liggett explains of the inspiration behind the build. "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 an 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."

With the hardware sorted, Liggett turned his attention to the software - written in C++ with Qt for the graphical interface. "The software reads the touchscreen events from the microcontroller and submits them to the Linux kernel by creating a uinput device with libevdev," Liggett notes. "This allows the resistive touchscreen to be seen as a normal input device to the application."

The resulting tool has multiple windows, including a 3D preview of the tool paths required by a G-code file input, a live feedback of the feedrate and spindle speed while running, an MDI window for inputting manual commands, and a program window which allows the user to view the loaded G-code. In its latest update, the software also received support for colouring tool paths by depth and spindle speed, line numbers in the program view, live program listing tracking, error response tracking, and gesture-based panning, zooming, and scrolling.

Liggett has published a detailed build log for the project, but for now is keeping the as-yet unfinished software private. "I'm not sure how or if I'll make the software available," he writes, "but it will be some time before I do."

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles