Tested with an Ender 3 2020, but should work with any printer that accepts GCODE commands over USB serial.
I wrote this quickly because I broke one of the mirror caps on my Subaru WRX. As I couldn't buy the caps on their own, instead needing to get a whole new mirror off eBay for £30, I decided to do the next logical thing and buy a 3D printer to make my own.
This software allows you to control a 3D printer head with keyboard controls, and save position data points to a file, effectively functioning as a CMM (coordinate measuring machine). Everything is manual, but this also means no additional hardware is required.
Simply clone and run! You may need to install pyserial
. Tested to work on macOS and WSL, untested on Windows.
git clone https://github.com/XDGFX/gcode-cmm.git
sudo chmod +x gcode-cmm/cmm.py
python3 cmm.py
# Installing pyserial if required
pip3 install pyserial==3.4
Open settings.json
and edit as required. the points_n
and dist_n
are only used in the rectangle mode.
There are two modes available, free and rectangle. Free allows full control over the printer head, and saving of any number of points. Rectangle will create a rectangular grid of evenly spaced points, and you only control the Z axis. Currently I have only properly used the free mode so use rectangle at your own risk.
I needed to measure some heavy curvature, and so attached the included nozzle cleaner needle to the printer head. This worked well, as the needle would bend if touching the part; without moving the part or offsetting the head.
Start the software, select the mode you want, and the controls should be visible on the console.
The following table shows which GCODE commands need to be supported by the printer - it's pretty basic so I would be surprised if your printer doesn't work.
Command | Description | Vital? |
---|---|---|
G0 | Movement | Yes |
G28 | Automatic Homing | Yes |
M107 P1 | Turn off part cooling fan | No |