Tuesday, January 6, 2015

GRBL Height Probing Tutorial

[Outdated, new version with arc support available on GitHub: https://github.com/martin2250/GrblHeightProbe2,http://www.youtube.com/watch?v=kzXzvcUAuus]

Hey makers!

I finally came around to record the promised tutorial on height mapping and auto-levelling G-Code files with a GRBL 0.9+ controller.

In this tutorial I show how I go from a design in E.A.G.L.E. to a finished single layer PCB with  traces narrower than 0.4mm using my custom toolchain to compensate for substrate unevenness.

The binaries of the toolchain are available here:
The source is available here:

(please note that google drive reported both files as viruses which is why I switched to Dropbox. If you don't trust me, just go through and recompile the source. there is nothing to worry about)

Be sure to read the readme included in the download, there are some more tips and tricks as well as a few instructions.

The toolchain does not support arcs right now. This means that you have to use programs like GCodeRipper to convert all G2/G3s to smaller G1 moves. Since pcb-gcode does not use arcs this is no issue if you want to make PCBS. May get implemented in a later release.

To see some more information on how your gcode file was parsed, select the file in the list on the left in HeightToGCode3. you will see some basic info as well as all lines that could not be parsed.

Saturday, November 29, 2014

AVR Temperature/Humidity Logger

[Better documentation and new firmware over at Hackaday.io: https://hackaday.io/project/6177-low-power-environmental-data-logger]

This is my latest project, a small low-power climate logger. I finally got around to assemble the case & electronics, now I can finally present it to you.

The main electrical components are an AtMega88 in a TQFP package, a HYT939 temperature and humidity sensor ,a 24AA1025 1M I²C EEPROM and a DS1337 RTC.

The PCB and case were both designed in EAGLE, the files are available in the download below.
The Atmega was programmed in C, the code is also available below.
Here is another video of the final product working:
The data is first saved to a 128byte buffer, then it is saved to a page in the EEPROM. Each page first has 5 bytes containing the time of the first measurement, the rest are 41 readings, each 3-byte reading contains the most significant 12bits of the 14bit raw sensor data for each temperature and humidity.
The aquired data can be exported via standart UART/TTL at 9600 baud. I chose a RCA connector because it was the best that I could find. To receive the data, I wrote a small windows application that outputs a .csv file.

Average current when display inactive: ~ 60µA
Resolution: 0.04°C /  0.025%rH
Memory: 292 days woth of data (41984 data points at an interval of 10 minutes)
Power source: 4 rechargeable AA batteries (2700mAh)

220'000 µF supercapacitor as backup for the DS1337
automatic data saving on power loss (220µF buffer capacitor)
Easily expandable menu implementation
Super Sexy wooden case with sliding battery door
The PCB and case were milled on my ShapeOko, here is a timelapse of the R1 board and a second case being made:
The design files and software are available here: https://drive.google.com/file/d/0B2OzfW5smQv8eFNkOVo3eThGSzA/view?usp=sharing

Here are some more pictures of the project:

(This ratsnest of wires was acutally enough to hold the PCB in place)

Saturday, September 13, 2014

GRBL Height Probing for PCBs

Hello and Welcome to my first post!

Not too long ago, I finally got my custom toolchain for creating and using height maps with GRBL to a working state.

This is the first and only program to use GRBLs new probing feature to level a PCB.

The basic concept is that your cnc machine measures the height differences across the surface, and uses that data to follow the shape of the surface exactly. A consistent depth is essential for milling Printed Circuit Boards.

Both the probing program and the program that applies that data to G-Code are written by myself are available for download: Google Drive.

Here you can see the very first attempt at milling a PCB, the CNC machine is a Shapeoko 2 with a Kress 800 Spindle. The bit is a 20° Engraving bit, but the tip already broke off, so it has about a 0.25 mm point.

A video of the process is available here (loud!):


  • Generate your G-Code (eg. with pcb-gcode for CadSoft Eagle)
  • Drag 'n' Drop G-Code onto HeightToGCode2.exe (zip/HeightToGCode2/bin/Debug)
  • Note Dimensions, close Program
  • Set Stepper Timeout to 255 in GRBL
  • Move Bit to your 0|0 location, z height is irrelevant
  • Open HeightProbe.exe (zip/HeightProbe/bin/Debug)
  • enter the Dimensions ( always include a bit of spare space)
  • enter the other settings (Output file is .csv)
  • MAKE SURE that you have the Probing feature enabled (GRBL 0.9g or higher) and that the Surface and the bit are connected to the Arduino (A5/SCL and Ground)
  • Hit Enter 3 times.
  • Wait for the Program to finish
  • Open HeightToGcode2 again
  • Drag 'n' Drop Gcode into window, hit enter
  • Drag 'n' Drop csv into window, hit enter
  • decide which other commands to keep
  • Use the resulting GCode File In Universal GCode Sender, your machine is already homed and the position is (0|0| safetyHeight), give GRBL that position via G92X0Y0Z[safety] before sending the file.
  • ...? Profit.
If I get enough feedback to motivate myself, I will make a video tutorial, which should clear things up.

The program can also just be used to create height maps, this is a 1 Euro coin, you can just make out spain in the top left hand corner: