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:

BehindYou

Verified Members
  • Posts

    46
  • Joined

  • Last visited

Posts posted by BehindYou

  1. Greetings,

     

    here is sample which I am using

    pexit_program
            endday = 26
            endmonth = 6
            endyear = 22
            if (year$ < endyear), e$
            else,
              if (year$ = endyear & month$ < endmonth), e$
              else,
                if (year$ = endyear & month$ = endmonth & day$ <= endday), e$
                else, 
                  [
                  "Your post is not valid anymore", e$
                  exitpost$, e$
                  ]

     

    keep in mind user can always change something (i can say more in PM)

     

    Kind regards 

    Ivan.

  2. On 3/9/2024 at 11:06 AM, lim-mazak said:

    Hi there, how can the post modified to limit the number of line or file size output in NC file? e.g. 100 lines, 1000 lines, 500kb, 1MB, etc.

    TIA....


    Greetings @lim-mazak

    What you can do is limit how many lines you want in your output file.

    To do that please first do backup of your post file.

    Now create new buffer where you will store your output information's and set variables ( the ones below its just an example from my post file)

    #---------------------------File manipulation buffer------------------------------------------------------
    #Buffer 6,
    wc6           : 1      
    rc6           : 1       
    size6         : 0       

    file_size      : ""
    sbufname6$    : ""
    fbuf 6 0 255 1 1        
    #----------------------------------------------------------------------------------------------------------

    #----------------------------------------------------------------------------------------------------------
    output              : 0                    # Variable is used for string comparisons
    return              : 0                    # Variable is used for closing open files
    sauxfile            : ""                   # For using aux file to store new NC file during ppost$ processing
    sncfile             : ""                   # Stores path of NC file
    s_output            : ""      # Path of the DOC output file (optional)


    Create new postblock  " ppost$"

    In the varable size6 you will limit the lines amount which you want to be outputted

    Keep in mind we are getting total 300 lines in this example, which includes  things from pheader$  and other things before the actual code

    ppost$
          sncfile = spathnc$ + snamenc$ + sextnc$
          sauxfile = spathnc$ + snamenc$ + sextaux$
          sbufname6$ = spathnc$ + snamenc$ + sextnc$

          spathaux$ = spathnc$
          snameaux$ = snamenc$
          s_output = spathnc$ + snamenc$  + sextnc$

          auxprg$ = 1
          newaux$
          subout$ = 2


          size6 = 300                              
          rc6 = 1                                    
          while rc6 <= size6,
            [
            file_size = rbuf(6, rc6)                   
            *file_size , e$                             
            ]
          
          subprg$ = 2
          newsub$
          mergesub$, e$

          return = fclose(sauxfile)        
          return = remove(sncfile)
          return = rename(sauxfile, sncfile)
          #return = remove (sbufname6$)
          clearsub$
          clearlcc$ 


    Once again before doing any changes do backup.

    Kind regards

    Ivan. 

    • Like 1
  3. Greetings.

    When you have extra time at work you can do many things :D

    Here is sample of the code how to convert your G- code output to binary output if you want to try yourself
    All the numbers are rounder up, all the negative numbers are converted to positive.
    Also mastercam has limit for the amount of decimal spaces so big numbers can be converted correctly( or there is another way?)
    code below require more work if you want to convert I, J and K to binary 
    For example for k$ you need 4 checks
    if k$ < 0, k$ = k$ * m_one
    if k$ < one & k$ > zero, k$ = k$ * two^8
    if k$ > zero & k$ > m_one,
    if k$ < zero,

    have fun guys, and remember if you want to try this do backup first

     

            if binary_output = one,
              [
              sbinary = " "
              if xabs < zero, xabs = xabs * m_one
              decimal = round(xabs)
              # Check if the decimal number is 0
              if decimal = zero, *decimal, e$
              # Initialize a variable to keep track of the power of 2
              power = zero
              # Loop to find the highest power of 2 less than or equal to the decimal number
              while two^power <= decimal,
                  [
                  power = power + one
                  ]
              # Adjust the power as we overshot in the loop
              # Loop through each power of 2 in descending order
              while power > zero,
                  # If the current power of 2 can be subtracted from the decimal number
                  [
                  if decimal - two^(power - one) >= zero,
                      [
                      sbinary = sbinary + sbinary_one  # Concatenate '1' to the string
                      decimal = decimal - two^(power - one)  # Update decimal value
                      ]
                  else,
                      [
                      sbinary = sbinary + sbinary_zero  # Concatenate '0' to the string
                      ]
                  power = power - one  # Decrement power
                  ]    
              binary_digits = rpar(sbinary, one)
              xabs = binary_digits
              *xabs
              ]
            else,
              [
              if absinc$ = zero, *xabs, !xinc
              else, xinc, !xabs
              ]
            !xabs
    Before
    N100 G21
    (TOOL - 5 OFFSET - 5)
    (WALTER_VNMG  INSERT - INSERT)
    N110 G0 T0505
    N120 G18
    N130 G97 S2000 M03
    N140 G0 G54 X16.973 Z4.464 M8
    N150 G50 S2000
    N160 G96 S185
    N170 G99 G1 X14.144 Z3.05 F.2
    N180 X14.144 Z-6.757 F.2
    N190 G18 G3 X14.2 Z-7.4 I-7.422 K-.643 F.2
    N200 G1 X14.2 Z-17.959 F.1
    N210 X14.2 Z-17.97 F.2
    N220 X14.2 Z-24.1 F.2
    N230 X17.028 Z-22.686 F.2
    N240 G0 X17.028 Z4.464
    N250 X15.117
    N260 G1 X12.289 Z3.05 F.2
    N270 X12.289 Z-3.75 F.2
    N280 G3 X14.144 Z-6.758 I-6.494 K-3.651 F.2
    N290 G1 X16.973 Z-5.343 F.2
    N300 G0 X16.973 Z4.464
    N310 X13.262
    N320 G1 X10.433 Z3.05 F.2
    N330 X10.433 Z-2.449 F.2
    N340 G3 X12.289 Z-3.749 I-5.566 K-4.951 F.2
    N350 G1 X15.117 Z-2.335 F.2
    N360 G0 X15.117 Z4.464
    N370 X11.406
    N380 G1 X8.578 Z3.05 F.2
    N390 X8.578 Z-1.57 F.2
    N400 G3 X10.388 Z-2.423 I-4.639 K-5.83 F.2
    N410 X10.433 Z-2.449 I-5.544 K-4.977 F.2
    N420 G1 X13.262 Z-1.035 F.2
    N430 G0 X13.262 Z4.464
    N440 X9.551

     

    After

    N100 G10101.
    (TOOL - 5 OFFSET - 5)
    (WALTER_VNMG  INSERT - INSERT)
    N110 G0 T0505
    N120 G10101.
    N130 G1100001. S11111010000 M03
    N140 G0 G110110 X10001. Z100. M8
    N150 G110010. S11111010000
    N160 G1100000. S10111001
    N170 G10111001. G99 G1 X1110. Z11. F.00110011
    N180 G110011. X1110. Z1110. F.00110011
    N190 G110011. G3 X1110. I1110. K111. F.00110011
    N200 G110011. G1 X1110. F.00011001
    N210 G11001. X1110. F.00110011
    N220 G110011. X1110. F.00110011
    N230 G110011. X10001. Z10001. F.00110011
    N240 G110011. G0 X10001. Z100.
    N250 G100. X1111.
    N260 G100. G1 X1100. Z11. F.00110011
    N270 G110011. X1100. Z1100. F.00110011
    N280 G110011. G3 X1110. Z1110. I1110. K111. F.00110011
    N290 G110011. G1 X10001. Z10001. F.00110011
    N300 G110011. G0 X10001. Z100.
    N310 G100. X1101.
    N320 G100. G1 X1010. Z11. F.00110011
    N330 G110011. X1010. Z1010. F.00110011
    N340 G110011. G3 X1100. Z1100. I1100. K111. F.00110011
    N350 G110011. G1 X1111. Z1111. F.00110011
    N360 G110011. G0 X1111. Z100.
    N370 G100. X1011.
    N380 G100. G1 X1001. Z11. F.00110011
    N390 G110011. X1001. Z1001. F.00110011
    N400 G110011. G3 X1010. Z1010. I1010. K111. F.00110011
    N410 G110011. X1010. I1010. K111. F.00110011
    N420 G110011. G1 X1101. Z1101. F.00110011
    N430 G110011. G0 X1101. Z100.
    N440 G100. X1010.

     

    Kind regards

  4. On 1/16/2024 at 4:32 PM, PACDIE said:
    O0000 How do I change the "i" to a "q" so the machine knows what to do?
    
    O0000 (LU5285 1ST OP)
    (MPMASTER-CH)
    (1ST OPP HAAS)
    (PROGRAM   - LU5285 1ST OP.NC)
    (DATE      - JAN-16-2024)
    (TIME      - 7:29 AM)
    (T3   - #51 SCREW DRILL      - D0.0670")
    G00 G17 G20 G40 G80 G90
    G91 G28 Z0.
    M08
    T3 M06 (#51 SCREW DRILL)
    (MAX - Z6.)
    (MIN - Z5.3002)
    G00 G17 G90 G54 X-3.6742 Y-2.2593 S12000 M03
    G43 H3 Z6.
    G94
    G98 G73 Z5.3002 R5.5002 I.05 F20.
    X-4.6742
    G80
    M09
    M05
    G91 G28 Z0.
    G28 Y0.
    G90
    M06
    M30
    %

    Greetings,
     In your post find  this section. If you are able to open it check the section below (If your post file ends with .psb you can't edit your post and you should contact your reseller)
    # Drill output
    # --------------------------------------------------------------------------
    fmt  "R" 2  refht_a     #Reference height
    fmt  "R" 2  refht_i     #Reference height
    fmt  "X" 2  initht_x    #Initial height, mapped X
    fmt     2   initht_y    #Initial height, mapped Y
    fmt  "Z" 2  initht_z    #Initial height, mapped Z
    fmt  "X" 2  refht_x     #Reference height, mapped X
    fmt     2   refht_y     #Reference height, mapped Y
    fmt  "Z" 2  refht_z     #Reference height, mapped Z
    fmt  "X" 2  depth_x     #Depth, mapped X
    fmt     2   depth_y     #Depth, mapped Y
    fmt  "Z" 2  depth_z     #Depth, mapped Z
    fmt  "Q" 2  peck1$      #First peck increment (positive)
    fmt     2   peck2$      #Second or last peck (positive)
    fmt  "R" 2  peckclr$    #Safety distance
    fmt     2   retr$       #Retract height
    fmt  "Q" 2  shftdrl$    #Fine bore tool shift
    # --------------------------------------------------------------------------

    second step:
    check if output is fine by you, if you want output without dot make sure to check Format statements section in your post and set how you want your output.

    If you have more questions, feel free to ask.

    Kind regards.

    Ivan

  5. OFC it's possible 

    Here is my output which I use

    (----------------------------------------------------------)
    (T27  | KENNAMETAL_D20_3D    | D27  | INSERT - R0.00 )
    (#1. | Lathe_Drill | )
    (     |  VC = S2627 mm/min       |     )
    (     |  MAX RPM = S2627 RPM     |     )
    (     |  Feedrate = 0.15 mm/rev |     )
    (==========================================================)
    (==========================================================)
    (T1   | WALTER_CNMG          | D1   | INSERT - R0.80  )
    (#2. | Facing | )
    (         |   VC = S265 mm/min       |         )
    (         |   MAX RPM = S2685 RPM     |         )
    (         |   Feedrate = 0.23 mm/rev |         )
    (==========================================================)
    (==========================================================)
    (T41  | ISCAR_DCGT           | D41  | INSERT - R0.10 )
    (#4. | Rough | )
    (     |  VC = S185 mm/min       |     )
    (     |  MAX RPM = S2874 RPM     |     )
    (     |  Feedrate = 0.20 mm/rev |     )
    (==========================================================)
    (==========================================================)
    (T74  | 3D LATHE TOOL-2      | D74  | INSERT - R0.20 )
    (#5. | Plunge rough; also, chained grooves | )
    (     |  VC = S125 mm/min       |     )
    (     |  MAX RPM = S1850 RPM     |     )
    (     |  Feedrate = 0.10 mm/rev |     )
    (==========================================================)
    (==========================================================)
    (T75  | WALTER_ID_GROOVE_D20.00_2.00 | D75  | INSERT - R0.20 )
    (#6. | Plunge rough; also, chained grooves | )
    (     |  VC = S100 mm/min       |     )
    (     |  MAX RPM = S1850 RPM     |     )
    (     |  Feedrate = 0.10 mm/rev |     )
    (==========================================================)
    (==========================================================)
    (T5   | WALTER_VNMG          | D5   | INSERT - R0.40  )
    (#8. | Finish | )
    (         |   VC = S185 mm/min       |         )
    (         |   MAX RPM = S2874 RPM     |         )
    (         |   Feedrate = 0.14 mm/rev |         )
    (==========================================================)

  6. Greetings.
    Download  mastercam2022-mp-reference and run  index.htm from the link below
    https://www.dropbox.com/scl/fo/328x8yqnyr7jdfrkqzchc/h?rlkey=ggxsxrhlda1pwos451wh4tnqr&dl=0

    Now Click on NCI Lines/20000 Lines and choose 20007
    From here you can retrieve information related with total tool length( tool + holder) 

    also check Mcam2022_Parameter_Ref.pdf  you may find other information's which you need.

    But make sure you can edit your post.

    Kind Regards

    Ivan

  7. Greetings everyone.

    While designing program for lathe machines how do you tell CNC Operator information related with stock.

     image.png.c1ec54d8b864dd05070b0cdf01af2623.png

     

    While taking 0 point (G54 or any other) on the part he should know Value of the "Right Margin" for phase one and "Left Margin" for phase two ?

    Here is my solution how I am doing it but I want to know if there is any better idea.

    So what I did:
    post processor will check the name of the saved file O0023(Program Name = 230105-MM-374-F1)  ( in my chase F1 means phase 1 and F2 phase 2)
    If file name contains F1, it will print out "Right Margin"  (  |  Stock_at_Right_Side 1.00 mm |  )
    If file name contains F2, it will print out "Left Margin"  (  |  Stock_at_Right_Side 3.00 mm |  )
    if file name contains F3 , it will set "Right/Left Margin"  to 0 because logically there is no stock left after phase one and phase two
    But if there is no key word in the file name it will get only "Right Margin" Value

    I am using stock flip option all the time so my stock leftover can be updated all the time

    We are using Doosan Puma 5100, 3100 machines(fanuc)

    If you have some better solution for the question above it would be nice.

    Kind Regards

    Ivan.


     

  8. Greetings

    I am trying to get information's from 20004 parameter to get

    (----------------------------------------------------------)
    (T12 | D12 |No. Flutes = 2 |  DIA. - 5. mm)
    (#8. | Face drilling - C axis | )
    (     |  Speed = 3820 RPM VC = 60.00 mm/min |  )
    (     |  Feedrate = 687.60 mm/min |     )
    (==========================================================)
    (==========================================================)
    (T16 | D16  |No. Flutes = 6 | DIA. - 10. mm)
    (#21. | 2D Dynamic Mill | )
    (     |  Speed = 3979 RPM VC = 125.00 mm/min |  )
    (     |  Feedrate = 1909.92 mm/min |     )
    (==========================================================)

    So what I did is :

    Created numerical variables to store the results of each value in the string (total 27 of them)
    if prmcode$ = 20004, tool_no  = rpar(sparameter$, 27)

    when I add tool_nf variable in any postblock which isn't mtlchg$ value is always same as the first tool
    if the first tool have 2 flutes every other tool will have same value
    But if I use it in mtlchg$ postblock its updating all the time

    I cant see what I am missing here

    Should I use nci_rewind$  to  get what i need ?

  9. Greetings @JParis

    I wish I had this info in my post :D
    Thank you so much for pointing  this out

    After few changes not it works flawlessly :)

          if rotary_type$ = 0 | rotary_type$ = 3,
            [
            b1_ymax  = y_max$
            b1_ymin  = y_min$
            ] 
    Now only when I have y selected or no axis selected (while using mill operations)  buffer will fill min/max variables :)

    Once again thank you @JParis

    Kind regards

    Ivan

    • Like 1
  10. Greetings  everyone.

    Related with y_max$ and y_min$  (lathe)

    Why the C-Axis value is stored in the above mentioned variables?

    Example output

    (=========================================================)
    (  | Max_Z position = +10.000 mm | )
    (  | Min_Z position = -26.000 mm | )
    (  | Min_Y position = -109.771 mm | )
    (  | Max_Y position = +109.771 mm | )

     
    (=======================================================)
    (  | Rapid Time = 4 sec | )
    (  | Feed Time = 41 sec | )
    (=======================================================)
    (  | Total Time = 45 sec | )
    (=======================================================)
     
     
     
    (C_AXIS_DRILL_D5.0)
     
    ( #8. Face drilling - C axis  |  )
     
    N15 G0 G40 G80 G13.1 G98
    N20 G0 T1212
    N25 G17
    N30 M35
    N35 M90  (Clamp Off)
    N40 G28 H0.
    N45 G0 G54 Z10. C12.
    N50 X220.752 Y0.                                   ---->   Y=0   and there is no other Y Value
    N55 G98 G97 S3820 P12 M03
    N60 M08
    N65 G83 Z-26. R-5. F687.6 M89  (Clamp On)
    N70 C36.
    N75 C60.
    N80 C84.
    N85 C108.
    N90 C132.
    N95 C156.
    N100 C180.
    N105 C204.
    N110 C228.
    N115 C252.
    N120 C276.
    N125 C300.
    N130 C324.
    N135 C348.
    N140 G80
    N145 M09
    N150 M90  (Clamp Off)
    N155 M05
    N160 G28 V0.
    N165 G28 U0.
    N170 G28 W0. H0.
    N175 T1212
    N180 M30
    %

  11. Greetings @ogu79

    First enable your debugger
    To do that got to:
    File/configuration/ Post dialog defaults 
    and put check mark to  "Enable post debugger"
    Open your .pst file and check if you have ppost$ in your post. If yes just change it to ppost_1 or something (later when you are done with debugging set it how it was before)

    Once you are done press "G1" button and at the bottom left corner press debug

    Once debugging is done find the line which you want to change. In your case  M5 M9 S1000M3 G4P1.

    Here is just an example code

    (C_AXIS_DRIL_D24)
     
    ( #1. Operation type -  Face drilling - C axis  -   |    )
     
    N110 G0 G40 G80 G13.1 G98
    N120 G0 T1313
    N130 M35
    N140 G28 H0.
    N150 G0 G54 Z10. C90.
    N160 X0.
    N170 G98 G97 S1194 P12 M03  ---> lets check where we get output of this line
    N180 M08
    N190 G83 Z-120. R-5. F143.3 M89  (Clamp On)
    N200 G80
    N210 M09
    N220 M90 (Clamp Off)
    N230 M05
    N240 G28 U0.
    N250 G28 W0. H0.
    N260 T1313
    N270 M30
    %

    image.thumb.png.17bb067da06cd10c81a89c99e57126eb.png

     

    Here I will check where I am getting G97 output.
    In the bottom left corner you will se some numbers 2940:43
    What it mean is: your G97 output is in row 2940 in your post and position in that row is 43

    this is the line from our post (everything is in the same line):

          else,    #Milling mode spindle
            [
            #result = nwadrs(strp, speed) #Different letter than 'S' for mill spindle?
            pbld, n$, [if nc_system_type = 0, *sgfeed], [if nc_system_type >= 1, *sgfeed_b], *sg97, *speed, "P12" , *spindle_m, e$ #spindle speed P12
            result = nwadrs(strs, speed) #Reset to 'S' for next single speeed output
            ]
          !css_actv$

    now lets move everything in separate line

          else,    #Milling mode spindle
            [
            #result = nwadrs(strp, speed) #Different letter than 'S' for mill spindle?
            pbld, n$, [if nc_system_type = 0, *sgfeed], [if nc_system_type >= 1],  e$ 
            pbld, n$, *sg97, e$
            pbld, n$,  *speed, "P12", e$
            pbld, n$, *spindle_m, e$

            result = nwadrs(strs, speed) #Reset to 'S' for next single speeed output
            ]
          !css_actv$

     

    now here is our new output

    (C_AXIS_DRIL_D24)
     
    ( #1. Operation type -  Face drilling - C axis  -   |    )
     
    N110 G0 G40 G80 G13.1 G98
    N120 G0 T1313
    N130 M35
    N140 G28 H0.
    N150 G0 G54 Z10. C90.
    N160 X0.
    N170 G98
    N180 G97
    N190 S1194 P12
    N200 M03
    N210 M08

    N220 G83 Z-120. R-5. F143.3 M89  (Clamp On)
    N230 G80
    N240 M09
    N250 M90 (Clamp Off)
    N260 M05
    N270 G28 U0.
    N280 G28 W0. H0.
    N290 T1313
    N300 M30
    %

    In the link below you can find link where you can find most of the pdf files related with postprocessor editing
    https://www.dropbox.com/scl/fo/328x8yqnyr7jdfrkqzchc/h?rlkey=ggxsxrhlda1pwos451wh4tnqr&dl=0

    I hope this can help you

    Kind regards

    Ivan

  12. Greeting @AndrewNg

    For the things you want to do there are few ways to do it.

    First step can be done like this ( From MP reference guide)

    Minimum Z axis value from NCI motion between tool changes.
    This is part of a set of variables that capture the minimum and maximum NCI values from axis motion between tool changes.
    The following discussion mentions z_min$ and z_max$ but please understand that everything applies equally well to x_min$, x_max$, y_min$ and y_max$.
    Capture these variables in the pwrtt$ postblock to determine the minimum and maximum values for the entire NCI file.
    It is important to understand that because the values of z_min$ and z_max$ can’t be known until the entire operation has been processed, while the operation is being processed those variables still have the values from the previous operation. So while pwrtt$ is being executed, some variables (like t$) always refer to the current tool being processed, but other variables like z_min$ and z_max$ effectively refer to the previous tool.
    This means that if you want to output these values with the current tool number, you need to do the following:    
    1. Ignore the first call to pwrtt$.    
    2. Set toolchange$ = 3. This will add an extra final call to pwrtt$ so you can capture the min and max values for the last operation.    
    3. Create a variable to store the number of the previous tool.
    The following code shows how you might accomplish this:                
    tooltable$      :  3    
     sav_t : 0      
    pwrtt$             # Tool table output          
    if t$ > 0,
       [            
       if gcode$ <> 1001, "[", *sav_t, *z_min$, *z_max$, "]", e$
       sav_t = t$
       ]          
    While z_min$ and z_max$ store the min and max values for the current operation, you can easily modify the above code so that you can also get the min and max values for the entire part.
    Create two new variables (z_min_all and z_max_all) and use them to keep track of the overall min and max values as each tool is processed.
    After the tool table has been processed, you can output them at your convenience. In example below, the min and max values for each tool are output in the tool table, then the overall min and max values are output once in the psof$ postblock.


    second way:

    You can just assign z_max$ variable to a buffer
    which means you should do buffer definition first
    for example : 
    fbuf 1 0 9 0 0

    for more about it, please read this topic: 
    @Colin Gilchrist



    third option

    You can get all those information's from your .set file

    to do that you should use file manipulation variables in ppost$ postblock
    Variables which you should use:
        # snamenc$  File name for the NC file output stream.
        # spathnc$  File path for the NC file output stream.
        # sextnc$   File name extension for the NC file output stream.
        # sextaux$  File name extension for the alternate file output stream auxprg$. The string is initialized to .AUX by default, but can be overridden.
        # auxprg$   Use this variable to open an alternate output file (.AUX). NC output will be directed to the AUX file when it has been opened with auxprg$ and the subout$ variable is set to 2.
        # newaux$   Open a file to receive output for the AUX stream (subout$ = 2). You can open a new file or open an existing file and append the new output to it; use the auxprg$ setting to control the output mode.
        # subout$   Determines which file output will be written to. Use this to create one or more alternate streams of NC data that you can write out to different files or merge together.

     

    before getting the main output as NC file I recommend you to do all the tests in the aux file.
    Why?
    Because what you will do in ppost$ block is this:
    you will run MP.dll to get output from .set file
    once you have output of your .set file in aux format you will select which line you want to grab from there and add to the main NC output.

    If you or anyone else there wants to know how can this be done feel free to PM and I will explain step by step what to do.


    I hope things above can help you.


    Kind regards

    Ivan.

     

     

     

     

     

     

    • Thanks 2
    • Like 2
  13. If he/she is new to the lathe programming 

    one example program won't hurt at all 😇

    Still this program wont work well (won't say why), because at one pont you smash your inserts over and over again 😁

     

    Some people needs example to find the right path.

    To others you can just give small hint and they will figure it out what to do.

    • Like 1
  14. Greetings,

    In the attachment you will find your part with some changes.

    This can only use you as reference if you want better program we should talk about tools, mat and so on.

    So what I did is:

    Drilling with D52 tool to the max depth
    Opening the hole with normal ID turning (much faster)
    Removing center with Face grooving tool and doing final pass with the same tool

    This is my solution for your product at the moment

    Also you can check how I did set up and so on.

    Speeds and feeds aren't correct so please do not use them,. Once again it's just an reference so you can see how it can be done.

    I hope this can guide you on the right path

    Also be careful  with the things which @AHarrison1 said in earlier message.

    Kind regards.

    Ivan.

    hemisphere.MCAM-CONTENT

    • Like 3
  15. ltlchg$          #Toolchange, lathe
          toolchng = one
          gcode$ = zero
          copy_x = vequ(x$)
          pcc_capture   #Capture LCC ends, stop output RLCC
          c_rcc_setup$  #Setup LCC on first 60000
          plcc_lead_begin  #Save original in sav_xa and shift copy_x for LCC comp.
          pcom_moveb    #Get machine position, set inc. from c1_xh
          c_mmlt$       #Position multi-tool sub, sets inc. current if G54...

          if prv_spaces$ > zero, " ", e$
          #ptoolcomment
          comment$
          pop_desc, e$
          if prv_spaces$ > zero, " ", e$

          spaces$ = prv_spaces$
          pbld, n$, "G0", *sg40, "G80", sm24, [if nc_system_type = 0, *sg99], [if nc_system_type >= 1, *sg99_b], e$
          if home_type < two, #Toolchange G50/home/reference position
            [
            sav_xh = vequ(copy_x)
            sav_absinc = absinc$
            absinc$ = zero
            pmap_home   #Get home position, xabs
            ps_inc_calc #Set start position, not incremental
            #Toolchange home position
            if home_type = one,
              pbld, n$, *sgcode, pfxout, pfyout, pfzout, e$
            else,
              [
              #Toolchange g50 position
              pbld, n$, *sg28ref, "U0." e$
              pbld, n$, *sg28ref, "W0." e$
              if tl_offset = 1,
                [
                if t$ <> tloffno$, tloffno$ = t$
                ]
              toolno = t$ * 100 + zero
              if home_type = m_one, pbld, n$, *sgcode, *toolno, e$
              else, pbld, n$, [if nc_system_type = 0, *sg50], [if nc_system_type > 1, *sg50_b], pfxout, pfyout, pfzout, e$
              ]
            pe_inc_calc #Update previous
            absinc$ = sav_absinc
            copy_x = vequ(sav_xh)
            ]
          if tl_offset = 1,
            [
            if t$ <> tloffno$, tloffno$ = t$
            ]        
          toolno = t$ * 100 + tloffno$
          if t$ <> tloffno$,  " ///// Tool No. and Offset No. aren't same ///// ", e$
    ADD ONE OF THE BELOW LINES HERE
          pbld, n$, *sgcode, *toolno, e$  #G0 tool change----------------------------------------------------------> Here is your tool number Output

    HERE MOVE YOUR G54

     

    what will you do here just add new line
     n$, *sg28ref, "U0.", "W0.", e$

    or 

    n$, *sg28ref, "U0.", e$
    n$, *sg28ref, "W0.", [if y_axis_mch = yes$, "V0."], e$

    It depends which axis you want to move first

     

    Structure of your post probably looks different so just search for those variables in your post and set them in order 
    First reference position
    Tool change
    G54 output

    If you have some more questions feel free to send me msg 
     

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