Raspberry Pi CNC - Adding a Z Probe

Опубликовано: 01 Август 2026
на канале: R Ballard Designs
3,627
67

Adding a simple z probe to the Raspberry Pi Cnc.

Here is the code to add to the button to make it work. Copy and paste into a button in BCNC.

G21
G91 ;relative mode
G38.2 Z-30 F100 ;Probe Z down 30mm at a feed of 100mm/min
G10L20Z12.7 ;Set Z to 12.7mm (thickness of probe plate)
G0 Z20 ;Lift Z 20mm to remove the probe plate
G90 ; Absolute mode


Notes:
You will only need to change the 12.7 of the line “G10L20Z12.7”. Change that to the thickness of your probe material. I would suggest to start slightly smaller (in this case I would say 12.4 instead of 12.7) just Incase your settings are off slightly. Remove the probe and Then give it command “G0 Z0” to check the final height. Then increase .1 at a time until it reaches the final height you want.

When the probe is finished you will see your Z height will equal the total of your Z probe plate and the extra 20mm that the Z goes up after the probe. In the code above it would read 32.7mm (12.7mm thickness of plate + 20mm clearance to remove the plate)

Here are a few links to stuff I use. Some are affiliate and some are not. Support my channel and click on something
Raspberry Pi 4: https://amzn.to/3JKjAel
Raspberry Pi 400: https://amzn.to/3tQWUUl
Raspberry Pi 10.1” Touch Screen: https://amzn.to/3j3kozr
Protoneer Raspberry Pi CNC Shield: https://www.zyltech.com/genuine-proto...
DM 542 Deiver: https://amzn.to/36UgNkc
420oz Stepper Motor: https://amzn.to/3NwEcZS
500W 48V Power Supply: https://amzn.to/3uHkxxT
Gatton CNC: https://www.davegatton.com/gatton-cnc...
Bob’s CNC Evolution 4: https://amzn.to/3iQBUq8
Bob’s CNC Revolution: https://www.bobscnc.com/products/revo...
1” Spoilboard Surfacing bit: https://amzn.to/3iNXMT8
1/8” Tapered Ballnose: https://amzn.to/3iLHTgg
Matabo (Hitachi) Router: https://amzn.to/3JPtXNW
Makita Compact Router: https://amzn.to/3JPuQGs