Arduino, GRBL, Experiences So Far

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Arduino, GRBL, Experiences So Far

Post by TReischl »

I have been wanting to build another machine for quite a while. Much smaller than my current machine. I built my current one and it is basically an Avid machine, using a lot of their parts. Gecko G540, SmoothStepper, etc. I know what it cost to build. Actually not much, around $2500 including mechanicals and electronics, not software. Has run well for over 10 years now.

Poking around on the internet I hear a lot about GRBL and some of the folks here use it. Kept seeing things about Arduino so got involved with that by adding a power feed to my manual mill. Did some research into Universal G Code Sender while I was at it.

Made the following purchases:

Arduino Mega 2560 R3 16.99
Alitove DC 24V 10A Power Supply 20.99
(4) TB6600 4A Stepper Motor Drivers 37.99
(4) Nema 17 2A 84 oz in Stepper Motors 40.00

Total: 115.97

I can guarantee you that the electronics on my current machine cost way WAY more than that.

Spent the last few days stripping wire, downloading free software like GRBL, Arduino IDE, Universal G Code Sender. Slogged through getting it all set up. That took a lot of digging around on the internet. Seems like there are pieces of info scattered everywhere but no comprehensive "Hey dummy, here is what you do".

An interesting thing about this is that there are some distinct crossover points (that is what I call them for lack of a better term). The first one occurs at the stepper motor drivers. The Arduino does not give a hoot about what it is driving, tiny stepper motor, big honking motor, no difference, it is just pumping out steps from the GRBL software to the motors. What this means is that if I have undersized my drivers and motors all I need to do is plug in more powerful ones. Not a big deal, but bigger ones do cost more. (I should note here that I am intending on doing small work, really small, typically with small tapered ball nose bits so the Nema 17's should be able to handle it). The next obvious crossover is at the end of the stepper motor shaft. From this point the electronics end and the mechanical begins. I am wanting to try some new drive systems, the flat belt style that acts like a gear rack is winning the race so far.

Ok, back to what has happened. After getting it all plugged together on top of my desk I loaded up a 3D model (a labrador retriever of course) and hit the go button. About keeled over in shock! The whole thing is working!

Who woulda thunk that you can drive a cnc machine with an itty bitty card that is about 2in X 4in X .75 and costs less than $20?

A while back I bought a really cheap NUC type computer and monitor. That is going to get dedicated to running the new machine. So, for about $300 plus the mechanical stuff I will have built the machine. The mechanical stuff is not all that expensive either these days.

BTW, I did not purchase a "cnc shield" for the Arduino. That is because they typically come with small stepper drivers on them not suitable for larger stepper motors. Some will drive the Nema 17's but if need be I will use Nema 23's and I do not want to have to reengineer the entire system if that happens.

In the past I have posted that a way to make money with cnc routers is to have multiple machines. The problem with that is off the shelf machines are not all that cheap so right away there is a $$$ limitation. I am not keen about the cheap 3018's coming out of china. Typically underpowered and abysmally slow cutting, stalling, etc. Those are issues that can be solved and not for a whole lot of money. I am not going into business, just want a machine to do smaller stuff that I am interested in.

Now that I have basically got the electronics worked out I will start on the mechanicals which is more my forte. I will try to keep this thread updated with how things go. No pictures yet because the electronics are all over my desk in a big rat's nest of wires, LOL.
"If you see a good fight, get in it." Dr. Vernon Johns

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Arduino, GRBL, Experiences So Far

Post by TReischl »

Forgot to mention in my first post that there is flavor of GRBL that will drive a full 5 axis machine. I may just put that on the Arduino card just for the heck of it, or maybe not.
"If you see a good fight, get in it." Dr. Vernon Johns

User avatar
highpockets
Vectric Wizard
Posts: 3667
Joined: Tue Jan 06, 2015 4:04 pm
Model of CNC Machine: PDJ Pilot Pro

Re: Arduino, GRBL, Experiences So Far

Post by highpockets »

Ted, you have definitely fallen head first down that rabbit hole. I'm waiting to see what pill you take :lol: :lol: :lol:
John
Maker of Chips

BillK
Vectric Wizard
Posts: 594
Joined: Wed Mar 27, 2013 4:16 pm
Model of CNC Machine: CNC Shark Pro Plus
Contact:

Re: Arduino, GRBL, Experiences So Far

Post by BillK »

I was just watching some YT from CNC NYC on this subject. Thanks for posting and keep us up to date.
BillK
https://www.facebook.com/CarvingsByKurtz

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Arduino, GRBL, Experiences So Far

Post by TReischl »

Time for an update. Working through the electronics has been interesting. I am very familiar with Mach3 and this is a bit different but sort of the same in a lot of respects. I have produced a PDF schematic showing how things are wired up. This is not the only way to do it, but it is what is working for me so far. This first PDF is only motor control, no limit switches, PWM, etc. As I add components and functions I will produce schematics for them. My intent is to have a schematic for Limit Switches only, Spindle Control only, etc. If I put them all in one big honking PDF file it will be a bit intimidating for someone just getting started building a machine. This stuff is all pretty simple until it is wrapped up in a big ball, then it gets confusing real quick. Here is the PDF file:
.
.
Schematic.pdf
(52.27 KiB) Downloaded 213 times
.
.
This wiring setup will work for pretty much any cnc type machine. Nothing special about it. I show it with 4 motors, X1, X2, Y, Z. There are some things that need to be done to make the X axis motors work correctly with GRBL when it comes to the wiring, I included notes to highlight those areas.

At this point I am not even sure what I am building, LOL!!!! Could be a simple two motor desktop laser engraver, or a small 3 axis machine capable of cutting aluminum. Beats me! I will figure that out in the next day or so. My guess is that I will most likely end up building them both because doing it this way is really inexpensive.

So far I am liking this GRBL stuff and the Universal G Code Sender. There are some differences from what I am used to, but for the most part, it is working okey dokey. The only thing that strikes me as a bit odd is jogging axis in UGS. But at the cost ($0) I am not gonna starting whinging.
"If you see a good fight, get in it." Dr. Vernon Johns

BillK
Vectric Wizard
Posts: 594
Joined: Wed Mar 27, 2013 4:16 pm
Model of CNC Machine: CNC Shark Pro Plus
Contact:

Re: Arduino, GRBL, Experiences So Far

Post by BillK »

Thanks Ted for doing this. Highly interested in this and I’m watching some other videos on it also. Good to learn if the control box on my machine goes out. Also, I got a bunch of used but clean Bosch Aluminum 45x45’s most are 2 and 3 feet long, and I think I can build a pretty sturdy CNC from that. It’s hard to believe these are real for $12, but I’m a believer. Keep up the good work!
BillK
https://www.facebook.com/CarvingsByKurtz

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Arduino, GRBL, Experiences So Far

Post by TReischl »

BillK wrote:
Wed Mar 03, 2021 6:48 pm
..... It’s hard to believe these are real for $12, but I’m a believer......
Been thinking about that. I don't think that the folks building cnc machines are necessarily ripping anyone off (well, actually I do think a select few are). These days a lot of the cost of anything has to do with labor. This electronic stuff is assembled, soldered, and packaged by automated machines. There is really not much money in it. Paying a person to assemble all the parts into a control box, then wire it up on a machine frame gets expensive real fast.

Been figuring this out for a while. If I go to McD's and grab up two sausage and egg mcmuffins and a large diet coke the total is $8.52 including tax. If I make myself scrambled eggs at home (3 eggs, not two) and have two patties of Jimmy Dean sausage and a diet coke the cost is about $1.25. Whoaa!!! They have employees, equipment, a building, managers, a guy to clean the parking lot, who knows what else, they all have to get paid AND turn a profit at the end of the day. The building has to be maintained, etc.

Sooo, buying the pieces of those things and assembling them myself is a huge cost savings. And yup, my costs include my time, but since I am retired ::::shrug:::: what else would I do, go around annoying the neighbors? Telling them old guy stories that begin with "Back then. . . .". LOL.
"If you see a good fight, get in it." Dr. Vernon Johns

Bobtail Farm
Vectric Craftsman
Posts: 283
Joined: Mon Dec 01, 2014 3:53 pm
Model of CNC Machine: Homemade

Arduino, GRBL, Experiences So Far

Post by Bobtail Farm »

thanks for the view of your journey.

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Arduino, GRBL, Experiences So Far

Post by TReischl »

Moving right along. . . . .

The micro switches arrived a few days ago. Here is what I bought:
.
Capture.png
.

They are very small and mounted on a circuit board. If you decided to use something like this it is a good idea to design the machine so it can pass OVER the actuating lever, not plow into it. Save yourself a lot of grief.

It took me a bit to figure out the wiring on these. They are normally closed, so the switches for any one axis need to be connected to each other, not wired in parallel. I have included the schematic:
.
.
Limit Switch Schematic.pdf
(43.99 KiB) Downloaded 142 times
.
Capture.png
.
There are some notes I included on the schematic. I am very used to using Mach3, there are some differences to note. I have not found a way to set up GRBL to allow the axis to be squared on a gantry style machine using the limit switches. I used to do that a long time ago on my machine. It was a PITA actually. Finicky, fussy, fidgety adjusting the location of the switches. Finally figured out it was much easier to set an adjustable hard stop on each side and call it a day. Turn the power off, manually pull the gantry against the stops, power up, and move off the stops. A guy on the YouTube called CNCNutz does it the same way. Which I would have seen that video sooner rather than later.

Also different is that I have not found a way to home one axis at a time using GRBL. Not sure that is real important, but it seems to me there have been times I only wanted to home the Z axis for some reason. Maybe getting too aggressive on a plunge and losing steps?

Some of this might be doable depending on what flavor of GRBL and which Arduino board is used. There is a five axis version of GRBL that runs on a Mega 2560 which may allow some of the things I mentioned. But at this point I am not going to change horses in mid stream.

Overall I am still pleased with this GRBL stuff. The Universal G Code Sender is ok. I have had a few times where it just locked up and I had to restart it. Not running a program, but while I was fiddling with wiring, etc. So that could be the cause. I sure as heck am no expert with this stuff so it could very easily be the way I am working with it.

Pretty sure I have decided on what type of machine I am going to build. A fixed column moving X and Y axis machine. They take up more space than a gantry but I am building a small machine, a very small machine. My thinking is that a lot of the issues with carving stem from lack of rigidity involving the spindle. By the time the spindle gets hung on the machine it typically has a lot of leverage issues. I watched a video of a DIY machine last evening built for machining aluminum. The machine was doing .25 deep cuts with a .25 dia end mill at about 40 IPM. Was getting a decent finish too. That is a far cry from .010 DOC at 25 IPM chewing away at the aluminum. I am thinking the rigidity of the machine would benefit 3D carving. At least it would take a few of the mechanical variables out of the equation.
"If you see a good fight, get in it." Dr. Vernon Johns

ElevationCreations
Vectric Craftsman
Posts: 180
Joined: Thu May 14, 2015 12:29 am
Model of CNC Machine: AVID PRO-Acorn , Shapeoko SO3 XXL & SO3s
Location: Colorado
Contact:

Re: Arduino, GRBL, Experiences So Far

Post by ElevationCreations »

TReischl wrote:
Sat Mar 06, 2021 9:19 pm
I have not found a way to home one axis at a time using GRBL. Not sure that is real important, but it seems to me there have been times I only wanted to home the Z axis for some reason. Maybe getting too aggressive on a plunge and losing steps?

Some of this might be doable depending on what flavor of GRBL and which Arduino board is used. There is a five axis version of GRBL that runs on a Mega 2560 which may allow some of the things I mentioned. But at this point I am not going to change horses in mid stream.
Ted,
You may want to try a different G-Code Sender. We use Intelli-G-Code by software redefined which has a much easier to use interface. The free version has some restrictions and there is also a paid version with expanded capabilities. You can home the entire machine or just one axis with this G-Code sender and use a 10-key as a jogging pendant.

Regarding the limit switches, we have found that hall sensors are much more reliable and less susceptible to damage and dust, although require a voltage source and magnets for the reference point. If I recall correctly we purchased three boards from Amazon for about $10 which wired easily into the Shapeoko Controller (which is an arduino controller) .

User avatar
Adrian
Vectric Archimage
Posts: 14503
Joined: Thu Nov 23, 2006 2:19 pm
Model of CNC Machine: ShopBot PRS Alpha 96x48
Location: Surrey, UK

Re: Arduino, GRBL, Experiences So Far

Post by Adrian »

Not 100% up on the way these "multi-stage" setups work but have you tried vTransfer that comes with Cut2D/VCarve/Aspire for sending the code?

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Arduino, GRBL, Experiences So Far

Post by TReischl »

I took a look at Intelli G Code. Might be something I try later on. Like the idea of a keypad for jogging so that is a biggie. The rest of it? Drawing stuff and then cutting it? Not so much, but that is only because it is not my "style" of working with a cnc. I would agree that it has a better looking interface, that is for sure. At this point in my travels I have not researched altering the open source code for GRBL. If I get into that later I may just create my own interface (I have a lot of experience doing that in my former life). Recently did that for a power feed mill project using an arduino board and touch screen.

Adrian, this GRBL stuff is pretty much the same as any other control hardware/software. Control board plugs into USB from computer. File is sent via the USB to the board, the board controls the info being sent to the stepper drivers. I do not see much difference in how it works as compared to Mach3. The big difference to me is that it is not as mysterious as Mach3. Right now I go from computer via USB to SmoothStepper, then to the Gecko G540.

There is one thing that is interesting that I will eventually get around to. A tablet running Windows or a Raspberry Pi can be connected effectively creating a stand alone control for the machine.

After getting the switches wired up yesterday I loaded a 3D carving file and ran it through it's paces. Everything worked as it should. Like everyone else I had the little pieces of tape on the steppers so I could see what they were doing and things looked correct.

About the Hall Effect switches, yup, I am aware of them. Also switches based on breaking a light beam. This is exactly what I like about this whole arduino/grbl thing. If later on I want to swap them out I will know exactly what I need to do.

This all started out because I was getting really curious about this arduino stuff. It all seems downright inexpensive, and so far it has been. It has been a fun learning experience. I am under no pressure to get this going since I already have a machine I built over 10 years ago (basically an Avid) that runs really well. It actually started after I bought a 3D printer for a couple of hundred bucks. There it was, a full 3 axis machine, how could that be I asked myself. The answer is becoming obvious.

Here is something to think about: For about $20 I can have a backup controller ready to go in case something happens to the arduino. If I implement the Windows Tablet idea then for about another $100 I can have a complete control backup. That is incredible to me. If the Gecko G540 goes out on my current machine it would cost $260, the SmoothStepper $160. PC dies? Another $150.
"If you see a good fight, get in it." Dr. Vernon Johns

User avatar
Adrian
Vectric Archimage
Posts: 14503
Joined: Thu Nov 23, 2006 2:19 pm
Model of CNC Machine: ShopBot PRS Alpha 96x48
Location: Surrey, UK

Re: Arduino, GRBL, Experiences So Far

Post by Adrian »

Guess it must just be the way that people describe it working then. They always talk about sending the code via one program and then running it with another. Confused about what vTransfer is for now then though. Oh well, I'll almost certainly never go down this particular avenue as it's a business not a hobby for me and I just need it to work with minimal faff.

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Arduino, GRBL, Experiences So Far

Post by TReischl »

Adrian wrote:
Sun Mar 07, 2021 2:54 pm
Guess it must just be the way that people describe it working then. They always talk about sending the code via one program and then running it with another. Confused about what vTransfer is for now then though. Oh well, I'll almost certainly never go down this particular avenue as it's a business not a hobby for me and I just need it to work with minimal faff.
That is what had me confused for a long time too, seemed pretty weird. I am thinking that what we were reading was folks who are new to CNC and the terminology gets messed up. Understandable.

VTransfer. . . hmmm, never used it. But I would bet is that it is a small version of a sender program without bells and whistles. Yup, I just did a quick Google search and it says

"VTransfer VTransfer is a small helper application provided by Vectric to simplify the process of sending toolpaths to some Grbl-based controllers. You should run VTransfer on the PC which your CNC machine is connected to via a USB serial connection."

Since I know nothing about it, not sure if it runs within VCarve/Aspire or if it is a stand alone program. . . .

I agree with you, there is a lot of confusion swirling around this GRBL stuff. I suppose that is what I am sorting out as I work along.

Oh, and then there is some misinformation in documentation. A couple of examples:

Pin labeled Reset/Abort is not a reset. It is an E Stop. Throws an alarm and the machine must be reset.

Pin labeled Cycle Start/Resume. Is not a Cycle Start like we think of one. It is a resume button to be used after a Pause has been executed. I fiddled around trying to get a cycle start but no go. All I could get was a resume.

That sort of thing can throw a person for a loop who has been around cnc for a while. I do not know about everyone else, but when I press Cycle Start I expect the machine to start.

I am looking forward to eventually digging into the code. It looks like it would be quite easy to set up a very nice control panel with push buttons to do various things.
"If you see a good fight, get in it." Dr. Vernon Johns

User avatar
TReischl
Vectric Wizard
Posts: 4567
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Arduino, GRBL, Experiences So Far

Post by TReischl »

sheesh.

The PDF of the limit switches above is incorrect. I just took another look and saw that I uploaded my original schematic which was incorrect. Oh, the horror of it all!

The switches do not need 5V supplied to them, that is provided by the pins on the board. So here is the corrected schematic:
.
Capture.png
.
And the PDF:
.
Updated Schematic.pdf
(67.05 KiB) Downloaded 130 times
"If you see a good fight, get in it." Dr. Vernon Johns

Post Reply