PDA

View Full Version : RobinCAM v1.0



Robin Hewitt
08-03-2010, 12:52 AM
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 :beer:

Robin

John Ferguson
14-03-2010, 07:19 PM
Robin,
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.
John

Robin Hewitt
14-03-2010, 10:17 PM
What are you writing the code in out of interest?
I will look forward to here how you are progressing.

Hi John

I am writing it in C. Progress is slow because I keep changing the excess removal algorythm. This means drawing lots of squiggly shapes on pieces of paper to see if I can catch it out :eek:

I want it to keep it incredibly simple, little as possible to go wrong.

The aim is to do all the work in AutoCAD so all I need to add is tool diameters and feed rates. Toying with two extra circles on layers called something like F30 and R20, providing tool diameters and feed rates for rough and finish. Having everything in the .dxf so I don't save anything to disk apart from the G code, sounds like a good idea :smile:

best

Robin

John Ferguson
15-03-2010, 07:30 AM
Robin,
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.

John

Robin Hewitt
15-03-2010, 11:15 AM
So the concept of tools on layers, how would that work for multiple tools?

Hi John

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:

Robin

John Ferguson
15-03-2010, 12:37 PM
Let me know what you need Robin and if I can help then I will.
John

Robin Hewitt
17-03-2010, 01:46 PM
Let me know what you need Robin and if I can help then I will.

Okay, a policy decision.

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:

Robin

John Ferguson
17-03-2010, 03:19 PM
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.
John

Robin Hewitt
17-03-2010, 04:34 PM
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:

Robin

Robin Hewitt
22-03-2010, 01:44 PM
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

Robin

Robin Hewitt
22-03-2010, 06:10 PM
Oops! Forgot pockets inside pockets :eek:

This means completely re-writing the island waterline detector :whistling:
Brane starting to faid, need beer :beer:

John Ferguson
23-03-2010, 09:21 PM
Its coming on Robin, what parameters are going to be setable, depth of cut, tool size etc ?
John

Robin Hewitt
25-03-2010, 11:55 AM
Its coming on Robin, what parameters are going to be setable, depth of cut, tool size etc ?
John

Everything I can't glean from the .dxf file, but I do my best. Have a movie...

Edit: If it won't play, here's the link http://www.youtube.com/watch?v=Hnaftasy7yo


http://www.youtube.com/watch?v=Hnaftasy7yo

Robin Hewitt
11-05-2010, 11:35 AM
Something of a hiatus, now going again :rolleyes:

This morning it started puking out G-code, read some in to my cutting software and it looks good:yahoo:

After much agonising about how to define tools inside a drawing file I eventually opted for added text.

T01 is the only tool that removes excess from the block. No T01=no excess removal. So you can go back in and tweak without massive editing of G code.

Still Um'ing and Ah'ing about whether to allow finishing excess in the Z axis when you reach the bottom of the block. I think probably not, total waste of time.

The RCA text line in the pic forces a 2 degree draft angle on anything with the same layer. Will probably add other modifiers to that.

More soon, probably. I can still come horribly unstuck, but looks hopeful. The proof of the pudding will be in the eating :heehee:

BillTodd
11-05-2010, 01:22 PM
Robin,

Rather than regen the cut, could you just store the vertexes and re-display them? (There must be some PD 3D C++ libraries available on the web somewhere that would do this kind of thing for you)

Bill

Robin Hewitt
11-05-2010, 10:30 PM
Hi Bill

What's a vertex? :heehee:

There is no cleverness in this program, it simply reads in a dxf, slices through at various levels then projects the slices in to cuts. That was about all my brane could handle.

Robin