587,535 active members*
3,652 visitors online*
Register for free
Login
Results 1 to 12 of 12
  1. #1
    Join Date
    May 2012
    Posts
    0

    Mazak Bolt Circle Macro (G-Code)

    Looking for help on using the Mazak Bolt Circle Macro for G-code. For reference, this is for a Mazak Vertical Mill Mazatrol Cam-M2.

    The macro and its execution runs great...but say for a simple three step process of center spot drill, peck drilling, and tapping on a bolt circle; and half way through your peck drilling operation your drill breaks and you need to restart the program on the peck drilling part, bypassing the first step of spot center drill. It seems as if the Macro sub program never terminates and it resumes by not working off the original center position of X0.Y0., but instead where it supposedly last left off on the bolt circle.

    Below is my macro (copied directly from old Mazak manual):

    (sub program 9999);
    G101A#70B#4001;
    G101A#71B#4003;
    N10 G204A15B#8C0;
    G101A#4200B902;
    N15;
    N20 G118A#12B#8;
    G103A#12B#8C#12;
    G201A25B#12C0;
    G101A#42F3;
    1001007800B903;
    N25 G204A30B#18C0;
    G101#4200B904;
    N30 G202A35B0C#18;
    G101A#4200B905;
    N35 G90;
    N45 G101A#75B0.;
    G111A#12B#8;
    G101A#32B0.;
    N50 G203A70B#12C#75;
    G105 A#30B360.C#8;
    G102 A#76B#1C#32;
    G102 A#31B#75C1.0;
    G104 A#32B#30C#31;
    G107 A#77B#18C#76;
    G102 A#77B#B5;
    1003007877C#24;
    G106 A#78B#18C#76;
    G102 A#78B#78C#25;
    X#77Y#78;
    G102 A#75B#75C1.;
    G111 A#12B#8;
    G203A70B#12C#75;
    G98;
    G200A50;
    N70 G00X#2F4;
    100400144Y#25;
    G#70G#71;
    M99;

    Now here is our program calling the use of the above bolt circle macro:

    G00G91G28Y0.Z0.;
    N10 T001(CD);
    M06;
    G00G90G43G54H1X0.Y0.Z3.M03S1250F10.;
    G81R.1Z-.1L0;
    G65P9999R10.3125A0.H12.X0.Y0.;
    G28G91G80Y0.Z0.;

    N20 T002(DR17/32);
    M06;
    G00G90G43G54H2X0.Y0.Z3.M03S450F5.;
    G83Z-.8R.1Q.2L0;
    G65P9999R10.3125A0.H12.X0.Y0.;
    G28G91G80Y0.Z0.;

    N30 T003(C/SINK);
    M06;
    G00G90G43G54H3X0.Y0.Z2.M03S200F5.;
    G82Z-.232R-.18P.2;
    G65P9999R10.3125A0.H12.X0.Y0.;
    G28G91G80Y0.Z0.;

    M30;

    So if we want to start the program at N20, it will still be in subprogram 9999 and not work off the correct X0.Y0.Z3. center, almost as if it doesnt even read that first G00 line. If we go back and put the G65 line from the first operation 'CD' in parenthesis ( ) , then it all works correctly.

    Any thoughts?

    Thank you in advance.

  2. #2
    Join Date
    Jun 2011
    Posts
    68
    Your G65 command is a MODAL Macro call. Hence, similar to a canned cycle that will end with a G80, you should really add a G66 after the routine call.
    Typically, a group 0 or 1 command will cancel (G00 or G01) but, be safe and add the cancel.
    You can also issue this command in MDI

  3. #3
    Join Date
    May 2012
    Posts
    0
    Quote Originally Posted by G0G90 View Post
    Your G65 command is a MODAL Macro call. Hence, similar to a canned cycle that will end with a G80, you should really add a G66 after the routine call.
    Typically, a group 0 or 1 command will cancel (G00 or G01) but, be safe and add the cancel.
    You can also issue this command in MDI
    thanks for the reply. what you said, makes sense, i didnt know about the G66 code routine. i tried adding G66 to line after the G65 call out and the same thing happened. when restarting the program at N20 for the drilling, it almost ignores that G00 line and positions itself at the first bolt hole location and uses that as its center. same as last time without the G66.

    any further thoughts? thank you

  4. #4
    Join Date
    Jun 2011
    Posts
    68
    Is it possible you're doing a "program restart" instead of just starting from line N20?
    If I'm reading this correctly, then the machine would position itself at the last finished hole position prior to taking your Y & Z axis home. (G28)

    I would try RESETing the machine and then starting from block N20 in memory mode. ?????

  5. #5
    Join Date
    May 2012
    Posts
    0
    Quote Originally Posted by G0G90 View Post
    Is it possible you're doing a "program restart" instead of just starting from line N20?
    If I'm reading this correctly, then the machine would position itself at the last finished hole position prior to taking your Y & Z axis home. (G28)

    I would try RESETing the machine and then starting from block N20 in memory mode. ?????
    thanks...no im certain we are starting at N20, it even shows in the top left corner that is currently on N20(9999), the 9999 being the subprogram bolt circle that was called in N10 also but should still be being read if program was restarted at N20.

    and strangely enough it is not positioning itself at the last hole, but rather the first hole but bypassing tool compensations in the G00 line following N20.

  6. #6
    Join Date
    Jun 2011
    Posts
    68
    That's odd.
    Have you tried issuing a G66 in MDI before you try to start back up?

  7. #7
    Join Date
    May 2012
    Posts
    0
    Quote Originally Posted by G0G90 View Post
    That's odd.
    Have you tried issuing a G66 in MDI before you try to start back up?
    let me further explain a bit...

    so with the program as-is, if i try to restart the program at N20, the following happens...
    first of all, its lists the program as 3816(9999) in the top left, meaning its already running the subprogram before even reaching the G65 call line. it then basically bypasses the entire G00 line that calls out positions, heights, and turns on spindle with speed. the spindle never turns on and just goes right to the correct first hole position. it then lowers itself on Z, but uses the height previously from tool 1 as opposed to tool 2 as it should. then when it should start the drilling process, it Alarms out '107 Velocity Command Zero', probably since the spindle isnt on as it bypassed that entire line.

    now if i add the G66 command immediately following the the G65 command in N10, such as..
    G65P9999R10.3125A0.H12.X0.Y0.;
    G66;
    G28G91G80Y0.Z0.;
    the same thing happens as above.

    very strange & frustrating...

  8. #8
    Join Date
    Jun 2011
    Posts
    68
    Very strange INDEED.
    However, I'm not as in-tune with Mazaks I would think that their basic operation should be similar to all/most machine tools.
    When you hit the RESET - does it still show an active program running? This should clear out the memory of any commands and put your basic G-Code groups back to their "initial state" (from parameters)

    Have you tried to issue the G67 from an MDI mode yet? Does this change the behavior?

  9. #9
    Join Date
    May 2012
    Posts
    0
    Quote Originally Posted by G0G90 View Post
    Very strange INDEED.
    However, I'm not as in-tune with Mazaks I would think that their basic operation should be similar to all/most machine tools.
    When you hit the RESET - does it still show an active program running? This should clear out the memory of any commands and put your basic G-Code groups back to their "initial state" (from parameters)

    Have you tried to issue the G67 from an MDI mode yet? Does this change the behavior?
    thank you, unfortunately i am not either, most of my time has been spent on HAAS or Fanuc controllers, learning as I go along...

    well it seems as if in these older model M2's, you cannot enter whatever you want into MDI. while in MDI you have the option of tool changes or selecting from a list of G code commands, G66/G67 not appearing on the list. sounds strange, but i know more modern Mazak controllers allow entering whatever you want in the MDI, much like the Fanucs and HAAS.

    when i RESET, it shows no program running and is definetly clear. then when i restart at N20, it ignores tools changes, home position, height, spindle speeds & feeds, etc...and run right to the first hole in the bolt circle.

  10. #10
    Join Date
    Jun 2011
    Posts
    68
    Sorry Steve - you've got me totally baffled as I would think it should ACT like a real/normal machine - this does not seem so.

    Perhaps a GOTO around the N10 sequence???

  11. #11
    Join Date
    May 2012
    Posts
    0
    Quote Originally Posted by G0G90 View Post
    Sorry Steve - you've got me totally baffled as I would think it should ACT like a real/normal machine - this does not seem so.

    Perhaps a GOTO around the N10 sequence???
    well after several hours of trial and error (and some new gray hairs)...finally figured out that it came down to something as simple as block numbers!

    we dont label each and every line of code with a "N##" block number, we just label the tool change lines to easily separate the operations. so T1 line would be N10, T2 would be N20 and so forth.

    well apparently the tool that first calls the bolt circle macro subprogram must be at least 45 blocks lower than the next tool that calls it. for ex...

    N10 T01
    .....
    G65 .....
    .....
    N55 T02
    ....
    G65....
    ....
    N60 T03

    strangely enough, through trial and error, N50 would not work but N55 or anything higher would. and strange again is that T3 doesnt follow the same rules, it could be N60 and work fine.

    so we now just do N100, N200, N300, etc....and all is well.

    figure id write this out in case somewhere down the line it helps someone.

    thanks again for the help

  12. #12
    Join Date
    Jun 2011
    Posts
    68
    Holy crap! - REALLY???
    Yup, wouldn't have pointed in that direction.

    I'll have to file that one under, "mazakisms" or "WTFazak"

    Thanks for sharing your solution!

Similar Threads

  1. MAZAK macros / bolt circle
    By steveBMT in forum Mazak, Mitsubishi, Mazatrol
    Replies: 2
    Last Post: 05-23-2012, 03:19 PM
  2. Bolt Circle not working
    By weirdharold in forum Mastercam
    Replies: 0
    Last Post: 01-14-2009, 07:42 AM
  3. Bolt Circle Programming
    By Isureamcael in forum G-Code Programing
    Replies: 37
    Last Post: 07-15-2008, 03:23 AM
  4. macro bolt circle
    By jdsmith0524 in forum G-Code Programing
    Replies: 3
    Last Post: 05-17-2007, 01:09 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
  •