View Full Version : ANNOUNCE: pycam - 3D CNC Toolpath Generation
lleroy 08-29-2008, 06:03 AM Hi folks,
I just released a GPL 3D CNC Toolpath Generation program.
You can see some screenshots of it in action at:
http://sourceforge.net/project/screenshots.php?group_id=237831
You can download it from:
http://sourceforge.net/project/showfiles.php?group_id=237831
The GUI is not very sophisticated yet... and the project website is fairly minimal,
but it should be functional...
Please let me know if you are trying it out and what you think...
I'm especially interested in hearing about someone actually using it
to create physical objects...
The first one to do so can put a picture on the project page :-)
-- lode
lezdep 11-11-2008, 01:26 PM I'm trying your application at the moment. Finishing toolpath looked kind of OK.
I've also got Roughing toolpath from second attempt. I'll have to spend
more time testing it (simulation in EMC2). Major issue I have before I could
run generated toolpaths is 0,0,0 position of the tool at the 0,0,0 coordinates
of the machine. That's deep inside my stock :( I will have to modify toolpaths
manually for now for testing, but would love to see a way in your app to
specify start location relative to stock for g-code program.
Side question - would you be willing to work together with other toolpath
developers and myself on attempt to integrate algorithms into one CAM
Application ? I can suggest 2 alternatives - new app based on Open
Cascade Application Framework (reviving cam-occ project) or adding
3 axes support to GCAM. Toolpath algorithms would have to be ported
to C/C++ though.
lezdep 11-11-2008, 11:29 PM I've just tried to run roughing and finishing toolpaths in EMC2's simulation again.
Actually biggest issue, which would prevent me from running them on real CNC
machine, is the way rapid movements are coded. Many rapid moves are done
alongside the stock with tool partially inside stock. That will brake the tool for sure.
I'm not certain if it is related to 0,0,0 start location, but it seems to me that rapid
moves are done towards the middle line of stock, instead of out of the stock to
safe distance above it. Could you check your logic there ?
I've only tried couple of combinations suggested for roughing and finishing like
"Cylindrical cutter with the PushCutter Pathgenerator and the Polygon PostProcessor" and
"Spherical cutter with the DropCutter Pathgenerator and the ZigZag PostProcessor".
For other combinations I saw toolpaths generated with rapid moves right through the
stock :confused: Looks like these rapid movements require lot more work in current version.
lleroy 11-14-2008, 11:39 AM A few bugs have been fixed since the 0.1 release...
It should now be able to generate toolpaths for EMC2
Feedback is welcome...
Dan Falck 11-16-2008, 11:51 AM Hi lleroy,
Thank you for producing this program. I think it this program can fill a gap in the opensource CAM world. I was able to run pycam-0.1.3 successfully (on Ubuntu 8.04). When attempting to run pycam-0.1.4, I get this error message:
~/CAM/pycam-0.1.4$ python pycam.py
Traceback (most recent call last):
File "pycam.py", line 6, in <module>
from pycam.Gui.SimpleGui import SimpleGui
File "/home/dan/CAM/pycam-0.1.4/pycam.py", line 6, in <module>
from pycam.Gui.SimpleGui import SimpleGui
ImportError: No module named Gui.SimpleGui
lezdep 11-16-2008, 01:56 PM Hmm, I'm running 0.1.4 on same Ubuntu version just fine. Have you installed all
required dependency packages ?
So far my tests with 0.1.4 produced quite decent results. Beside some limitations
of algorithms, tools to not crash into stock anymore and I plan to do real cuts on
my CNC Mill as soon as I have time. I encourage others to try it and provide feedback.
This way Lode could make it better.
Dan Falck 11-16-2008, 02:18 PM The dependencies shouldn't have given a problem on this system (in theory...) since pycam-0.1.3 works. I use pyopengl and togl for a lot of other projects. But,that's not to say that Togl isn't causing problems this time-or that I don't have file permissions set wrong- or my directory paths wrong...
I'll dig a little more.
Thanks,
Dan
lleroy 11-16-2008, 02:33 PM looks like there is a missing file in that release.
you can fix it by copying the file pycam/__init__.py from the 0.1.3 release...
thanks for reporting this!
-- lode
Dan Falck 11-16-2008, 02:38 PM lleroy,
Thanks- that was it.
Dan
Dan Falck 11-16-2008, 03:21 PM lleroy,
Could you introduce a feature to be able to change the direction of the cutter path? I would like to run the cutter from +Y to -Y on some parts.
Thanks,
Dan
lleroy 11-17-2008, 04:03 AM yes, that's easy... it will be part of the next release... meanwhile,
you can get the current code from subversion:
http://pycam.svn.sourceforge.net/viewvc/pycam/trunk.tar.gz?view=tar
-- lode
Dan Falck 11-17-2008, 09:34 AM lleroy,
I did a SVN checkout and it works. Thank you- that's it.
Dan
Dan Falck 11-22-2008, 08:44 PM lleroy,
If you get a chance and would like to chat on IRC - join freenode #cam
There are several other guys who hang out on that channel that have downloaded pycam and are trying it out.
Thanks,
Dan
lezdep 11-23-2008, 10:40 PM So, there are people testing it. Is there a way to make them post here ? What are they
talking about ? From my experience at the moment finishing toolpath algorithms
(DropCutter with ZigZagCutter) do not generate vertical drops :( That's an issue preventing
me from trying to actually cut something on my CNC Mill.
I don't know how toolpath calculations work in pycam, but my gut feeling is there is
some trivial mistake in the code (may be not so trivial), which makes otherwise correct
algorithm generate slops instead of verticals. Hope Lode will have time to chase this
issue down eventually.
cyclestart 11-23-2008, 11:57 PM Hi lode
Thanks for pycam. :cheers:
Looking at it the first time this evening so not much to report so far. The usual CAM terms like 'contour' are absent and some the terms like 'drop cutter' are unfamiliar to me. No worries, I'll puzzle it out. :)
Is it possible you have no cnc machine to test the g_code output? Just curious as there are no examples on your site. Maybe I can carve out something worthy of display. Got to sort out an ailing axis drive first.
Dan Falck 11-24-2008, 09:52 AM So, there are people testing it. Is there a way to make them post here ? What are they
talking about ? From my experience at the moment finishing toolpath algorithms
(DropCutter with ZigZagCutter) do not generate vertical drops :( That's an issue preventing
me from trying to actually cut something on my CNC Mill.
I don't know how toolpath calculations work in pycam, but my gut feeling is there is
some trivial mistake in the code (may be not so trivial), which makes otherwise correct
algorithm generate slops instead of verticals. Hope Lode will have time to chase this
issue down eventually.
I like to chat with some folks on the #emc channel on freenode and some of us started a #cam channel there too ( several years ago). It's nice being able to chat in real time, because we try things on our respective computers, show off screen shots , and help each other out. The guy who wrote aptos (apt360 linux port) is always there, plus several guys with cnc programming/machining experience. I believe that some of these guys will be posting here soon.
Three of us tried out pycam yesterday and everyone was pleasantly surprised. It has a long way to go but has lot of potential. I like the fact that it's written in python and is fairly easy to understand the underlying code.
Pycam is layed out logically and should be easy to adapt to other projects, if one wants to. I can see using it along with the other small g-code generators here- http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Simple_EMC_G-Code_Generators for a lot of stuff.
I was able to change where the tool went between zigzag passes by looking for the the z_safe height variable in one of the files. The screen shot here is from a guitar neck iges file.
lezdep 11-24-2008, 02:56 PM Version from SVN behaves OK in between zigzag passes. Did anyone try
DropCutter ? Issue for me is that for whatever reason on drops up and down
it doesn't follow vertical geometry boundaries, instead it produces slops.
If anyone could locate and fix this issue, I will be happy camper and will try
to machine my first parts using pycam's toolpaths.
Does anyone know what "Number of samples" parameter is for ?
What time are you guys on-line normally ? And which IRC client would be
the best available on Ubuntu ?
Dan Falck 11-24-2008, 03:03 PM I'm using Pidgin for IRC because it was easy to install from synaptic on Ubuntu. I'm online right now, but there's usually someone on most of the day and into the night.
Dan
lleroy 11-25-2008, 03:24 AM Does anyone know what "Number of samples" parameter is for ?
The DropCutter goes as folows:
1)make lines along the X-axis
2)for each line, take a number of samples
3)at each sample, drop the cutter until it hits the model, this is a cutter location point
4)connect the cutter location points along the line
see also the bundled HOWTO.txt
btw, I've uploaded a new release 0.1.5 with a fix for the verticals in DropCutter
lezdep 11-25-2008, 11:19 PM New DropCutter looks a lot better. There still seems to be some glitches. But for
my simpler and bigger part it generates acceptable toolpaths.
Increasing number of samples help to make much more smoother toolpaths.
lleroy 11-26-2008, 03:02 AM There still seems to be some glitches.
yep, there was a small bug in there... it's fixed now...
lezdep 11-26-2008, 07:24 AM Great. SVN has the latest, I assume.
yep, there was a small bug in there... it's fixed now...
lezdep 11-26-2008, 07:30 AM Doesn't look like it is. "svn update" haven't downloaded anything. Could you
check in your latest changes ?
Great. SVN has the latest, I assume.
Death Adder 11-26-2008, 07:47 AM The DropCutter goes as folows:
1)make lines along the X-axis
2)for each line, take a number of samples
3)at each sample, drop the cutter until it hits the model, this is a cutter location point
4)connect the cutter location points along the line
see also the bundled HOWTO.txt
btw, I've uploaded a new release 0.1.5 with a fix for the verticals in DropCutter
Would it not be better to go by tolerance instead of # of samples? It's difficult to determine how many samples are needed to get down to an acceptable tolerance.
lezdep 11-26-2008, 10:09 AM Is anyone working on the GUI modifications at the moment ? I think it would
make sense to move button/parameters pane to the side of main window and
make it fixed size, allowing preview pane to be bigger. Also it would be very
helpful to allow interactive navigation in preview. At the moment only
zoom works for me. 3D rotation and panning would be great.
I don't know Python, but I'll try to learn it and look if I could do some
GUI modifications. Lode, if you point out modules/files where current GUI is
implemented, that would help me a bit to get started.
lleroy 11-26-2008, 11:32 AM 3D rotation and panning would be great.
hold down left mouse button in the 3D visualization and move -> rotate
hold down right mouse button in the 3D visualization and move -> zoom
hold down middle mouse button in the 3D visualization and move -> pan
lleroy 11-26-2008, 11:37 AM I don't know Python, but I'll try to learn it and look if I could do some
GUI modifications. Lode, if you point out modules/files where current GUI is
implemented, that would help me a bit to get started.
the gui is based on tk (see http://infohost.nmt.edu/tcc/help/pubs/tkinter.pdf)
the gui is completely defined inside the file pycam/GUI/SimpleGui.py
please leave it as is, but copy it to something else,
like "pycam/GUI/FancyGui.py" and edit pycam.py accordingly,
or copy it to something else too...
lezdep 11-26-2008, 01:49 PM That does not work for me. I've got bunch of messages in xterm, I've
started pycam from. I didn't pay close attention. I guess I have to find
out what those messages are saying ;) Thanks.
hold down left mouse button in the 3D visualization and move -> rotate
hold down right mouse button in the 3D visualization and move -> zoom
hold down middle mouse button in the 3D visualization and move -> pan
lezdep 11-29-2008, 11:59 PM While I don't have wiki access yet, I'll post my wish list (mini todo) here, just to
capture it somewhere.
- input field for feed rate (Fxxx in g-code)
- input field for plunge rate (Fxxx on verticals in g-code)
- input field for tool number (Tx M6 in g-code)
- control for direction of cutting - conventional or climbing
would help with some parts where zigzag pattern does not work well
lezdep 11-30-2008, 12:51 AM One more - change tool and torus radius to accept diameter instead.
I'm so used to specify diameter, that I only realized today - I was using tool
size 2 time bigger. Ooops.
lezdep 01-13-2009, 10:07 PM Done my first machining using toolpath generated by pycam. Used DropCutter/ZigZagCutter
to generate finishing toolpath. Roughing toolpath was generated using Adaptive Clearing demo from freesteel.co.uk
lezdep 01-13-2009, 10:09 PM Here are images of Adaptive Clearing demo's toolpath machining
lleroy 01-14-2009, 02:59 AM Thanks for posting the pictures... It's cool to see pycam in use!
danheeks 01-15-2009, 03:57 PM leroy,
This looks good.
I had to move the test files from "trunk/Tests" to "trunk" to run them
DropCutterTest.py is not up to date:
I had to add an extra parameters to the call to pg.GenerateToolPath
and I had to add 5 more parameters to the call to SimpleGCodeExporter
Your code is easy to read. I can see how to use it.
The tool path has lots of small tangential moves, which I will have to join.
Do you already have a function to join tangential moves?
I am going to try this with my Open Cascade GUI, http://code.google.com/p/heekscnc/ ( it's not finished yet )
Dan Heeks.
lezdep 01-15-2009, 08:20 PM Hey, Dan
Have you looked at occ-cam and Olivier Coma's project ?
http://cam.occ.googlepages.com/
http://olivier.coma.free.fr/opencascade/opencascade.html
I believe there is some useful code in those projects. But I'm not very
efficient in C++ myself.
Did you try Salome ?
leroy,
I am going to try this with my Open Cascade GUI, http://code.google.com/p/heekscnc/ ( it's not finished yet )
Dan Heeks.
lleroy 01-16-2009, 03:06 AM I had to move the test files from "trunk/Tests" to "trunk" to run them
I normally run the test as "python Tests/DropCutterTest.py"
DropCutterTest.py is not up to date:
I had to add an extra parameters to the call to pg.GenerateToolPath
and I had to add 5 more parameters to the call to SimpleGCodeExporter
I noticed your patch, and merged it, thanks for reporting...
The tool path has lots of small tangential moves, which I will have to join.
Do you already have a function to join tangential moves?
do you mean that multiple moves that are colinear should be joined into one linear move? no I haven't done that... it should be very easy to implement, but I consider it an optimization (http://www.softwarequotes.com/ShowQuotes.asp?ID=577&Name=Jackson,_Michael_A.&Type=Q#2084)
-- lode
danheeks 01-16-2009, 03:57 AM lode,
>> I normally run the test as "python Tests/DropCutterTest.py"
Yes, that works. I have removed my copied files now.
>> do you mean that multiple moves that are colinear should be joined into one linear move?
Yes. If your code doesn't do it, then my code must do it.
lezdep,
I had not looked at these projects before. Thanks for telling me about them.
* cam.occ uses the Open CASCADE model to get the toolpath directly. This means the toolpath is accurate, but the algorithm can not be used for .stl files.
*olivier.coma This is interesting, he is doing 5-axis machining.
* SALOME This is a big project. I will look at this more, later.
lleroy 01-16-2009, 05:39 AM Dan,
how are you going about to integrate pycam into heekscnc?
I had thought about the following:
1) you write a file "model.stl" and a file "model.cfg" (see Samples/TestModel.stl and .cfg)
2) you call "pycam.py model.stl model.gcode"
3) recover the output file
It should be easy to add an pycam/Exporters/SomethingExporter.py
that outputs the toolpaths in a format that's easier for you to parse
rather than gcode...
-- lode
danheeks 01-16-2009, 06:06 AM lode,
I did not plan to use the .cfg file.
Some of my operations may use Python that is not in pycam.
heekscnc will write an stl file for each operation that uses drop cutter. It will then write a Python file including:
pathlist = pg.GenerateToolPath(x0, x1, y0, y1, z0, z1, dx, dy, 0)
followed by:
CutPathList(pathlist) which will call my feed and rapid functions.
We are planning to write backplotters specific to different machines, so that the user can see toolpath from old NC files, so I will use these to see the toolpath.
However, it would probably be better if I could integrate my NC code generators and backplotters into your project.
We haven't written much, yet. We are doing it in an object-oriented way, so that new exporters can be derived from existing exporters. See http://code.google.com/p/heekscnc/source/browse/trunk/nc/iso.py which is derived from http://code.google.com/p/heekscnc/source/browse/trunk/nc/nc.py These have been contributed by Hirutso Enni, a contributor to HeeksCNC, this week. I will ask him to contact you to talk about it. Please email me so I have your email address. danheeks@gmail.com
Dan.
lezdep 01-16-2009, 03:50 PM Look closely at Salome. I think it's very well featured and complete 3D CAD.
Parametrized design is missing, but nevertheless, definitely very functional.
You might decide to either join forces with them or concentrate on CAM
integration for example, instead of re-doing in heekscad things available in
Salome.
lezdep,
I had not looked at these projects before. Thanks for telling me about them.
* cam.occ uses the Open CASCADE model to get the toolpath directly. This means the toolpath is accurate, but the algorithm can not be used for .stl files.
*olivier.coma This is interesting, he is doing 5-axis machining.
* SALOME This is a big project. I will look at this more, later.
danheeks 01-16-2009, 04:25 PM lezdep, SALOME: Is there a download for my computers ( Windows Vista or XP or Ubuntu 8.04 ) ?
lezdep 01-16-2009, 05:08 PM There is standalone Linux executable here -
http://caelinux.com/CMS/index.php?option=com_content&task=view&id=44&Itemid=40
They also have bootable LiveDVD you can run on any PC.
lezdep 01-18-2009, 03:38 AM Another session of machining. Other side of my part. This time I generated both roughing
and finishing toolpaths using pycam. Overall toolpath are acceptable. Issues are related
to the fact, that hight of toolpath is bigger than length of cutting portion of my tool. So on
some passes, tool was cutting only part of the stock, while deflecting from another part.
There are couple picture of produced part. It's not ideal, but good first try.
danheeks 01-18-2009, 04:40 AM Good work, lezdep.
Lode,
I can now open an NC file into my CAM software.
The toolpath isn't quite right.
Please look at my blog for details.
http://heekscnc.blogspot.com/2009/01/pycam-dropcutter.html
Is there something I can change?
Dan.
lezdep 01-18-2009, 12:03 PM DropCutter would normally work with ZigZagCutter. There are "valid" combinations
listed in README file. Which combination of cutters have you used ?
Good work, lezdep.
Lode,
I can now open an NC file into my CAM software.
The toolpath isn't quite right.
Please look at my blog for details.
http://heekscnc.blogspot.com/2009/01/pycam-dropcutter.html
Is there something I can change?
Dan.
danheeks 01-18-2009, 01:29 PM It's OK, I have found the problem.
In SimpleGCodeExporter.py there are lines like this:
# self.file.write(gc.rapid(point.x,point.y,gc.safetyheight)+"\n")
to rapid to the clearance plane, but they are commented out.
Anyway, I have written my own exporter for HeeksCNC, see here http://code.google.com/p/heekscnc/source/browse/trunk/PyCamToHeeks.py
I now have a zig zag operation in HeeksCNC, that makes NC code with my existing mechanism and backplots the NC file, so I can see the toolpath. See my blog for a picture http://heekscnc.blogspot.com/2009/01/zig-zag-thanks-to-pycam.html
lleroy 01-19-2009, 07:58 AM Another session of machining. Other side of my part. This time I generated both roughing and finishing toolpaths using pycam.
:banana:
Overall toolpath are acceptable. Issues are related to the fact, that hight of toolpath is bigger than length of cutting portion of my tool. So on
some passes, tool was cutting only part of the stock, while deflecting from another part.
Maybe this can be solved for now by first doing the roughing with PushCutter/Polygon in x direction, and then in y direction? It would be mostly cutting air, but it should remove the nasty bits for the DropCutter/ZigZag....?
Of course, this will be the job of the PushCutter/Contour once that's working.
lezdep 01-20-2009, 12:10 AM One thing to note - roughing toolpath was generated with previous version.
PushCutter appears to be broken in current version.
One direction milling we talked about would help somewhat in my case.
Combination with Adaptive Clearing worked good though.
:banana:
Maybe this can be solved for now by first doing the roughing with PushCutter/Polygon in x direction, and then in y direction? It would be mostly cutting air, but it should remove the nasty bits for the DropCutter/ZigZag....?
Of course, this will be the job of the PushCutter/Contour once that's working.
lezdep 03-27-2009, 01:14 PM Did more machining. PyCAM was used to generate number of toolpaths. Worked
quite well. Nice thing about PyCAM is that it allows to define toolpath's borders implicitly.
So, I could only generate toolpath for selected portion of my 3D model.
For example only packets in parts were machined with CNC. Rest I've done manually.
I found PyCAM to be very useful and working well for me. Next will be machining
of diffuser for my model. I will show results as soon as I'm done. All toolpaths for
that work were generated using PyCAM.
roger_e 05-20-2009, 09:51 PM Okay I got Ubuntu 8.04 and EMC2 on a dual boot.
My machine is a minitech 4Axis...and I use it comercially....right now with mach3 and lazy cam...for the business we are ordering Visual Mill...
WE make optical components
So I got a system and time to play around with pycam...What is the direct way to get it up and running on Ubuntu 8.04?
Thanks
lleroy 05-25-2009, 02:59 AM So I got a system and time to play around with pycam...What is the direct way to get it up and running on Ubuntu 8.04?
thanks for your interest in pycam... unfortunately I do not know ubuntu... so I cannot provide you a step-by-step guidance.
there are some hints on the help forum: http://sourceforge.net/forum/forum.php?forum_id=860184
|
|