Skip to content

CNC mills need a touch sensor to measure e.g. the center of a workpiece. This repository hold data on how to build such a sensor and the code to operate it with a WLAN based basestation.

License

Notifications You must be signed in to change notification settings

HeikoKa/Wireless-3D-Touch-Probe-Sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wireless 3D Touch Probe Edge Finder for CNC/VMC Machines

See also announcements under Discussions.

Description

For CNC machines like VMC (Vertical Machining Center) a regular task is to find the center or an edge of a workpiece as a reference for the following machining. However, this can be extremely annoying to do manually by moving the X, Y and Z axis. Professional machinists use so call 3D Touch Probe or Edge Finder to do this automatically. For hobbyists and semi-professionals these Touch Probes are way too expensive.

There are a lot of examples where people build a DIY 3D Touch Probe, that is basically nothing more than a switch that is connects by a wire to the CNC controller. For machines that make use of an ATC (Automatic Tool Changer) like a carousel this is not suitable, because of the wire from the probe to the CNC controller. In order to make use of a completely automated probing a wireless connection is required. In this project I share my results for a WLAN UDP based 3D Touch Probe consisting of the Probe and a Basestation. While the Probe is working by a recharable battery and two ESP32 or ESP8266 microcontroller, the Basestation also hosts a ESP32 or ESP8266 microcontroller and is powered by a 5V power supply and is connected to the CNC controller to hand over e.g. the current switch state of the 3D Touch Probe. Although the electronics suits best for the provided mechanics, it is basically possible to use the code and the electronics for any 3D-Touch Probe.

The following picture shows the 3D-Touch-Probe in a ATC tool holder BT30. The round connector is the magnetic charging connector for the internal battery. The transparent middle part is used to show serveral states by LEDs, e.g. power on, WLAN connected, touch probe closed/open, battery low, general error etc. For pictures of the basestation see the /media/pics/ folder. The videos seem not to work online, you might need to download them first. I did not publised all information, because it take a lot of time and I am not sure if there is any interest. So, contact me (h.kalte@gmx.de) and I will answer all you questions.

3D_Touch_Probe.jpg 3D_Touch_Probe.jpg 3D_Touch_Probe.jpg 3D_Touch_Probe.jpg

Sensor Server/Basestation Hardware

Hardware/PCB Revision Features Pictures
Basestation 1.0 (prototype, not available) n/a n/a
Basestation 2.0 (current revision, available and fully functional)
  • Powerfull ESP32-WROOM-32N Microcontroller
  • Sleep input (transistor protected) for CNC to send battery powered Sensor asleep (by UDP message)
  • 3 transistor protected outputs. Each output can be used in “normal” and open collector mode to indicate to the CNC controller: sensor event, Wifi ready, sensor battery low
  • Output mode to CNC controller individually settable by jumpers
  • 6 LEDs for current status: Power On, Wlan Ready, Battery Low, Sleep, Sensor Event, General Error
  • 3 additional GPI/Os of the ESP32 for general purpose features
  • USB connector and USB to UART chip onboard that handles software update and debugging outputs.
  • 2 switches for Reset and Boot
  • External Antenna connector
  • Specifically design to fit in a DIN Rail Terminal Enclosure
  • 2 layer PCB design
  • 5V Power Supply recommended, 12 V not recommended and 24V not possible.
  • Individually solder by me
Basestation 3.0 (designed but yet not manufactured)
  • All Features of revision 2.0 plus
  • One additional protected output to the CNC controller (4 in total)
  • LEDs and outputs to CNC are independent (allows switching of the output polarity independently from the LED)
  • 4-layer PCB and improved PCB design to better protect against the rough environment of a CNC mill
  • Better accessibility of the USB port
  • Automatic detection of the hardware revision
  • DC-DC converter to power the hardware up to 24V supply.
  • ESP protection (TVS diode)
  • Fuse to protect the board and the environment
image

Sensor Client Hardware

Hardware/PCB Revision Features Pictures
Sensor 1.0 (current revision, available and fully functional)
  • Highly integrated ESP32-PICO-V3-02
  • Specifically designed power management to ensure longest possible operation and sleep time when powered by battery Lithium polymer battery (LiPo). During sleep everything is switched off except for one pull up resistor.
  • Highly integrated and very small outline 35mm diameter
  • Wake up by simple touch of the sensor mechanic (mechanical switch must be a normally closed switch)
  • DC-DC converter for efficient power management and to handle changing LiPo voltage during operation.
  • LiPo charging IC on board to comfortably charge LiPo by e.g., USB cable.
  • UART connector for Software update and debugging.
  • Charging status is detected by the Microcontroller and can be displayed via LED (can also be send via UDP message to the basestation and webserver)
  • Battery voltage is measured, and low and critical battery voltage can be indicated by LED and send to basestation to inform CNC controller by general purpose input.
  • Connectors for: LiPo battery, Sensor Switch and charging device.
  • Individual sensor debounce capacitor possible
  • RGB LED for status information. Blinking and individual colours are possible, e.g. Power, WLAN initialization, Sensor status, Charging, low and critical battery voltage etc.
  • On board ceramic antenna (in this version no BNC connector for an external antenna)
  • Several additional ESP32 I/O on test points
  • 4-layer PCB design to cope with rough conditions
Sensor 2.0 (designed but yet not manufactured)
  • Additional BNC connector for external antennas (only necessary in complete closed mechanical designs)
  • Improved battery measurement
  • Improved charging detection
  • Smaller and more robust buttons for Reset and Boot
  • Improved DC-DC Layout
  • Small PCB errors fixed
  • Automatic PCB revision detection

Features

  • X, Y and Z detection
  • Client (3D touch probe) and server (base station) code
  • Wireless communication based on WIFI, especially suitable for automatic toolchanger
  • Many parameters (see header file)
  • Debug mode for detailed serial monitor print outs
  • Optional webserver
  • Optional round trip delay measurement
  • Battery voltage monitoring
  • WLAN signal strength monitoring
  • Client and Server alive monitoring
  • Wake up 3D touch client by touching the sensor by hand or automatically by CNC maschine
  • Send client asleep feature to save battery life
  • Easy recharging of the client battery by magnetic USB cable
  • Many more

Content of the repository

  • C/C++ code for ESP32 and ESP8266 client and server
  • 3D Fusion 360 model of the 3d touch sensor (not yet)
  • Schematic of the electronics of both ESP32 and ESP8266 boards (not yet)
  • Eding CNC macro for inner/outer center finding (not yet)
  • Picture of the hardware and picture during build
  • Videos of the function
  • Bill of material (not yet)

Getting Started

  • get two ESP32 (or ESP8266) boards and two USB-C cables (not just a power USB cable it must support the serial communication)
  • download and setup Arduine IDE for the ESP32 or ESP8266
  • download the repository (client, server und header file)
  • adjust the include file path in the server and client file (because Arduino IDE does not support relative include paths)
  • enable DEBUG mode in the header file for the first runs to get as many infos as possible
  • compile and download files for client and server
  • watch the serial prints of the Client and Server to understand what ist happening

Mechanical Hardware Build

  • No lathe required, CNC maschine and welding ist necessary
  • Lathe tools in a vise is required

Authors

Heiko Kalte, h.kalte@gmx.de

Version History

  • 0.1
    • Initial Release

Donate

If this project help you reduce time to develop, you can give me a cup of coffee :)

paypal

License

This project is licensed under the GNU General Public License v3.0 License - see the LICENSE.md file for details