OSSS-CNC

Embed Size (px)

Citation preview

  • 8/4/2019 OSSS-CNC

    1/8

    Open Source Scientific Software (OSSS) Groupat ResearchGate.net

    Open Source SoftwareReview:

    CNC- From CAD toFAB

    Version: May 1, 2011

    Author and :Charles Warner, Panama

    This group provides a forum to introduce useful Open Source Scientific Software(OSSS) to the community as well as a forum for mutual support and the exchangeof ideas and experiences.

    If you like, join our group athttp://www.researchgate.net/group/Open_Source_Scientific_Software_OSSS/

  • 8/4/2019 OSSS-CNC

    2/8

    Open Source Scientific Software (OSSS) Group at ResearchGate.net

    1 OpenSource CNC- From CAD to FABI first encountered Rapid Prototyping or 3D Printing back in the late 1980's, when Icontracted with a Canadian company that offered the service based on a process thatused a laser to cure specific regions of a soup of liquid plastic. Very impressive, and sowas the price- several thousand dollars to produce a single prototype that, in production,should have cost less than a dollar. Most of the costs were the result of converting the 2Dmechanical drawings (about the only option back in those days, unless you happened towork for a major aerospace or automotive company) to machine code for controlling thelaser.

    Things have come a long way in the past 20 years or so. Commercial Rapid Prototyping

    systems have come down in price to a few ten's to hundreds of thousand dollars, withhobby-level systems appearing in the price range of a couple thousand dollars (or less, ifyou are willing to dig through your scrap pile and build from scratch). CAD has progressedsignificantly, with 3D modeling becoming very common (and affordable). More traditionalmachining equipment (lathes and mills, for example) rely more and more on automaticnumerical control- CNC, in industry parlance. I myself do not consider this a totally goodthing- for me, when I get frustrated or stressed, there is nothing more relaxing thanstepping out to the shop and turning some little trinket out on my lathe (akin to the waysome people use meditation or recreational drugs). Thus, I am not all that concerned withproduction costs of my little trinkets. Although I spend a good deal of time analyzingspeeds and feeds to determine optimum, I generally operate at 10% of the optimum, just

    to prolong the experience...However, one of my dream projects is to build my own RapidPrototyping machine, and for this, numerical control is crucial.

    The process of going from the CAD design to finished product consists of:

    Open Source Software Review:

    CNC- From CAD to FAB

  • 8/4/2019 OSSS-CNC

    3/8

    Open Source Scientific Software (OSSS) Group at ResearchGate.net

    Giving credit where credit is due: the above is a variation on a diagram available from thepyCAM wiki. I have adapted the original to the way I have my system set up, and changedthe focus from PyCAM to G-code, because it is the generation of the machine codelanguage from the original graphical design that is critical (this is what drove the cost of therapid prototyping process back in the 1980's).

    G-code is a colloquial name for the RS-274 machine tool programming language. It is not

    the only language used for machine control, nor is it standard across the industry. TheRS-274 standard was developed by the National Institute of Standards and Technology(NIST) in the 1980's. The simplest g-code program is nothing more than an ASCII text filecontaining a list of movement and coordinate commands. The RS-274 standard doesinclude higher-order features such as arithmetic functions, variables, conditions, loops,and sub-routines. There are other approaches, such as ClassicLadder, that may be ofinterest to others. Our personal interest is primarily in the *.ngc dialog of this language,because that is what EMC2 uses, and RepRap (one of our candidate rapid prototypingsystems) already uses it (as described here).

    On either side of the G-Code center in the above chart, we see multiple paths for getting

    from our design to final product. On the right is another program that originated at NIST,EMC2, which is an Open Source software system for computer control of machinessuch as milling machines, lathes, plasma cutters, cutting machines, robots,... etc. and isdistributed by LinuxCNC.org on a live CD compiled with Ubuntu (they also offer a demoversion that can be run on an existing Linux installation, without full functionality- this demoversion is what we are working with for this study). According to the EMC2 web site, Thesimulator mode is useful for playing with gcode onscreen, but not for measuring jitter ordriving actual machinery. We haven't yet built our machine, so we don't need full

    Open Source Software Review:

    CNC- From CAD to FAB

    http://sourceforge.net/apps/mediawiki/pycam/index.php?title=BigPictureOfProcessinghttp://objects.reprap.org/wiki/EMCRepRaphttp://www.linuxcnc.org/http://sourceforge.net/apps/mediawiki/pycam/index.php?title=BigPictureOfProcessinghttp://objects.reprap.org/wiki/EMCRepRaphttp://www.linuxcnc.org/
  • 8/4/2019 OSSS-CNC

    4/8

    Open Source Scientific Software (OSSS) Group at ResearchGate.net

    capabilities yet. The EMC2 program will ultimately read our g-code and send instructionsto our CNC machine. EMC2 happens to use its own variant (officially titled rs274ngc)based upon the NIST standard.

    To the left of the G-Code island, we see a number of paths to get from design to g-code.We identify two possible interpreters, which are are the two we have explored, but notnecessarily the most appropriate for any given application. Note that the two primarypaths are based on either 2D *.dxf original CAD files, or 3D *.stl files. Our initialexperiments suggest that the 2D path would be most appropriate for engraving and such,although it should be possible to create a 3D object with multiple views. Since our firstexperiment involved a 3D milling exercise, however, we opted to generate our *.stl file inSalome (a personal preference, since we are more familiar with Salome than some of ourother packages). Interestingly, there exists a python script add-on for Blender thatgenerates g-code directly, which greatly simplifies the procedure, but we find Blender,

    because it is such a powerful and universal 3D modeler, is a bit cumbersome for simpletasks. So here is the object we want to mill:

    Which was generated in Salome, exported to a *.stl file, then imaged in Blender (justbecause we can!). Next, we import the *.stl into pyCAM:

    Open Source Software Review:

    CNC- From CAD to FAB

    http://www.salome-platform.org/http://yoyo.ghost.pl/down/mGcodeGenerator.py_101007_1157_0.1.82.ziphttp://www.blender.org/http://pycam.sourceforge.net/http://www.salome-platform.org/http://yoyo.ghost.pl/down/mGcodeGenerator.py_101007_1157_0.1.82.ziphttp://www.blender.org/http://pycam.sourceforge.net/
  • 8/4/2019 OSSS-CNC

    5/8

    Open Source Scientific Software (OSSS) Group at ResearchGate.net

    After playing around a bit with various selections for tooling, processes, and such (allactually very well-documented by the pyCAM developers), we finally come up with a

    successful g-code defining our cut (we could have added additional tool paths to includerough cuts and finish cuts were we really going to make this part). We check the tool pathby clicking on the simulate button. Here's a close-up showing that the tool paths actuallyfollow the contours we are looking for:

    Open Source Software Review:

    CNC- From CAD to FAB

  • 8/4/2019 OSSS-CNC

    6/8

    Open Source Scientific Software (OSSS) Group at ResearchGate.net

    Next, to test the EMC2 simulator, we save the g-code we just generated, and load it intothe EMC2 simulator. Whoops! EMC2 complains that our model exceeds the limits of themachine in the x direction. It just so happens that these limits are set in a *.ini file, plainASCII text which we can edit quite easily. This illustrates the versatility of the software.Although the package comes with various *.ini files for a variety of machines, it is relativelyeasy to modify for any particular piece of equipment. Here is our mill cutting one of thegrooves:

    Open Source Software Review:

    CNC- From CAD to FAB

  • 8/4/2019 OSSS-CNC

    7/8

    Open Source Scientific Software (OSSS) Group at ResearchGate.net

    And here is the finished profile:

    Of course, this exercise does not represent the best way to produce this particular object(for instance, we would drill the hole, rather than mill it, and we would use roughing and

    Open Source Software Review:

    CNC- From CAD to FAB

  • 8/4/2019 OSSS-CNC

    8/8

    Open Source Scientific Software (OSSS) Group at ResearchGate.net

    finishing cuts, not just the semi-finish cut we used here). But, this illustrates the basicprocedure.

    The next experiment is to explore the python script in Blender. We imported the *.stl fileinto Blender (which may not have been the proper way to do it- we lost our dimensionalreference!):

    But we do see the tool path being generated.

    There are still lots of experiments to do, and features to explore, but, hopefully, we havedemonstrated some of the capabilities for CAD programming that are available within theOpenSource community. For those who would like to explore this subject further, here aresome links to get you started:

    http://www.linuxcnc.org/

    http://sourceforge.net/projects/cncsimulator/ (Windows-based simulator)http://www.cnczone.com/

    http://www.cncinformation.com/

    http://christian-kohloeffel.homepage.t-online.de/dxf2gocde.html

    http://pycam.wiki.sourceforge.net/

    http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?GcodeGenerator

    Open Source Software Review:

    CNC- From CAD to FAB

    http://www.linuxcnc.org/http://sourceforge.net/projects/cncsimulator/http://www.cnczone.com/http://www.cncinformation.com/http://christian-kohloeffel.homepage.t-online.de/dxf2gocde.htmlhttp://pycam.wiki.sourceforge.net/http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?GcodeGeneratorhttp://www.linuxcnc.org/http://sourceforge.net/projects/cncsimulator/http://www.cnczone.com/http://www.cncinformation.com/http://christian-kohloeffel.homepage.t-online.de/dxf2gocde.htmlhttp://pycam.wiki.sourceforge.net/http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?GcodeGenerator