Start/Pause/Stop Buttons for Mach3 CNC

by Molloy in Workshop > CNC

2846 Views, 2 Favorites, 0 Comments

Start/Pause/Stop Buttons for Mach3 CNC

IMG_0046(2).JPEG
IMG_0045(2).JPEG

I have more than one CNC machine controlled by Mach3. I attach the machines to a single PC using a printer cable switch box which allows me to pick which machine the PC is controlling. I found grabbing the mouse, or hitting Alt-R on the keyboard to be awkward and wanted something more easily accessible.

For this project, I constructed a button box with 3 arcade-style buttons, Green, Yellow and Red and attached the buttons to an arcade controller board. The arcade controller board can be programmed to send keystrokes thru the attached USB connector to a computer as a second keyboard.

Supplies

geekpi USB Joystick controller.jpg

(3) arcade controller buttons - search Ebay

(1) arcade controller board -

(3) pairs of wires for switches

(1) USB A-micro cab

(1) box for buttons

(3) 3d printed button protectors

Build the Button Box

Make a box for the buttons with room for the controller board

install the buttons and attach them using the supplied cables to the controller board

you can connect to any of the button inputs that are convenient

optionally 3d print the button protector rings and glue them to box

attach the USB cable from controller board to computer

Get Joystick Software

Screenshot 2022-03-26 145525.jpg

I used JoyToKey app which can be found here:

https://download.cnet.com/JoyToKey/3000-2094_4-75220348.html

When you push a button, the corresponding entry will turn yellow

double-click the button and program the key stroke you want that button to transmit to Mach3

I used Ctrl-NumPadKey 1, 2 and 3 for Start, Pause and Stop

Using the app, assign your desired key combos to the pins

File, save to keep your changes

Setup Mach3 Ports and Pins

ports and pins.png
ports and pins hot key.png

Go into mach3 under config, ports and pins

Select the input pins tab

Scroll down to OEM Trig Number 1

Enable the pin, check emulation and click on the Shortcut box. A box will pop up asking you to press the key you want to assign

press the Ctrl-NumPadKey and the desired numpad key to assign the key to the shortcut


Setup Mach3 System Hotkeys

system hotkey setup.png

you can find OEM codes here:

http://www.3axis.ru/images/prodacts/sourse/0/mach3_oem_code.pdf

In this I found Start = 1001 , Pause = 1002 and Stop = 1003

In Mach3 under Config, System Hotkeys go to the right hand side in the external buttons OEM codes enter the matching codes

If all went as planned, your buttons should work as desired