DIY CNC mill from mainly salvaged and 3D printed parts

So I have a couple posts in some other threads on this subject, but wanted to move it to it's own thread in the interest of not Hijacking one of the other threads.The other project with posts are the "What did you build today" and the "CNC PCB milling" posts.

So as not to be too repetitive, I will not do a lengthy first post for this repeating what I said in other posts, but I will post some of the pics that I posted in the other threads so people can get a visual as they start to read this.

I will have more to post here later tonight as I am in the process of 3D printing the bearing mounts for the platter. Once I have that done I will probably shoot a short video showing the current workings so far.

@neverdie The software that I am using for designing the whole thing is OpenSCAD. Within OpenSCAD, I found a gear library that seems to work pretty good. Right now the parts are just printed in PLA. When I designed the front and rear frame braces, the plan was to print them with 10% infill just to test them for fit and then print them with either a slightly higher infill or solid plastic. I was surprised to find how sturdy the parts were with just that 10% infill, so I left them at that. If I find any part that isn't sturdy enough, I can re-print it with higher infill, or in ABS or PETG which are a bit stronger.

So last night I tested the limits of my 3D printer bed. I printed a thin platter that I will mainly use as a drill guide for the MDF that I will cut today. I haven't posted anything in a while on this because I was working with a guy from work that has a metal lathe to make me a new Y axis threaded rod/lead screw. Here is a set of side by side pictures showing my OpenSCAD 3D rendering with a picture of the actual setup so far at the same angle.

I will also be working on figuring out a set of X/Z axis uprights today. I have done a little work on an X axis motor assembly the past couple days, but it was mainly playing with some ideas. More on that later.

Are you planning to build any closed-loop feedback into your design? I think the z-axis on my CNC might benefit from it, but I suppose it might require different software to take advantage of it. Perhaps there are other ways of getting the same result though.

@neverdie What kind of closed loop feedback are you referring to? I just have the standard GRBL software on an arduino uno with a CNC shield on top. I haven't looked into everything that the board can do but there are a lot of options that I will have to figure out.

One question I have related to your CNC setup and this shield. Do you have end stop switches on both ends of your X, Y and Z axes? I noticed that there is + and - end stop switch inputs for all 3. My 3D printer only has end stops on one end of each, but maybe a CNC is different.

So I am toying with an idea for the uprights that will hold the X and Z axis. I salvaged these old DLP projector wall mount brackets and got 2 of these parts.
The idea is to have them mounted on the sides of the Y axis frame to hold the X and Z axis vertically. I guess my main issue that's leaning me away from using them is that they are quite heavy. If I do use them, I will have to design some sort of bracket that would mount them to the Y axis frame. One nice thing is that they have some holes pre-drilled at a few different levels that might help in mounting the cross rails for the X axis.

@dbemowsk Looks promising. The Trinus 3D printer (http://www.trinus3d.com/) went all steel on everything, and maker's muse attributed that as the reason why it could print in such fine detail.

As to the closed-loop versus open-loop feedback, I had written about that in the CNC PCB milling thread, but @andrew didn't think it was needed, so it probably isn't. But anyway, if you look inside, say, modern inkjet printers, they don't even use stepper motors anymore for head positioning in the x-axis. Instead, they rely on a kind of quadrature linear tape that it reads to position the head very precisely. Well, why? In the past, they used to use stepper motors for that. Is it purely a manufacturing cost saving, or did they need to go that route to get more precise control as DPI's increased?

So, since you're salvaging parts anyway, you could extract such linear positioning tapes from used inkjet printers (which are practically free, because people upgrade and throw out their old equipment because it's so cheap now). Just a thought....

@neverdie I get what you are going for now with the closed loop feedback. The problem in it is that I plan to use the standard GRBL firmware to run this, and if I were to go with that approach, I would probably have to modify the GRBL firmware to accommodate that as I don't think it is something native to it. If I am wrong on that, please correct me. Along with that, I don't know if I would have to make modifications to the CNC shield to do it, or if I could tone out some available pins to use for that. I don't know how encoders like that would work with steppers anyway. When steppers move one position, that equates to a certain distance based on it's direct drive, or as in my case the gear ratio. The fine encoder discs or strips used in ink jet printers may be able to be matched to the steps of the stepper, but if one step of the motor matched to a half step position on the encoder, that could throw things off slightly. I think the encoders would only be needed if the steppers were prone to missing steps, which if they are set up correctly, shouldn't. I think the steppers will be accurate enough for this application. Besides, the extra work it would take to salvage the parts and implement them into the design would be more work than I would care to take on at this point.

Just a concern, the MDF plate could/might contains sand particles (manufactures use cheap wood materials), so don't let your expensive endmills cut down to the MDF as this will ware out the sharp endmills

After some further review and thought, I am thinking of just getting a set of 3 motors. I figure that way I have a matched set and I am not fighting things like too slow speed on one axis that is fighting the others when milling a job. This will require some modifications to my current Y axis, but I will only have to modify the bracket on the motor side which won't be hard at all.

Well, haven't posted to my thread in a while so I thought I'd give an update. I am close to having the Z axis complete. Below are some pictures of the spindle assembly as I have it right now.

This is the next part in line to be printed is the Z axis motor mount and X axis carriage. Below is a pic of the design. I have it printing now and there is 11 hours to go in the print. The longest printed part so far.

From what I've read, your GRBL controller would compensate, as it knows the speed of each motor (well, after you tell it, that is).

I figured that, but I was having trouble with a couple of the steppers that I was trying to use. Couldn't seem to get them to run reliably from the GRBL controller. The other part would have been figuring out a drive system for them as they all had geared heads. I would have had to figure out a gearing and mounting system. The motors I got were only $33 US, so basically $11/motor, so not a bad price, and I can direct couple them to the threaded rods making things easier.

So I would call today's part of the build pretty significant. I have the Z axis mostly assembled and did a drive test. Below are some pics of the assembly.

Here is the assembly taking it's first steps. It still needs some adjustment, but from what I am seeing, things should work. The next part of the build is going to be getting the uprights made that will hold the X axis rods and drive assembly. Once that is done, I should be able to do some more solid testing and calibration. CNC Z axis short test – 00:44— Dan Bemowski

As some of you may have noticed, based on the earlier cad drawing, I had to make some adjustments to the large white bracket. The adjustments were there to let the spindle motor pass by the bracket. On the first attempt, the back of the spindle motor was hitting the bracket restricting travel. Also, the lower lip of the spindle motor assembly was hitting the lower part of the bracket. A few tweaks later and this was born.

So, the project is nearing completion. I have an amalgam of colors used in the setup as I was trying to use up some rolls of plastic that I had on hand. I now have a gantry assembly that is held together at the top with some 3D printed T-Slot channel that was part of a failed print. There are 3 pieces strung together with some 10-24 threaded rods run through the center holes.

The bottom is strung together with a custom 3D printed I support that also has a piece of 10-24 threaded rod through it. That too was done in two pieces because I could not fit the whole thing on my print bed.

I am in the process of printing the drill guides to drill the holes in the MDF sides that will hold the smooth rods and the X axis stepper.

Here are the latest pics of the assembly so far.

Once I have the gantry X axis rods in place with the Z axis carriage, I will then be able to do a full test of the electronics. I opted for now to keep the salvaged Y axis motor assembly since I had that working. Once I have everything working, I will post a video.

@dbemowsk MDF? That is chipboard or particle board, no?
I very much doubt you will get sufficient rigidity even were you to glue/screw ribs on those side plates, and as a material it behaves badly with vibrating bolts etc...

@zboblamont I'll see how it goes. It is a big experiment at this point. If it doesn't work out I may be able to have a frame milled pretty cheap. I work for our local school district and I know the shop teachers at our high school that run the large CNC mill that they have. I may be able to have them mill me some parts. I do have all the needed steppers and things, I may just need a frame, worst case.

So the CNC is near ready for testing. I need to solder a connector on to the X axis stepper and I should be able to run some tests. I think the next step is going to be figuring out how to calibrate the GRBL controller.

@neverdie Thanks. I appreciate the tip and the compliment. Are you sure it is revolutions per inch and not steps per inch? The larger black motors I have for the X and Z axes are 400 steps per rev, but I think the Y axis motor is only 200 steps per rev. The Y axis is running on the large geared assembly though, so that should help more with both torque and revolution step count.

There is the talk about the rigidity of it. I am thinking if I run it a bit slower, the rigidity will matter a little bit less, but I'll see once I get it going. The MDF I used is 3/4", and it feels pretty rigid, but only tests will tell. I have my spindle chuck, a set of 7 coletts and some bits on order from amazon. Those should be here tomorrow I am thinking, since everything was prime.

I believe these are the settings that I need to change: https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9
I will be trying to configure things tonight. From the tracking information, I should have my chuck, coletts and the drills tonight, but the V bits won't be here til Monday. I am wondering if there are any test files that I can try to test my calibration? I will try to set up software on my WIndows laptop for now, but may migrate to a laptop running linux for the final setup.

I haven't had a chance to test the accuracy of the machine yet, but I did find a web page that has a VERY useful calculator for figuring out your steps per mm for a lead screw type system.https://www.prusaprinters.org/calculator
Scroll down to the section labeled "Steps per millimeter - leadscrew driven systems". You just enter the parameters of your motor, microstepping, gear ratio (if any) and lead screw type/size. From that it calculates the steps per mm that is needed to configure your X, Y and Z axes for your GRBL controller.

@neverdie Interesting video. It appears that I may have to get myself a dial indicator tool. Looks as if it will prove very useful. Using that calculator page that I found can at least get me to a starting point, and I can adjust from there.

So I am trying to get my spindle control set up and I am having an issue. I am checking with a volt meter between the spindle enable (SpnEn) and ground and I am reading 5v. No matter what spindle commands I am sending (M03, M04 or M05) I am always reading 5v. Is there a different command for spindle enable? If I check the spindle direction pin (SpnDir), I read 5v when I send M03, and 0v when I send M04. So that appears to be working.

@dbemowsk
On my board,
M3 SP1000
spins the spindle at maximum speed. Just M3 by itself doesn't.
It's not obvious from looking at your board where the spindle OUT voltage is. Maybe on the opposite side? I guess you'll have to probe around to find it.

@neverdie The SpnEn and SpnDir are control signals. For this board you need to have an external motor driver. After some looking, I may have found my answer. I am running GRBL 1.1. It appears that they swapped 2 of the pins. Pin 12 used to be the spindle enable pin in GRBL 0.9. In 1.1, they swapped 11 and 12 because pin 12 cannot be used for PWM which is how the controller limits the speed. I have not tried it yet, but I am going to try the Z+ pin which is pin 11. If that works, I may do a slight board mod.
Here is the post that explains it. https://github.com/grbl/grbl/issues/1187

@neverdie I have always said, at least for 3D printers, that RAMPS was the way to go if you had to change your main board. Many of these 3D printer main boards have everything integrated into them. With RAMPS, it is all modular. If something dies, you are replacing 1 part rather than an entire board.

@dbemowsk Short of making a very careful study of the datasheets, the other info that's available is awfully sketchy, so I ordered one of each module, and I'll see if I can get either one to work on the RAMPS board that I ordered. I'm not completely sure, but I get the impression that after they are properly configured, they can maybe just plug and play.

So, here is the latest update with pictures. I have the whole setup mounted on a leftover piece of MDF. I am using an ATX computer power supply to run everything. The fan pulls air from the back of the setup and blows it over the heatsinks for all of the modules.

For spindle control I have 3 different modules. The first is a buck converter to boost the 12 volts to 24 for running the spindle motor.

Next I have a dual H-Bridge that I had in my parts bin. I am only using one side of it. This handles the motor direction and speed. One problem with it that I had to overcome was that it had separate logic inputs for forward and reverse. The problem was that the CNC shield had a single output for spindle direction. To overcome this, I made a simple not gate circuit using an NPN switching transistor which sends a normal logic level to one input pin and an inverted signal to the other. I then use the enable line to start and stop the spindle. This setup works well.
This is the entire spindle drive circuity.

I like the idea of recycling an old PC power supply with a boost converter. For instance, a lot of the 48v power supplies don't come with regular 110VAC plugs, and you're even left with semi-exposed 110VAC wiring, so this kinda works around that. It's a bit ungainly, but it works.

The only problem is you probably can't get to more than 240w, as that would be 20amps at 12v to the input of the boost converter. Actually less than 240w because of conversion inefficiency. At best probably just 0.85*240=204w. Maybe it would be good enough for milling PCBs though.

So I am trying to test the new machine and am having some trouble. I am running into an issue with some gcode I am testing. The gcode was generated from inkscape and I am including the gcode below. The way I am testing this is just using a terminal connection to the CNC and pasting the gcode into the terminal window. If there is a better way to test this let me know.

When I paste in the gcode below, the CNC runs through part of it and then stops. If I then hit enter in the terminal window I get this:

error: Invalid gcode ID:35

From my research on this error I found this:
A G2 or G3 arc, traced with the offset definition, is missing the IJK offset word in the selected plane to trace the arc.

After testing in chunks, I have found the line that appears to be causing the error.
This will cause the error:

If I run it just to the line that ends in J0.000000, I don't get the error. From all the testing I am doing, it almost seems like a problem with the version og GRBL that I am running. If anyone can help, it would be greatly appreciated.

So I did a test run of an old style font carving my house number into a piece of wood. I created the gcode using Inkscape which is a popular vector graphics program. For a test run I think it went fairly well.

@neverdie I don't think it's runout. If you look, a lot of the video is shaky. I think it is vibration from the V bit cutting into the wood. The tip of that bit may be bent a little which would cause vibration like that. I guess I'l find out when I try cutting a PCB. When I do one, I'll change to a new bit. I ordered a pack of 10. I have to see if I have any copper clad laying around.

@dbemowsk As it turns out, I too will have to make something similar to:
in order to install my new brushless motor on the z-axis. What parts should I order to go inside the plastic? I mean, obviously two ball bearing something's and some kind of threaded nut or something. I'm just not sure exactly which something's I should get, if you know what I mean. Did you buy your something's, or were they junk-drawer parts that you had laying around?

The z-axis that came with the 2418 is just a unit that came pre-assembled. I'm not even sure how I will take it apart. I suppose I could maybe extract the parts that are in it and re-use them, but they're melted into the plastic, so if I do that, I'm burning my bridges back to the system as it currently is. It does work, so I'm reluctant to wreck it.

@neverdie I wouldn't advise tearing apart your old one. As you mentioned, you could at least fall back to that if it came down to it. I am assuming that you are getting a different spindle motor?

To make that part I just used 3D printed linear bearings that the smooth rods slide into. For the threaded rod/lead screw, I used a threaded rod coupler nut like this one:
I just hollowed out the hex shape inside the plastic so that when it is tightened on it holds it snug. I designed the part in OpenSCAD. Because I was designing the part myself, I had free reign on the design.

So, I was doing some reading on how to use auto-leveling with GRBL and the CNC shield that I have. What I read was that for GRBL on an arduino, the probe needed to be connected to analog pin 5 and ground. For the shield that I have, this is the arduino pinout that I found on it:
Turns out that A5 is not connected on my shield and is labeled (not used/reserved). Luckily, in my parts bin I had a couple arduino uno prototyping boards. So I made a board that stacks in between the CNC shield and the uno. Here is the board with the probe attached:
The probe wires are made from an old dupont header cable that was salvaged out of an old PC. I figured that fit right in with the theme of the project.

And here is the stack.
I did a test and the probe seems to work. Tomorrow I will probably do a test mill of a small pcb to see how that works out.

For a junk parts build, I am pretty happy with the way it is turning out.

Just a note to everyone. These style couplers are NOT good for the X axis, or Z axis if the motor is vertical and facing down.
The problem is that the spiral part is actually quite springy. When say the X axis motor spins to pull the X axis to one side, the springy part seems to really stretch. Pushing the X axis works fine. Since my Z axis motor is mounted on top with the weight of the axis being downward, this will cause the coupler to stretch even more. My 3D printer uses these on it's Z axis which works fine because the motors face up with the pressure of the Z axis down on the couplers.

The only thing about the ones that I got that I liked was the way that it clamps to the shaft. I think the clamping action is better because you get more surface area grabbing the shaft.

Something like this may be the best because it is solid and there is no stretching. It also has the clamping action.

@dbemowsk they should work if used as intended. These couplings are supposed to be stiff in only one direction of freedom: Rotation of the axis (=transfer the torque of the motor to the axis). The other 5 degrees of freedom should be of low stiffness to absorb misalignment between motor and axis. So the correct type of bearings should actually constrain the axis to only rotate in one DoF and not translate into the coupling.