What's new
What's new

Clean sub-routine CAM

snowshooze

Stainless
Joined
Sep 15, 2010
Location
Anchorage, Alaska, USA
Hi guys!
First,my many thanks for all the help you have given me bringing me in to CNC !!

Ok, I started out at ground zero, learning G-code, and in
Fanuc, DX-32 Fadal Format 1 as well as Haas.
I can walk up to any of them and start shouting out code without CAD/CAM and off they go.
I just have to remember which machine I am talking to...

But, it didn't take long for me to realize I had to have CAD/CAM as crunching all the geometry only proves that I can do it, and it is pure plodding.
So I got this spiffy CAD/CAM software, and, after just about 6 months, I can drive it.

But, it doesn't utilize sub-routines at all. Translation, yes.

I like the subs because the say everything I need to say, and I only define xyzac zero.

This software defines every movement.
If I have 20 drilled holes for 20 parts in one stick of stock...
The danged thing will call, say a G80 at the finish of every hole, go to a new position, re-call the G81... do it all again..

The clutter overwhelms the machine memory, makes me go blind, and makes floor edits impractical.

I took this software I have and did a job of 14 parts, and the code was 41K
I re-wrote it old school, and it was just about 4K
And I could read the crap.

Oh yeah, and the machine can't even hold 41K without the $1600.00 memory expansion...



So, I did a bit of reading on the site.
It would appear that Gibbscam, FeatureCam, Surfcam, and possibly Mastercam can handle it.

I am already damned tired of shelling out hard cash for software with soft balls.

I really want to generate code with L100, P100, # $ and come up with a very elegant, compact, floor-friendly code.

Is there anything out there that can utilize and generate subs in multiple Post-processors that can clean this spaghetti mess up?

Again,
My many thanks.

Mark
 
So I got this spiffy CAD/CAM software,

Is there anything out there that can utilize and generate subs in multiple Post-processors


Pretty darn cryptic there Mark!

Short answer is no, I can't think of anything that will clean up your messed up spaghetti code automagically.

But!

Would you please let at least some of us in on the secret of what this spiffy CAD/CAM software is that you're using?
 
The reason that cadcam software doesn't make use of subroutines for single parts is for the sake of simulation and for the sake of modularity of the program, ie., the ability to move machining operations around in various order of execution, on the whim of the programmer. Because a good cadcam wants to assure you of a reliable and consistent result, it needs to know that there are no surprises in logical execution of the program.

Now which is cheaper, doing the memory upgrade, or buying another cadcam that may not actually perform as expected. There is more to machining than making succinct programs. If you graduate to high speed machining strategies, you're still going to need lots of memory.
 
Sounds to me like you're too anal about the way your program is structured no matter if it's efficient or not.
Don't take offense to that, because I am too.
What cam system are you using? Does it have a post processor that you can alter so the program comes out exactly how you want it to?
Why do you want a sub program for drilling holes?
 
Just hrowing in my .02 cents.....
I understand you are limited with the memory on your machine and the onlt thing that fixes that is money. When it comes to programs I have had to struggle with some of the more seasoned guys around here with some of the issues you mention. I dont want you reading code at the machine. The programs should be getting posted in a way that produces a good part in the most efficient way reasonably possible. We sell parts.....we do not sell programs. In my situation here at work (unlike you) memory is free...it exists.....use it. If something doesnt work, or is wrong it is the programmers responsibility to fix the error in the cam software and repost the program.....that is one reason to have a cam system. Another reason is to have an accurate project saved to make future edits / posting / programming quicker.
In my opinion .....you are barking up the wrong tree.......the program is just a tool to make a part.....it doesnt need to be the neatest, coolest, most structured thing....it just needs to make a good part efficiently.
The customer pays for a quality part.....he/she doesnt give 2 shits about the program used to make those parts.
 
Surfcam user here. I use subs to make multiple parts frequently. With MPost it couldn't be easier. When you post, it asks how many parts you want. Done.

Are you wanting subs in a single part program to organize the tools? I didn't quite understand your question. You can do this too. The post templates are friendly to edit.


Can you post a sample program of what you're looking for?
 
Just hrowing in my .02 cents.....
I understand you are limited with the memory on your machine and the onlt thing that fixes that is money. When it comes to programs I have had to struggle with some of the more seasoned guys around here with some of the issues you mention. I dont want you reading code at the machine. The programs should be getting posted in a way that produces a good part in the most efficient way reasonably possible. We sell parts.....we do not sell programs. In my situation here at work (unlike you) memory is free...it exists.....use it. If something doesnt work, or is wrong it is the programmers responsibility to fix the error in the cam software and repost the program.....that is one reason to have a cam system. Another reason is to have an accurate project saved to make future edits / posting / programming quicker.
In my opinion .....you are barking up the wrong tree.......the program is just a tool to make a part.....it doesnt need to be the neatest, coolest, most structured thing....it just needs to make a good part efficiently.
The customer pays for a quality part.....he/she doesnt give 2 shits about the program used to make those parts.

Curious here, what's your procedure for running a new part? If you don't want operators reading code at the machine, do they just "cycle-start-n-walk-away?"

I get it that it's quite easy to generate a shit-ton of code that isn't easy to read with high speed tool paths, surfacing, or multi-axis, but come on. They read nothing?
 
Curious here, what's your procedure for running a new part? If you don't want operators reading code at the machine, do they just "cycle-start-n-walk-away?"

I get it that it's quite easy to generate a shit-ton of code that isn't easy to read with high speed tool paths, surfacing, or multi-axis, but come on. They read nothing?

It depends on which machine we are talking about......we have one cell with 2 mills in it and yes.....cycle start...make sure the first tool looks right (pause .100" above part at clearance plane) then dont walk away.....walk to the other machine and get it going too. We use crash detection in our can system and have all our tools and holders defined accurately. Some of those programs have 30,000 lines of code or more.....surely you wouldnt single block through it????? As far as reading code....THEY READ NOTHING....at most a couple of M codes.....nothing else.
 
I dunno ....

I am very much in favor of subroutines ( not sub-programs!! them I hate with an absolute passion )

Drill cycles called once, all locations are in the sub.
Multiple stepdown toolpaths are also in the sub, the main body contains only the starting location. Makes it very easy to look at each step-depth during setup.

I do a reasonable amount of hand coding, usually for time savings, and whenever a sub is beneficial, I use it.
Thankfully FeatureCAM is also quite well versed in using subs and it's set up to use it at every instance possible.
 
I dunno ....

I am very much in favor of subroutines ( not sub-programs!! them I hate with an absolute passion )

Drill cycles called once, all locations are in the sub.
Multiple stepdown toolpaths are also in the sub, the main body contains only the starting location. Makes it very easy to look at each step-depth during setup.

I do a reasonable amount of hand coding, usually for time savings, and whenever a sub is beneficial, I use it.
Thankfully FeatureCAM is also quite well versed in using subs and it's set up to use it at every instance possible.

I can see how a sub saves you time when hand programming.....probably significant time. I see little benefit to subs when posting from a Cam package. Post it...run it....if it isnt right then fix your cam project and re-post it. If your post isnt right....get it right.
 
It depends on which machine we are talking about......we have one cell with 2 mills in it and yes.....cycle start...make sure the first tool looks right (pause .100" above part at clearance plane) then dont walk away.....walk to the other machine and get it going too. We use crash detection in our can system and have all our tools and holders defined accurately. Some of those programs have 30,000 lines of code or more.....surely you wouldnt single block through it????? As far as reading code....THEY READ NOTHING....at most a couple of M codes.....nothing else.

I second this... "SOP" for us is to make sure the first couple of tools come to the correct clearance plane, then let it go. We very, very rarely have crashes; when we do, it is due to a setup error. In fact, most of our operators (four of six at least) don't know very much about reading G code. I wish that were different, not because it would prevent crashes, but it would help our operators be able to do some things on their own.

I'd be scared to death to use CAM software that has any remote chance of putting out code for a crash! I hope that isn't what happens.

I would add... as programmer, I very rarely even look at the code I post! Generate, save it to the stick, and off they go.
 
I'd be scared to death to use CAM software that has any remote chance of putting out code for a crash! I hope that isn't what happens.

.


OK, completely off on a tangent now, but I gotta ask:
Just why the hell is it always assumed that the reason for testing and watching a new program is because XYZ CAM sucks and cannot
put out reliable code?
Sure, some of them do suck, but once a post is dialed in most of them will be deadly reliable code every time.

However!
No matter how reliable the code is if it's an utter garbage!
And, the dumber the programmer is, the stinkier garbage CAM will output every time!

Now to those advocating an exclusive check -> change CAM -> repost -> check -> rinse and repeat method, I have to ask how is that more efficient
than having a capable setup/machinist watch the machine, change minor code when needed, make notes of the changes and when done, send the notes back to
the programmer to carve it into the original CAM file and then repost?

I am a small enough operation so what I do may be different than some others. I do everything from drawing up the model, come up with the process, write the program
and most often setup the machine. The above works for me, as well as for my part timer setup guy.

At the same time all my customers are also machine shops with dedicated programmers, and they work on the method advocated by some here.
Make code in CAM, send it to floor, drink coffe until someone complains about the trash created by CAM.
Then make change, repost and back to the coffee maker....

I am in no way saying that one should look through thousands of line of code, or hundreds even.
But to completely ignore the code and let everything just play itself out is plain dumb.
May work for you, but I ain't even gonna try it.

I do trust my CAM, it is me I don't trust. And, if I was working for you I wouldn't trust you or your trash either.
Period.
 
OK, completely off on a tangent now, but I gotta ask:
Just why the hell is it always assumed that the reason for testing and watching a new program is because XYZ CAM sucks and cannot
put out reliable code?
Sure, some of them do suck, but once a post is dialed in most of them will be deadly reliable code every time.

However!
No matter how reliable the code is if it's an utter garbage!
And, the dumber the programmer is, the stinkier garbage CAM will output every time!

Now to those advocating an exclusive check -> change CAM -> repost -> check -> rinse and repeat method, I have to ask how is that more efficient
than having a capable setup/machinist watch the machine, change minor code when needed, make notes of the changes and when done, send the notes back to
the programmer to carve it into the original CAM file and then repost?

I am a small enough operation so what I do may be different than some others. I do everything from drawing up the model, come up with the process, write the program
and most often setup the machine. The above works for me, as well as for my part timer setup guy.

At the same time all my customers are also machine shops with dedicated programmers, and they work on the method advocated by some here.
Make code in CAM, send it to floor, drink coffe until someone complains about the trash created by CAM.
Then make change, repost and back to the coffee maker....

I am in no way saying that one should look through thousands of line of code, or hundreds even.
But to completely ignore the code and let everything just play itself out is plain dumb.
May work for you, but I ain't even gonna try it.

I do trust my CAM, it is me I don't trust. And, if I was working for you I wouldn't trust you or your trash either.
Period.
Well said...

Sent from my SAMSUNG-SGH-I337 using Tapatalk
 
OK, completely off on a tangent now, but I gotta ask:
Just why the hell is it always assumed that the reason for testing and watching a new program is because XYZ CAM sucks and cannot
put out reliable code?
Sure, some of them do suck, but once a post is dialed in most of them will be deadly reliable code every time.

However!
No matter how reliable the code is if it's an utter garbage!
And, the dumber the programmer is, the stinkier garbage CAM will output every time!

Now to those advocating an exclusive check -> change CAM -> repost -> check -> rinse and repeat method, I have to ask how is that more efficient
than having a capable setup/machinist watch the machine, change minor code when needed, make notes of the changes and when done, send the notes back to
the programmer to carve it into the original CAM file and then repost?

I am a small enough operation so what I do may be different than some others. I do everything from drawing up the model, come up with the process, write the program
and most often setup the machine. The above works for me, as well as for my part timer setup guy.

At the same time all my customers are also machine shops with dedicated programmers, and they work on the method advocated by some here.
Make code in CAM, send it to floor, drink coffe until someone complains about the trash created by CAM.
Then make change, repost and back to the coffee maker....

I am in no way saying that one should look through thousands of line of code, or hundreds even.
But to completely ignore the code and let everything just play itself out is plain dumb.
May work for you, but I ain't even gonna try it.

I do trust my CAM, it is me I don't trust. And, if I was working for you I wouldn't trust you or your trash either.
Period.

I like the part about it being dumb the best.......we have 4 guys programming 10-12 new jobs EVERY day of the week. We have been doing this for 8-10 years now with minimal issues.....the majority (99%???) of those issues are setup, probe, operator or brainfart related. Now some guy on the internet says this is dumb apparently smart would be what? The fact that you can not succesfully make this happen at your shop does not mean that those of us who can are somehow dumb......quite possibly the opposite may be more accurate.
 
I like the part about it being dumb the best.......we have 4 guys programming 10-12 new jobs EVERY day of the week. We have been doing this for 8-10 years now with minimal issues.....the majority (99%???) of those issues are setup, probe, operator or brainfart related..


So basically in your shop the operators are the ones making the mistakes, programmers are infallible.

Got it!
 
I second this... "SOP" for us is to make sure the first couple of tools come to the correct clearance plane, then let it go. We very, very rarely have crashes; when we do, it is due to a setup error. In fact, most of our operators (four of six at least) don't know very much about reading G code. I wish that were different, not because it would prevent crashes, but it would help our operators be able to do some things on their own.

I'd be scared to death to use CAM software that has any remote chance of putting out code for a crash! I hope that isn't what happens.

I would add... as programmer, I very rarely even look at the code I post! Generate, save it to the stick, and off they go.

That software would be worth looking at.
 
I guess I ain't alone on this one...

Hi guys, and again, my many thanks!!!

Yeah, well, like today I thought my center drill should be sunk another .020", and if I hadn't already took the program completely apart, and put it back the way it " Otta " be..
I'da been looking for that first center drill operation yonder down around N1200 or so, where in my re-hash it was line N165
And I only had to edit that line.
If it were the stuff the CAM puts out, I'd re-write the program upstairs.

Bobcad puts out program by the ton. The post-processor for Haas is solid, but Fadal Format1 post has never ran, ever without cleanup and edits.

I like the software, and I have pay-for support there and they are a good bunch...

There ain't a cleaner code that I have seen than the ones written by hand.
With subroutines and sub-programs.
I watch them guys running parts on you-tube, and I just die.

Wrong cutter for the job, the machine will likely wear out before the first part is ever finished.. machine relentlessly returning to some point in space to start another tool path when it shoulda just hopped over 1/4" and went tother way..a lot I know I can overcome.
I guess the trouble is that I am just a lazy machinist, and I am funny about how much time and energy is being soaked up by this " Automatically " generated code.
When I can hand write code that cuts machine time 15% over the software, it makes me want to buy better software.
Never make a move you don't need. There are only so many moves left in the machine before it is worn out. I am counting.
Never repeat yourself, it makes you look dumb.
Go to point B and do it again, idiot.
I honestly think it is better sometimes to just get a post for one part..
Cut it up. Break out subs on that, write a program with all the drill, tap, z axis stuff like G81, x, y z, r, f...x x x x
And then pull the subs for the other stuff with a g91...x x x x

So, I'd rather have intelligent code than miles of it.

I knew after I got into this real quick that I had to unload all the geometry calcs as fast as I could.
Now, I know I need to unload all the wasted time trying to take miles of stupid code and get me away from spending all my time making it go.
Now, granted... it will run. ( Well... I guess everybody has a Haas... )
But the Fadal, as previously stated... Not Hip.

Sometimes, I ask myself... " Self, ya think you want to make chips, or fight all day? "
I ain't cranking out tool path geometry anymore, but this is every bit as bad.

I don't know what works. Lotsa guys say Solid-works with a Master-cam chaser.

I realize at this point, it would be far more efficient for me to throw money at software that works the first time, every time than to keep fighting what I have.
If there be such a thing.
I dunno.


I am just a Lazy Machinist trying to support a good beer habit with as little effort as possible.
I sure enjoy what you guys have to say though!
Mark
 
BobCAD is pretty bottom-shelf as far as CAM goes, but I will say any CAM with a nice post that uses subroutines is going to cost more than the $1600 to expand the memory on your machine...
 








 
Back
Top