587,955 active members*
3,556 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2005
    Posts
    214

    Tool length setter

    I'm using an electronic tool touch off setter so I can maintain an accurate local Z zero when changing tools on my benchtop mill. It's wired into my controller and functions as a switch.

    Here's the scenario I'd like to have happen. I have a Z zero position I use for my rotary axis a known distance (-28.65mm) above the top of the toolsetter. After a tool change, I'd like to touch off on the toolsetter and reset local Z at -28.65 and return to local X0Y0 so I'm ready to run the next program.

    I can send the spindle to the toolsetter, manually touch off and trip the switch, G92 Z-28.65 and it works fine.

    If I run this:

    G53 Z0 [Lift Z Head]
    G53 X276 Y125 [Move to XY position of tool measure switch]
    L91 G0 Z-100 [Move down the rapid distance]
    L91 G1 Z-250 M28 F20 G31 [Move down to tool switch]
    g92 z-28.65 [set LZ at TOOL SWITCH HEIGHT]
    G53 Z0 [Lift Z Head]
    G0X0Y0 [RETURN TO LOCAL XY ZEROS]

    It runs but doesn't set a new Z position, Z zero remains whatever my previous local Z zero was.

    What am I missing?

    Thanks,

    Harry
    www.harryhamilldesigns.com
    CAD sculpting and services

  2. #2
    Join Date
    Mar 2005
    Posts
    214
    bumpy
    www.harryhamilldesigns.com
    CAD sculpting and services

  3. #3
    Join Date
    Mar 2003
    Posts
    4826
    I am assuming that this line:
    L91 G1 Z-250 M28 F20 G31 [Move down to tool switch]
    permits the tool to move freely downwards until it hits the switch?

    It would appear that you are trying to avoid setting (and using) tool length offsets?

    G53 is the machine coordinate system. Chances are good that you cannot alter the position of the G53 coordinate system. The G92 is a coordinate system shift. Since you cannot shift the G53 system, I would think that you would have to specify one of the available work offsets (G54) at the start of your code, so that the G92 shift can actually be applied to something.

    For example, if machine home is initially synonymous with the G54 workshift, then
    G00 G53 X0Y0Z0 will return the machine to home.
    and
    G00 G54 X0Y0Z0 will return the machine to the same position, until such time that you shift the Z value with the G92. Setting the G92 after the G54 workshift has been called (established as current), then you should see a new position established for every tool. Maybe. I don't know what controller you are using.
    First you get good, then you get fast. Then grouchiness sets in.

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

  4. #4
    Join Date
    Jan 2007
    Posts
    210
    Yup, the G53 on the next line cancels out your G92 preset.

    If you want to return Z to the original zero replace the G53 Z0 line with:
    G91 G28 Z0
    G90

    Warning: This may or may not work on your control.
    On a Fanuc there is a parameter that controls whether or not a G28 (reference point return) cancels a G92.
    Bob
    You can always spot the pioneers -- They're the ones with the arrows in their backs.

  5. #5
    Join Date
    Mar 2005
    Posts
    214
    I am assuming that this line:
    L91 G1 Z-250 M28 F20 G31 [Move down to tool switch]
    permits the tool to move freely downwards until it hits the switch?
    Correct, the switch is triggered, the move is stopped and we go to the next line of code.

    It would appear that you are trying to avoid setting (and using) tool length offsets?
    Ummm, I think I am. I'm just trying to define where in space the tip of the tool is after swapping them. By changing the tool setter Z height setting in different macros, I can set Z zero (local) for different fixtures.

    I'm using Wincnc, which normally saves the offsets after measuring with a G37 and then uses them with soft limits to keep from dinging your table. I'm not sure if what I'm doing is the best way to go about it, but it seemed like a good idea at the time. Feel free to tell me I'm trying to reinvent the wheel.

    So, I need to get out of G53 by calling a G54 before calling a G92?

    What about this?

    G53 Z0 [Lift Z Head]
    G53 X276 Y125 [Move to XY position of tool measure switch]
    L91 G0 Z-100 [Move down the rapid distance]
    L91 G1 Z-250 M28 F20 G31 [Move down to tool switch]
    G54
    G92 Z-28.65 [set LZ at TOOL SWITCH HEIGHT]
    G91 G28 Z0 [Lift Z Head] - Is this going to home Z or just send it to zero?
    G90 - What's the G90 for?
    G0X0Y0 [RETURN TO LOCAL XY ZEROS]

    Thanks for all your help, it's confusing trying to figure this out.
    www.harryhamilldesigns.com
    CAD sculpting and services

  6. #6
    Join Date
    Mar 2003
    Posts
    4826
    The only reason to check each and every tool with the presetter (after every tool change) is to ensure superior accuracy of tool position (if you fuss about 10ths of a thousandth) or to perhaps detect tool breakage. It could also prevent a tool crash (I suppose) if you were doing manual tool changes and inadvertantly put a tool in the spindle out of sequence. Are any of these reasons valid for your application?

    If not, I would suggest you practice conventional setup: set the tool length offsets as the distance from the tooltip at G53 Z0 (home) versus the Z axis position with tooltip at the presetter.

    Most likely your control uses G43 H_ to enable a tool length offset for a given tool.

    After this is done then you can use a method similar to what you laid out in your first post, to establish the difference between the presetter switch and the work Z0 (top of stock). The difference between the presetter height and the stock height then becomes a Z value in the G54 work shift and is a constant for all tools, because all tools are set relative to the presetter.

    I think if I were you that I would eliminate the confustion created by the difference in height between your indexer axis and the tool presetter. That is just one extra factor that you don't need to be concerned with except on those occasions when you are actually doing 4th axis work. In that instance, then the G54 Z value is your 28.65 value that you have applied as a constant in your first post.
    First you get good, then you get fast. Then grouchiness sets in.

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

  7. #7
    Join Date
    Jan 2007
    Posts
    210
    First a disclaimer, I've never used Wincnc. However, I do contract cnc program optimization for a big, dumb Giant Manufacturing company so I've worked with all kinds of cnc controls.

    In the world of cnc programing there are many different ways to accomplish the same thing. Give ten different programmers the same task and you'll get ten totally different programs.

    There are several ways of moving your program zero around. Most programmers get comfortable with one method and stick with it. There is no one "right" way to do it. I'd suggest you pick up a book like "CNC Programming Handbook" by Peter Smid as a good starting point.

    G53 is the machines base coordinate system. It's zeros are set by where the machine homes itself. These zeros are known as the machine's reference points. On older machines this is the only coordinate system that the control understands.

    A G92 is a coordinate preset command. The X,Y,Z numbers on this command are preset into the controller at the current position.
    Think of a readout on a manual machine, a pointer in the spindle, and a 1-2-3 block in your vise. You move the pointer to the left side of your 1-2-3 block and zero the readout. You have preset your X to zero. You could also move your pointer to the right side of the block and preset a 3.00 into the readout giving you the same "0" point in space. This is what a G92 does. Since it "shifts" the zero point this command is known as a coordinate system shift. On early machines this is the only way to create a new zero point. Typically this zero point is defined at some convenient point on the workpiece.

    Later on G54..G59 coordinate systems were added. These are known as workpiece coordinate systems. This eliminated the need for G92's and allowed you to set your own coordinate system for your parts. The offset between the machine's (G53) coordinate system and your part program's are stored in a table and you can switch between the differing "zeros" by selecting what coordinate system you are in at any given moment. Once you specify a coordinate system (G53,G54,G55,etc) the machine interprets your X,Y,Z values as being in the selected coordinates until you call up a different system.
    In your example you call G53 on the first two lines, The second G53 does nothing as you are already in the G53 system. This is known as a modal command. Once set you stay in this "mode" until an alternate coordinate system is selected.

    A G28 is a reference point return command. It's usage is to return the machine to the original "home" position. But if you give a G28 by itself the control doesn't know which axis you want to return so here is where the command gets a little tricky. Early controls used hardwired logic and a letter like "Z" had to be followed by a number.
    G28 is technically defined as return to the reference point moving though the point called out on the line. Since we have shifted the coordinates using a G92 we may not know what a "safe" intermediate point is.
    This is the reason for the G91. G91 is "incremental mode". This means the axis values specified in the line are incremental distances from where we are.
    If you used programmed:
    G91 G01 Z1.0 F10
    Z1.0
    Z1.0
    The Z axis would move 1 inch up as each line was executed. Note that G91, G01, F10 are all "modal" commands. Once they are read they stay in effect until you change them.
    By using G91 G28 Z0 the intermediate point to move through while returning to the machine's home position is zero distance from where we are. This way we can return to Z home without caring about where we are now. A typical program will use G91 G28 X0 Y0 Z0 in the beginning to return all three axis to the home position when starting.
    A program on an older machine would often start like this:
    G91 G28 Z0.0 (return Z to Home)
    G28 X0.0 Y0.0 (return X and Y to Home)
    G90 (absolute programming mode)
    G92 X-40.5 Y-23.2 Z12.1 (preset the readout telling the machine that the workpiece zero was -40.5,-23.2, and 12.1 from the home switches)

    G90 cancels the G91 and returns the control to absolute programming.
    I'd suggest playing with G90 (absolute) and G91 (incremental) modes using G01 moves at slow feedrates (so you can hit the cycle stop before you run into something) to get an understanding of what they do.

    Once cncs got tool changers the idea of tool offsets were added to the language. This way you had one programming zero point even though your tools were differing lengths. You would store the difference between the the actual length of the tool and a "zero" length tool in the "H" registers.
    Now when you pick up tool# 1 you issue a "G43 H01". This tells the control to add the value in the H01 register to the Z axis values when moving. G43 is tool length plus compensation". A G49 command cancels the tool length compensation. You store the lengths for each tool in a different H register and now you can change tools without having to move your program Z zero to account for differing lengths.

    Nowadays most programmers will use G54 to set the workpiece zero in space and the H registers to compensate for different length tools.

    I'm sure all the above is clear as mud. It's a lot easier to explain when I'm standing in front of someone and waving my arms around. I usually spend two or three days teaching these concepts to a newcomer.

    Read up on cnc programming and play around with some of these commands at very slow machine speeds. Keep you hand on the "Oh-****" button, everyone crashes a machine while learning.
    Bob
    You can always spot the pioneers -- They're the ones with the arrows in their backs.

  8. #8
    Join Date
    Mar 2005
    Posts
    214
    Wow, thanks for all the info!

    I worked on it for several hours today and made some headway in both getting the mill to respond the way I'd like and in understanding what's going on a bit.

    I'm milling jewelry in multiple steps, most things in a combination of flat milling and rotary. Almost everything is done in the rotary one way or another so it's key. Alignment has to be dead on, when I'm milling .75mm prongs from several directions being off a tenth or even a few hundreths of a mm ruins a piece. So, I need to have Z zero exactly on A axis rotation and tool tips have to be at the same zero as well. At least for WinCnc, tool offsets would probably work if I had a tool changer or accurately remountable tools. They're straight shanks with collars and won't mount in precisely the same depth in the collet each time. I'm using 1/8" shank conical cutters with tips in the .005" - .001" range. They tend to break easily too, so I'd be changing and having to keep track of which tool had which offset, which seemed like more effort than it's worth.

    I realized G53 was machine coordinates, but didn't realize it was modal, that explains a lot. I can see now I wouldn't need it on the second line.

    I didn't realize that all those commands are modal - the fog is beginning to lift. I've been mainly using simple Gcode commands like G0 and G92's to traverse to a point and set zeros before running a program.

    In Wincnc: G28 homes all axis, G28Z homes only Z etc. From what I can understand, G91 G28 Z0 is equivalent? It's tells the machine, just go home from here, wherever here happens to be?

    Thanks for book idea, I've looked in our local library system for anything on Gcode (you never know) without any luck and all I can find elsewhere is pretty cryptic.

    I ended up getting this to work today and it does what I want, but I'd like to get it correct if it seems wacky. (Besides the extra G53, that'll come out..... G0 X276Y125 should work?)

    G53 Z0 [Lift Z Head]
    G53 X276 Y125 [Move to XY position of tool measure switch]
    L91 G0 Z-98 [Move down the rapid distance]
    L91 G1 Z-15 M28 F20 G31 [Move down to tool switch]
    G92 Z-28.65 [set LZ at TOOL SWITCH HEIGHT]
    L90 G0Z65 F800 [Lift Z Head AND RESTORE FEEDRATE]
    L92Z [CANCEL G92 RESTORE]
    L90 G0X0Y0 [RETURN TO LOCAL XY ZEROS]
    www.harryhamilldesigns.com
    CAD sculpting and services

Similar Threads

  1. Tool Setter Macro for M-V60C and Metrol Setter
    By mitshack in forum Mazak, Mitsubishi, Mazatrol
    Replies: 1
    Last Post: 02-02-2013, 12:08 PM
  2. Tool setter macro for M-V60C and Metrol setter
    By mitshack in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 0
    Last Post: 10-06-2008, 02:38 PM
  3. Depth setter / tool length input?
    By thackman in forum Syil Products
    Replies: 1
    Last Post: 06-26-2008, 10:08 PM
  4. Tool Setter
    By GARY DAVIS in forum Fadal
    Replies: 6
    Last Post: 03-19-2008, 01:44 AM
  5. tool setter
    By ACME in forum MetalWork Discussion
    Replies: 8
    Last Post: 07-30-2005, 05:15 PM

Posting Permissions

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