-
1Building the XY Gantry
Included in this post are the STL and DXF files needed to 3D print and laser cut the gantry. STL files of the laser cut parts are also included in case a laser cutter is not available. The STL and DXF files can also be downloaded from Thingiverse. I have included the link below.
https://www.thingiverse.com/thing:3799000
I've also included a parts list, which includes the quantities needed for the 3d printed and laser cut parts, and a list of purchased parts and sources.
The Fusion360 design file for the XY gantry can be found in the link below. This can be used for determine parts placement for the 3D printed and laser cut parts.
https://myhub.autodesk360.com/ue2d8bc19/g/shares/SH56a43QTfd62c1cd9687e9feca593e75dfb
For this project I glued all of the mating 3D printed part together. Since I printed this with ABS I was able to make glue using acetone and failed prints. Super glue or Bob Smith will also work.
After the 3D printed and laser cut parts were assembled the motors and belt drives were mounted. The motors were bolted to the motor mounts using the M3x6mm screws. The idler pulley shafts I bought were to long and need to be cut down to 20mm. The idler pulley assembly was put together using the M3x30mm screws and nuts. The belts were cut to length and clamped using the M4x20mm screws and gear clamp belt clamps. The spring tensioners were added to the center belt.
-
2Programming the CNC Controller
The CNC controller was programmed with GRBL. The github link for GRBL can be found below.
I have also included my GRBL settings below, and a tutorial I used to figure out how to configure the settings.
https://github.com/gnea/grbl/wiki/Grbl-v1.1-Configuration
$0=10 (step pulse, usec)
$1=25 (step idle delay, msec)
$2=0 (step port invert mask:00000000)
$3=0 (dir port invert mask:00000000)
$4=0 (step enable invert, bool)
$5=0 (limit pins invert, bool)
$6=0 (probe pin invert, bool)
$10=3 (status report mask:00000011)
$11=1.000 (junction deviation, mm)
$12=0.025 (arc tolerance, mm)
$13=0 (report inches, bool)
$20=0 (soft limits, bool)
$21=0 (hard limits, bool)
$22=0 (homing cycle, bool)
$23=0 (homing dir invert mask:00000000)
$24=25.000 (homing feed, mm/min)
$25=500.000 (homing seek, mm/min)
$26=250 (homing debounce, msec)
$27=1.000 (homing pull-off, mm)
$100=20.000 (x, step/mm)
$101=20.000 (y, step/mm)
$102=20.000 (z, step/mm)
$110=125000.000 (x max rate, mm/min)
$111=125000.000 (y max rate, mm/min)
$112=125000.000 (z max rate, mm/min)
$120=1500.000 (x accel, mm/sec^2)
$121=1500.000 (y accel, mm/sec^2)
$122=1500.000 (z accel, mm/sec^2)
$130=200.000 (x max travel, mm)
$131=200.000 (y max travel, mm)
$132=200.000 (z max travel, mm) -
3Setting up the CNC controller
Below are photographs of the CNC controller shield. These can be used to determine jumper position, wiring, and stepper driver orientation.
For the stepper motors I used I set the drives up for 1/4 step. This can be set using the jumpers positioned below each of the three large capacitors. Note that only the middle jumper is set.
Since the y-axis has two steppers I used driver A to drive the second motor. This is done by adding the two jumpers on the left to the y-position. Since the two y-axis steppers need to spin in opposite directions, I wire one of the steppers backwards. Note the wire color pattern for driver Y and A.
Note the location of the potentiometers
-
4Setting up the Raspberry Pi
For this project I used a Pi Zero. Because this was my first Raspberry Pi, and because the USB and HDMI adapters were so expensive, I bought a kit that came with the adapters and an SD card preloaded with Raspian. This made everything a lot simpler.
The python script running on the Raspberry Pi requires "pymouse". This can be gotten by installing pyuserinput and pymouse using PIP. I've also pasted the script below.
#to use pymouse use PIP to install pyuserinput pymouse
import pymouse
import serial
import timemouse = pymouse.PyMouse()
ser = serial.Serial('/dev/ttyACM0', 115200, timeout = 10)
time.sleep(3)
while True:
(x,y) = mouse.position()
X = x/12
Y = y/6
ser.write(b'G90 G0 X')
ser.write(str(X).encode('ascii'))
ser.write(b'Y')
ser.write(str(Y).encode('ascii'))
ser.write(b' \n')
message = ser.read(4)
print (message) -
5Wiring
The wiring should be straight forward:
- wire the stepper motor using the 38MM 4-Lead with 1m Cables from the CNC shield to their respective motors
- wire the CNC controller to the power supply using the 10-inches 18 gauge red/back wire, and set the power supply to 24V
- plug the USB hub into the Raspberry Pi
- plug one of the mouse dongle into the USB hub
- using the USB A-male to B-male cable connect the Arduino to the USB hub
- Plug the micro USB cable into the power supply and into the Raspberry Pi for power
- plug the other mouse dongle into an computer
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.