Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Subprograming tutorial?


motor-vater
 Share

Recommended Posts

Anyone know of a good place to acquire a lesson in sub programing with transform? The new job requires alot of sub programing and I'm not liking doing it manually. I have spent days and hours off the clock trying to figure it out, but always get mixed results, weird program numbers, etc. I am getting pretty burnt on the trial and error process and just hoping there is some material out there that can give me a basic understanding of how to correctly use the transform feature to do tombstone work. Like make one tool go all the way around, then change tools and move through the next op..... I have gotten them to work, but had to hand edit the file. Maybe its just a name the file correctly problem not sure really. In normal programs when I am setting up all the stock parameters, etc. I give a file a number like say 05000 when I post, it always comes out O00000 (05000). So maybe I just need a tutorial in properly naming my ops for the subs to work correctly...lol As always Thanks

Link to comment
Share on other sites

Not as much programming as it the post. Without a post dialed into what you are doing and made to support what you are trying to do I think you will keep chasing your tail. Best process I can think of it to use a transform operation for each tool verse trying to use one transform operation to do a bunch of tools. Make up a sample with some drilling and milling use about 5 or 10 tools and put the file up here as .z2g with the post you are trying to use. Then someone can see what you are seeing and then figure out a way to help you.

  • Like 1
Link to comment
Share on other sites

OK as always great info around here, I was able to modify the MPMaster to do alot of what I wanted but made an example just to proof it out. I would like to share my file as to get some pointers and tips to see if I am doing it right. With my example they are just simple tool paths. So I was able to use the 2 parts on the top for the main paths and then sub from there. In a real example their might be heavy code involved with opti roughs and surface toolpathe etc. So my question would be how to sub so that I only program one part then machining both parts, then rotate around the 4 sides. I am looking to keep the code as light as possible. I appreciate all the tips and pointers, looks like I'm gonna be doing alot of this kind of work and I am looking forward to kicking its xxxx!

 

As a side not I have not tried to stick this in a machine yet so I am not even confident the code works the way I want it to.. lol but it looks Kosher, except the A goes past 360 but I'm not even sure that's an issue. Please feel free to critique my attempt, only way I will learn.

 

tombstone exper.ZIP

  • Like 1
Link to comment
Share on other sites
43 minutes ago, motor-vater said:

OK as always great info around here, I was able to modify the MPMaster to do alot of what I wanted but made an example just to proof it out. I would like to share my file as to get some pointers and tips to see if I am doing it right. With my example they are just simple tool paths. So I was able to use the 2 parts on the top for the main paths and then sub from there. In a real example their might be heavy code involved with opti roughs and surface toolpathe etc. So my question would be how to sub so that I only program one part then machining both parts, then rotate around the 4 sides. I am looking to keep the code as light as possible. I appreciate all the tips and pointers, looks like I'm gonna be doing alot of this kind of work and I am looking forward to kicking its xxxx!

 

As a side not I have not tried to stick this in a machine yet so I am not even confident the code works the way I want it to.. lol but it looks Kosher, except the A goes past 360 but I'm not even sure that's an issue. Please feel free to critique my attempt, only way I will learn.

 

tombstone exper.ZIP

I would run it on the machine and see if it matches what you need. Good work and if you go into the machine manager and change the A axis to 0-360 then you will not get the output past 360. Will need to see if you want signed direction or shortest distance. 

image.thumb.png.065f31fdf4e82d1c57750ac0456f30a8.png

  • Thanks 1
Link to comment
Share on other sites

Here is the NC code with Signed Direction checked.

O0500 (Tombstone Example)
(MPMASTER GENERIC 3/4-AXIS VERTICAL)
(MACHINE GROUP-1)
(MCX FILE  - C:\USERS\RON\APPDATA\LOCAL\TEMP\WZ7DC1\TOMBSTONE EXPER.MCAM)
(PROGRAM   - Tombstone Example.NC)
(DATE      - APR-09-2018)
(TIME      - 10:49 AM)
(T1   - 1/2 FLAT ENDMILL     - H1   - D1   - D0.5000")
(T2   - 1/2 DRILL            - H2   - D2   - D0.5000")
(T3   - 1/2 BALL ENDMILL     - H3   - D3   - D0.5000" - R0.2500")
(OVERALL MAX - Z6.)
(OVERALL MIN - Z1.75)
N100 G00 G17 G20 G40 G80 G90
N110 G91 G28 Z0.
N120 (PROFILE PART)
N130 (COMPENSATION TYPE - COMPUTER)
N140 T1 M06 (1/2 FLAT ENDMILL)
N150 (MAX - Z6.)
N160 (MIN - Z3.)
N170 G00 G17 G90 G154 P1 A0. X.25 Y-3. S3056 M03
N180 G43 H1 Z6.
N190 M08
N200 M98 P0501
N210 G91 G28 Z0.
N220 (PROFILE PART)
N230 G00 G90 G154 P2 A90. X.25 Y-3.
N240 G43 H1 Z6.
N250 M98 P0501
N260 G91 G28 Z0.
N270 (PROFILE PART)
N280 G00 G90 G154 P3 A180. X.25 Y-3.
N290 G43 H1 Z6.
N300 M98 P0501
N310 G91 G28 Z0.
N320 (PROFILE PART)
N330 G00 G90 G154 P4 A270. X.25 Y-3.
N340 G43 H1 Z6.
N350 M98 P0501
N360 G91 G28 Z0.
N370 (PROFILE TOP)
N380 G00 G90 G154 P1 A0. X1.5652 Y3.25
N390 G43 H1 Z6.
N400 M98 P0502
N410 G91 G28 Z0.
N420 (PROFILE TOP)
N430 G00 G90 G154 P2 A90. X1.5652 Y3.25
N440 G43 H1 Z6.
N450 M98 P0502
N460 G91 G28 Z0.
N470 (PROFILE TOP)
N480 G00 G90 G154 P3 A180. X1.5652 Y3.25
N490 G43 H1 Z6.
N500 M98 P0502
N510 G91 G28 Z0.
N520 (PROFILE TOP)
N530 G00 G90 G154 P4 A270. X1.5652 Y3.25
N540 G43 H1 Z6.
N550 M98 P0502
N560 M09
N570 M05
N580 G91 G28 Z0.
N590 M01
N600 (DRILL TOP)
N610 T2 M06 (1/2 DRILL)
N620 (MAX - Z6.)
N630 (MIN - Z3.)
N640 G00 G17 G90 G154 P1 A0. X-3.5 Y1.5 S1833 M03
N650 G43 H2 Z6.
N660 M98 P0503
N670 G91 G28 Z0.
N680 (DRILL TOP)
N690 G00 G90 G154 P2 A90. X-3.5 Y1.5
N700 G43 H2 Z6.
N710 M98 P0503
N720 G91 G28 Z0.
N730 (DRILL TOP)
N740 G00 G90 G154 P3 A180. X-3.5 Y1.5
N750 G43 H2 Z6.
N760 M98 P0503
N770 G91 G28 Z0.
N780 (DRILL TOP)
N790 G00 G90 G154 P4 A270. X-3.5 Y1.5
N800 G43 H2 Z6.
N810 M98 P0503
N820 M05
N830 G91 G28 Z0.
N840 M01
N850 (CUT CHANNEL)
N860 (COMPENSATION TYPE - OFF)
N870 T3 M06 (1/2 BALL ENDMILL)
N880 (MAX - Z6.)
N890 (MIN - Z1.75)
N900 G00 G17 G90 G154 P1 A0. X-4.5 Y3.5 S3056 M03
N910 G43 H3 Z6.
N920 M08
N930 M98 P0504
N940 G91 G28 Z0.
N950 (CUT CHANNEL)
N960 G00 G90 G154 P2 A90. X-4.5 Y3.5
N970 G43 H3 Z6.
N980 M98 P0504
N990 G91 G28 Z0.
N1000 (CUT CHANNEL)
N1010 G00 G90 G154 P3 A180. X-4.5 Y3.5
N1020 G43 H3 Z6.
N1030 M98 P0504
N1040 G91 G28 Z0.
N1050 (CUT CHANNEL)
N1060 G00 G90 G154 P4 A270. X-4.5 Y3.5
N1070 G43 H3 Z6.
N1080 M98 P0504
N1090 M09
N1100 M05
N1110 G91 G28 Z0.
N1120 G28 Y0. A0.
N1130 G90
N1140 M30

 

  • Like 1
Link to comment
Share on other sites

If you did them as individual transform operation then you could control back and forth rotations. By having one operation you are at the mercy of what it give you if you would like to finish a tool at a face then work back to start from the previous that is where individual transform operation let you control that. The current process is not that intelligent it just keep going back to start for each tool verse starting from the face that the machine is indexed  at. That is where the programmer can really control things, by doing that controlling it and not letting the CAM Software that is not aware enough do it for you. will have to watch the crazy workoffset getting messed up trying it this way.

Link to comment
Share on other sites

Example? Are you saying just transform around instead of sub? Subing gives us the advantage of indicating each part at its own WCS vs. hoping the fixture is true, that and the memory on these machines is seriously lacking. But I might not be following what your are saying, and completely outed myself as in over my head... lol

Link to comment
Share on other sites

Your most efficient process for running this type of work is to limit indexes. Mastercam using transform doesn't take this into account. The programmer has to take this into account. You have C0 as you starting index. You then index around to C270 on your 4th Face. You want your next operation to start at 270 and then go back down to C0. The way you have your transform operation setup you will get each tool start at C0 which means an index from where you were on your last tool back to the start at C0. One fast machine will barely notice the time it takes, but every second counts when I am programming and wasted Z rapid moves and indexes drive me crazy. I will spend 2 hours programming something on a production job to cut 1 minute out of the running of the part. I am only running 5 parts no big deal, but when I am running large quantities I change my mind set to shave every possible second I can. Got a customer running 350 parts a week on a different project. We were able to cut 6 minutes a part out of the run time. That is a potential savings of 109,200 minutes or 1820 hours. That was worth my 40 hours to do what I did for that customer. In your case if it just to make it run in the machine and no one cares then make it easy on yourself and do it like you did it, but if you want to push yourself and really dial down the process then look at every possible place you can to run it the most efficient way you can.

  • Like 1
Link to comment
Share on other sites

Here is the code and the example file. Notice I start with 9 and use -1 top reverse the workoffet to match. To bad we can assign a value to each face and have Mastercam track it through the planes manger. I cannot explain why the indexes are negative when they should be positive.

%
O0500 (5th Axis Tombstone Example)
(MPMASTER GENERIC 3/4-AXIS VERTICAL)
(MACHINE GROUP-1)
(MCX FILE  - C:\USERS\RON\DOCUMENTS\MY MCAM2018\PARTS\TOMBSTONE EXPER.MCAM)
(PROGRAM   - 5th Axis Tombstone Example.NC)
(DATE      - APR-09-2018)
(TIME      - 11:11 AM)
(T1   - 1/2 FLAT ENDMILL     - H1   - D1   - D0.5000")
(T2   - 1/2 DRILL            - H2   - D2   - D0.5000")
(T3   - 1/2 BALL ENDMILL     - H3   - D3   - D0.5000" - R0.2500")
(OVERALL MAX - Z6.)
(OVERALL MIN - Z1.75)
N100 G00 G17 G20 G40 G80 G90
N110 G91 G28 Z0.
N120 (PROFILE PART)
N130 (COMPENSATION TYPE - COMPUTER)
N140 T1 M06 (1/2 FLAT ENDMILL)
N150 (MAX - Z6.)
N160 (MIN - Z3.)
N170 G00 G17 G90 G154 P1 A0. X.25 Y-3. S3056 M03
N180 G43 H1 Z6.
N190 M08
N200 M98 P0501
N210 G91 G28 Z0.
N220 (PROFILE PART)
N230 G00 G90 G154 P2 A90. X.25 Y-3.
N240 G43 H1 Z6.
N250 M98 P0501
N260 G91 G28 Z0.
N270 (PROFILE PART)
N280 G00 G90 G154 P3 A180. X.25 Y-3.
N290 G43 H1 Z6.
N300 M98 P0501
N310 G91 G28 Z0.
N320 (PROFILE PART)
N330 G00 G90 G154 P4 A270. X.25 Y-3.
N340 G43 H1 Z6.
N350 M98 P0501
N360 M09
N370 M05
N380 G91 G28 Z0.
N390 M01
N400 (DRILL TOP)
N410 T2 M06 (1/2 DRILL)
N420 (MAX - Z6.)
N430 (MIN - Z3.)
N440 G00 G17 G90 G154 P4 A270. X-3.5 Y1.5 S1833 M03
N450 G43 H2 Z6.
N460 M98 P0502
N470 G91 G28 Z0.
N480 (DRILL TOP)
N490 G00 G90 G154 P3 A-180. X-3.5 Y1.5
N500 G43 H2 Z6.
N510 M98 P0502
N520 G91 G28 Z0.
N530 (DRILL TOP)
N540 G00 G90 G154 P2 A-90. X-3.5 Y1.5
N550 G43 H2 Z6.
N560 M98 P0502
N570 G91 G28 Z0.
N580 (DRILL TOP)
N590 G00 G90 G154 P1 A-0. X-3.5 Y1.5
N600 G43 H2 Z6.
N610 M98 P0502
N620 M05
N630 G91 G28 Z0.
N640 M01
N650 (CUT CHANNEL)
N660 (COMPENSATION TYPE - OFF)
N670 T3 M06 (1/2 BALL ENDMILL)
N680 (MAX - Z6.)
N690 (MIN - Z1.75)
N700 G00 G17 G90 G154 P1 A0. X-4.5 Y3.5 S3056 M03
N710 G43 H3 Z6.
N720 M08
N730 M98 P0504
N740 G91 G28 Z0.
N750 (CUT CHANNEL)
N760 G00 G90 G154 P2 A90. X-4.5 Y3.5
N770 G43 H3 Z6.
N780 M98 P0504
N790 G91 G28 Z0.
N800 (CUT CHANNEL)
N810 G00 G90 G154 P3 A180. X-4.5 Y3.5
N820 G43 H3 Z6.
N830 M98 P0504
N840 G91 G28 Z0.
N850 (CUT CHANNEL)
N860 G00 G90 G154 P4 A270. X-4.5 Y3.5
N870 G43 H3 Z6.
N880 M98 P0504
N890 M09
N900 M05
N910 G91 G28 Z0.
N920 G28 Y0. A0.
N930 G90
N940 M30

This was using your modified MPMASTER post.

5th Axis tombstone exper

  • Thanks 1
Link to comment
Share on other sites

It is a production shop. I'm already shaving time by using my chair of Mcam vs. their oneCNC. But my goal is to improve my game, for the sake of bettering myself. Obviously my employer benefits aswell. Thank you for your insight, one thing I hate is rapid moves, but I am limited in my knowledge of how to eliminate them. I am constantly seeking improvement in my process but find the lack of material in these processes does not help. That is why I am grateful for yours and others help on this forum. I literally learn something new everyday.

Link to comment
Share on other sites
6 minutes ago, motor-vater said:

It is a production shop. I'm already shaving time by using my chair of Mcam vs. their oneCNC. But my goal is to improve my game, for the sake of bettering myself. Obviously my employer benefits aswell. Thank you for your insight, one thing I hate is rapid moves, but I am limited in my knowledge of how to eliminate them. I am constantly seeking improvement in my process but find the lack of material in these processes does not help. That is why I am grateful for yours and others help on this forum. I literally learn something new everyday.

Ref points is your best friend. One Ref point the face operation getting you to the face and then one your last operation one ref point to get you away from the face. Then you can set all your rapids to the lowest place.

I am blessed and I am glad to be a blessing to anyone I can help that wants to be helped. Thank you for wanting to get better.

  • Like 2
Link to comment
Share on other sites

Ron Saw what you did there, Awesome! Now I understand what you are saying. Thanks again. Colin as always I love getting your input on these things as well. There are many great minds lingering around here and 2 many ways to accomplish the same things in mastercam. As many opinions as possible are always helpful.

Link to comment
Share on other sites
%
O0500 (5th Axis Tombstone Example)
(MPMASTER GENERIC 3/4-AXIS VERTICAL)
(MACHINE GROUP-1)
(MCX FILE  - C:\USERS\BRAD\DOWNLOADS\5TH AXIS TOMBSTONE EXPER.MCAM)
(PROGRAM   - 5th Axis Tombstone Example.NC)
(DATE      - APR-09-2018)
(TIME      - 11:55 AM)
(T1   - 1/2 FLAT ENDMILL     - H1   - D1   - D0.5000")
(T2   - 1/2 DRILL            - H2   - D2   - D0.5000")
(T3   - 1/2 BALL ENDMILL     - H3   - D3   - D0.5000" - R0.2500")
(OVERALL MAX - Z6.)
(OVERALL MIN - Z1.75)
G00 G17 G20 G40 G80 G90
G91 G28 Z0.
(PROFILE PART)
(COMPENSATION TYPE - COMPUTER)
T1 M06 (1/2 FLAT ENDMILL)
(MAX - Z6.)
(MIN - Z3.)
G00 G17 G90 G154 P1 A0. X.25 Y-3. S3056 M03
G43 H1 Z6.
M08
M98 P0501
G91 G28 Z0.
(PROFILE PART)
G00 G90 G154 P2 A90. X.25 Y-3.
G43 H1 Z6.
M98 P0501
G91 G28 Z0.
(PROFILE PART)
G00 G90 G154 P3 A180. X.25 Y-3.
G43 H1 Z6.
M98 P0501
G91 G28 Z0.
(PROFILE PART)
G00 G90 G154 P4 A270. X.25 Y-3.
G43 H1 Z6.
M98 P0501
M09
M05
G91 G28 Z0.
M01
(DRILL TOP)
T2 M06 (1/2 DRILL)
(MAX - Z6.)
(MIN - Z3.)
G00 G17 G90 G154 P4 A270. X-3.5 Y1.5 S1833 M03
G43 H2 Z6.
M98 P0502
G91 G28 Z0.
(DRILL TOP)
G00 G90 G154 P3 A-180. X-3.5 Y1.5
G43 H2 Z6.
M98 P0502
G91 G28 Z0.
(DRILL TOP)
G00 G90 G154 P2 A-90. X-3.5 Y1.5
G43 H2 Z6.
M98 P0502
G91 G28 Z0.
(DRILL TOP)
G00 G90 G154 P1 A-0. X-3.5 Y1.5
G43 H2 Z6.
M98 P0502
M05
G91 G28 Z0.
M01
(CUT CHANNEL)
(COMPENSATION TYPE - OFF)
T3 M06 (1/2 BALL ENDMILL)
(MAX - Z6.)
(MIN - Z1.75)
G00 G17 G90 G154 P1 A0. X-4.5 Y3.5 S3056 M03
G43 H3 Z6.
M08
M98 P0504
G91 G28 Z0.
(CUT CHANNEL)
G00 G90 G154 P2 A90. X-4.5 Y3.5
G43 H3 Z6.
M98 P0504
G91 G28 Z0.
(CUT CHANNEL)
G00 G90 G154 P3 A180. X-4.5 Y3.5
G43 H3 Z6.
M98 P0504
G91 G28 Z0.
(CUT CHANNEL)
G00 G90 G154 P4 A270. X-4.5 Y3.5
G43 H3 Z6.
M98 P0504
M09
M05
G91 G28 Z0.
G28 Y0. A0.
G90
M30

N0501
(PROFILE PART)
Z4.2
G94 G01 Z3. F12.22
Y-2.5 F24.45
G03 X-.25 Y-2. I-.5 J0.
G01 X-4.
G02 X-4.25 Y-1.75 I0. J.25
G01 Y-.75
G02 X-4. Y-.5 I.25 J0.
G01 X3.5
G02 Y-2. I0. J-.75
G01 X-.25
G03 X-.75 Y-2.5 I0. J-.5
G01 Y-3.
Z3.2 F12.22
G00 Z5.
Z6.
X-.25 Y3.25
Z4.2
G01 Z3.
Y2.75 F24.45
G03 X.25 Y2.25 I.5 J0.
G01 X4.
G02 X4.25 Y2. I0. J-.25
G01 Y1.
G02 X4. Y.75 I-.25 J0.
G01 X-3.5
G02 Y2.25 I0. J.75
G01 X.25
G03 X.75 Y2.75 I0. J.5
G01 Y3.25
Z3.2 F12.22
G00 Z6.
(PROFILE TOP)
X1.5652
Z4.2
G01 Z3.5
Y2.75 F24.45
G03 X2.0652 Y2.25 I.5 J0.
G01 X4.
G02 X4.25 Y2. I0. J-.25
G01 Y1.
G02 X4. Y.75 I-.25 J0.
G01 X0.
G02 X-.25 Y1. I0. J.25
G01 Y2.
G02 X0. Y2.25 I.25 J0.
G01 X2.0652
G03 X2.5652 Y2.75 I0. J.5
G01 Y3.25
Z3.7 F12.22
G00 Z5.5
Z6.
X-1.5 Y-3.
Z4.2
G01 Z3.5
Y-2.5 F24.45
G03 X-2. Y-2. I-.5 J0.
G01 X-4.
G02 X-4.25 Y-1.75 I0. J.25
G01 Y-.75
G02 X-4. Y-.5 I.25 J0.
G01 X0.
G02 X.25 Y-.75 I0. J-.25
G01 Y-1.75
G02 X0. Y-2. I-.25 J0.
G01 X-2.
G03 X-2.5 Y-2.5 I0. J-.5
G01 Y-3.
Z3.7 F12.22
G00 Z6.
M99

N0502
(DRILL TOP)
G94
G98 G81 Z3. R6.5 F8.8
X3.5 Y-1.25
G80
M99

N0504
(CUT CHANNEL)
Z2.2
G94 G01 Z1.75 F9.78
X-4. F19.56
X-1.25
Z1.95 F9.78
G00 Z5.75
Z6.
X4.5 Y-3.5
Z2.2
G01 Z1.75
X4. F19.56
X1.25
Z1.95 F9.78
G00 Z6.
M99
Link to comment
Share on other sites

In your transform settings you have one set to output subs...then you're trying to transform the transform and get subs...

If you set the 1st one to output subs you should be able to transform rotate without outputting subs and still get the subs you want..

I do this all the time but unfortunately I can't share a file

Link to comment
Share on other sites

Jparis can you show me with the attached sample file? I hear what your saying I'll have to play some more when I have time. I got a stack of hot jobs in front of me and a gun to my head to get them done yesterday... Man I wish my boss would ever ask me how long something takes before he commits to a ridiculous deadline...

  • Thanks 1
Link to comment
Share on other sites

OK, I am going to preface this by saying I don't know how many people do it this way but this is what I do.....

As I can have anywhere between 4 and 96 pcs, (so far) on a tombstone, we use a WCS for every position with setups like this....it also allows for absolute subs which are just easier to manage with changes.

I create all of the WCS positions...from that point I can handle transforms in a few different ways.....I can go for a straight transform around a tombstone and not worry too much about running high to low or go for effient and run high to low >> Rotate >> the low to high...becasue all of my origins are pre-made, when transforming I don't have to worry about juggling the offset numbers, the positions are picked up within the transform and inherit the work shift number from the plane...

Transform is FAR more flexible when used in this manner...sure, you can certainly just grab your ops and transform them and that will get you code that will run....when you run high production pars the guy on the floor will just spend a bunch of time making the program more efficient...I choose to do it on my end instead

 

https://www.dropbox.com/s/gawqglcas6lul2z/TOMBSTONE SAMPLE.ZIP?dl=0

 

PS...My post also handles several things....I get a clearance jump at ALL workshift calls, the height is controlled via a MR variable....with outputting, at times many work shifts, my post will also calculate ans output all the G10 information in the header

 

 

Edited by Guest
Added PS
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...