YooCNC: Difference between revisions

From Nottinghack Wiki
Jump to navigation Jump to search
mNo edit summary
Added a big heap of information on software
Line 29: Line 29:


http://www.ebay.co.uk/itm/Full-58-Piece-not-52-Clamping-Kit-8mm-table-slot-/370559078721?pt=LH_DefaultDomain_3&hash=item56470ad141#ht_1333wt_1144
http://www.ebay.co.uk/itm/Full-58-Piece-not-52-Clamping-Kit-8mm-table-slot-/370559078721?pt=LH_DefaultDomain_3&hash=item56470ad141#ht_1333wt_1144
==Useful Software and Workflow:==
This section has links to a load of free software that can be used to draw things and send them to the CNC machine. Also, tips and quirks I've found to do with it.
Mostly, things like the CNC and laser cutter work with DXF files. Utilities like DXF2GCode and NewlyDraw may not work well with blocks (entities in a DXF file that act as a single object, but are made of several). To be safe, explode all blocks down to their most constituent basic entities.
G-code is what the CNC software on the PC under the Yoo CNC uses to command the machine.
* G-code:
Reference:
Very good reference with animations here: http://www.cncezpro.com/gcodes.cfm
This Wikipedia page lists many more commands: http://en.wikipedia.org/wiki/G-code
To get the CNC working with your CAD drawing, you'll need to convert it to G-code. G-code at first appears to be a byzantine and possibly niche assortment of numerical codes, but it's actually an industry standard for computer control of machines and goes back to the 1950s. It's not so complex, especially for basic shapes, there are just a lot of different commands to remember. As well as the references above, I've found it useful to draw things, run the DXFs through DXF2GCode, and then look at the resulting code in a text editor to learn about it.
G-code is a way of instructing a machine to make very precise movements, and contains more than just the lines and coordinates of your CAD drawing. It can also contain information on tool positioning, machine functions such as speed and cooling, the exact path tools will follow while cutting your parts, and how many passes they'll make at what depth. There's a bit more detail on G-code in the section below on DXF2Gcode.
* DraftSight:
http://www.3ds.com/products/draftsight/free-cad-software
DraftSight is a free, lightweight CAD drawing program by the makers of SolidWorks. Not open source, but free and works on multiple OSes. There's a getting started guide here: http://www.3ds.com/fileadmin/PRODUCTS/DRAFT_SIGHT/PDF/GETTING-STARTED-GUIDE.pdf
David Hayward is putting together a workshop that will cover:
(Setting up work area)
(Drawing basic shapes)
(Positioning things precisely - grid snapping, entity snapping)
(Patterns and symmetry)
(Saving files: Export for laser, export for CNC).
Draftsight only does 2D drawing, and cannot export directly to G-code. It can save as DXF, which can then be converted.
* HeeksCAD
It was started by Dan Heeks. His blog is:
http://heekscnc.blogspot.com/2009/05/heekscad-ubuntu-installation.html
The project homepage is:
http://heeks.net/
The software is available from github:
https://github.com/Heeks
But it used to be on a google code thing and this has other links:
http://code.google.com/p/heekscnc/
HeeksCAD can apparently export directly to G-code, which makes the Python script below unnecessary.
* DXF2GCode:
http://code.google.com/p/dxf2gcode/
Download the beta from May 2010. *NOT* version 01, as this has a critical bug with tool correction that doesn't seem to be mentioned anywhere else. There's an executable of b01 for Windows, and the source python script to run in OS X or Linux.
You'll need to feed it DXF files, of which there are a lot of revised standards. DXF2GCode works best with R2010 ASCII Drawing DXF files, other types tend to import as blank.
Important:
When you export your CAD drawing to DXF to be made into GCode, give enough clearance between the coordinates 0,0 and your first cut to allow for the width of the tool you'll be using. See more in tool correction, below.
Cut order:
Cut order seems to correspond to the order in which components are drawn in your CAD program. If theres are lines you absolutely need to be cut last, for instance the edges of plates that are going to have holes made in them by the machine too, then select them, copy them, delete the originals, and paste new ones into place before saving the DXF.
Tool correction:
Tool correction is set with Tool Diameter and Start Radius. By default, the CNC will treat each line in your drawing as the centre of the cut. Obviously, you're not using a cutter of zero-width, so that would be useless for making precise parts.
One way to compensate would be to redraw your DXF, painstakingly tweaking, scaling and repositioning everything to allow for the width of tool you'll be using. That though would be laborious, and each drawing you made would be useless for cutting with other tools.
GCode allows you to simply set the tool width and define whether or not the machine cuts to the right or left of the line.
In DXF to GCode, set the tool diameter in mm at the top left of the settings pane, then right click (Windows) or middle click (OS X) on the lines you want to set the tool compensation for. Select "Set Cutter Correction", then pick the corresponding GCode:
G40 - Acts as a cancel command for G41 or G42. No correction, the centre of the tool will travel down the centre of the line.
G41 - Left of the line.
G42 - Right of the line.
To visualise what G41 and G42 do, imagine you're driving a car around a giant version of your drawing. Left and right correspond to left and right relative to the cutter direction of travel, not the work area or your CAD drawing.
Each shape, when selected, will highlight red and show arrows indicating cutter direction of travel (Blue: start of cut, green: end of cut), tool compensation (If any, blue arrow tangential to the cut line).
Start radius:
Will influence the run in that the tool takes for the cut, shown on the mark by a curved blue line curling into the cut.
If you want to do passes of multiple depths for different lines, this may require multiple G-code files. You can use the same DXF file to export separate G-code files for each depth.
(If you learn to edit G-code or use a more advanced CAM program, you can put all of this in one file).
Start at X [mm]:
Start at Y [mm]:
These set the start point for the tool. LinuxCAD does not like minus values, so I advise leaving them at 0,0 and planning accordingly in your CAD drawing.
Z retraction area:
This is the height the machine will raise the bit by to move between cuts. Make sure it's higher than your final cutting depth!
Z safety margin:
Not sure. Looking through the code it generates, it seems to be an extra height step that it holds the tool at before dropping along Z to make cuts. For instance, in this example of cutting a circle, with Z retraction set to 5mm, Z saftey margin set to 3mm, and the first pass set for -0.5, it makes this:
G0 Z  5.000
G0 X  11.793 Y  12.500
G0 Z  3.000
F150
G1 Z  -0.500
(F corresponds to G1 feed Z-direction, explained below).
Z infeed depth:
This is the depth the bit will go to for each pass. For the 6040 based CNC machine that Nottingham Hackspace has on loan from Ash, never set it to more than 1mm. 0.5mm is preferable, especially for harder materials like plywood and polycarbonate. The machine is small and spindles easily overstressed; please look after it.
Z mill depth:
This is the total depth your GCode will instruct the CNC machine to mill to. It will achieve this by making multiple passes along the lines, each one at the Z infeed depth you set above.
G1 feed Z-direction:
How fast it will raise and lower the tool on the Z-axis, in mm per minute.
G1 feed XY-direction:
How fast the machine will move the bit to make cuts on the XY axes, in mm per minute. Slow it right down for tougher materials!
Calculating feed rates can be complex, depending on the material, depth of cut, and the type and size of tool you're using. If in doubt, go slow and make shallow passes.
* LinuxCAD:
The PC under the YooCNC is setup with the right build of Ubuntu and shortcuts to LinuxCNC on the desktop. Do not update Ubuntu, doing so will break LinuxCNC.
Keyboard controls for moving the head are arrow keys for XY, and Pg Up/Pg Down to move on the z-axis. Holding shift with those will allow you to make faster moves. The CNC won't move at all without the red power switches on, both on the front of the blue control box, and the toolbar of LinuxCNC. The spindle is controlled entirely by the green switch on the blue control box and the speed dial next to it.
Homing the axes is an important part of setting up for the job. It sets the 0 positions for the X, Y and Z axes. Your G-code works from this point by default, or the offset one you may have defined with DXF2Gcode. As mentioned above, LinuxCNC does not like minus values and won't let you cut if the G-code appears that it might send the tool beyond 0,0 in a negative direction (Sometimes, high values for start radius in DXF2Gcode will cause it to balk too. I find 0.2 seems to work).
Make sure not to rehome the axes between passes. Once homed, the machine can keep using those coordinates even if the head isn't precisely back at 0,0,0 between them. Usually, if you use DXF2Gcode, the machine will stop at 0,0 on XY, plus the z-retraction you set.
Be *VERY* careful to treat the machine gently. Do not cut too deeply, and be aware that if you're cutting into a sheet of wood, it may not be perfectly level. If in doubt, stop the job rather than break the machine.


[[Category:Network]]
[[Category:Network]]
[[Category:Tools and Equipment]]
[[Category:Tools and Equipment]]

Revision as of 01:19, 9 March 2012

We currently have a YooCNC mill on loan.

Appears to be a 6040 CNC, rather generic Chinese Mill, shipped with a few different controller boards/steppers/spindles.


It's setup in the workshop and has a dedicated pc named YooCNC on the network, it's dual boot with XP and Ubuntu/EMC2.

To use the CNC you need to boot into Ubuntu (default choice)

Password is yoocnc6040

Posible that controller board has room for limit switches (net research) even though lacking connector on the back. need to take a look inside. --'RepRap' Matt 18:26, 30 October 2011 (EST)

Need to read the manual and configure EMC2 --'RepRap' Matt

  • Chuck is a ER11 type

Currently fitted with a 1/8" collet

http://www.techniksusa.com/metal/torque_chart.htm

http://www.mycncuk.com/forums/showthread.php/3346-ER11-Collet-size-lying

  • Collet set

http://www.ebay.co.uk/itm/FULL-ER11-SPRING-COLLET-SET-13-PCS-CNC-MILLING-LATHE-TOOL-WORKHOLDING-A02-/110774847042?pt=BI_Tool_Work_Holding&hash=item19cab20642#ht_4460wt_1144

  • Step block clamping kit

http://www.ebay.co.uk/itm/Full-58-Piece-not-52-Clamping-Kit-8mm-table-slot-/370559078721?pt=LH_DefaultDomain_3&hash=item56470ad141#ht_1333wt_1144


Useful Software and Workflow:

This section has links to a load of free software that can be used to draw things and send them to the CNC machine. Also, tips and quirks I've found to do with it.

Mostly, things like the CNC and laser cutter work with DXF files. Utilities like DXF2GCode and NewlyDraw may not work well with blocks (entities in a DXF file that act as a single object, but are made of several). To be safe, explode all blocks down to their most constituent basic entities.

G-code is what the CNC software on the PC under the Yoo CNC uses to command the machine.

  • G-code:

Reference: Very good reference with animations here: http://www.cncezpro.com/gcodes.cfm This Wikipedia page lists many more commands: http://en.wikipedia.org/wiki/G-code

To get the CNC working with your CAD drawing, you'll need to convert it to G-code. G-code at first appears to be a byzantine and possibly niche assortment of numerical codes, but it's actually an industry standard for computer control of machines and goes back to the 1950s. It's not so complex, especially for basic shapes, there are just a lot of different commands to remember. As well as the references above, I've found it useful to draw things, run the DXFs through DXF2GCode, and then look at the resulting code in a text editor to learn about it.

G-code is a way of instructing a machine to make very precise movements, and contains more than just the lines and coordinates of your CAD drawing. It can also contain information on tool positioning, machine functions such as speed and cooling, the exact path tools will follow while cutting your parts, and how many passes they'll make at what depth. There's a bit more detail on G-code in the section below on DXF2Gcode.



  • DraftSight:

http://www.3ds.com/products/draftsight/free-cad-software

DraftSight is a free, lightweight CAD drawing program by the makers of SolidWorks. Not open source, but free and works on multiple OSes. There's a getting started guide here: http://www.3ds.com/fileadmin/PRODUCTS/DRAFT_SIGHT/PDF/GETTING-STARTED-GUIDE.pdf

David Hayward is putting together a workshop that will cover: (Setting up work area) (Drawing basic shapes) (Positioning things precisely - grid snapping, entity snapping) (Patterns and symmetry) (Saving files: Export for laser, export for CNC).

Draftsight only does 2D drawing, and cannot export directly to G-code. It can save as DXF, which can then be converted.


  • HeeksCAD

It was started by Dan Heeks. His blog is: http://heekscnc.blogspot.com/2009/05/heekscad-ubuntu-installation.html

The project homepage is: http://heeks.net/

The software is available from github: https://github.com/Heeks But it used to be on a google code thing and this has other links: http://code.google.com/p/heekscnc/

HeeksCAD can apparently export directly to G-code, which makes the Python script below unnecessary.


  • DXF2GCode:

http://code.google.com/p/dxf2gcode/

Download the beta from May 2010. *NOT* version 01, as this has a critical bug with tool correction that doesn't seem to be mentioned anywhere else. There's an executable of b01 for Windows, and the source python script to run in OS X or Linux.

You'll need to feed it DXF files, of which there are a lot of revised standards. DXF2GCode works best with R2010 ASCII Drawing DXF files, other types tend to import as blank.

Important: When you export your CAD drawing to DXF to be made into GCode, give enough clearance between the coordinates 0,0 and your first cut to allow for the width of the tool you'll be using. See more in tool correction, below.


Cut order: Cut order seems to correspond to the order in which components are drawn in your CAD program. If theres are lines you absolutely need to be cut last, for instance the edges of plates that are going to have holes made in them by the machine too, then select them, copy them, delete the originals, and paste new ones into place before saving the DXF.


Tool correction: Tool correction is set with Tool Diameter and Start Radius. By default, the CNC will treat each line in your drawing as the centre of the cut. Obviously, you're not using a cutter of zero-width, so that would be useless for making precise parts.

One way to compensate would be to redraw your DXF, painstakingly tweaking, scaling and repositioning everything to allow for the width of tool you'll be using. That though would be laborious, and each drawing you made would be useless for cutting with other tools.

GCode allows you to simply set the tool width and define whether or not the machine cuts to the right or left of the line.

In DXF to GCode, set the tool diameter in mm at the top left of the settings pane, then right click (Windows) or middle click (OS X) on the lines you want to set the tool compensation for. Select "Set Cutter Correction", then pick the corresponding GCode:

G40 - Acts as a cancel command for G41 or G42. No correction, the centre of the tool will travel down the centre of the line. G41 - Left of the line. G42 - Right of the line.

To visualise what G41 and G42 do, imagine you're driving a car around a giant version of your drawing. Left and right correspond to left and right relative to the cutter direction of travel, not the work area or your CAD drawing.

Each shape, when selected, will highlight red and show arrows indicating cutter direction of travel (Blue: start of cut, green: end of cut), tool compensation (If any, blue arrow tangential to the cut line).

Start radius: Will influence the run in that the tool takes for the cut, shown on the mark by a curved blue line curling into the cut.

If you want to do passes of multiple depths for different lines, this may require multiple G-code files. You can use the same DXF file to export separate G-code files for each depth.

(If you learn to edit G-code or use a more advanced CAM program, you can put all of this in one file).

Start at X [mm]: Start at Y [mm]: These set the start point for the tool. LinuxCAD does not like minus values, so I advise leaving them at 0,0 and planning accordingly in your CAD drawing.


Z retraction area: This is the height the machine will raise the bit by to move between cuts. Make sure it's higher than your final cutting depth!

Z safety margin: Not sure. Looking through the code it generates, it seems to be an extra height step that it holds the tool at before dropping along Z to make cuts. For instance, in this example of cutting a circle, with Z retraction set to 5mm, Z saftey margin set to 3mm, and the first pass set for -0.5, it makes this:

G0 Z 5.000 G0 X 11.793 Y 12.500 G0 Z 3.000 F150 G1 Z -0.500

(F corresponds to G1 feed Z-direction, explained below).

Z infeed depth: This is the depth the bit will go to for each pass. For the 6040 based CNC machine that Nottingham Hackspace has on loan from Ash, never set it to more than 1mm. 0.5mm is preferable, especially for harder materials like plywood and polycarbonate. The machine is small and spindles easily overstressed; please look after it.

Z mill depth: This is the total depth your GCode will instruct the CNC machine to mill to. It will achieve this by making multiple passes along the lines, each one at the Z infeed depth you set above.

G1 feed Z-direction: How fast it will raise and lower the tool on the Z-axis, in mm per minute.

G1 feed XY-direction: How fast the machine will move the bit to make cuts on the XY axes, in mm per minute. Slow it right down for tougher materials!

Calculating feed rates can be complex, depending on the material, depth of cut, and the type and size of tool you're using. If in doubt, go slow and make shallow passes.



  • LinuxCAD:

The PC under the YooCNC is setup with the right build of Ubuntu and shortcuts to LinuxCNC on the desktop. Do not update Ubuntu, doing so will break LinuxCNC.

Keyboard controls for moving the head are arrow keys for XY, and Pg Up/Pg Down to move on the z-axis. Holding shift with those will allow you to make faster moves. The CNC won't move at all without the red power switches on, both on the front of the blue control box, and the toolbar of LinuxCNC. The spindle is controlled entirely by the green switch on the blue control box and the speed dial next to it.

Homing the axes is an important part of setting up for the job. It sets the 0 positions for the X, Y and Z axes. Your G-code works from this point by default, or the offset one you may have defined with DXF2Gcode. As mentioned above, LinuxCNC does not like minus values and won't let you cut if the G-code appears that it might send the tool beyond 0,0 in a negative direction (Sometimes, high values for start radius in DXF2Gcode will cause it to balk too. I find 0.2 seems to work).

Make sure not to rehome the axes between passes. Once homed, the machine can keep using those coordinates even if the head isn't precisely back at 0,0,0 between them. Usually, if you use DXF2Gcode, the machine will stop at 0,0 on XY, plus the z-retraction you set.

Be *VERY* careful to treat the machine gently. Do not cut too deeply, and be aware that if you're cutting into a sheet of wood, it may not be perfectly level. If in doubt, stop the job rather than break the machine.