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:

Lathe custom form thread


K20
 Share

Recommended Posts

52 minutes ago, JParis said:

I'll bite...whatcha' got?

You need to put dwell on

the lenght and pitch are in the misc

Control depth of pass in peck and depth of cut

To finish give only one passe in peck and depth of cut but change the whith of pass from % to step amount

Always keep dwell to  1 or more

and unselect finish

I dont have an nc simulator but the code is tested

Do you know a good freeware to test nc codes?

Give me feedback 

NOW IN ENGLISH

 

 

THREADENG .pst

THREADENG .mcam-lmd

custom thread.mcam

Edited by K20
CORRECTION TO ENGLISH
  • Thanks 1
Link to comment
Share on other sites

I have said it before and will say it again: this should be a standard feature of Mastercam :) I use a macro B program for special threading, but a custom post sounds like more fun. Thanks for sharing for free!

Remember to put the tool to a small tilt to avoid rubbing with the back of the tool.

  • Like 2
Link to comment
Share on other sites
  • 11 months later...

K20,

I appreciate that you've been able to hack the Post to get the output that you want. But using the "Dwell" parameter, is the wrong way to go about making this work. What you've done is to "break" the Dwell function, for any other section of the Post that would use it to output an actual "Dwell" command.

Here is the original Dwell Post Block:

pdwell1         #Dwell output
      gcode$ = four  #for implied dwells
      pcan1, pbld, n$, *sgcode, *dwell$, strcantext, e$

Here is the block that you've hacked to get the output you want for this specific task:

pdwell1         #Dwell output
      pbld, n$, "G32", *mr1$, psgcode, *mr2$, e$
      #if gcode$ = four 
      #pbld, n$, "G32", "mr1$","*mr2$", e$
      #pbld, n$, "G32", "-"*dwell$, *pffr, e$
      #pbld, n$, *psgfeed, e$
      #pbld, n$, "G00", e$

 

I don't want to discourage you from learning how to edit a Post, as that is something I think every serious CNC Programmer should learn how to do. But there is also a "right way", and a "wrong way" to make your edits. I consider any edits that "break" other functions in the Post to be the "wrong way" to edit a Post.

Also, do you realize you "broke" the Incremental Calculations for X and Z output?

Here is the original Format Assignment block:

fmt  "N" 24  n$           #Sequence number

fmt  "X" 2  xabs        #X position output
fmt  "Y" 2  yabs        #Y position output
fmt  "Z" 2  zabs        #Z position output

fmt  "U" 3  xinc        #X position output
fmt  "V" 3  yinc        #Y position output
fmt  "W" 3  zinc        #Z position output

fmt  "C" 11 cabs        #C axis position
fmt  "H" 14 cinc        #C axis position
fmt  "C" 11 cout_a      #C axis position
fmt  "H" 14 cout_i      #C axis position

I put a carriage return after the "absolute" and "incremental" variables, to help you see that these 3 absolute variables (xabs, yabs, and zabs) and the three incremental variables (xinc, yinc, zinc), must remain in a "ordered list" (implied array of variables). When you move the variables out of position, or insert a new variable at the beginning, middle, or end of the list, you break any of the "vector math functions" that expect an ordered list of variables. Vector Add, and Vector Subtract functions use a single "input" variable, that indicates the beginning of a list of "3 ordered variables".

Here is your Format Assignment section:

fmt  "N" 4  n$          #Sequence number

fmt  "X" 2  xabs        #X position output
fmt  "Y" 2  yabs        #Y position output
fmt  "Z" 2  zabs        #Z position output

fmt  "Z" 2  zinc        #Z position output

fmt  "U" 3  xinc        #X position output
fmt  "V" 3  yinc        #Y position output
fmt  "W" 3  mr1$        #Z position output

fmt  "I" 3  iout        #Arc center description in X
fmt  "J" 3  jout        #Arc center description in Y
fmt  "K" 3  kout        #Arc center description in Z
fmt  "R" 2  arcrad$     #Arc Radius

By moving "zinc" above "xinc", and adding your own new Format Assignment for MR1, you've changed the way that the Incremental values will be calculated. The most dangerous part of this, is the fact that 'zinc' will never get its value set by this code:

#Incremental calculations
ps_inc_calc     #Incremental calculations, start
      xia = fmtrnd(xabs)
      yia = fmtrnd(yabs)
      zia = fmtrnd(zabs)
      xinc = vsub (xia, prv_xia) #This line calculates all three incremental variables: xinc, yinc, and zinc, with Vector Subtract!

By editing the placement of your variables in the "ordered list", that function will now set: xinc, yinc, and mr1$. (So, zinc never gets set!)

You could do the following, which would at least not "break" the incremental functions:

fmt  "N" 4  n$          #Sequence number

fmt  "X" 2  xabs        #X position output
fmt  "Y" 2  yabs        #Y position output
fmt  "Z" 2  zabs        #Z position output

fmt  "U" 3  xinc        #X position output
fmt  "V" 3  yinc        #Y position output
fmt  "Z" 2  zinc        #Z position output

fmt  "W" 3  mr1$        #Z position output

fmt  "I" 3  iout        #Arc center description in X
fmt  "J" 3  jout        #Arc center description in Y
fmt  "K" 3  kout        #Arc center description in Z
fmt  "R" 2  arcrad$     #Arc Radius

 

Again, I'm not trying to discourage you from making Post Edits that serve your needs, but I'm very worried with this statement you made: "I can also edit Posts for other controls". By making the edits the way that you are, you're honestly causing more harm than good.

Link to comment
Share on other sites
17 minutes ago, Colin Gilchrist said:

Hello Collin, i know my way of making this post was UN ortodox but i hade to get code fast for a job.

This post is intended for one and only thing : Shape threading.  I dont work post every day.  But it was the simplest, fastest way i did it.

Thank you for the remarks.

And sorry getting myself in your expertise.

Kevin

 

 

 

Quote

 

Made several parts with this.................................... Kev

And never asked a dime for the work.

 

 

 

 

K20,

I appreciate that you've been able to hack the Post to get the output that you want. But using the "Dwell" parameter, is the wrong way to go about making this work. What you've done is to "break" the Dwell function, for any other section of the Post that would use it to output an actual "Dwell" command.

Here is the original Dwell Post Block:


pdwell1         #Dwell output
      gcode$ = four  #for implied dwells
      pcan1, pbld, n$, *sgcode, *dwell$, strcantext, e$

Here is the block that you've hacked to get the output you want for this specific task:


pdwell1         #Dwell output
      pbld, n$, "G32", *mr1$, psgcode, *mr2$, e$
      #if gcode$ = four 
      #pbld, n$, "G32", "mr1$","*mr2$", e$
      #pbld, n$, "G32", "-"*dwell$, *pffr, e$
      #pbld, n$, *psgfeed, e$
      #pbld, n$, "G00", e$

 

I don't want to discourage you from learning how to edit a Post, as that is something I think every serious CNC Programmer should learn how to do. But there is also a "right way", and a "wrong way" to make your edits. I consider any edits that "break" other functions in the Post to be the "wrong way" to edit a Post.

Also, do you realize you "broke" the Incremental Calculations for X and Z output?

Here is the original Format Assignment block:


fmt  "N" 24  n$           #Sequence number

fmt  "X" 2  xabs        #X position output
fmt  "Y" 2  yabs        #Y position output
fmt  "Z" 2  zabs        #Z position output

fmt  "U" 3  xinc        #X position output
fmt  "V" 3  yinc        #Y position output
fmt  "W" 3  zinc        #Z position output

fmt  "C" 11 cabs        #C axis position
fmt  "H" 14 cinc        #C axis position
fmt  "C" 11 cout_a      #C axis position
fmt  "H" 14 cout_i      #C axis position

I put a carriage return after the "absolute" and "incremental" variables, to help you see that these 3 absolute variables (xabs, yabs, and zabs) and the three incremental variables (xinc, yinc, zinc), must remain in a "ordered list" (implied array of variables). When you move the variables out of position, or insert a new variable at the beginning, middle, or end of the list, you break any of the "vector math functions" that expect an ordered list of variables. Vector Add, and Vector Subtract functions use a single "input" variable, that indicates the beginning of a list of "3 ordered variables".

Here is your Format Assignment section:


fmt  "N" 4  n$          #Sequence number

fmt  "X" 2  xabs        #X position output
fmt  "Y" 2  yabs        #Y position output
fmt  "Z" 2  zabs        #Z position output

fmt  "Z" 2  zinc        #Z position output

fmt  "U" 3  xinc        #X position output
fmt  "V" 3  yinc        #Y position output
fmt  "W" 3  mr1$        #Z position output

fmt  "I" 3  iout        #Arc center description in X
fmt  "J" 3  jout        #Arc center description in Y
fmt  "K" 3  kout        #Arc center description in Z
fmt  "R" 2  arcrad$     #Arc Radius

By moving "zinc" above "xinc", and adding your own new Format Assignment for MR1, you've changed the way that the Incremental values will be calculated. The most dangerous part of this, is the fact that 'zinc' will never get its value set by this code:


#Incremental calculations
ps_inc_calc     #Incremental calculations, start
      xia = fmtrnd(xabs)
      yia = fmtrnd(yabs)
      zia = fmtrnd(zabs)
      xinc = vsub (xia, prv_xia) #This line calculates all three incremental variables: xinc, yinc, and zinc, with Vector Subtract!

By editing the placement of your variables in the "ordered list", that function will now set: xinc, yinc, and mr1$. (So, zinc never gets set!)

You could do the following, which would at least not "break" the incremental functions:


fmt  "N" 4  n$          #Sequence number

fmt  "X" 2  xabs        #X position output
fmt  "Y" 2  yabs        #Y position output
fmt  "Z" 2  zabs        #Z position output

fmt  "U" 3  xinc        #X position output
fmt  "V" 3  yinc        #Y position output
fmt  "Z" 2  zinc        #Z position output

fmt  "W" 3  mr1$        #Z position output

fmt  "I" 3  iout        #Arc center description in X
fmt  "J" 3  jout        #Arc center description in Y
fmt  "K" 3  kout        #Arc center description in Z
fmt  "R" 2  arcrad$     #Arc Radius

 

Again, I'm not trying to discourage you from making Post Edits that serve your needs, but I'm very worried with this statement you made: "I can also edit Posts for other controls". By making the edits the way that you are, you're honestly causing more harm than good.

 

Link to comment
Share on other sites
On 9/27/2017 at 4:48 PM, SlaveCam said:

I have said it before and will say it again: this should be a standard feature of Mastercam :)

Totally agree with you ! 

ive been able to program a cable drum in MCAM with a button insert using a bunch of G33 but the math + the chaining behind was a PITA to do 

Link to comment
Share on other sites
47 minutes ago, K20 said:

Maybe Colin Gilchrist could make us one No Charge. 

I was juste trying to help.....

 

I completely get that you're trying to be helpful. I didn't mean my critique to be insulting, and I hope you don't take it that way. I get that you're trying to accomplish something with the Post that Mastercam doesn't currently support.

All that said, I think it is dangerous for anyone to have to hand-edit their NC Code, and producing a Post that breaks a fundamental Post Mechanism, just to get output for a specific application, is not the way I like to develop Posts. My main concern was you saying i CAN ALSO EDIT POST TO OTHER CONTROLS .

To me, that is a dangerous statement to make, when you are simply hacking the Post, so that it works for one specific application only, and you are breaking a feature of the Post to get the output you need.

Look, I get it. I often have to make a compromise on doing a job "the right way", and having someone tell me to "just get it done", so I end up taking a shortcut.

You've got a total of 8 posts on this forum, of which, 7 of those posts are in this particular thread. So please forgive me if I've offended you, but look at it from my perspective: I am simply trying to warn anyone who might be interested in using your "free Post", of exactly what it will do, and more importantly what it won't do.

I think you'll find that I've given plenty of "free" advice, help, and/or Posts to this forum. That includes having taught a completely free version of my Basic Post Class, a couple years back. 

  • Like 1
Link to comment
Share on other sites

I am currently doing this with a grooving tool path.

1. I use “Depth Cuts” so that I only get positioning moves.                                                        

2. I make sure that “Groove Walls” is set to “Steps” so that I only get positioning moves.      

3. I use “Absolute” for my retract value to clear the threads when positioning.                   

4. I activate “Dwell Time” so that I have a separate line that I can convert to threading.        

5.This only works with a roughing path.           

Ok,

When I post to Cimco,

I shift the entire rough groove operation by a given amount so that I position in front of the stock.

Then I Replace my dwell line (G4 P1000)  with my Thread Z Finish Value & Thread Pitch  (G32 Z-5.35 F.500)

 

free shape thread.png

free shape thread cimco.png

Link to comment
Share on other sites
20 minutes ago, jlw™ said:

Orvie, could you save a step and just shift your groove geo to output the Z values you want?

The way I do it, the groove path respects the stock.

If I put the geometry in front of the stock, I wouldn't be able to create a finish cycle.

This material is usually inconel.

By having leftover stock, I can create a second threading operation with smaller stepovers for cleaning up just the walls.

Without stock recognition, the finish passes would cut a lot of air and take way too long.

I've tried this many ways.

Link to comment
Share on other sites

ORVIE

-Copy your groove in an other level 

-Cut the groove pattern in multi segment about the sise of scallop you want

-Use the same groove path tweaking the step over for finish scallops

-use stock 

-In depth make 2 passe (seems it yont clear stock in 1 passe)

- Made a ZIP TO GO at the end.

Sheers

 

Rugh finish no air time

image.thumb.png.b6758305262dd25d3d4d25e1e9037adb.pngimage.thumb.png.bde8430e077d6126b0acbe2d1871ee1e.png

GROOVE.ZIP

Link to comment
Share on other sites
  • 7 months later...

 

สวัสดี K20 มากขอบคุณฉันพยายามที่จะแก้ปฐมวัยโพสต์นี้เป็นเวลา 10 ปีสร้างโปรแกรมของที่คุณคุณเอง แต่ไม่ประสบความสามารถสำเร็จจนกว่าที่คุณคุณจะเห็นพระเจ้าโปรดชัดเจน ....

bandicam 2019-04-21 16-39-22-699.jpg

Edited by aekky-1992
Link to comment
Share on other sites
  • 2 months later...
  • 1 year later...

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