kimdaihai / esp32-cnc-mpg-handwheel-conversion-mach4

Converts a wired MPG Handwheel (for controlling a CNC Machine) into wireless (over Wifi) using an ESP32 development kit.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mach4 Wireless (Wifi) MPG Handwheel Using ESP32 and Modbus TCP library

Demonstration & Assembly

https://www.youtube.com/watch?v=FvmKIaZbhRo
https://www.youtube.com/watch?v=sGhttK0reT0&t=2s
https://www.youtube.com/watch?v=5fpQ3xS1Tu8&t=2s

Required Arduino Libraries

https://github.com/emelianov/modbus-esp8266
https://github.com/madhephaestus/ESP32Encoder
https://github.com/tzapu/WiFiManager

ESP32 Firmware and Network Setup

  1. Upload the Mach4MPGModbus.ino file to the ESP32 using the Arduino (or other) IDE.
  2. Reboot the ESP32.
  3. The ESP32 device should show up in the list of network access points.

  1. Connect to this access point and navigate to 192.168.4.1 in a browser.
  2. Press the "Configure Wifi" button.

  1. Find your network access point and connect to it by providing your network credentials.

Mach4 Software Setup

  1. Find the local IP address of the ESP32 (espressif).

  1. Launch the MPGInstaller.exe from the dist folder of the repo.
  2. Select the Mach4 profile you want to update, enter the IP address of the ESP32 and press install. (if the ESP32 device is already connected to the network, the IP address should auto-populate)

  1. Turn on the ESP32 MPG, open Mach4 and navigate to Diagnostic->Modbus in the File Menu.
  2. To connect or reconnect to the modbus device, press the stop button in the diagnostic window and then the play button. (Alternatively use the Wizard instead [step 6])

  1. The wizard can be accessed by opening the Wizard launcher in the Mach4 file menu. (Wizard->Select Wizard->MPGWiz)

Parts List (Amazon links)

  1. MPG Handwheel
  2. Lipo Battery
  3. Lithium Battery Charger Module
  4. Boost Converter
  5. ESP32

Wiring - Display

ESP32 to ILI9341 Display: ESP32 GND -> ILI9341 GND
ESP32 3V3 -> ILI9341 VCC
ESP32 D27 -> ILI9341 LED
ESP32 D15 -> ILI9341 CS
ESP32 EN -> ILI9341 RESET
ESP32 D13 -> ILI9341 D/C
ESP32 D23 -> ILI9341 SDI
ESP32 D23 -> ILI9341 T_DIN
ESP32 D18 -> ILI9341 SCK
ESP32 D18 -> ILI9341 T_CLK
ESP32 D21 -> ILI9341 T_CS
ESP32 D19 -> ILI9341 T_OUT
ESP32 D2 -> Encoder A+
ESP32 D4 -> Encoder B+

Wiring - No Display

battery -> TP4056 Charger Module -> XL6009 Boost Convert (3.3 to 5V) -> MPG Estop switch -> ESP32 VIN/GND

(The LED on the MPG PCB is connected to the 3.3v and GND terminals on the ESP32)

MPG PCB:
ESP32 GND -> COM
ESP32 Pin 2 -> A+
ESP32 Pin 4 -> B+
ESP32 Pin 13 -> X Axis
ESP32 Pin 14 -> Y Axis
ESP32 Pin 27 -> Z Axis
ESP32 Pin 25 -> MPG Enable Switch
ESP32 Pin 32 -> A Axis
ESP32 Pin 35 -> B Axis (8k ohm pullup to 3.3v)
ESP32 Pin 34 -> C Axis (8k ohm pullup to 3.3v)
ESP32 Pin 15 -> Inc 1
ESP32 Pin 21 -> Inc 2
ESP32 Pin 22 -> Inc 3

Wiring an Ethernet Port

W5500 Lite:
ESP32 Pin 23 -> MOSI
ESP32 Pin 19 -> MISO
ESP32 Pin 18 -> SCLK
ESP32 Pin 5 -> CS
ESP32 Pin 26 -> RST

PCB Gerber File & 3d print files for Display included

Original 3d print file creator: https://www.thingiverse.com/thing:4539827

About

Converts a wired MPG Handwheel (for controlling a CNC Machine) into wireless (over Wifi) using an ESP32 development kit.


Languages

Language:C 94.5%Language:C++ 5.2%Language:Processing 0.1%Language:Python 0.1%Language:Lua 0.0%Language:HTML 0.0%Language:JavaScript 0.0%Language:Shell 0.0%