347,653 Registered Members
Welcome to the CNC-Arena Forum
Page 2 of 2 FirstFirst 12
Results 13 to 22 of 22
  1. #13

    Join Date
    Dec 2012
    Posts
    26

    some thoughts

    Your code looks right as far as the two lines you say are giving you trouble. Double check that your G54 is set correctly. Also if you are just wanting to move your table away before tool changes, use an offset that you don't typically use. Our shop has mainly Haas machines so there are a ton of extra offsets to use. You can so something like G0 G90 G58 x0 Y0. Then you just set G58 X0 Y0 where ever you want the table to go before the tool change. We find this is the easiest way because then zero is hard coded in the post but you can move it anywhere depending on what you are working on by just changing where G58 is set.

  2. #14
    Flies
    Join Date
    Dec 2008
    Location
    Krypton
    Posts
    1966
    N520 G0 Z24.75
    N530 M5
    N540 G91 G28 Z0.
    N550 G28 X0. Y0. <--- suggest only to have the Y move, unless tool will hit part on toolchange
    N560 A0. <---- your problem is here, you are still in incremental, needs a G90
    N570 M01
    ....
    N660 A0.
    N670 M01
    N680 G49 T19 M6

    this works great except for the odd movements after tool change on line n590 and n690. this give me a limit switch issue as the table wants to move further and then trips the limit switch. any ideas why it outputs this move? it seems a different move each tool change.

    the G54 line is...set G54 co-ord system and then goto those X/Y/A points in relation to the G54 origin.... the part's XYZ origin is input into the Work Offset area in the control - it relates back to the home position of the machine.

    if this is a bit odd then it may just be easier to change the g28 x0 y0 line to something that gets the spindle away from the work so i am not changing tools above the job

  3. #15

    Join Date
    Jan 2010
    Posts
    190
    thanks guys.

    had a play around with it. the offset idea sounds great but had a quick play around and obviously set it wrong as it kept wanting to trip the z limit switch.
    like i said i am sure it was my settings doing this.

    i had been playing around with g90 in the g28 x0 y0 line but it wasn't playing ball. then read your reply and was glad to read i was at least on the right track. i then edited the gcode manually to read.

    g28 x0 y0
    a0 g90

    this got rid of my movement straight after the tool change ( as it turns out the lines i thought were causing problems werent the issue as you guys suggested)

    i then looked at the post and couldn't find were it adds the A0 after the
    g28 x0 y0
    so i just added a line in the post after it with just G90 on it.so it reads
    M5
    N650 G91 G28 Z0.
    N660 G28 X0. Y0.
    N670 G90
    N680 A0.
    when i post code now i can plug it straight into the machine without editing (so far with basic testing anyway)

    here is a sample of a simple 40mm square with a contour and 4 holes all using different drills/tools. This code is unedited after posting and i ran it through the mill as is and worked a treat. at least i know were in the post this toolchange section is so if i want to play around at a later date i have a little bit of a clue what goes on as i think i will get tired of the table retuning the the home position every tool change. but either way it beats the hell out of manually editing a code as if i get it wrong it is a big crash.

    anything wrong with what i have edited the post to output???


    ( T1 | 14. FLAT END MILL | H1 )
    ( T124 | 7 DRILL | H124 )
    ( T19 | 5MM DRILL | H19 )
    ( T4 | 6.8 DRILL | H4 )
    ( T21 | 10MM TX-DRILL | H21 )
    N100 G21
    N110 G0 G17 G40 G49 G80 G90
    N120 G49 T1 M6
    N130 G0 G90 G54 X-35. Y6. A0. S2046 M3
    N140 G43 H1 Z25.
    N150 Z10.
    N160 G1 Z-12. F306.9
    N170 X-21. F613.8
    N180 G3 X-7. Y20. I0. J14.
    N190 G1 Y40.
    N200 G2 X0. Y47. I7. J0.
    N210 G1 X40.
    N220 G2 X47. Y40. I0. J-7.
    N230 G1 Y0.
    N240 G2 X40. Y-7. I-7. J0.
    N250 G1 X0.
    N260 G2 X-7. Y0. I0. J7.
    N270 G1 Y20.
    N280 G3 X-21. Y34. I-14. J0.
    N290 G1 X-35.
    N300 G0 Z25.
    N310 M5
    N320 G91 G28 Z0.
    N330 G28 X0. Y0.
    N340 G90
    N350 A0.
    N360 M01
    N370 G49 T124 M6
    N380 G0 G90 G54 X10. Y10. A0. S300 M3
    N390 G43 H124 Z25.
    N400 G99 G81 Z-3. R25. F7500.
    N410 G80
    N420 M5
    N430 G91 G28 Z0.
    N440 G28 X0. Y0.
    N450 G90
    N460 A0.
    N470 M01
    N480 G49 T19 M6
    N490 G0 G90 G54 X10. Y30. A0. S4000 M3
    N500 G43 H19 Z25.
    N510 G99 G81 Z-6. R25. F240.
    N520 G80
    N530 M5
    N540 G91 G28 Z0.
    N550 G28 X0. Y0.
    N560 G90
    N570 A0.
    N580 M01
    N590 G49 T4 M6
    N600 G0 G90 G54 X30. Y30. A0. S2200 M3
    N610 G43 H4 Z25.
    N620 G99 G81 Z-5. R25. F330.
    N630 G80
    N640 M5
    N650 G91 G28 Z0.
    N660 G28 X0. Y0.
    N670 G90
    N680 A0.
    N690 M01
    N700 G49 T21 M6
    N710 G0 G90 G54 X30. Y10. A0. S4000 M3
    N720 G43 H21 Z25.
    N730 G99 G81 Z-2. R25. F1389.9
    N740 G80
    N750 M5
    N760 G91 G28 Z0.
    N770 G28 X0. Y0.
    N780 G90
    N790 A0.
    N800 M30
    %

    thanks for your help guys, would have been stuffed without you.
    :cheers:

  4. #16

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

  5. #17
    Flies
    Join Date
    Dec 2008
    Location
    Krypton
    Posts
    1966
    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

  6. #18

    Join Date
    Jan 2010
    Posts
    190
    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

  7. #19
    Flies
    Join Date
    Dec 2008
    Location
    Krypton
    Posts
    1966
    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

  8. #20

    Join Date
    Jan 2010
    Posts
    190
    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??

  9. #21
    Flies
    Join Date
    Dec 2008
    Location
    Krypton
    Posts
    1966
    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.

  10. #22

    Join Date
    Jan 2010
    Posts
    190
    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???

Page 2 of 2 FirstFirst 12

Similar Threads

  1. setting up new post
    By BurrMan in forum BobCad-Cam
    Replies: 8
    Last Post: 10-16-2012, 03:34 AM
  2. Feedrate Setting In Post
    By phoodieman in forum Post Processor Files
    Replies: 3
    Last Post: 01-21-2010, 02:13 PM
  3. Help setting up post process from TCC to Mach3
    By 56speedster in forum TurboCAD/CAM
    Replies: 0
    Last Post: 03-29-2008, 03: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
  •  
Advertising