Close
0%
0%

Touchscreen Control Panel for Grbl

A touchscreen control panel for Grbl controllers with MPG handwheel and hardware inputs.

Similar projects worth following
This project is a Grbl-compatible CNC control panel with a 10" resistive touchscreen, hardware led cycle start, feed hold, and cycle stop buttons, custom macro buttons, spindle on and spindle off rotary switches, analog jog joystick, jog control knobs, feed override and spindle override knobs, an emergency stop, an MPG handwheel, and custom sender software. It is based on the Raspberry Pi and ATmega328P.

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.

Hardware

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.


While waiting on the PCBs, work began on the CAD modelling of the enclosure in FreeCAD.  All of the numeric constants utilized in the design were stored in a FreeCAD spreadsheet.  The various files in the design all linked to the same spreadsheet so that changing a design parameter in one place would instantly update all the files in the design.

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.

Touchscreen Integration

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.

General Interface

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.

Visual Window

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.

Running State

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.

MDI Window

The MDI window allows for manual commands and viewing the information going to and from the machine.


Program Window

The program window shows the G-Code loaded into the program.


Onscreen Keyboard

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 »

  • 1 × 10.1" Resistive Touchscreen
  • 1 × 100PPR MPG Handwheel
  • 2 × Potentiometers Spindle Override and Feed Override potentiometers
  • 1 × Panel Mount RCA Plugs
  • 1 × Barrel Plug

View all 19 components

  • Onscreen Keyboard

    Uriah Liggett03/06/2020 at 14:13 0 comments

    Several enhancements were made to the onscreen keyboard to make typing easier.  The project description was updated to include details about how the keyboard operates and a video was created for it as well. Also, the height of the selection boxes on the main UI was doubled while the width was reduced to improve touch performance.

  • Improved visualization, user input, program feedback, and navigation

    Uriah Liggett03/01/2020 at 22:29 0 comments

    I've added quite a few software enhancements since the last log entry.  I will be going over them in greater detail over the coming days.

    • Added support for coloring tool paths by depth
    • Added support for coloring tool paths by spindle speed
    • Updated the look of the medium sized modal tool buttons

    • Added support for displaying the current line number in the Program window.
    • Added support for tracking the program table to the current line.
    • Added support for displaying the ok/error response for each line as responses are retrieved from the machine
    • Added a Clear button to the program window
    • Added a number line to the onscreen keyboard
    • Added support for zooming the perspective view. 
    • Added support for panning the orthographics views to track with the location of the mouse or finger on the screen
    • Added support for scrolling the scollable areas with touch gestures.
    • Added support for unloading a loaded NC file.
    • Added the ability to change the verbosity of the serial communication on the MDI page
    • Updated M01 handling to issue a M00 to the controller and removed the previously existing "paused" state.

  • Double Check Your Step Frequency

    Uriah Liggett02/21/2020 at 01:38 0 comments

    I spent the better part of two evenings diagnosing an issue where Grbl would either stop responding or run off to a random location when issuing some rapid commands.  After finally swallowing my pride and posting a bug report to the forum, it took about 10 minutes for someone to point out my mistake.  My configuration was using a 41 khz step frequency which is above the Grbl max of 30 khz.  Since this Arduino was used for development and wasn't connected to my CNC, there was no visual indication that the step rate was way too high.  Ah well, problem solved.

    Once that issue was worked out I resolved a few inefficiencies in the communication state management, added the ability to show verbose output on the console page, and changed the Settings page to have an explicit save button instead of auto-saving when a change is made.  I also performed basic 4-axis tests with the grbl-Mega-5x fork with promising results.

View all 3 project logs

Enjoy this project?

Share

Discussions

salman hameed wrote 03/17/2020 at 13:39 point

Its seems a very good project for CNC machines on . The controls and options are awesome . I'm very interested in this project and I hope you will share documents on hardware and software.

  Are you sure? yes | no

Randy Wright wrote 03/11/2020 at 05:01 point

Awesome control panel! It is touchscreen! www.dc-harvest.com/

  Are you sure? yes | no

CJ Marlen wrote 03/05/2020 at 19:40 point

Well Done!!  Open Source RaspberryPi and/or Arduino controlled CNC units are needed... the person that comes up with a CNC Metal Cutting Plasma Cutting Controller will be the Hero as that type of CNC unit will also run DIY waterjet units using the parts from high-pressure sprayers to cut thin aluminum, wood, foam, food, PCB board, Glass, stone, and many other items WaterJets are good at cutting.

  Are you sure? yes | no

Tyler Gerritsen wrote 03/05/2020 at 16:21 point

Hi Uriah, this looks amazing!  Nice work :)  I think the encoder is a great input device.

My friend is building a 1.2m x 1.2m CNC mill.  I think this would be a great control solution for it.  Would you be willing to share the Gerbers / KiCAD files and software at some point?

  Are you sure? yes | no

Robert Bonham wrote 03/04/2020 at 17:00 point

Do you have future plans for this project?  Any chance we might see a complete solution or kit on Tindie or similar platform down the road?

  Are you sure? yes | no

Uriah Liggett wrote 03/06/2020 at 14:16 point

Hi Robert, that's definitely an option if there is enough interest.

  Are you sure? yes | no

Ravi Karoria wrote 02/22/2020 at 16:05 point

Would you mind sharing that owesome software? I was looking for something similar for my 13 inch display connected with rpi4 for my cnc mill.

  Are you sure? yes | no

Uriah Liggett wrote 02/27/2020 at 12:29 point

Hi Ravi.  I'm not sure how or if I'll make the software available, but it will be some time before I do.  Thanks.

  Are you sure? yes | no

Ravi Karoria wrote 02/28/2020 at 06:35 point

Hi Uriah. No issues. I suggest you to use grbl_esp32 by bdring which is grbl port for esp32 dev board. By that way you will get grbl on a 32 bit controller which is much faster than arduino uno. You will get almost 120kHz step frequency and esp32 is as cheap as arduino uno!

  Are you sure? yes | no

mikekscholz wrote 02/21/2020 at 23:20 point

This is some impressive work. In my planning for my home machine Ive always leaned towards cnc.js running on the Pi but your software seems much more efficient with system resources.

  Are you sure? yes | no

Uriah Liggett wrote 02/27/2020 at 12:29 point

Thank you Mike

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates