Couldn't find the G code producing software I wanted so I decided to write my own :whistling:
I want to draw lines and arcs with AutoCAD, give them thickness and elevation, export it as a dxf, then get an instant 2.5D toolpath that updates the moment I tweak the tool sizes.
I've been on it a week and by Jingo I'm nearly there.
I'm writing it around one part I want to make so it's probably full of bugs, but the code is well commented and lacks cleverness so I shouldn't need much DDT.
I read the part in as lines, arcs and circles. Gcode cuts lines, arcs and circles so that was a no-brainer. I stitch them together end to end forming lumps and pockets. Only entities having the same elevation and thickness will stitch. I can expand/contract lumps and pockets to get tool paths.
Zero thickness items draw but don't cut.
Exceptions to that are a zero thickness lines and arcs with a zero elevation. That is the block outline.
Lumps have positive thickness.
Pockets have negative thickness.
Thinking about imposing draft angles using the layer name, but I've managed to do it without layer names so far. Makes it less complicated to draw
I draw it on screen in either plan or dimetric projection, the space bar toggles between 3 views.
So far toolpath generation takes approx 0.2 seconds from the dxf file data and produces 3 distinct cut planes on my 3 level part. I think the delay is in the bubble sorting when I grid it out.
Just starting on the excess material removal...
I have already identified the excess as an easy to follow map so I can chop it out anyway I like. Thought maybe if I wrote about it here it might clear it in my head. There are so just many possibilities.
I want to cut down hill because my mill cuts much better down hill.
It whittles away an edge sweet as a nut so long as I don't go in beyond the tool radius.
It ploughs through and cuts a slot nicely, but it does like to have tool supporting metal on both sides of the cutter when I do that.
If I whittle it down from the outside, round and round and round I'll be wasting lots of time cutting air if the part is severely off centre.
OTOH, one or two laps is often all you need, especially at the botttom.
Thinking outlines, if I add laps cutting tool radius deep until the stock removal rate per lap drops away significantly, back up one level and start by clearing to that. I don't want to end up cutting a U shaped indent orbitally:nope:
Thinking on it, it's dead easy to get a close approximation on the remaining excess material area so that's my way to go. (See how this writing it down lark sharpens the dulled brain) :heehee:
I also need to identify paths through the block that could separate two islands then whittle them down independantly, that could save a lot of time consuming laps.
Brain unfogged, I'll do some more code tomorrow.
One thing I particularly want to try is a spiral down finishing cut, seems the best bet for a fine finish on my mill. Don't ask me why, just is
I am new to the Forum but I have been reading your posts on different subjects.
I was just about to create a thread on what software is available to take DXF files from Autocad and make 2.5D parts.
I have just started the conversion (well I am collecting parts) of an X3 mill and because I am new to CNC work I am not sure what software would be best suited to what I need.
What are you writing the code in out of interest?
I will look forward to here how you are progressing.
I do think you have the right idea on this, a small utility to sit between Autocad and Mach3 to post process the dxf makes much more sense than having to buy an expensive CAM package.
So the concept of tools on layers, how would that work for multiple tools?
I am not sure I could be of a great deal of help but I do programme in C for work (I am a electronics design engineer) but mainly on embedded devices, but if I can help in any way then I would be happy to do so.
Originally Posted by John Ferguson
It doesn't, you only get two tools. One for roughing, one for finishing.
If you want more tools for a fiddly bit, thats another version of the drawing. Fortunately all co-ordinates are absolute so everything lines up.
I wasn't actually intending to write a commercial product, but you could help me test it if you wanted :naughty:
Let me know what you need Robin and if I can help then I will.
Okay, a policy decision.
Originally Posted by John Ferguson
What to do if the selected tool is simply too big to cut the part? An IO error.
If it all goes to hell in a handbasket, being impossible, do I press on regardless or give up with a WTF error message? :naughty:
Personally, if had just fitted £20 of material in the mill and the program can work out that the tool is wrong then I think it should throw an error.
Continuing on regards less would seem pointless to me.
Current error handling is a getch(); pausing at whatever happens to be on the screen. I was going to ditch the frantic redrawing as it builds up the cuts but I could leave it in :naughty:
It's vaguely informative if you can guess what it's trying to do, more informative if it has cross hatching. The information is there if you can guess what you're looking at. I could leave it in. Hate programs that just say "No" leaving you high and dry.
I see light at the end of the tunnel, may be ready to try a cut after the week end, but it won't be a £20 lump of metal :heehee:
Quick progress report. Slow progress :heehee:
Given a drawing and a level it produces a tool path. Now I just have to step down cutting levels.
The black pic is the AutoCAD drawing. An awkward shape, including a triangular island set in a circular pocket.
The white pic is RobinCAM's interpretation of the ,dxf. Blue items are bulges, green for pockets, orange for the outline of the metal billet, black for the cuts. (The rectangular bulge is above this cut level so it doesn't cut here).
This shape is actually impossible to cut, the tool is too big to fetch in to the nooks and crannies. However, the program philosopy is "do your best, give me a tool path" so it simply gets as close as it can without remoing any metal it didn't ought'a.
Basically it starts bottom right on the billet then tries to face the top down with a series of horizontal, right to left passes. If it hits a bulge or a pocket it cuts the outline then goes back to horizontal passes. I can't see any other way to do it without cutting uphill.
Cut generation for this one level is instant. but I will need info beyond the AutoCAD picture (bugger). Depths of cut, roughing clearance, plunge velocity, things like that