585,743 active members*
5,022 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > G54 to G59 multiple jig set up, one gcode?
Results 1 to 14 of 14
  1. #1
    Join Date
    Aug 2009
    Posts
    136

    G54 to G59 multiple jig set up, one gcode?

    i would like to know how to set up multiple jig on my table and run them from one gcode using the g45 to g59. can i see an examlpe of one please. this is the beginning and end of one of mine g codes. i'll be setting 4 jigs on the table.

    thank you


    G90
    G20
    G49
    G0Z0.5308
    M3 S1500
    G0 X18.2972 Y-0.4192 Z0.1600
    G1 Z0.0000 F20
    G1 X18.2972 Y18.2728 F100
    X18.0500
    X18.0500 Y-0.4192

    X18.2972 Y-0.4192
    Y18.2728
    X-0.4924
    G0 Z0.1600
    G0 X0.0000 Y0.0000 Z0.5308
    G0Z0.5308
    G0X0.0000Y0.0000
    M5
    M30

  2. #2
    Join Date
    Aug 2011
    Posts
    2517
    make 4 separate programs for your 4 parts/jigs

    call them with M98

    i.e.......

    %
    O0001 (MAIN PROGRAM)
    M98 P0010
    M98 P0020
    M98 P0030
    M98 P0040
    G54 (SET WORKSHIFT BACK TO G54 FOR SAFETY OTHERWISE AT YOUR JOB END THE
    MACHINE WILL REMAIN IN G57)
    M30
    %

    %
    O0010
    G54
    (YOUR 1ST PART PROGRAM HERE)
    M99
    %


    %
    O0020
    G55
    (YOUR 2ND PART PROGRAM HERE)
    M99
    %


    %
    O0030
    G56
    (YOUR 3RD PART PROGRAM HERE)
    M99
    %


    %
    O0040
    G57
    (YOUR 4TH PART PROGRAM HERE)
    M99
    %

  3. #3
    Join Date
    Aug 2009
    Posts
    136
    so do i leave the M5 code and M30? do i put the

    thank you for your help

  4. #4
    Join Date
    May 2008
    Posts
    37
    no need to have the M5 until you are ready to turn off the spindle and the M30 only goes at the end of the main program.

  5. #5
    Join Date
    Jul 2005
    Posts
    12177
    You do not need four part programs if you are only using one tool.

    The main program selects the work zero then calls the part program:
    %
    O0001 (MAIN PROGRAM)
    G54 M98 P0010
    G55 M98 P0010
    G56 M98 P0010
    G57 M98 P0010
    G54
    M30
    %

    %
    O0010 (PART PROGRAM)
    etc
    M3 S1500
    G0 X18.2972 Y-0.4192
    G0Z0.5308
    Z0.1600
    etc
    G53 G00 Z0.
    M99
    %

    You will notice I added G53 G00 Z0. to the part program. This is so the tool is lifted clear before moving to the next part. Also I changed the order in which the tool approaches the part; it moves first to the X and Y position then down to the Z. This means it is less likely to hit clamps, etc, sticking up higher than the part.

    If you are using two tools the main program becomes;

    O0001 (MAIN PROGRAM)
    G54 M98 P0010
    M98 P0020
    G55 M98 P0010
    M98 P0020
    G56 M98 P0010
    M98 P0020
    G57 M98 P0010
    M98 P0020
    G54
    M30

    And you have a Part Program, O0020, for the second tool.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  6. #6
    Join Date
    Aug 2011
    Posts
    2517
    well yeah he didn't say if he was running 4 identical parts or 4 different parts. my example was over-simplified to show just the program calls. Obviously if its the same part x4 then just use one sub program and change the workshift in the main program before calling the same sub again. I assumed he knows to add clears to avoid hitting clamps etc

  7. #7
    Join Date
    May 2008
    Posts
    37
    As for clearances, is that when I would use a G98 or G99?

    For example,

    H06 Z[#101+.020] M08 (Rapid to .020" above material, coolant on)
    G81 G98 X#108 Y#214 Z.8737 R0+1.375 F#121 (Drilling .406 hole at 1/2-14 NPSF ports)

    In this drilling operation, will the spindle return to the Z value in the line prior to the drill call (or the Z value when the drill cycle is called) in between hole?

    And if I am thinking right the R0+1.375 would be where the tool would rapid down to when starting each hole. Please correct me if I am wrong. I am also curious about the 0+ attached to the R variable. Is this correct for Fanuc programming or is that a style that is only used in the Fadal format of my controller?

  8. #8
    Join Date
    May 2008
    Posts
    37
    That must seem weird. Sorry I posted a question in the wrong thread. But am I right, anyone know?

  9. #9
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by keystone76 View Post
    As for clearances, is that when I would use a G98 or G99?

    For example,

    H06 Z[#101+.020] M08 (Rapid to .020" above material, coolant on)
    G81 G98 X#108 Y#214 Z.8737 R0+1.375 F#121 (Drilling .406 hole at 1/2-14 NPSF ports)

    In this drilling operation, will the spindle return to the Z value in the line prior to the drill call (or the Z value when the drill cycle is called) in between hole?

    And if I am thinking right the R0+1.375 would be where the tool would rapid down to when starting each hole. Please correct me if I am wrong. I am also curious about the 0+ attached to the R variable. Is this correct for Fanuc programming or is that a style that is only used in the Fadal format of my controller?
    That must seem weird. Sorry I posted a question in the wrong thread. But am I right, anyone know?
    It would have been better to have moved your question to another Thread, however, to answer your question:

    1. In your example, the tool would return to the Initial Level (the Z level prior to calling the G81 cycle) equating to Z[#101+.020]. Had G99 been used in the G81 cycle, the tool would have returned to the Z level set up by the R address before moving to the next X,Y coordinate. Using G98 can be used to return to a Z level that will clear a feature or clamp that may be encountered between hole XY coordinates.

    2. R is the Retract Plane and is the Z level to where the tool rapids prior to commencing to feed to the Z depth specified in the G81 cycle. Depending on the Fanuc control model, the R value can be either an incremental value from the Initial Level, or an absolute Z value.

    3. R is not a Macro variable in the Fanuc system. Accordingly, R0+1.375 is incorrect. A variable can be used in conjunction with the R address, for example:
    R#1+1.375

    4. You should have either G43 or G44 in association with the H address to apply the Tool Length offset, for example:
    G43 H06 Z[#101+.020] M08

    0.020" above the material is close to initially rapid to, and makes having an R plane somewhat irrelevant. OK if you want to scare the operator.

    Regards,

    Bill

  10. #10
    Join Date
    May 2008
    Posts
    37
    Bill,

    Thanks for taking the time to answer my question even though it was not related to the original question. I have been following two threads and was confused on where I was.

    I have been reading Fanuc Custom Macros by Peter Smid and am really interested in programming manually and using macros to simplify my world. But I have only been machining for about four years and have mostly relied on MasterCAM to generate my code which is posting to my Fadal in their Fadal format. Therefore I am not familiar with all the G codes in Fanuc style programming.

    In the Fadal format I have never had to use a G43. And when I look at the G codes for Fanuc I see there is a G43 (tool length offset - positive) and G44 (tool length offset - negative), which leads to confusion.

    Does G43 H? call the tool length offset in the tool table and is so why would anyone use a negative offset?

    You also confuse me when you say that R is not a macro variable when in fact it is used in so many canned cycles and as I read it can also be used as a local variable within a macro. Could you give me an example line of a deep hole drilling cycle as it should be written in Fanuc style?

    Thanks

    Geoff

  11. #11
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by keystone76 View Post
    Bill,

    Thanks for taking the time to answer my question even though it was not related to the original question. I have been following two threads and was confused on where I was.

    I have been reading Fanuc Custom Macros by Peter Smid and am really interested in programming manually and using macros to simplify my world. But I have only been machining for about four years and have mostly relied on MasterCAM to generate my code which is posting to my Fadal in their Fadal format. Therefore I am not familiar with all the G codes in Fanuc style programming.

    In the Fadal format I have never had to use a G43. And when I look at the G codes for Fanuc I see there is a G43 (tool length offset - positive) and G44 (tool length offset - negative), which leads to confusion.

    Does G43 H? call the tool length offset in the tool table and is so why would anyone use a negative offset?

    You also confuse me when you say that R is not a macro variable when in fact it is used in so many canned cycles and as I read it can also be used as a local variable within a macro. Could you give me an example line of a deep hole drilling cycle as it should be written in Fanuc style?

    Thanks

    Geoff
    Geoff,
    Start up a new thread so you don't steal this one from the OP

    Does G43 H? call the tool length offset in the tool table and is so why would anyone use a negative offset?

    Yes. The number associated with the H address is the tool length offset number corresponding to the offset registered under that number in the Tool Offset Table. Generally, G43 will be used to apply the tool length offset, but they can be interchanged depending on the sign of the registered offset. Typically, if the length of the tool from tool tip to Gauge Line, a line corresponding to the face of the spindle nose, is entered as a positive value in the Tool Table, then G43 will be used to apply the offset specified by the H address.


    You also confuse me when you say that R is not a macro variable when in fact it is used in so many canned cycles and as I read it can also be used as a local variable within a macro. Could you give me an example line of a deep hole drilling cycle as it should be written in Fanuc style?

    X,Y and Z are also used in canned cycles, but that does not make them Macro variables. The R used as an NC address is just that, an address. With the exclusion of L, N, O, and P, there are local variables associated with all alpha characters. These alpha characters can be use to pass a value to a variable used in a Macro Program, by using them as an Argument in a Macro Call statement.

    For example:
    Local variable #1 is associated with the address "A". Accordingly, in the following example, #1 in the called Macro program (O1000) will be passed the value of 100.0 specified by the "A" argument in the Macro Call statement.

    G65 A100. P1000

    G65 R5. P2000

    In the last example, local variable #18 is associated with the address "R". Accordingly, #18 in the called Macro program (O2000) will be passed the value of 5.

    Regards,

    Bill

  12. #12
    Join Date
    Aug 2009
    Posts
    136
    just so you know i have 4 differint parts at this time, but cutting 4 of the same part would be nice thinking about it.

    kevin

  13. #13
    Join Date
    May 2008
    Posts
    37
    Bill

    Thanks again for the help. Sometimes the verbage gets a little confusing. Argument, variable, they both assign values to something else.

    I do think I have something to offer regarding the original thread topic as I have been nesting 24 parts in 6 different work offsets religously for the last 4 years. Having said that, I feel the question was answered pretty good by other users. But if anyone has any specific questions I would be glad to help if I can.

  14. #14
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by keystone76 View Post
    Bill

    Thanks again for the help. Sometimes the verbage gets a little confusing. Argument, variable, they both assign values to something else.

    I do think I have something to offer regarding the original thread topic as I have been nesting 24 parts in 6 different work offsets religously for the last 4 years. Having said that, I feel the question was answered pretty good by other users. But if anyone has any specific questions I would be glad to help if I can.
    Thanks again for the help. Sometimes the verbage gets a little confusing. Argument, variable, they both assign values to something else.

    Geoff,
    The following may make it more clear.

    Argument is a term used in software writing and refers to a parameter or value entered by a user in response to the requirements of a software function.

    A variable is a way of referring to a memory location used in a computer program. Variables in the Fanuc Macro language are numbers preceded by a # symbol, associated with a value and whose associated value may be changed. In Okuma and other Controls, Alpha, and a combination of Alpha and Numeric characters can be used to define a variable. Accordingly, in the following example Macro statement, the Arguments are "X100.", "Y125." and are the values passed to the corresponding variables #24 and #25 respectively in the Macro program called in the Macro statement.

    G65 X100. Y125. P1000 (CALL MACRO PROGRAM O1000 AND PASS THE VALUES 100 AND 125. )

    %
    O1000
    G0 X#24 Y#25 (RAPID TO THE X Y COORDINATES PASSED BY THE ARGUMENTS IN THE CALLING STATEMENT)
    ..........
    ..........
    M99

    Regards,

    Bill

Similar Threads

  1. Rhinocam and multiple spindles and or multiple tables?
    By brett gallmeyer in forum Rhinocam
    Replies: 0
    Last Post: 02-23-2011, 08:30 PM
  2. Multiple set-ups
    By RP Designs in forum MetalWork Discussion
    Replies: 3
    Last Post: 05-07-2009, 12:18 AM
  3. Multiple Set-ups?
    By Smitty092000 in forum Mastercam
    Replies: 1
    Last Post: 01-17-2009, 04:21 PM
  4. Replies: 0
    Last Post: 03-10-2005, 07:46 PM
  5. gcode to gcode converter
    By july_favre in forum Uncategorised CAM Discussion
    Replies: 4
    Last Post: 05-25-2004, 12:51 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
  •