Build Your Own CNC! (Part 1) - Hardware

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

This Old Tony is a Youtube machinist/maker, this is the 1st part of a CNC tutorial he's doing. IMO this is a great intro into the hardware side of CNC.

👍︎︎ 7 👤︎︎ u/tekym 📅︎︎ Nov 26 2018 🗫︎ replies

ThisOldTony's videos in general are highly entertaining. But sometimes I wonder if there are people that believe he can chop metal with his hands.

👍︎︎ 6 👤︎︎ u/fischoderaal 📅︎︎ Nov 26 2018 🗫︎ replies

Nice I did a cnc etch sketch several years ago for my nephew

https://youtu.be/cRL00wJtB0M

👍︎︎ 2 👤︎︎ u/Pubcrawler1 📅︎︎ Nov 26 2018 🗫︎ replies
Captions
[Music] instead of trying to do this by hand I wonder if we couldn't contrive I mean control this numerically with a computer [Music] this might sound silly but I'm excited this might actually be a fun project but first things first we need to set the stage here establish some ground rules get everyone some snuff up to snuff yes we're going to try to see and see an etch-a-sketch [Music] that may sound facetious perhaps even flippant but if we're going to tackle the basics it's probably a good enough place to start as any in fact given how Universal the etch-a-sketch experience might be the backlash that this thing is likely to have and sort of the infrastructure we'll need to build to get this to work this may just be an exemplary example not to toot my own horn specifically I'd like to talk about the actual hardware here the build itself start to finish what it takes to get from point A to point B and then of course point C and C which bits do what and why what you'll need how to wire it that sort of thing in order to do that we need a project I suppose we could do something more abstract you could for example wire all this stuff on your kitchen table just for kicks and spin around some tape flags or use it to work up a very specific amount of spaghetti but with any luck a concrete project gives us some better context and one last thing before I shut up shut up scouts honor but this is important there are quite a few ways to do this you certainly don't have to use the parts and software I'm about to demonstrate in fact my way might not be the best way for you on top of that I'm not exactly the captain of the CNC industry I learned this by fighting through it myself if there's a better way to do this or I misspeak bear with me let me know in the comments but bear with me the point of this video is to hopefully demystify some of this stuff and shove you over the edge give you that little nudge you might need to roll up your sleeves and get into some of this yourselves I could give you a whole list of caveats and gotchas right out of the gate but instead we'll talk about details as they come up sound good bottom line if you're a cien specialist I'd love your input but this video might not be for you in fact if you watch it you might even need a pry bar to get your eyes unrolled out of the top of your head in my early days of computer control I didn't have much luck I tried screaming at the computer hitting it with a stick extortion threatening its family none of those worked when it dawned on me that I needed some muscle middlemen liaisons as we like to say if we think we're being bugged and that my friends brings us to this magical device a motor don't worry about what type of motor this is just yet why we pick this one and why it has two more wires than a naturally occurring motor does just know that motors these little wonders of nature take electrical energy and turn it into mechanical motion hope I'm not offending anyone but you put power in the back end and the spinny bit starts turning think of it like Google Translate but for the physical world our rosetta stone the etch-a-sketch talks mechanical the computer talks electrical and this this is our liaison so okay maybe we're starting to get somewhere we have an etch-a-sketch that once it's knobs spun and we have a motor that wants to spin when power is applied now let's just establish some common language so that when we spin the knobs especially when we asked the computer to spin the knobs we're talking the same directions now before that accident in 85 back before the government took away my employees I'd sit my smoking chair over by the lathe fire and barked out commands saying right knob left now up down over and over gets tiring so let's make up our own shorthand our own little secret language this knob here controls the cursor is left-to-right position I don't know if you can see it it's even got a little left right arrow molded into the casework bear with me now I'm making this up as I go along for argument's sake let's call the left-right direction X and the up-down direction we'll call Y now instead of saying left knob right knob we only need to say X and y and for direction we'll use positive and negative positive X means turn the left knob clockwise negative Y means turn the right knob counterclockwise for the etch-a-sketch that covers all our bases we can make four moves plus X minus X plus y and minus y that's it that's all we got I can now give you instructions that say X for y for X minus four Y minus four and if I could have turned those with a robotic precision we should have ended up drawing a square that's four turns wide and four turns tall to recap how little we've covered so far we have our thing we want to control in this case an etch-a-sketch but for you again that might be a lathe a mini mill or a CNC pizza cutter we have something capable of performing the mechanical motion we need again in our case a motor two motors in fact since we have two knobs to turn and of course the computer that will be barking orders a computer need not be anything fancy any old computer will likely do but if you also plan to run CAD and cam software you're playing pac-man on it or watching this old Tony videos you might want something with a little more punch or just the CNC stuff any relatively modern computer will likely do I've seen CNC setups run on hundred dollar tablet PCs we'll talk more about the computer in a minute but for now we have a problem we have a ton of wires and there's really no apparent way to attach these motor wires to the computer and even if we could stuff these wires under these keys somehow with a small screwdriver the computer on its own isn't really designed to supply the power these motors need to turn it can send out signals not hard enough to push the motors to supply the motors with signals that make them happy we need motor drivers since these motors are steppers we need stepper drives if you were using a servo motor you'd need a servo drive if you using bagpipes to drive your cnc router you'd need an air compressor that last one might have been a bit of a stretch but hopefully you get the idea and since I said bagpipes it's time to talk about these stepper motors I'm not going to get into how and why they do what they do that could be an entire video on its own but for our purposes suffice it to say that these don't work like regular electric motors they're special they don't just spin if they did they'd likely rip the knobs right off our etch-a-sketch instead they only turn one step at a time give them a blip in the back end with a computer and they'll move either clockwise or counter clockwise one-step these particular steppers move 1.8 degree for every blip or step you send them I know that because it's written right there on the motor consequently to make this motor do one complete turn or 360 degrees it would need 360 degrees divided by one point eight degrees per step it would need 200 steps or blips in the back end it would need 200 pulses from the computer to move one full turn if we wanted this motor to turn only half a revolution only a hundred and eighty degrees we tell the computer to send a hundred pulses 100 pulses times one point eight degrees per pulse is a hundred and eighty degrees so now what happens if one point eight degrees is too coarse for us if we needed something finer than that say we want our CNC pizza cutter to make super precise cuts or dentin order enough pizza for everyone and need a lot of super thin slices well you could gear it down say we attach this motor to our edges sketch knobs with a two-to-one belt reduction we had a large gear or pulley on the knob and a smaller one on the motor and we use a belt or a chain or gears or whatever now when the motor turns one step one point eight degrees the knob would only turn half of that because of the mechanical reduction the etch-a-sketch knob would only turn 0.9 degrees cool so we can cut our pizza accurately into twice as many slices as before but because of that gear reduction our pizza cutter would now move only half as fast our reduction gives us twice the accuracy in fact it would even give us twice the torque but the trade-off was speed imagine we needed a ten to one boost and accuracy instead of two to one that would be one slow CNC pizza cutter and we now risk angering hungry mob but drives usually have a trick up their sleeve a trick called micro stepping I can do some mathemagical stuff inside that sends combinations of partial pulses down these four wires that can move or stop and hold the stepper motor in unnatural States they can divide the degrees it turns per pulse into less what the native stepper is designed for this particular drive offers it looks like eight microstepping options depending on how you set up switch to switch three and switch four which are over here it's a series of dip switches depending if you set them to zero or one that combination dictates the microstepping so if you set switch to switch 3 and switch for all to zero it would be in half-step mode if you switched to 3 and 4 to 0 1 and 1 it would be in 1/10 microstepping mode which would mean the computer would have to send ten times more pulses to make one complete revolution of the motor instead of 200 steps it would have to send 2,000 steps we'll get into more of what all this junk means when we actually wire this thing but don't let this intimidate you it's pretty straightforward just from their chart I don't really see a way to turn microstepping off which is what I would have liked for this demo but it is called a micro step driver so maybe there isn't a full step option anyway in light of what we said before using micro stepping to increase your accuracy isn't always what it's cracked up to be especially for motors and drives of this caliber better drives of course offer better micro stepping more reliable micro stepping but hopefully you can start to see there's a trade-off or a tuning situation you can get into between your mechanical side how you attach your motors to whatever ear reductions and torque and speed and micro stepping options so there's a tuning loop in here that would technically also need to be accounted for that's outside the scope of this video but if this very basic vanilla CNC intro video works out and we do more of these I'd be happy to share what I think I know about that kind of stuff anyway since we're here let's wire the motors into the drives this stepper motor has 4 wires most of them usually do but it could have more depending which type you buy but here we have a pair for each phase phase a and phase B I'm not exactly sure which ones are which but I'm going to assume red and blue or probably one phase and green and yellow or another you can use a meter but an easy way to test is to short the coils out short wires out so with none of the wires connected the motor should turn maybe short one of the coils out the motor would lock up so I guessed wrong that's still turning blue and yellow that's it it's locked up it won't turn to try red and green yeah I can certainly overpower it but those two wires certainly make up one of the phases if I short out both sets that should be a lot harder to turn yep now it won't budge so there are two phases and they're wired into the stepper drive phase connections a and B pull this connector out and wire blue yellow into one phase and red green into the other phase and don't worry just yet if the wires are in the right places just make all your drives consistent so if you did blue yellow red green in this case on one drive do the same order on the other drives keep them consistent we have some control over this in the software on the computer you may have to come back and swap some wires if the directions are wonky but for now don't worry about it just make them all consistent I'm going to set all of the dip switches the same on both drives by the way so these are set to either 1 or 0 and their switch labels there I'm going to set switch to 3 and 4 all to 0 so we're half-stepping these switches 5 6 & 7 depending how you set those set the drive current now it looks like these drives can do up to 4 amps the motors that I have if you go back and you look at the label or it said 1.8 degree it states that there are 3 amps steppers so you would set switch 5 two one switch 6 to zero and switch 7 to one but again since I'm just turning the knobs on an etch-a-sketch I'm just gonna set this to its minimum half an amp the next step in our little build here would be to wire the control signals the spa and der lines step in Direction signals these would come into the drive from the computer before we do that though let's check quick about the hardware that we've been staring at what you're looking at here is a kit I got from ebay for about $200 it came with three motors these are NEMA 23 s I think that's the frame size of the motor they're good to about four hundred ounce inches in the ballpark of three Newton meters of torque these could be okay for a small router three printer that kind of stuff I mean it really depends on how you design it and what sort of performance you're shooting for it came with the three motors three stepper drivers the things we've just been staring at power supply a control board and I think a chizel remote control I may have just thrown away now for 200 bucks all this stuff doesn't sound all that bad does it though and I hate to be cynical I'm not expecting exceedingly high performance or a very long life with these things for reference my CNC router runs gecko brand stepper drivers this is a g2 10 I think this is an older one I did quickly check their website and it looks like the cheapest standalone drive you can get will set you back about a hundred and ten dollars so three gecko drives one for each axis would be 330 bucks right there as we saw this one with the kit is good to four amps these gecko drives are good to seven they can push a lot more current to larger stepper motors my machine uses these I think these are NEMA 34 s I'm using Sanyo dankey motors but they're this size the terminal block isn't on this it's still attached to the stepper I was using this for my original 4th axis but hopefully you can see the wiring is pretty much the same there's the four wires from the stepper motor then there's direction and step signal this does the current limiting or the current set via resistor there's a little chart here depending which resistor you'd wire and the screw terminals would set the current rating for the drive this also has a disable feature so does this drive we just haven't looked at it yet controller boards are what we'll talk about next again this is the one that came with the kit but I won't be using this one I'll be using a PMD x/4 20/4 this board by itself cost me two hundred and fifty dollars doing some seat of my pants math a decent control board plus three gecko drives would set you back I don't know about six hundred bucks that's not even counting the stepper motors the kit with everything in it cost me 200 hopefully that illustrates that this is very much the case of you get what you pay for if you'd like to just learn get your feet wet or make a very small machine this kit would probably be fine but I wouldn't bank on it lasting very longer giving you completely trouble-free operation one thing to watch out for and why I'm not using the control board in the kit that this won't work with Mach 4 Mach 4 is the software I plan to use on the computer that runs this whole operation this we won't work with any of the free Linux translators either it uses its own proprietary software that came bundled on a weird-looking CD with the kid itself again probably fine to learn with but I wouldn't put much stock in a board like this though to be fair it does look pretty well put together I'll give it that off the cuff it does have two more relays than the PMD X board does but I'm sure it wouldn't take very long staring at the spec sheet to see what the real difference is between these two boards are okay so Control board's not exactly sure where to start with these as we said they're a pair of step lines this is where the computer sends the step pulses the drive uses to turn the motor and a pair of direction lines which as the name so cleverly implies tells the drive which direction each one of those pulses that are coming in are meant to go clockwise or counter clockwise so if you send just a pulse or a step that alone isn't enough for the drive it needs to know which direction you want that pulse to turn the motor now back in my day of homebrew C&C we're talking ten years ago at least mind you those signals would come straight from the computer through the parallel port anybody remember one of these the old printer style parallel ports the software would map some of these pins to be step indirection signals and you'd have to somehow wire this to that not exceptionally easy to do so you could buy what is called a breakout board something that looked sort of like this this isn't a parallel port breakout board this connector doesn't fit here but it should convey the idea it had a socket you could plug the cable into and screw terminals that broke out each one of those pins that way you could wire your a parallel port to your drive that's what these control boards also do they're also breakout boards however instead of using the parallel port these happen to be USB USB connection here and USB connection here on my router I use an Ethernet smooth stepper it's more or less the same thing except it sends the control signals over Ethernet instead of USB or parallel port an Ethernet smooth stepper as of this video would set you back about 180 bucks it's actually less expensive than the PMD X board but notice that the smooth stepper doesn't have screw terminals or relays or anything like that it requires additional hardware again there are a dozen ways to do this in fact if you're a masochist you could do this with Arduinos and gerbils and all that kind of stuff back when the parallel port was all the rave the operating system of the PC itself was the real-time controller it sent the signals to the pins and the drives push that to the steppers and the steppers did their thing the problem with that is the real-time part now real CNC machines professional machining centers have dedicated hardware I mean I think they do anyway but they did the PC with the software was acting as an emulator so if your operating system even so much as blinked well it could interrupt control you couldn't play pac-man or watch this old Tony if you get an instant message from your mom pop up or a system update that could stall your G code I mean think of it like GPS if GPS instructions for some reason got laggy and weren't real-time and told you to turn a mile before or a mile after your exit it could cause some problems now although these are breakout boards they're primarily pulse engines they take all that real-time heavy lifting off of the operating system and do it themselves these generate the pulses timing and switching on their own getting only their instructions from the PC and storing that in some sort of buffer or something run their own clock that runs your steppers or your servo motors so with these why your CNC is doing its thing you can play games watch this old Tony or wish your mom a Happy Thanksgiving if you decide to buy one just make sure it supports whatever G code translator you intend to run I plan to use mock for hobby for this demo this PMD export is designed to work with mock four it won't run mock three the smooth stepper will run three and four there are other options you could try some of the free open-source linux-based translators they are a lot cheaper of course but you need a PC running Linux and frankly that's just a lifestyle change I'm not ready for we'll certainly talk about the software more in depth later but I just thought I should mention that now no reason to be alarmed deep breaths now other than a few more wires this is still the same setup we've been looking at so far let me walk you through it I have attached most of the components to a piece of MDF the components that I could attach the motors or just sitting there this is how the pros do it if you're a hobbyist you could build all this stuff into a nice enclosure with fans and switches and lights I've got the two drives wired in with their respective motors this will control the X knob and this will control the Y knob I put some tape on there with some labels just to keep track to them once they start moving now if you had a z-axis like on a mill the raise and lower the head you'd have another set of these XY and Z and of course they're still wired as before if you can follow these wire bumbles it's still the four motor wires going to phase a and phase B on their respective drives well we're here I also wired power to each Drive that's this purple and green line here in this case it's 36 volts DC a pair to each drive but that depends on the drive that you use this kit already came with the appropriate power supply and speaking of which I've wired all the power through a terminal block this was an attempt to keep things neat but by the looks of it it's not working out for me there's line power coming in from the wall it's split into two sets in the back there one goes off screen to the power supply and the other set go to the control board coming back from that power supply we have the 36 volts DC and that's one set green and purple going to the x-axis drive in another set green and purple going to a y-axis drive and this is that line voltage coming into the control boards this set of wires sneaks under the board it's up on some standoffs and provides power this thing is currently disconnected powered down but be careful around that you can get DC versions of these or DC versions of Control board's in general in which case you may need a separate DC power supply anyway it's got power USB is connected to my laptop I've made the step and Direction connections for X&Y this bundle is the X motor goes to the X Drive and this bundle is why this would be Z this would be an A axis or a fourth axis this particular board also controls another motor but I think these might be slaved together like if you had a really big router with say two motors driving the long axis or two lead screws this would drive them in sync in addition I'm taking five volts off of one of the board outputs these just serve to enable the drives we'll look at that in a second so for this particular board just to recap all those terminals are X Drive Y Z fourth axis and then I think synchronized fourth axis and there's a series of outputs you could use that to turn on spindles or ring the doorbell at your front door to prank the dog start coolant pumps flash warning lights that sort of stuff the second to the last block and I haven't done my homework here I'm just reading the silkscreen on the board those five terminals read encoder I guess this thing can also accommodate feedback and the very last block is an emergency stop the emergency stop terminals have sort of this Spade connector wired into it from the factory I received it this way it's shorting those first two screw terminals if those two terminals aren't closed aren't connected the board won't run the software won't run the drives won't run it should have one or more of those gigantic red panic buttons wired to it so if something goes wrong you could slam it and everything comes to a dead stop those should all be wired normally closed it's a fail-safe so if one of your wires comes loose or something breaks in your East op system the board would Fault out and everything would stop if it were wired normally open and you did have a broken wire when you slam that e-stop button that signal would never get to the board these other two terminal blocks on the back are the inputs to the board so this is where you'd put things like limit switches I don't know temperature and humidity sensors depends what you're building usually limit switches go there this board also provides two additional headers there's one there at the front closest to the camera and one just sort of looking past what I think is some kind of regulation circuitry converting the line voltage to DC to run the board you can buy additional cards for those slots that do things like spindle control you know control your spindle speed right from the software you could also plug in additional breakout boards there to get more inputs and outputs so if you'd like a CNC machine with one of those Star Trek style control consoles with the lay-z-boy and the blinking lights you could wire separate panels like that into those headers but anyway we were last talking about this step in Direction signals if you read the silkscreen J 7 and j 8 that's motor 0 and motor 1 in our case that's x and y each one of those terminals has three connections common step and direction so I'm using brown for common and on x-axis for example I'm using white first step and pink for direction back at the drive in this case for the X motor you can see how I've got this step indirection wired in there I've got the comm line split the brown wire is going to step positive and Direction positive and then the direction signal and the step signal to the negatives that took a little bit of reading a little bit of figuring out I'd never use these drives before but if you buy one you take a look at this wiring this seems to be working so far the other two wires this blue and this black is the 5 volts I mentioned earlier that I took off the output side of the control board that is to enable the drive this drive won't do anything at all unless it's seeing five volts in those enable lines and that's really it that's the bare bones basic setup really this honestly isn't all that hard to do follow the instructions for your particular hardware that's easier to do if you buy sort of the good stuff the manuals in the support community for both the PMD X and the warp nine smooth stepper Control board's absolutely amazing the manuals for these drives and the board it came with I didn't really look at it too long but you can maybe use your imagination if you do use the kit it seems pretty straightforward there are some extra terminals the labels match so it's just wired a wire so there is that my computer is running the installation for this board was dead simple the setup files are already available on their website I just ran the installer and it pretty much did everything for me its power this up and move the motors Mach 4 hobby is configured enabled and in control of the hardware there are keyboard keys mapped to the axes by default up and down arrow is why and left and right arrow would be X but I lost these in a tragic childhood accident and have remapped them to I don't know what that is page up and page down now that we've established electronic or computer dominance over the physical world you can really control whatever any way you like add some kind of a SIM card receiver and I don't know feed your cats with a phone call next step is to somehow get these motors attached to the edge all right all right fine I can't keep this charade up any longer everything is mounted and wired just not right lying to you folks I'd love nothing more but to get into it with you but this video has gotten way too long and the next steps involved the software configuration and calibration what we've done here is really only half the story probably a third of the story and the software is what we'll get into in the next video so I think that's it for now if anyone has any questions about what we did or didn't do let me know down in the comments and I'll do my best to answer those in part two unless you're going to ask about using that third motor to invert this thing shake it to erase the etch-a-sketch in the back of my head I had planned to do that use it they just rotate this entire assembly up and down a few times but it turns out you really got a shake the heck out of this thing to erase it anyway until next time thanks for watching [Music] you
Info
Channel: This Old Tony
Views: 1,076,313
Rating: undefined out of 5
Keywords: DIY CNC, cnc build, etchasketch, etch a sketch, etch-a-sketch, stepper, motor, driver, smoothstepper, PMDX, Mach4, Mach3, Mach, wiring
Id: K0XfRPi_h2M
Channel Id: undefined
Length: 27min 46sec (1666 seconds)
Published: Sat Nov 24 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.