Introduction: Arduino Based DRO for GRBL CNC Machine
I started this project with a single goal in mind. I wanted a simple, yet effective way to view information about my CNC machine, while standing at the CNC machine, rather than craning my neck in almost contortionist positions, and squinting like a man staring into the sun, just to see the computer monitor on the other side of the room.
With that in mind, i set out to cobble together a deluge of cheap components, ebay specials, and the spare bit of solder and duct tape.
Here is the result of almost a year of waiting on parts from china.. erm.. Diligently working towards my goal. :)
Step 1: Hardware Design Stage...
The first thing we need to do, is to throw everything into a pile, randomly plug things in, put out all the fires, open the windows to let the smoke and fumes out, and then we can start to build something kind of interesting.. Well. To me anyway.
I started off by getting one of those ubiquitous arduino328p's in "DIP" package form. (Dual inline pins = Stick with legs)
From there, i needed some way of visually displaying the information. My first thought was to use the standard 16x2 LCD, and quickly i realized i simply couldn't fit everything onto that little LCD without fancy scrolling, or timed screen switching, both of which weren't very appealing. So my next idea was a 20x4. it has plenty of room to show basic information, and with a tactile, i can switch between work, and machine coordinates. With that, i set off to build the arduino sketch...
Somewhere along the way, i saw a real DRO on an actual manual mill... the 7-segment display was visible from across the warehouse... So i decided to add that to my design, just in case i didn't like the LCD anymore. After many hours of scouring ebay to find the modules i liked, i bought 3 of the 8 digit 7-segment display modules with the max7219 ic on them. Perfect... now all i have to do is build an arduino library for.... nope.. Looks like someone has already done this.
Nick Gammon designed this library for use with these displays, and others. It's pretty straight forward.
Nick Gammon's Max7219 Arduino Library
My only dislike, is i haven't been able to align the numbers to the right, and the "-" symbol on the left.. but meh, it works.
A few weeks later, after cobbling together odds and ends, bits and bobs, and with some help from someone on youtube, i had a working prototype on breadboard using the 7-segment modules. .
Step 2: PCB Design...
Tinkering around in Eagle, i managed to cludge together a PCB... It took me three tries to get the board to come out right, but that's just inexperience, and dodgy ebay special dry photoresist film.
Included in this step are an updated set of eagle files. Unlike my catastrophe of a first board (depicted images) The updated design is a little larger, and fixes some issues i had with supplying enough power to the modules. Turns out, if the path the electricity has to take goes all the way around the board in a circle, some components at the far end won't get enough juice to chooch (AvE... Stop infecting me with your colloquialisms!)
Anywho, the board is designed to be used with three of those max7219 e-segment display modules, as well as an LCD. The LCD portion is optional, but in future iterations, i plan on breaking out another pin for a hall effect sensor on the CNC spindle to display actual spindle RPM's.
Also in this version of the eagle files, i've added better silkscreen placement and documentation, broken out the RGB status led in case you don't have the surface mount version, or want to mount it in a case, and want the LED somewhere else. I've also added an ICSP header, in case you don't want to use the USB to reprogram it.
Also, you'll notice this board doesn't use the DIP package Atmeg328p. Instead it's using a QFP SMD package. (QFP = Quad Flat Pack.) This was done mainly to have more space under the board for traces, without having to rout around yet more through-hole pins.
There are breakout pins for the mode, and reset buttons, as well as the bottom two breakouts, one goes to the LCD, the other to the arduino controlling the GRBL CNC Machine.
The entire board is only 2.6" x 2.25" (or 65.94mm x 57.1mm for you metric folks)
The X, Y and Z headers can be any standard .1" pich header, or simply run ribbon cable to your modules if need be.
-=[ BE MINDFUL!!! ]=- -=[ BE MINDFUL!!! ]=- -=[ BE MINDFUL!!! ]=-
The modules only plug in one way. Be careful to notice which side of the module is VCC/GND and the same on the board. If you plug them in, or wire them backwards, you'll probably smoke the unit.
Step 3: The End of the Road.. Or, the Begining of Something Else.. Who Knows.
Finally, we come to the point in this little tour of ADD/ADHD that is my life.
Herein lies the final pretty image of my DRO project. Complete with @Scanlime Sticker (Thank you Micah for the inspiration, and the stickers!)
I've tacked on a Rar archive with the DRO sketches i've been using. There's probably room for improvement, and definitely not a completed, clean work. There are features in the code that i have yet to implement, and features not in the code that i have yet to figure out how to add..
All in all, i think it was a pretty successful PoC. While not technically a "closed loop" Digital read out. It does serve a purpose. I would like to continue building upon this, and eventually add support for quadrature scales or something. And i definitely would like to add more advanced features such as implementing canned probe cycles, hole patterns, etc. That will require an additional IC to toggle incoming, and outgoing communication with the GRBL arduino, but it can be done using a CD4066 or something.
Hope this inspires you. If you build it, please let me know. I'de love to see pictures and improvements.
Thanks for wading into the derp end with me :)
-=[ ArcAiN6 ]=-
Attachments

Participated in the
Arduino Contest 2017

Participated in the
Epilog Challenge 9
7 Comments
3 years ago
nice write up. Pls I've been having issue on how to display direction info and other information regarding pause and resume on LCD DISPLAY. I dont know how to achieve this using GRBL library. I'm using arduino nano. I want to know how you achieve your own display, probably you add a your own define function to grbl library or other things to the arduino nano. Pls help out. my email- awefrancolaz@gmail.com, whatsapp number- 09078374078. I will be very grateful to recieve your reply. Thanks.
5 years ago
Interesting. Is this just the read out section or is it an actual working unit connected to your CNC machine. And if it is a working unit prototype, what are you using for the sensors to read the X, Y and Z axis?
Reply 5 years ago
The project consists of the following:
PCB: This pcb handles the positional data from GRBL by spying on the serial communication line from the GRBL arduino, to the computer. (Eagle board files provided)
Arduino Code: This is what runs on the PCB's atmega328P.
It reads the positional data, and state of the machine.
If there is an alarm, the LCD, and 7-segment displays will flash to indicate this.
The mode button switches between work coordinates, and machine coordinates.
The Status RGB LED toggles between green and blue to indicate machine or work coordinate display, and flashes red when there is an alarm.
For now, this only reads the data provided by GRBL and displays it.
This was what i need when i'm using the remote to position the machine, or reposition it after a tool change, or in case of an issue. I also use this to see where the machine is, in relation to other parts on the bed, sort of a sanity check before running the gcode.
However, i do have plans of adding quadrature scales to my machine, and using that data, in conjunction with the GRBL data to extend capabilities. Once i'm able to buy these hardware, it should be trivial to update the code, and board, and possibly even add more functionality.
5 years ago
How did you get the position data? Is it a real measurment or just the gbrl coordinates?
Reply 5 years ago
It's the GRBL postition response. As stated, it isn't a closed loop system, so it relies on GRBL to provide positioning at this time. In the future, i hope to add quadrature scales.
5 years ago
Thanks for sharing :)
Reply 5 years ago
My pleasure. :)
! was goaded into sharing this for a contest..
Here's to hoping i at least place...
If you like it, feel free to go to the following link, scroll down until you see my project and vote for me :)
https://www.instructables.com/contest/arduino2017/