Threaded View
-
31-08-2014 #17
A few quick words of background so you know where I'm coming from, and how much or little to trust anything I say...
I built my first CNC router a couple of years ago. It's essentially the JGRO design - comes from the US, built of MDF, uses cheap threaded rod as leadscrews. And those are the good points! It's bendy, not very accurate (i.e. difficult to set up accurately), distorts when it gets warm/cold/dry/moist/there's an R in the month, etc. But, the materials to build it were cheap, I cut my own Delrin anti-backlash nuts, made my own flexible couplers, etc, all in the name of keeping costs down as I didn't know if I was going to have much use for it after one specific job for which I built it (and which was a success). However, I struck lucky in one area and bought decent steppers, drivers, and power supply on the grounds that I had a sneaking suspicion that I would replace it with something better and these would be reusable. I have a background in electronics, mechanical engineering, and software. A useful combination, so playing with CNC stuff is up my street. I had already built a 3D printer, but I have no experience of CNC in any kind of commercial context.
If you don't mind, I'll try to walk you through the process of going from a design idea in your head to CNC cutting it without using your analogies and see how it goes.
You want to cut a rectangle of MDF, say, which is 25mm by 50mm. Start with a CAD drawing package. Draw a 25mm x 50mm rectangle, with the bottom LH corner at (0,0). That location is not essential but it's a common choice and if you are consistent about this kind of thing, it can help avoid mistakes. Save the drawing in .dxf format, which is probably the most common format for CAD drawings around. So, that's the design done and stored. Now to generate a toolpath. You are going to cut this with a 6mm diameter cutter, so the toolpath is going to be a rectangle with its bottom LH corner at (-3,-3), and 31x56mm along the sides. Draw this on a piece of paper and you will see where these dimensions come from. However, you don't need to do the arithmetic as the next piece of software, the CAM package, will do that for you. I use VCarve or Cut3D from Vectric but there are plenty of other options, some of them free. Start the CAM software, and load the dxf file from earlier. Somewhere in the software you will be able to specify the tool diameter that you want to use, so the software knows how far outside the line to generate the toolpath, how fast you want to cut, etc. I'm skipping a bit of detail about how this is done, but I want to concentrate on the principles and not get bogged down in what is often software-specific detail. So, the CAM software calculates the toolpath, essentially a list of coordinates to move to. Something like, "raise the cutter above the work, move to (-3,-3), lower to cutting depth, move to (28,-3) at a speed of 5000mm/min, move to (28,53), ..." Again, there's a little bit more to it, but that's the core element. This toolpath will be written as gcode which is a largely machine-independent language which works in real-world coordinates like these. However, every machine has a slightly different dialect of gcode, so CAM software includes a post-processor which takes the basic toolpath and creates a machine-specific output file. Somewhere in the CAM package there will be an option to choose which machine is the target. For us, the usual options are Mach3 or LinuxCNC. The rest are generally intended for commercial machines with their own controller software. Hit the button, and you will end up with a gcode file which will have the commands to move the tool, plus commands to start the spindle, set the coordinates to metric/imperial, or whatever. You can look at gcode files with a text editor, and even edit them if you are brave enough. Remember, at this point the gcode commands are instructions to move the tool in real-world units (metric or imperial). Now move to the machine, and fire up the machine control software, Mach3 or LinuxCNC, according to choice. [leaves small pause for religious arguments about which is "best"...]. The job of the machine control software is to read the gcode file in mm, say, and turn it into a set of pulses which will eventually drive stepper motors. It does all the clever things needed to synchronise movement in X and Y when you are cutting diagonals, going round curves, etc. What Mach3 needs to know is how many pulses move the tool in X, Y, and Z (may be different for each axis, but it can handle that). For the sake of argument, you have a 10mm pitch ballscrew, so one turn moves the tool 10mm. The stepper motor has 200 steps per rotation, but the driver is configured to use x8 microstepping. That means that it does some clever things with the way it drives the motor so that effectively the motor now has 200x8=1600 steps per rev, so a finer resolution. But one rev of the ballscrew is 10mm, so one step is 10/1600=(something but I can't do the sums in my head) mm. Mach3 and LinuxCNC both have a way to tell the software what all these numbers are for your particular machine. I use LinuxCNC, so I tell it the leadscrew pitch, number of steps per rev of the motor, and the microstepping ratio. Mach3 does it slightly differently, I believe, but the principle is exactly the same. So, the software now knows how many steps are needed to move the tool a given amount. It takes each gcode instruction in turn, looks at how far the tool has to move, calculates the number of steps needed, and for each step it generates an electrical pulse at the parallel port on the appropriate pin. This connects to the input of the driver (probably via a breakout board which is only a glorified junction box at this level of analysis) and the driver acts as a giant amplifier, turning the low voltage pulse at its input into a walloping great pulse of voltage and current at its output, carefully monitoring current to avoid overloading the motor, etc. Remember, each pulse from Mach3 moves the motor by one microstep which moves the tool by 10/1600 mm. The faster the pulses, the faster the tool moves.
And that's kind of where we came in. Whatever the machine capabilities, the CAD and CAM stages will be more or less the same, and the gcode pretty consistent. However, Mach3 or LinuxCNC is where the software and hardware interact, and why the software has to know about the hardware characteristics. Then, if you lie to Mach3 and say that the machine is capable of 2000mm/min movement but you are using underpowered steppers/drivers that can't run at this speed, the steppers won't keep up with the pulses being sent to them, the tool will not be where Mach3 thinks it is, the workpiece will come out the wrong size, and if you're lucky you won't actually break anything. One of the tuning operations when you set up a new machine, or certainly a new design, is to actually test it, and find out just how fast it will go without lost steps or other nastiness. Use underpowered steppers and the machine won't run as fast, although up to a point you can compensate by just using slower cutting speeds. That's what I have to do with my own machine; ideally I wanted to cut some MDF at about 5000mm/min but the fastest I can go without problems is only about 600mm/min. That means that everything takes nearly ten times longer than it should. It's worth trying to get it right...
Oh, and my new machine currently under construction is in steel, welded frame, much heavier and stronger. I've learnt something from the Mk1, anyway.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Ok, so whats wrong?
By Davek0974 in forum 3D Printing MachinesReplies: 32Last Post: 27-03-2014, 12:19 PM -
Looks like the normal first page has gone awry.... or is it my PC?
By WandrinAndy in forum General DiscussionReplies: 22Last Post: 03-10-2012, 08:05 PM -
Whats It Worth
By Jay in forum General DiscussionReplies: 3Last Post: 21-01-2012, 09:08 PM -
whats the matter!
By ptjw7uk in forum General DiscussionReplies: 18Last Post: 29-11-2009, 07:21 PM -
DP of gears, whats it all mean?
By irving2008 in forum Machine DiscussionReplies: 6Last Post: 25-10-2009, 11:34 PM
Bookmarks