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:

Canned Cycle Rough - G68


Recommended Posts

Hello guys.

 

I am studying a way to configure the turning cycle G68 XZCDLMKFHSE Q.

 

I managed to set almost the whole cycle, but the value of X and Z not yet. X and Z are the start profile.

 

I know the generic pos mastercam calculates this, but I can not capture these values​​. Can someone give me a light on this.

 

 

G0 X110. Z2.566

F.2

G68 X52.634 Z.097 C2. D.2 L.4 M.2 S10 E20 Q220 (Correctly)

G68 X0. Z0. C2. D.2 L.4 M.2 S10 E20 Q220 (Wrongly)

N10 X52.634

G1 Z.097

X55.297 Z-1.234

G3 X55.765 Z-1.8 R.8

G1 Z-7.372

Z-24.517

Z-32.604

Z-58.773

X63.639 Z-69.42

X97.127 Z-76.026

G3 X97.862 Z-76.32 R.8

G1 X99.723 Z-77.687

G3 X100. Z-78.137 R.8

G1 Z-104.726

N20 X110.

G0 Z2.566

G0 X300. Z100.

 

The values ​​that are coming X0 and Z0 should be X52.634 Z.097.

 

I know that somehow these values ​​can be captured in this excerpt from post processor. But do not know how. formulate and test several already failed.

 

 

prcc_setup$ #Lathe canned cycle setup

#Capture values from rough

sav_iprcc = c1_ipr_actv

sav_feedcc = c1_fr_pos

if orient$ = one|orient$ = two|orient$ = five|orient$ = 6, lccdirx = one

else, lccdirx = m_one

if orient$ = one|orient$ = four|orient$ = five|orient$ = 8, lccdirz = one

else, lccdirz = m_one

if lathecc > zero, cc_stop_fcc = one

else, cc_stop_fcc = zero

#G74/G75

if lathecc = three,

[

lcc_xcst = vequ (copy_x)

if dopeckcc = zero,

[

depthcc = zero

clearcc = zero

]

if directcc > one,

[

gcodecc = four

grvspcc = stepcc

grvdpcc = depthcc

]

else,

[

gcodecc = five

grvspcc = depthcc

grvdpcc = stepcc

]

]

else,

[

if n1_cc_pos,

[

sav_xa = vequ(copy_x)

#Shift for cutter comp. start position

copy_x = copy_x + (lcc_move * lccdirx)

copy_z = copy_z + (lcc_move * lccdirz)

pcom_moveb

compok = zero

lcc_cc_pos = one

]

else, lcc_cc_pos = zero

]

sub_seq_typ$ = 0

 

prcc_call_st$ #Rough canned cycle start

if tool_op$ <> 208,

[

sav_subout = subout$

sav_omitsq = omitseq$

omitseq$ = one

extprg$ = one

subout$ = three

]

 

prcc_call_end$ #Rough canned cycle end

 

# Restore cc_1013 to the value it held prior to the rough

# groove canned cycle. cc_1013 was changed in ptoolend.

if tool_op$ = 208 | tool_op$ = 62, cc_1013$ = sav_cc_1013

if tool_op$ <> 208,

[

omitseq$ = sav_omitsq

#Close the ext file

result = fclose (sbufname3$)

#Open the ext file as a buffer

#Use the size to determine the start and end sequence

subout$ = sav_subout

size3 = rbuf(three, zero)

if omitseq$ = one,

[

ng70s = n$

ng70e = n$ + seqinc$

]

else,

[

if old_new_sw = zero, ng70s = n$ + seqinc$

else, ng70s = n$ + (seqinc$ * two)

ng70e = ng70s + (seqinc$ * (size3 - one))

]

pwrite_g70

]

#Setup the stock and clearance directions

g73x = vsub (lcc_xcst,lcc_xcend)

if old_new_sw = zero, g73x = g73x

else, g73x = g73x * dia_mult

g73z = g73z

xstckcc = xstckcc * dia_mult * lccdirx

zstckcc = zstckcc * lccdirz

clearcc = clearcc * lccdirz

#Write the cycle definition

sav_feed = feed

sav_ipr = ipr_actv$

feed = sav_feedcc

ipr_actv$ = sav_iprcc

if lathecc = three,

[

#Setup the previous position for inc. in G74/G75 cycle

sav_xa = vequ(xabs) #Save the cycle end

copy_x = vequ(lcc_xcst) #The cycle start raw

pshft_map_xa

pxyzcout ##The cycle start in machine terms

ps_inc_calc #Recalculate incremental

pe_inc_calc #Update previous at start

xabs = vequ(sav_xa) #Restore the cycle end

ps_inc_calc #Recalculate incremental

]

if old_new_sw = zero,

[

if gcodecc < three, pg71old

if gcodecc = three, pg73old

if gcodecc > three, pg74old

]

else,

[

if gcodecc < three, pg71new

if gcodecc = three, pg73new

if gcodecc > three, pg74new

]

if lathecc = three,

[

#Set the cycle end position at the original start

copy_x = vequ(lcc_xcst) #The cycle start raw

pshft_map_xa

pxyzcout ##The cycle start in machine terms

ps_inc_calc #Position at start

pe_inc_calc #Update previous

ps_inc_calc #Recalculate incremental

]

feed = sav_feed

ipr_actv$ = sav_ipr

if tool_op$ <> 208,

[

#Bug2 is off to prevent execution crashes with long strings

bug2$ = zero

#Write the cycle profile, sequence are written now

rc3 = one

while rc3 <= size3,

[

#Write the lathe canned cycle profile

string3 = rbuf (three, rc3)

if rc3 = two,

[

#Add the finish spindle speed to the first move

speed = n1_ss

pbld, *n$, *string3, e$ #*speed,

]

else,

[

if omitseq$ = one & rc3 = size3 + one, pbld, *n$, *string3, e$

else, pbld, n$, *string3, e$

]

]

#Close the buffer

result = fclose (three)

#Remove the ext file

result = remove (sbufname3$)

bug2$ = sav_bug2

]

 

pfcc_call$ #G70 recall output postblock

if cc_stop_fcc = zero,

[

pread_g70

if foundcc = zero, result = mprint(sfccerror)

]

no_nc_out$ = zero

cc_stop_fcc = zero

 

pread_g70 #Read G70 recall buffer

foundcc = zero

size2 = rbuf (two, zero)

wc2 = one

while wc2 <= size2 & foundcc = zero,

[

fcc_subid = rbuf (two, wc2)

if fcc_subid = sub_op_id$,

[

gcodecc = zero

ng70s = fcc_ng70s

ng70e = fcc_ng70e

pbld, n$, *scclgcode, *ng70s, *ng70e, e$

foundcc = one

]

]

 

pwrite_g70 #Write G70 recall buffer

fcc_subid = sub_op_id$

fcc_ng70s = ng70s

fcc_ng70e = ng70e

fcc_subid = wbuf (two, rc2)

 

 

I appreciate your cooperation in my learning.

Link to comment
Share on other sites

Like I answered you privately not something easily undertaken. Things go on with the mp.dll and mp.pst that does some things behind the scenes. Might try the debugger to find what is the exact variable capturing and then outputting the value. Might could capture that and then buffer it our or something like that. but tons of extra work for a process I am really not sure you need. Not sure why the standard canned cycle could not be modified to do what you are after and be done.

  • Like 1
Link to comment
Share on other sites

Hi Bayron,

 

Can you upload a Zip to Go file that contains a sample Mastercam file, and the post that you are working on?

 

What version of Mastercam are you writing this post for? I believe X6 had a re-write of the Lathe canned cycles. There are some switch strings at the top of the post that can be used to configure the output for the canned cycle. I think that only changes the output of Cutter Comp, and sets if the comp value is turned on inside the cycle or not.

 

When the values are being calculated, I believe these variables hold the start and end positions, but you'll have to check and see where they get their values from:

 

lcc_xcst	 : 0	 #Lathe canned cycle contour start position
lcc_ycst	 : 0	 #Lathe canned cycle contour start position
lcc_zcst	 : 0	 #Lathe canned cycle contour start position
lcc_xcend    : 0	 #Lathe canned cycle contour end position
lcc_ycend    : 0	 #Lathe canned cycle contour end position
lcc_zcend    : 0	 #Lathe canned cycle contour end position

 

The values are probably set using a 'vequ' function. "Vector Equate" (vequ) is a function that copies the values of three sequential variables, and loads them into three other consecutive variables.

 

That is what this line does:

 

lcc_xcst = vequ (copy_x)

 

To give you any more tips for debugging this, I'd need to see your sample files...

  • Like 1
Link to comment
Share on other sites

Hi Bayron,

 

Can you upload a Zip to Go file that contains a sample Mastercam file, and the post that you are working on?

 

What version of Mastercam are you writing this post for? I believe X6 had a re-write of the Lathe canned cycles. There are some switch strings at the top of the post that can be used to configure the output for the canned cycle. I think that only changes the output of Cutter Comp, and sets if the comp value is turned on inside the cycle or not.

 

When the values are being calculated, I believe these variables hold the start and end positions, but you'll have to check and see where they get their values from:

 

lcc_xcst	 : 0	 #Lathe canned cycle contour start position
lcc_ycst	 : 0	 #Lathe canned cycle contour start position
lcc_zcst	 : 0	 #Lathe canned cycle contour start position
lcc_xcend : 0	 #Lathe canned cycle contour end position
lcc_ycend : 0	 #Lathe canned cycle contour end position
lcc_zcend : 0	 #Lathe canned cycle contour end position

 

The values are probably set using a 'vequ' function. "Vector Equate" (vequ) is a function that copies the values of three sequential variables, and loads them into three other consecutive variables.

 

That is what this line does:

 

lcc_xcst = vequ (copy_x)

 

To give you any more tips for debugging this, I'd need to see your sample files...

 

Hi Colin

 

Thank you, your answer gave me many ideas, I'll do some tests.

 

Dear Colin how do I send you the Zip to Go?

 

Thank you again.

Link to comment
Share on other sites

Like I answered you privately not something easily undertaken. Things go on with the mp.dll and mp.pst that does some things behind the scenes. Might try the debugger to find what is the exact variable capturing and then outputting the value. Might could capture that and then buffer it our or something like that. but tons of extra work for a process I am really not sure you need. Not sure why the standard canned cycle could not be modified to do what you are after and be done.

 

Dear Crazy^Millman, thank you very much

Link to comment
Share on other sites

First, make sure you have your test file loaded.

 

Go to Help > Zip2Go Utility.

 

In the dialog box, make sure the "toolpaths" check box is turned on. (leave the other boxes that are already on, checked).

 

Press the "create Zip2go file" button.

 

That places a copy of the Zip to go file in your "my documents" folder, with the same name as your MCX-7 file.

 

In this message board, you can do a Reply, then click on "More Reply Options". There is a feature on the message board to attach a file to a forum post. I'd suggest attaching the Zip2Go file there, that way others can take a look and help you get this figured out. I think of Emastercam like a small community. People will jump in when someone asks a question. I help when I can, but I can't promise I'll be able to answer your question.

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