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:

MPLmaster left hand tap


westerfieldc
 Share

Recommended Posts

I feel like a tard but here's my question I'm editing Mplmaster for a mori NL2500 when face tapping it ouputs G84 right tap correctly. But when I try left hand it still outputs G84 instead of the G84.1 that I put in under the (fstrsel sg70 gcodecc scclgcode 6 -1). I figure I'm just doing something wrong but I'm not sure what.

 

Thanks

Link to comment
Share on other sites

Wether your tapping on the main spindle or sub spindle it will still be a G84. G84 is rigid tapping.

 

In tool setup for the sub spindle tapping make sure your tool is set up for the correct spindle.

 

Notice I have a tool for left and right spindles?

 

moritap.jpg

Link to comment
Share on other sites

Guys the easy way to cut Left Hand Threads and have the code reflect that is to add spindle logic to the post for that code output. Mastercam sees reversing of the spindle as negative spindle speed. So if you use the same logic used for the M3/M4 then if would allow you to then make the post pick the right code for the tapping.

 

Here is the key part of the post to look at:

 

code:

pswtchspin      #Reverse spindle direction

if g_spdir > two, g_spdir = abs (g_spdir - five) + three

else, g_spdir = abs (g_spdir - two)

This logic sets the spindle direction forward or reverse. How do I know this well it tells you in the post it does.

 

So use the if g_spdir > two, and the else, to build your logic for outputting the correct G code for left hand tapping pretty straight forward logic. If you need help be glad to try to help you out. Surprised MPLMASTER does not already have this logic built into it. headscratch.gifheadscratch.gif

Link to comment
Share on other sites

No I looking for what Ron was talking about because the Mori uses M329 S??? then G84 or G84.1 so reversing the spindle dosen't come into play. Like Ron stated I am surprised the the post doesn't do it for me. It looks like it should that's why I think I'm doing something wrong. Ron if you could expand on your first reply how do I tie the spindle direction to sg83_fd

Link to comment
Share on other sites

Disclaimer anything shown here is use at your own risk. If you crash your machine or mess up your post you do it at your own risk!!!!!!

 

Oh and I think none of this was patented so we should be ok there. wink.gifwink.gif

 

Well it looks like the logic was not built into the post. It does have front and back spindle logic built into it, but for left and right hand tapping this logic was left out since it is not industry standard. It is easily done and using the current mplmaster I will show you or anyone how to do this.

 

Here is out tapping section from the post:

code:

ltap$            #Canned tap cycle, lathe

pdrlcommonb

if use_pitch = 0, #Feed/Min mode, feed divided by spindle speed is equal to thread lead

[

if rigid_tap, pbld, n$, *sm29, *speed, e$ #Rigid Tapping Can use G84/G88 with M29 or just G84.2

pcan1, pbld, n$, *sgdrlref, pgdrlout, pxout, pyout, pzout,

prdrlout, dwell$, pffr, strcantext, e$

]

else, #Feed/Rev mode, feed is equal to thread lead

[

if rigid_tap, pbld, n$, *sm29, *speed, e$ #Rigid Tapping Can use G84/G88 with M29 or just G84.2

if met_tool$, pitch = n_tap_thds$ # Tap pitch (mm per thread)

else, pitch = 1/n_tap_thds$ # Tap pitch (inches per thread)

pcan1, pbld, n$, *sgdrlref, pgdrlout, pxout, pyout, pzout,

prdrlout, dwell$, *pitch, !feed, strcantext, e$

]

pcom_movea

pcanceldcl

Now we need to look at what is called the strng values for Gcode output:

 

code:

# --------------------------------------------------------------------------

# Canned drill cycle string select

sg80_f : "G83" #drill face

sg80_fd : "G83" #drill face w/dwell

sg81_f : "G83" #peck face

sg81_fd : "G83" #peck face w/dwell

sg82_f : "G83" #chpbrk face

sg82_fd : "G83" #chpbrk face w/dwell

sg83_f : "G84" #tap right face

sg83_fd : "G84" #tap left face

sg84_f : "G85" #bore1 face

sg84_fd : "G85" #bore1 face w/dwell

sg85_f : "G86" #bore2 face

sg85_fd : "G88" #bore2 face w/dwell

sg86_f : "G87" #misc1 face

sg86_fd : "G87" #misc1 face w/dwell

sg87_f : "G8?" #misc2 face

sg87_fd : "G8?" #misc2 face w/dwell

sgdrillf : "" #Target for string

 

fstrsel sg80_f drlgsel sgdrillf 16 -1

Now if you notice the post talks about Left face and Right Face and not CW/CCW of the spindle. The industry standard here is the spindle direction would be the driving force for the use of a left or right hand tap. The needed for logic to do what you want will have to be created. What we need to do is define how we want to drive this. That will be easy. We will use the peck1$ or peck2$ from the output.

 

Now up front we have several different methods to call the code.

 

#1 We could use a mi integer or mr integer to call this code. Problem with this method not all contained in the drilling cycles and would require you to go through different windows to activate the code.

 

code:

if mi4$ = 0, "G84.1" #default

else, "G84.2"

#2 We could use a known call within the drilling cycle. We would first need to define the variable and let it be like a place holder then use the value from the drilling cycle to complete the code.

 

code:

fmt  G  4   peck2$     #M3/M4 Call for Left and right hand tapping 


Then in out post use that in the tapping cycle:

code:

        [

if rigid_tap, pbld, n$, *sm29, *speed, e$ #Rigid Tapping Can use G84/G88 with M29 or just G84.2

pcan1, pbld, n$, *sgdrlref, peck2$, pxout, pyout, pzout,

prdrlout, dwell$, pffr, strcantext, e$

]

Now in the Tap cycle for lathe you need to activate peck2$ by either changing the text in the post or in the control definition. Now put in either G84.1 or G84.2 and done.

 

The last one is a little more complex, but one to me that provides the least amount of chance of crashing the machine and still have the ability to call many different codes from the operation using what is already there.

 

Ok so we need to change the string containing out gcodes to now include what we are looking for. Now most people would think just insert it in the above, problem is the logic of the post supports the lay of the land so to speak. The drilling operations have a number and that number controls what code is used for each operation so if you inserted the code in the middle all the rest of your drilling code would be messed up. So we add our gcode at the end of this section. We have to change the string value from 16 to 17 since we added it. (We have right hand logic already in the post so all we are doing is adding left hand logic for the main, but we could easily add 2 using the same loci for main and sub to have it support main and sub left hand tapping using gcode as our control)

 

code:

# --------------------------------------------------------------------------

# Canned drill cycle string select

sg80_f : "G83" #drill face

sg80_fd : "G83" #drill face w/dwell

sg81_f : "G83" #peck face

sg81_fd : "G83" #peck face w/dwell

sg82_f : "G83" #chpbrk face

sg82_fd : "G83" #chpbrk face w/dwell

sg83_f : "G84" #tap right face

sg83_fd : "G84" #tap left face

sg84_f : "G85" #bore1 face

sg84_fd : "G85" #bore1 face w/dwell

sg85_f : "G86" #bore2 face

sg85_fd : "G88" #bore2 face w/dwell

sg86_f : "G87" #misc1 face

sg86_fd : "G87" #misc1 face w/dwell

sg87_f : "G8?" #misc2 face

sg87_fd : "G8?" #misc2 face w/dwell

sg84_2 : "G84.1" #Left Hand Tapping

sgdrillf : "" #Target for string

 

fstrsel sg80_f drlgsel sgdrillf 17 -1

We define our ltap operation to use peck1$ and we made something like M3=0(Default)/M4=1

 

Look here in the control definition to change the text for the lathe tapping:

 

ltap_cd.png

 

Now we go back to our ltap area of the post and add logic here:

code:

ltap$            #Canned tap cycle, lathe

pdrlcommonb

if peck1$ > 0, drlgsel = 17 #Added for Left Hand Tapping using Gcode.

if use_pitch = 0, #Feed/Min mode, feed divided by spindle speed is equal to thread lead

[

if rigid_tap, pbld, n$, *sm29, *speed, e$ #Rigid Tapping Can use G84/G88 with M29 or just G84.2

pcan1, pbld, n$, *sgdrlref, pgdrlout, pxout, pyout, pzout,

prdrlout, dwell$, pffr, strcantext, e$

]

else, #Feed/Rev mode, feed is equal to thread lead

[

if rigid_tap, pbld, n$, *sm29, *speed, e$ #Rigid Tapping Can use G84/G88 with M29 or just G84.2

if met_tool$, pitch = n_tap_thds$ # Tap pitch (mm per thread)

else, pitch = 1/n_tap_thds$ # Tap pitch (inches per thread)

pcan1, pbld, n$, *sgdrlref, pgdrlout, pxout, pyout, pzout,

prdrlout, dwell$, *pitch, !feed, strcantext, e$

]

pcom_movea

pcanceldcl

Now this should give you left hand tapping code that really takes your post and adds to the already proven logic and still gives you all the other things you have without worrying about messing something else up.

 

I hope that was clear enough and helpful.

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