584,866 active members*
5,068 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > Uncategorised CAM Discussion > Macros and toolchange. Need help please with offsets.
Page 1 of 2 12
Results 1 to 20 of 25
  1. #1
    Join Date
    Jun 2013
    Posts
    443

    Macros and toolchange. Need help please with offsets.

    I posted this on the Mach 3 forum and was unable to resolve. Hoping someone can either help me or point me to the place where I can help myself?

    I have been of late trying to machine several components through different table offsets. Sometimes up to 5 at a time. Not having an ATC this is the best way to utilise my machine. So I am using G54, G55, G56, G57 etc….

    Using the Mach 2010 auto tool change macro is fine, except that when I change a tool. The tool-change works only to offset the new tool length for G54. The others (G55, G56, G57 etc) just keep acting as if the first tool is still there. In my case I run the facing mill first. Next op is a much longer end mill. Cuts out the G54 fine but will crash onto the others. An option is too keep everything at the same Z but thats not ideal, you know, surly there is an easier or proper way to machine multiple and different components??

    I cant work out how to:

    A) During auto tool change, have the macro look through the program I am running to see if there are multiple table offsets involved.
    B) Apply the new tool-change offset to those table offsets being used.


    The macro below is what I am sure is the correct one I need to alter for this but, I am unsure. Any, and believe me, ANY help would be appreciated. From what I have learned so far it appears to be a relatively easy fix?? Regards - update the forum wont let me paste the macro. Its M881 on the Mach 3 2010 screenset

  2. #2
    Join Date
    Jun 2013
    Posts
    443

    Re: Macros and toolchange. Need help please with offsets.

    Oh. And even if someone said.... "you need to learn this and write this" would be awesome.

    Sent from my SM-N970F using Tapatalk

  3. #3

    Re: Macros and toolchange. Need help please with offsets.

    Hello and happy new year!
    I'll suggest you to use MachStdMill from Calypso Ventures.
    This amazing screenset will give you useful tools for working and handling offsets, in a nice manner, well documented.

    At least, try to watch their video clips where they are explaining how to handle different working ways. I think, for you, the Master Tool working mode will help.

    Regards

  4. #4
    Join Date
    Mar 2003
    Posts
    35538

    Re: Macros and toolchange. Need help please with offsets.

    These macros will set the offsets for G54-G59 when zeroing and changing tools. They've been on my website for years.
    http://www.thecncwoodworker.com/down...ro_G54-G59.zip
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  5. #5

    Re: Macros and toolchange. Need help please with offsets.

    I don't know anything about Mach 3 (Fanuc guy) but I did check to see that it does in fact use G-code. Good enough for me.

    I work across multiple work offsets all the time, but seldom do the work offset setups include multiple Z heights. This is tricky stuff, even for someone who programs in G-code and knows their stuff. It's certainly not impossible, but it does take extra care. Meaning you really need to be paying attention, and might need manual intervention into your post(s). It would take a superbly written post processor to handle multiple Z heights. I don't use one for anything other then coordinates, so can't say from experience that one exists, but I suppose there is.

    The first part of your problem can likely be solved by having the tool change macro pre-read the active work offset, store it, use whatever offset it does for tool change, then restore the previously active work offset. I'd be willing to guess that ger21's macros do just that.

    But to my main point and is possibly part of the OP's dilemma. Whenever working across multiple work offsets, variable Z height ones or not, after a new offset is called, say like when moving from G54 to G55, until the control is asked to read an X, Y and Z in the code that follows, it's going to still be using the coordinate position of the previous work offset, even though a new one has been called. My point being, if never asked to read or reference the new work offset, the control is not magically going to make good on the fact that you've changed it.

    Picture this. Say you have four vises bolted to your machine table along the X axis. You've been sort of careful lining them up, but after measuring them all and setting the work offsets for each, say G54-G57, you see that your Y setting varies by about 20 to 50 thou, give or take. No worries you say, I've got all the offsets dialed in. Now you're going to drill two holes in each of four parts, all of which are the same. (Note Z offsets are all the same in this example.) So you write...

    T1 M6 (SPOT DRILL)
    G17G20G40G49G54G80G90G98

    G0 X1.48 Y-0.75
    G43 Z0.1 H1 S2376 M3 T14
    M8
    G99 G82 Z-0.12 R0.1 P50 F14.
    X3.48
    G55
    X1.48
    X3.48
    G56
    X1.48
    X3.48
    G57
    X1.48
    X3.48
    G80
    M9

    Seeing as coordinates are generally considered modal, meaning active until changed, and possibly posted that way, in the above G code the location of the Y position of all the holes spot drilled is going to be fine on the G54 vise, but drilled in error on all the rest. Why? Because the Y address (which includes it's work offset reference) was not asked to be read again. The X was, so no problems there. The following fixes that.

    T1 M6 (SPOT DRILL)
    G17G20G40G49G54G80G90G98

    G0 X1.48 Y-0.75
    G43 Z0.1 H1 S2376 M3 T14
    M8
    G99 G82 Z-0.12 R0.1 P50 F14.
    X3.48
    G55
    X1.48Y-0.75
    X3.48
    G56
    X1.48Y-0.75
    X3.48
    G57
    X1.48Y-0.75
    X3.48
    G80
    M9

    This is a very simple example but stresses my point. The offset address must be forced to be re-read when shifting to new work offsets. This gets even more critical, and difficult, with changes in Z.

    The above example would not likely appear in the OP's setup, as I get the idea that he is working on different parts in completely different setups. Not four exactly the same part in common Z height vises as the example above is working in.

    My points to the OP is to look at your code and ask yourself, when this Z level (as a stand alone position or as part of a cycle call) is called, what Work Offset is active, and where do I need to safely put the tool before again letting a Z call show up in the code? In short, all the X, Y and Z calls right before a Work offset change and also right after, are very critical in keeping your machine from crashing. How where and when do you activate the new X, Y and Z, and where is the tool in 3D space when you do so? What is it going to pass over and at what height when it does move? Things to think about.

    Looks like I had some spare time on a New Years Day. Hope this helps your cause.

  6. #6
    Join Date
    Feb 2011
    Posts
    353

    Re: Macros and toolchange. Need help please with offsets.

    With out a posting of the program it will be hard to determine the OP's problem as everything is a guess
    are all the work offsets (g54, g55, g56 ect) 0 in the Z's or do they correspond to an actual offset from the table (all different) ?
    if they are all 0 has the OP made different tool offsets for the tools for each fixture and are they called out correctly ?
    If they are not the same is the work offset called out correctly like what the_gentlegiant has posted above ?

  7. #7

    Re: Macros and toolchange. Need help please with offsets.

    Quote Originally Posted by rcs60 View Post
    With out a posting of the program it will be hard to determine the OP's problem as everything is a guess
    are all the work offsets (g54, g55, g56 ect) 0 in the Z's or do they correspond to an actual offset from the table (all different) ?
    if they are all 0 has the OP made different tool offsets for the tools for each fixture and are they called out correctly ?
    If they are not the same is the work offset called out correctly like what the_gentlegiant has posted above ?
    Good points by rcs60. Would be an odd way to go about things having a different tool offsets for each work offset. Talk about confusing. Even with correctly set Z heights across multiple work offsets, it's still risky and best-pay-attention business programming for multiple parts across multiple varied Z offsets. Especially running in succession or simultaneously. Not so bad if you have four different setups that you tend to leave all the time and are programming and running only one at a time. There it's just a simple manner of not going astray with X or Y moves. Normal Z should take care of itself. Well... unless the machine always runs off somewhere in X and Y to do a tool change.

    Personally I try to avoid it. Setups don't take that long in many instances. It's like working way-way down deep in a pocket. One false move and everything is toast. Can get real expensive in just an instant.

  8. #8
    Join Date
    Jun 2013
    Posts
    443

    Re: Macros and toolchange. Need help please with offsets.

    I really appreciate the replies and will post a sample program once back in good reception.

    Using Fusion 360. I can have multiple parts in one program and assign each one with its own offset, yes zero each individual one. Fusion is really good for multiple part production. Tool changes can add quite a lot of time to my production times so machining as many at once is best for me. Then they can be positioned anywhere on my table. I will zero each one out with its own WCS on each fixture. This includes the Z.

    On running the program, the tool or Z will move through each one rising or lowering to face off 1mm or so. No problem with clearances I ensure it's 100mm above the highest part.

    Everything works fine until I have an auto tool change. The G54 positioned part picks up the longer tool offset and if Fusion has arranged it to be next in line there is no problem. But as soon as the program changes to the other fixtures they still think they have the original tool. Because of this success so far, I believe the macros that Ger has posted will fix my problem as they push the toolchange through the other fixtures.

    Looking through the replies also did make me wonder about the code Fusion generates as to not arriving with the problem highlighted previously with the small differences in the Y fixtures. So I must post a program for you to check out and will do.

    Oh and apologies if I have missed anything. I'm not trained, have been doing this a while now. Just not at production level where I am invoicing.

    Sent from my SM-N970F using Tapatalk

  9. #9

    Re: Macros and toolchange. Need help please with offsets.

    Hello boydage,

    Yes it would be good to see a portion of your G code. Any trouble there should be easy to spot.

    Seems you're doing it right by having a separate Work Offset including a number in the Z portion that matches the Z zero reference surface of each part in its respective vise/fixture, and your Fusion work space. All good.

    It almost sounds like after a tool change, you're code is not taking the time to activate the tool offset for the new tool just loaded. This is not usually handled by a tool change, and is typically started in a manner somewhat like I showed above on the 2nd line after the safety line. G43 H1 Z0.1 S2376 M3 and so on. Just like with the missing Y addresses in my example. Until the control reads a new tool length "H" offset there's no reason for it to change. Unless this is something special to Mach 3, tool change macros don't automatically install new tool height offsets, they just change the tool. Remember... computers are basically dumb. You have to tell them everything.

  10. #10
    Join Date
    Jun 2013
    Posts
    443

    Re: Macros and toolchange. Need help please with offsets.

    I will post asap. Out of interest I do wonder if there is much difference in a PC based machine and a cnc controller? The routine or macro that happens with mine is one Ger21 sold me about 6 years ago. I've just started getting paid to use my machine. Upgraded it for alloy by strengthening every thing including a larger spindle.

    So the current screenset on Mach 3 has two start options. Green for go and an auto Z zero.

    If I decide to use it, instead of the start green button there is an auto tool change auto zero function. If you are already familiar then apologies and no need to read further. If not, it goes like this.

    Initial run command, the tool (or probe) will lower on the Z to the workpiece (either a touch plate or probe or a make circuit with the tool)

    This zeros the Z.

    Then it (spindle) travels to a fixed plate on my table. Stopping at location, then lowering down to the fixed plate to touchoff and store an offset, fixed plate to the zeroed Z.

    Tool will lift, travel back to the workpiece (clearances preprogrammed)

    Tool will then goto a toolchange position. If you have used a probe you will then put your first tool in the collet.

    Tool then travels back to the fixed plate. Touches off again, the new (if applicable) Z offset is applied.

    Work begins until the next toolchange where it all happens again.

    My initial problem was I have been unable to put the stored Z offset into other fixtures the G55 G56 etc.

    But I do believe Ger21 has posted the macros I need. I'm on holiday way off the grid. And all I want to do is try out the macros he posted ha.

    But does that make more sense now as to what I am doing? Tell you what, Fusion have done a fantastic job at creating the ability to machine multiple and different parts all in one go.

    Sent from my SM-N970F using Tapatalk

  11. #11
    Join Date
    Mar 2003
    Posts
    35538

    Re: Macros and toolchange. Need help please with offsets.

    It almost sounds like after a tool change, you're code is not taking the time to activate the tool offset for the new tool just loaded. This is not usually handled by a tool change, and is typically started in a manner somewhat like I showed above on the 2nd line after the safety line. G43 H1 Z0.1 S2376 M3 and so on. Just like with the missing Y addresses in my example. Until the control reads a new tool length "H" offset there's no reason for it to change. Unless this is something special to Mach 3, tool change macros don't automatically install new tool height offsets, they just change the tool.
    We're not using G43 Length Offsets here. They aren't very useful if you don't have fixed length tool holders.
    After the manual tool change, the machine references the tool to a reference plate and sets the Z axis Offset to zero the tool.
    His issue was that the Z offset was only being applied to G54, and not G55-G59.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  12. #12

    Re: Macros and toolchange. Need help please with offsets.

    Quote Originally Posted by ger21 View Post
    We're not using G43 Length Offsets here. They aren't very useful if you don't have fixed length tool holders.
    After the manual tool change, the machine references the tool to a reference plate and sets the Z axis Offset to zero the tool.
    His issue was that the Z offset was only being applied to G54, and not G55-G59.
    Thanks ger21. That pretty much clears up everything in my head. Never occurred to me that there are no fixed tool lengths. I know nothing about the hobby or PC based controllers and machines they usually run, other then they seem to be getting pretty elaborate these days. It was with some trepidation that I even posted in this thread. I figured, just as it has proved out, that potentially some of the information I offer wouldn't fit in. I'll try to keep my nose out of these things in the future. Besides... sounds like the OP is going to get this figured out anyway.

    I still say that working across multiple fixtures and/or vises of different Z heights, especially ones that are different by a handful of inches, takes special care. Maybe Fusion handles things like that with ease. Again I wouldn't know as I also know nothing about Fusion. Ha... I even owned it once for a year, and I still know nothing about it! :-)

  13. #13
    Join Date
    Jun 2013
    Posts
    443

    Re: Macros and toolchange. Need help please with offsets.

    Mr Gentlegiant you sound trained and experienced. Are you one of the people who has forgotten more than most of us know? Haha. I am not trained although am in other areas. And have immense respect for others and their trades. The butcher I use for home kill here in NZ has been doing it for 50+ years.

    Hey so thanks. I did think about fixed tool lengths using an EF32 collet wondering if it was possible by toolholder?? But Ger has solved that issue with the macro he wrote. Quite cool really.

    I have spent about $6k and at least 200 manhours on my machine. I am manufacturing small to medium size components for the medical industry. My employer pays me an hourly rate on top of my normal rate for the use of my machine which I offered. When he accepted it was a massive rush to get everything in acceptable order and condition.

    I have used a few CAD/CAM programs. And do recommend Fusion although can only compare it to Cambam which is quite basic.

    With this I am wondering if you are still interested in seeing the code Fusion produces for multiple and different parts all with their own wcs(s)?

    Regards




    Sent from my SM-N970F using Tapatalk

  14. #14
    Join Date
    Jun 2013
    Posts
    443

    Re: Macros and toolchange. Need help please with offsets.

    And Gerry. Thanks for this..... again. Your help has been invaluable over the years. Going to PM you.

    Sent from my SM-N970F using Tapatalk

  15. #15
    Join Date
    Jun 2013
    Posts
    443

    Re: Macros and toolchange. Need help please with offsets.

    Hey so how's this..... I am still using my original Chinese BOB. Do I change it out for a new type?

    Sent from my SM-N970F using Tapatalk

  16. #16
    Join Date
    Mar 2003
    Posts
    35538

    Re: Macros and toolchange. Need help please with offsets.

    No reason to change it if it's working. You might want to get a spare, if they are still only $10.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  17. #17
    Join Date
    Mar 2003
    Posts
    35538

    Re: Macros and toolchange. Need help please with offsets.

    Quote Originally Posted by the_gentlegiant View Post
    Thanks ger21. That pretty much clears up everything in my head. Never occurred to me that there are no fixed tool lengths. I know nothing about the hobby or PC based controllers and machines they usually run, other then they seem to be getting pretty elaborate these days.
    Most if not all hobby CNC controllers do support fixed tool lengths and G43 length offsets, if you have a machine that can use them. But I believe that Boydage just has a spindle with an ER32 collet, and no tool holders.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  18. #18

    Re: Macros and toolchange. Need help please with offsets.

    Quote Originally Posted by boydage View Post
    Mr Gentlegiant you sound trained and experienced.
    With this I am wondering if you are still interested in seeing the code Fusion produces for multiple and different parts all with their own wcs(s)?

    Regards
    Hey boydage. Experienced yes. Trained no. Well unless you call 2 semesters of you're-on-your-own Vo-tech Machine Shop training. Pretty much just self taught like a lot of people around here. Never worked in a machine shop in my life that wasn't my own. Honestly I wish I had for awhile at least. I've had my own machining business going on almost 20 years now.

    Pretty impressive box of electronics you got there. Don't know how you all figure that stuff out as quick and easily as it appears you do. Me I do ground ups on full size machine tools of all types. Not my trade, but who can afford new? I get them used and make them like new. It's a sickness I have that I can't stop until nearly every screw has been removed, no matter what it is.

    Sure it'd be fun to see your Fusion code. I will say in advance though that I've seen a lot of Fusion derived (and others) G-code on this site that looks like garbage. Typically so much extra stuff that's not needed. Messy if you will. But hey, still curious to see how you're playing it safe, but not too safe, going from one offset to the next. Also curios which offsets represent the lowest and highest Z reference plains. And what's the span of the Z levels being working with?

    Glad you're getting it all figured out. Fun to learn new things that's for sure.

  19. #19
    Join Date
    Jun 2013
    Posts
    443

    Re: Macros and toolchange. Need help please with offsets.

    Nice one. I was thinking about rebuilding one myself. My (new) employer wants to setup a cnc workshop from scratch. I've told him I am not trained or qualified but he reckons we will just learn from the mistakes we make ha.

    But back to this. Roger that on the code. Because of my lack of an atc I do need to make up for it by being smart and using as much "machine time" as possible instead of changing a tool every few min. Tell you what, without putting Fusion on a pedistal, they have done a fantastic job with wcs setup and running several ops at the same time. I will post when back home.

    Oh and the wiring. My new employer is an electrician. I rebuilt my control box very quickly in case he opened it up. It used to be a mass of spaghetti haha

    Sent from my SM-N970F using Tapatalk

  20. #20
    Join Date
    Jan 2005
    Posts
    15362

    Re: Macros and toolchange. Need help please with offsets.

    Quote Originally Posted by boydage View Post
    I will post asap. Out of interest I do wonder if there is much difference in a PC based machine and a cnc controller? The routine or macro that happens with mine is one Ger21 sold me about 6 years ago. I've just started getting paid to use my machine. Upgraded it for alloy by strengthening every thing including a larger spindle.

    So the current screenset on Mach 3 has two start options. Green for go and an auto Z zero.

    If I decide to use it, instead of the start green button there is an auto tool change auto zero function. If you are already familiar then apologies and no need to read further. If not, it goes like this.

    Initial run command, the tool (or probe) will lower on the Z to the workpiece (either a touch plate or probe or a make circuit with the tool)

    This zeros the Z.

    Then it (spindle) travels to a fixed plate on my table. Stopping at location, then lowering down to the fixed plate to touchoff and store an offset, fixed plate to the zeroed Z.

    Tool will lift, travel back to the workpiece (clearances preprogrammed)

    Tool will then goto a toolchange position. If you have used a probe you will then put your first tool in the collet.

    Tool then travels back to the fixed plate. Touches off again, the new (if applicable) Z offset is applied.

    Work begins until the next toolchange where it all happens again.

    My initial problem was I have been unable to put the stored Z offset into other fixtures the G55 G56 etc.

    But I do believe Ger21 has posted the macros I need. I'm on holiday way off the grid. And all I want to do is try out the macros he posted ha.

    But does that make more sense now as to what I am doing? Tell you what, Fusion have done a fantastic job at creating the ability to machine multiple and different parts all in one go.

    Sent from my SM-N970F using Tapatalk
    Using a PC most manufactures are using a PC based controller even Fanuc is using a PC based controller, so your answer is if the PC is setup correctly it can be better than , PC CPU's have become more powerful then any purpose built CNC control
    Mactec54

Page 1 of 2 12

Similar Threads

  1. G54, G55, G56,...work offsets by Macros?
    By dungvv in forum Controller & Computer Solutions
    Replies: 1
    Last Post: 01-18-2019, 01:42 PM
  2. Fauna 21T tool offsets and work offsets
    By tar356 in forum Fanuc
    Replies: 2
    Last Post: 09-22-2017, 12:44 PM
  3. Replies: 2
    Last Post: 10-24-2014, 04:17 PM
  4. Macros: Automatic calculation of fixture offsets
    By pwilson101 in forum Uncategorised MetalWorking Machines
    Replies: 0
    Last Post: 02-01-2012, 09:55 PM
  5. Toolchange
    By zooloader in forum Okuma
    Replies: 6
    Last Post: 11-04-2010, 08:48 PM

Tags for this Thread

Posting Permissions

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