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:

Transform rotate sub routine problem


mcpgmr
 Share

Recommended Posts

Fanuc Control or post problem. Sample code below. Does the first three rotations right then machine goes off on a tangent. Any ideas? Thanks in advance.

 

( RF AND FIN PKT TO 1ST LEVEL )

N566 X-1.8904 Y-3.2743

N571 M98 P0001

N541 G69

( RF AND FIN PKT TO 1ST LEVEL )

N576 G90 X1.8904 Y-3.2743

N581 G0 G90 G68 X0. Y0. G91 R60.

N586 M98 P0001

( RF AND FIN PKT TO 1ST LEVEL )

N591 G90 X3.7809 Y0.

N596 G0 G90 G68 X0. Y0. G91 R60.

N601 M98 P0001

( RF AND FIN PKT TO 1ST LEVEL )

N606 G90 X1.8904 Y3.2743

N611 G0 G90 G68 X0. Y0. G91 R60.

N616 M98 P0001

( RF AND FIN PKT TO 1ST LEVEL )

N621 G90 X-1.8904 Y3.2743

N626 G0 G90 G68 X0. Y0. G91 R60.

N631 M98 P0001

N636 M5

N641 G91 G28 Z0. M9

N646 G91 G28 Y0.0

N651 G90

N656 M30

 

O0001

N1 Z.1

N6 G1 X-1.8342 Y-3.177 Z.0941 F10.

N11 X-1.9148 Y-3.3165 Z.0857

N16 X-1.8342 Y-3.177 Z.0772

N21 X-1.9148 Y-3.3165 Z.0688

N26 X-1.8342 Y-3.177 Z.0604

N31 X-1.9148 Y-3.3165 Z.0519

N36 X-1.8342 Y-3.177 Z.0435

N41 X-1.9148 Y-3.3165 Z.035

N46 X-1.8342 Y-3.177 Z.0266

N51 X-1.9148 Y-3.3165 Z.0182

N56 X-1.8342 Y-3.177 Z.0097

N61 X-1.9148 Y-3.3165 Z.0013

N66 X-1.8342 Y-3.177 Z-.0072

N71 X-1.9148 Y-3.3165 Z-.0156

N76 X-1.8342 Y-3.177 Z-.024

N81 X-1.9148 Y-3.3165 Z-.0325

N86 X-1.8342 Y-3.177 Z-.0409

N91 X-1.9148 Y-3.3165 Z-.0494

N96 X-1.8342 Y-3.177 Z-.0578

N101 X-1.9148 Y-3.3165 Z-.0662

N106 X-1.8342 Y-3.177 Z-.0747

N111 X-1.9148 Y-3.3165 Z-.0831

N116 X-1.8342 Y-3.177 Z-.0916

N121 X-1.9148 Y-3.3165 Z-.1

N126 X-1.9157 Y-3.308 F21.33

N131 M98 P1006

Link to comment
Share on other sites

Didn't soleve the problem. Machine seems to be rotating the pocket at the wrong angle now. I don't see a difference when I change from absolute to incremental in my rotaion parameters in MCX2. I also have a G90 and G91 on the G68 line. See previous sample code. How would you guys go about doing this? I have my z depths subs set to incremental and my transfor rot subs set to absolute. Trying to keep the code under 118000 bytes which is my limit. Thanks in advance.

Link to comment
Share on other sites

Does anyone actually have there post tweaked right for xform rotation sub routines and depth of cut sub routines and are successful at getting code that does not need to be edited at the control? I sure could use some pointers. Control is Fanuc Oi-M. Thanks in advance.

Link to comment
Share on other sites

:BUMP: Hey guys, Does anyone that have limited memory on the machine (118000) use rotation sub routines with X2? If so what is your method. I create the geo for one pocket and then transform using rotation and set the amount of copies and angle of rotation. When I check the sub routine box I'm not sure if I should go absolute or incremental. Either way I see no difference in the code. I get G68 and everything but no G69 canceleation. I'm not asking for a post but onle some pointers on how to make mine work. Also when it does generate the subs it seems like it creates new ones as it rotates rather then rotate the first ones again which is eating up more space. Thanks in advance!

Link to comment
Share on other sites

Hi Paul,

 

We have a machine with limited memory and used this once not too long ago. I had the transform op set to rotate, the method is set to coordinate, and I have the subprogram set to absolute. I get a single subprogram with mine, but I see there is check box labeled "unique subprograms" under Group NCI output in the lower left corner. If it's checked but blanked out will it cause problems? I don't know, something to look at. The only post mod I did was to not output an incremental rotation in the G68 line. Our machine did not like that as it went off into nowhere like you described. I did not get as far as the M69 problem, I just edited that into the program after the subprogram call. This is only time we've used this and I needed to keep moving with other things.

 

Here's the post block I changed:

 

psub_rotate #Rotate start code, user

pbld, n$, *sgcode, *sgabsinc, strns_rot_on, *sub_trnsx$, *sub_trnsy$,

*rt_cinc, e$ #removed [absinc$ = one], *sgabsinc, #1/29/2008 gds

 

I always note what I change with a date in case I hack it up so ignore my jibberish at the end there. Wish I had a full solution for you, but maybe this will help a little.

 

Greg

Link to comment
Share on other sites

What is M98 P1006 for? are you using this to return to your main program or does it call another sub that you didn't post? It could make a difference. M99 should be used to end all sub programs and I think this is whats causing the problem. Also need to use G69 after each M98 P1000 call to cancel rotation.

Link to comment
Share on other sites

Paul, I just tweaked my post last week for that same thing. The G90 and G91 in same line and G69 only after 1st rotation, right?

I just got back from Georgia (cribmaster conference), so gimme a little to dig it up....

Link to comment
Share on other sites

Got it.... Make these changes to these post blocks (make sure you have backups... wink.gif ) and see if it works.

HTH cheers.gif

 

code:

 psub_rotate     #Rotate start code, user

pbld, n$, *sgcode, *sgabsinc, strns_rot_on, *sub_trnsx$, *sub_trnsy$,

#[absinc$ = one], *sgabsinc, *rt_cinc, e$ ------Don't want this here....remd 4-23-08 rb

*rt_cinc, e$

and

code:

 psub_end_m$      #End in main level

 

n$, "M99", e$

prv_absinc$ = -1

#Reset update variables for subs at main level

#Mirror or Rotate cancel, output is forced

if (sub_trnstyp$ > zero & esub_sec_no$ > zero)

| (sub_trnstyp$ > one & esub_sec_no$ = esub_totl_no$-one

######## WAS ############################################

#if (sub_trnstyp$ = zero & esub_sec_no$ > zero)

# | (sub_trnstyp$ = one & esub_sec_no$ = esub_totl_no$-one

########end WAS########################################## edited 4-23-08 rb


and in pcuttype block...

code:

 if sub_trnstyp$ = one & sub_trnmthd$ = two,

[

#Calculate the rotation incremental angle for G68

rt_csav = atan2(sub_m2$, sub_m1$)

#rt_cinc = prv_rt_csav - rt_csav ---edit 4 lines 4-23-08 rb

rt_cinc = rt_csav

#while rt_cinc > 180, rt_cinc = rt_cinc - 360

#while rt_cinc < -180,rt_cinc = rt_cinc + 360

if rot_ccw_pos = one, rt_cinc = -rt_cinc

!rt_csav

if sub_sec_no$, mr_rt_actv = two

else, mr_rt_actv = one

]

Link to comment
Share on other sites

Well it was a little bit of work, but the post for some reason is not seeing the strns_rot_off variable. So what I did was to add this to the end of the psub_call_trans to get this output:

 

code:

(  1/4 FLAT ROBB JACK ENDMILL   TOOL - 12  DIA. OFF. - 12  LEN. - 12  DIA. - .25 )

( RF AND FIN PKT TO 1ST LEVEL )

N5190 T12

N5200 M6

N5210 G0 G90 G54 X-2.9195 Y-.05 S1833 M3

N5220 G43 H12 Z2. M8

N5230 Z.1

N5240 G1 Z-.1 F2.

N5250 M98 P1003

N5260 G90 Z0. F50.

N5270 G0 Z.25

N5280 X-2.9145 Y0.

N5290 Z.1

N5300 G1 Z-.1 F2.

N5310 M98 P1004

N5320 G90 Z0. F50.

N5330 G0 Z.25

N5340 X-2.9195 Y-.05

N5350 Z0.

N5360 G1 Z-.2 F2.

N5370 M98 P1003

N5380 G90 Z-.1 F50.

N5390 G0 Z.25

N5400 X-2.9145 Y0.

N5410 Z0.

N5420 G1 Z-.2 F2.

N5430 M98 P1004

N5440 G90 Z-.1 F50.

N5450 G0 Z.25

N5460 X-2.9195 Y-.05

N5470 Z-.1

N5480 G1 Z-.3 F2.

N5490 M98 P1003

N5500 G90 Z-.2 F50.

N5510 G0 Z.25

N5520 X-2.9145 Y0.

N5530 Z-.1

N5540 G1 Z-.3 F2.

N5550 M98 P1004

N5560 G90 Z-.2 F50.

N5570 G0 Z2.

( REPEAT POCKET 5 TIMES AT 60 DEG )

( RF AND FIN PKT TO 1ST LEVEL )

N5580 X-1.4164 Y-2.5533

N5590 M98 P0001

N5600 G69

( RF AND FIN PKT TO 1ST LEVEL )

N5610 G90 X1.503 Y-2.5033

N5620 G0 G90 G68 X0. Y0. R60.

N5630 M98 P0001

N5640 G69

( RF AND FIN PKT TO 1ST LEVEL )

N5650 G90 X2.9195 Y.05

N5660 G0 G90 G68 X0. Y0. R60.

N5670 M98 P0001

N5680 G69

( RF AND FIN PKT TO 1ST LEVEL )

N5690 G90 X1.4164 Y2.5533

N5700 G0 G90 G68 X0. Y0. R60.

N5710 M98 P0001

N5720 G69

( RF AND FIN PKT TO 1ST LEVEL )

N5730 G90 X-1.503 Y2.5033

N5740 G0 G90 G68 X0. Y0. R60.

N5750 M98 P0001

N5760 G69

( RF AND FIN 2ND LEVEL OF PKTS )

N5770 G90 X-4.394 Y-.4063

N5780 Z-.2

N5790 G1 Z-.375 F2.

N5800 X-4.4378 Y-.325 F14.66

N5810 M98 P1005

N5820 G90 Z-.275 F50.

N5830 G0 Z.25

N5840 X-4.4753 Y-.05

N5850 Z-.2

N5860 G1 Z-.375 F2.

N5870 M98 P1006

N5880 G90 Z-.275 F50.

N5890 G0 Z.25

It was added to this post block:

code:

psub_call_trans #Translate level calls from toolchange, user

if mi1$ <= one, result = mprint(shomeserror)

sav_absinc = absinc$

pindex

#Mirror or Rotate Coord's

if sub_trnstyp$ = zero | (sub_trnstyp$ = one & mr_rt_actv),

[

#The original pattern is not mirrored or rotated

if sub_sec_no$,

[

absinc$ = zero

if sub_trnstyp$, psub_rotate

else, psub_mirror

]

mr_rt_actv = three

]

else, #Translate

[

if sub_mny_t$,

[

if mi1$ > one, absinc$ = zero

pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfzout,

pfcout, e$

pe_inc_calc

ps_inc_calc

]

]

absinc$ = sav_absinc

result = nwadrs(strp, main_prg_no$)

if progno$ = main_prg_no$, result = mprint(sprgnerror)

pbld, n$, "M98", *main_prg_no$, e$

prv_feed = c9k #Force feed in sub

if sub_trnstyp$ = 1, pbld, n$, strns_rot_off, e$ #<---- Added 5-1-08

Also need to do away with this one here:

code:

psub_end_m$      #End in main level

n$, "M99", e$

prv_absinc$ = -1

#Reset update variables for subs at main level

#Mirror or Rotate cancel, output is forced

if (sub_trnstyp$ = zero & esub_sec_no$ > zero)

| (sub_trnstyp$ = one & esub_sec_no$ = esub_totl_no$-one

& sub_trnmthd$ = two),

[

subout$ = zero

no_nc_out$ = m_one

sav_absinc = absinc$

#Mirror cancel

if sub_trnstyp$ = zero,

[

absinc$ = zero

pbld, n$, *sgabsinc, strns_mir_off, *sub_trnsx$, *sub_trnsy$, e$

]

else, #Rotate cancel

[

#pbld, n$, strns_rot_off, e$ #<---- Made not to post to eliminate 2 G69 Codes

]

absinc$ = sav_absinc

no_nc_out$ = zero

]

end_sub_mny = sub_mny_t$

HTH

Link to comment
Share on other sites

Ron, did you have the

code:

 [absinc$ = one], *sgabsinc, *rt_cinc, e$ 

in your psub_rotate block? I had to rem it out in mine to get rid of the G90 and G91 in same block.

Just wondering... I looked thru all my posts, and they all have it. Perhaps I need to consider different base posts?

Link to comment
Share on other sites

It was done in his post when he sent it to me. I have never used it like he using it to rotate a pocket on a part. That is where the problem was coming in not rotating it around the B axis, but one one face where it is rotating it around the same B axis position and Mastercam seems to handle it on Axis rotations well, not on the same. By adding what I did you get it no matter what when rotating, but will not get it for other transform operations like Transform or Mirror only on Rotate.

 

HTH

Link to comment
Share on other sites

Thats where I ran into the problem. I rarely use axis rotation (G68). Last week I had a boss I was profiling on a stator at 22.5 degree increments on a vertical and I have limited memory. So I used the G68 Trans/Rotate to get it into subs. That is when I ran into it. You are right, I don't have problems with A or B rotations.

I am surprised that This G68 with G90 and G91 problem has not come up sooner. None of my Fanucs can use both abs/inc in one block.... headscratch.gif

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...