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:

K20

Verified Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by K20

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

     

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

    • Thanks 1

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