586,952 active members*
2,787 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > Mastercam > issue with post or a mx5 setting?
Results 1 to 20 of 22

Hybrid View

  1. #1
    Join Date
    May 2004
    Posts
    4519
    I think pcom_moveb outputs the A.

  2. #2
    Join Date
    Dec 2008
    Posts
    3120
    pretract is the postblock that is done after each operation
    - and at the end of the program
    protretinc is the postblock for rotary return within the pretract block
    ---you have to follow each jump to fully understand how it works


    Code:
    pretract        #End of tool path, toolchange
          sav_absinc = absinc$ ( save mode )
          absinc$ = one    ( force mastercam into inremental  mode)
          sav_coolant = coolant$ ( save coolant status )
          coolant$ = zero ( force Coolant OFF )
    #      if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless
            [                 #  explicitely turned off through a canned text edit
            if all_cool_off,
              [
              #all coolant off with a single off code here
              if coolant_on, pbld, n$, sall_cool_off, e$
              coolant_on = zero
              ]
            else,
              [
              local_int = zero
              coolantx = zero
              while local_int < 20 & coolant_on > 0,
                [
                coolantx = and(2^local_int, coolant_on)
                local_int = local_int + one
                if coolantx > zero,
                  [
                  coolantx = local_int
                  pbld, n$, scoolantx, e$
                  ]
                coolantx = zero
                ]
              coolant_on = zero
              ]
            ]
          #cc_pos is reset in the toolchange here
          cc_pos$ = zero ( force cutter comp OFF ) 
          gcode$ = zero  ( force Rapid mode  )
          #pbld, n$, sccomp, *sm05, psub_end_mny, e$   ( stop spindle )
          pbld, n$, sccomp, "M9", psub_end_mny, e$        (Coolant OFF )
          pbld, n$, *sgcode, sgabsinc, *sg28ref, "Z0.", "M19", e$ ( Retract to machine Z origin, stop & orientate the spindle )
          if nextop$ = 1003 | tlchg_home,   ( is this the last operation ??..... skip bracketted section if NO )
              [
               pbld, n$, *sg28ref, "Y0.", e$  ( retract to machine Y origin )
               absinc$ = zero  ( force mastercam into absolute mode )
               pbld, n$, *sgcode, sgabsinc, protretinc, e$ ( force output of Rapid, Absolute, run the rotary return postblock )
              ]
          absinc$ = sav_absinc  ( set mastercam back to original mode before this postblock)
          coolant$ = sav_coolant ( set back to original coolant setting )
    I also suggest that you alter your toolchange program to include a G90 somewhere in the cycle, you could also incude a G94 ( Feed units per minute ) and a G80 ( cancel canned cycles) to make it a lot safer.

    You did notice that I don't have X origin return in the output, just Y.......tool only retracts for each toolchange, & the table will move to front door at end of program for operator to remove/load parts

  3. #3
    Join Date
    Jan 2010
    Posts
    321
    I did notice the y only move but as this is a knee mill with z on the quill having the vice and job way out the way of me manually changing tools appeals to me at the moment.

    when you say to alter the tc program i assume cause i dont have a auto tool changer this is not needed.??

    so how would you suggest i have my end of toolpath/program outputting???

    were would i put the g80?

    something like
    g91 g28 z0
    g28 x0 y0
    g90 g80
    a0

    not sure what you mean about the g94 tho. what will that do?

    sorry for the beginner type questions but this is all very new to me. alot to learn

  4. #4
    Join Date
    Dec 2008
    Posts
    3120
    Quote Originally Posted by Deano7/11 View Post
    I did notice the y only move but as this is a knee mill with z on the quill having the vice and job way out the way of me manually changing tools appeals to me at the moment.

    when you say to alter the tc program i assume cause i dont have a auto tool changer this is not needed.??
    - So what does the M6 do in your machine ???
    the M6 should be calling up a little macro, or just have a Z return (G0 G91 G28 Z0.) with a program stop ( M00 )

    so how would you suggest i have my end of toolpath/program outputting???

    were would i put the g80?

    something like
    g91 g28 z0
    g28 x0 y0
    g90 g80
    a0

    not sure what you mean about the g94 tho. what will that do?
    The G94 would be used as a safety code, so if you did any machining with a feed per revolution ie tapping, it would be changed back to your normal setting for milling

    I have mine output after any drill cycles, just to be safe
    - the * before the postblock actually forces the output to the NC file, even if it is a modal code.
    Code:
    pcanceldc$       #Cancel canned drill cycle
          result = newfs(three, zinc)
          z$ = initht$
          if cuttype = one, prv_zia = initht$ + (rotdia$/two)
          else, prv_zia = initht$
          pxyzcout
          !zabs, !zinc
          prv_gcode$ = zero
          pcan
          pcan1, pbld, n$, *sg80, *sg94, strcantext, e$
          #if drillcyc$ = 3, pbld, n$, sg94, e$
          pcan2
    IMO, the required output NC code before each toolchange you need is
    - I placed the modal G codes so you can see whatis actually active
    Code:
     
    G80 G94    ( this line outputs after any drill cycle )
    M5
    M9
    G0 G91 G28 Z0.
    G0 G91 G28 X0. Y0.
    G0 G90 A0.  ( the A0. can be omitted if you only have 3 axis )
    M1    (  optional stop, good for when proving off, or wanting the program to stop to inspect the cut, tool, part size etc.- by just flicking the OPT. STOP switch to ON )
    I would also NOT have the G49 ( cancel tool length ) output on the toolchange line, it doesn't do anything, as the next G43 will reset tool length

  5. #5
    Join Date
    Jan 2010
    Posts
    321
    ok i think i have got it now.
    i have left the A0 in at the end of the program as it doesn't hurt anything.
    i couldn't have a g0 and g28 on the same line (as in g0 g28 x0 y0) as mach3 said you cant have 2 gcodes that do something or other on the same line (some sort of error). so i ditched the g0 and that fixed the error.

    the m06 prompts the tool change number on the screen and the 'change tool and press cycle start' comment, tried it without the m06 and found this out.

    i played around more with the G58 as the position of getting the tool away from the job and not having the table go to home and worked out what i was doing wrong last night so have now got it sorted. the great thing is i can position the g58 position anywhere that is away from the job enough and can be set to a different position every job if required. so now have implemented this feature into the post.

    i removed the G49 from the tool change line. but it is still in on the second line of the program. i will leave it their i think. i took your advice on the g94 and i have entered it after a drill cycle. feed per rev at this stage wont be an issue as i don't think mach 3 does rigid tapping but it is now in the post.

    below is what is output from the post at the start of the program.

    N100 G21
    N110 G0 G17 G40 G49 G80 G90
    N120 T1 M6
    N130 G0 G90 G54 X-35. Y6. A0. S2046 M3
    N140 G43 H1 Z25.
    N150 Z10.

    below is end of a toolpath and start of a drilling cycle

    N290 G1 X-35.
    N300 G0 Z25.
    N310 M5
    N320 G91 G28 Z0.
    N330 G90 G58 X0 Y0
    N340 G0 G90 A0.
    N350 M01
    N360 T124 M6
    N370 G0 G90 G54 X10. Y10. A0. S300 M3
    N380 G43 H124 Z25.
    N390 G99 G81 Z-3. R25. F7500.

    and below this is at the end of a drill cycle and tool change

    N290 G1 X-35.
    N300 G0 Z25.
    N310 M5
    N320 G91 G28 Z0.
    N330 G90 G58 X0 Y0
    N340 G0 G90 A0.
    N350 M01
    N360 T124 M6
    N370 G0 G90 G54 X10. Y10. A0. S300 M3
    N380 G43 H124 Z25.


    and below is end of a drill cycle and also end of program.
    N690 G99 G81 Z-2. R25. F1389.9
    N700 G80 G94
    N710 M5
    N720 G91 G28 Z0.
    N730 G90 G58 X0 Y0
    N740 G0 G90 A0.
    N750 M30


    so what do you think?????

    about right??

  6. #6
    Join Date
    Dec 2008
    Posts
    3120
    Seems good

    Another couple of suggestions, so to aid any editing at the control
    - seeing you have not used coolant yet, I would force a M9 ( coolant OFF ) after the M5, won't do anthing if coolant is already OFF, but if you forget to turn ON & edit it in at the control, you'd also have to edit in the OFF codes as well.

    - I would restate the last coord system after the G58 X0. Y0.
    so that rotary origin is returning to the G54 part origin setting, not the G58 setting
    - plus if you do manual moving, it is relative to the part's origin
    Code:
    N320 G91 G28 Z0.
    N330 G90 G58 X0 Y0
    N340 G0 G90 G54 A0.
    N350 M01
    It is called up with the pwcs postblock ( not sure if * is required before it ).
    it will need to look like .... pbld, n$, *sgcode, sgabsinc, pwcs, protretinc, e$
    or pbld, n$, "G0 G90", pwcs, "A0.", e$
    it will depend on how you editted your post.

  7. #7
    Join Date
    Jan 2010
    Posts
    321
    great ideas there.

    i have inserted a *sm09 after the *sm05 to force a coolant off. have tested the post and that outputs as required.

    the g54 on the other hand is proving to be a prick.

    the only way i can get it in the system so far is by "G54" and not the pwcs that you suggested.

    i know that i am editting the correct section of the post cause if i change one of the other g codes on the save line say change the "G90" to "g90" the lower case g that i changed outputs in the post.

    i assume the pwcs is the correct way to do it. even is i put a *pwcs it still doen't output the code. maybe there is an issue with the pwcs section of the post that you can see.

    pwcs #G54+ coordinate setting at toolchange
    if mi1$ > one,
    [
    sav_frc_wcs = force_wcs
    if sub_level$ > 0, force_wcs = zero
    if workofs$ <> prv_workofs$ | (force_wcs & toolchng),
    [
    if workofs$ < 6,
    [
    g_wcs = workofs$ + 54
    *g_wcs
    ]
    else,
    [
    p_wcs = workofs$ - five
    "G54.1", *p_wcs
    ]
    ]
    force_wcs = sav_frc_wcs
    !workofs$
    ]

    as for how i have editted the post i have a few of the "g90" type entries and a few *sg90 or *sgcode in there. either way seems to work. should i be doing this a certain way or does it make no differece???

Similar Threads

  1. setting up new post
    By BurrMan in forum BobCad-Cam
    Replies: 8
    Last Post: 10-16-2012, 03:34 AM
  2. setting up a post in MC for my Prototrak MX2
    By NHPhil in forum Community Club House
    Replies: 2
    Last Post: 09-01-2010, 01:21 AM
  3. Could someone post there setting for a HY02D223B
    By Ed Williams in forum DIY CNC Router Table Machines
    Replies: 6
    Last Post: 05-20-2009, 06:23 PM
  4. Help setting up post process from TCC to Mach3
    By 56speedster in forum Uncategorised CAM Discussion
    Replies: 0
    Last Post: 03-29-2008, 04:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •