I few weeks ago I bought convertible 3 in 1 device (DOBOT Mooz-2 Plus) which allow 3D printing, laser engraving and CNC. After initial testing of each module I decided to try the CNC module in PCB engraving. Initial tests showed me that is required precise leveling of copper plate before engraving. I would like to the Autoleveller tool for 2-stage leveling. Due the my device allows to control via serial I decided to add a external z axis probe which allows to collect a level map of cooper plate and add proper corrections for final G-code.
I have used a Digispark module for which I connected crocodile clips: one to GND and second to PIN0. These clips will be connected to copper plate and the spindle. With this probe I will detect the moment when the spindle reach the top surface of cooper and I could store the actual Z axis position, which will be used for corrections. The code was written in C and is really simple. I was used USBSerial library for communication with PC for get status of probe (if clips are open (O) or close (C)). In main loop is checked status of PIN0 and if we got command to report status of open or close of Z axis probing circuit. Below there is source code:
#include <DigiCDC.h> #define LED_PIN 1 #define PROBE_PIN 0 void setup() { SerialUSB.begin(); pinMode(LED_PIN,OUTPUT); digitalWrite(LED_PIN, LOW); pinMode(PROBE_PIN,INPUT_PULLUP); } void loop() { uint8_t probeState = digitalRead(PROBE_PIN); if (probeState == LOW) { digitalWrite(LED_PIN, HIGH); } else { digitalWrite(LED_PIN, LOW); } if (SerialUSB.available()) { char input = SerialUSB.read(); if (input == 'P') { if (probeState == LOW) { SerialUSB.write("C\n"); } else { SerialUSB.write("O\n"); } } } SerialUSB.refresh(); }
I found here a really nice case for Digispark, so I printed it and use it for my Z probe. Below there I are photos from assembly.
In next part I would like to create simple script or application which will communicate with device and probe for process of collecting measurements from copper plate.
Top Comments