586,100 active members*
3,115 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 25

Hybrid View

  1. #1
    Join Date
    Mar 2005
    Posts
    1498

    A sample tool change macro.

    [CODE]050815-1532 EST USA

    A sample tool change macro.

    Following is a tool change macro that I use on HAAS machines.

    The O6901 can be any O-number you choose. Whatever number you use must be used in the calling program.

    This macro will not work on our 1993 machine because variables are not allowed for P in the G10. A much more complicated macro is required to accomplish the same result and allow no modification in the calling program.

    For your reference on alpha to # addresses see the HAAS manual under MACROS the section on Alphabetic Addressing.


    The calling line looks like

    G65 P6901 E54 R 0.250 S 7500 T07 D07 ( call tool chg sub )

    where

    G65 is the call to external subroutine P6901.

    E54 --- The E maps to variable #8 in the subroutine and
    ....... 54 specifies the coordinate system. You will see
    ....... G#8 in the fourth row of the subroutine.

    R 0.250 The R maps to variable #18 in the subroutine and
    ....... 0.250 provides the cutter diameter for G10 L12 to load.

    S 7500 -The S maps to variable #19 in the sub and
    ....... 7500 provides the value for spindle speed.

    T07 --- The T maps to #20 in the sub and
    ....... 07 provides the value for the next tool.

    D07 --- The D maps to #7 in the sub and
    ....... 07 provides the value for cutter comp address.
    ....... Used with P in the G10 L12, and D in G43.

    Depending on your normal useage and how offsets are used may require
    modifications to this subroutine.

    Also there are people that do not like this general approach.

    The reason I like it is that all pertinent parameters are on one easily read line and entered only once. In particular the #7 variable, and the #20. This reduces errors.

    We have setting 33 Fanuc, 40 dia, 58 Fanuc, 49 ON (skip same tool change).

    Note that by changing the value for R but using the same tool we change from roughing to finishing.



    %
    O6901
    (Beta TOOL CHANGE macro subroutine 981212-1750)
    G10 G90 L12 P#7 R#18
    G80 M09
    G90 M06 T#20
    G#8 M08
    S#19 M03
    G43 H#20 D#7
    M99



    A sample calling program:

    O3002
    (BRAD_2.CNC Date-time created 08-14-2005 11:13:20)
    (Beta prog 981226-1009 )


    (**** TOOL Change to Mill Roughing **** --->1 IDM12R HAAS TL # 7 )

    G65 P6901 E54 R 0.250 S 7500 T07 D07 ( call tool chg sub )

    G0 X -0.4000 Y 2.3000
    Z 0.1000
    F 60.0 G1 M97 P 11 Z -0.1300
    G90 G0 Z 0.1000




    (**** TOOL Change to Mill Finishing **** -->2 IDM12F HAAS TL # 7 )

    G65 P6901 E54 R 0.248 S 7500 T07 D07 ( call tool chg sub )

    G0 X -0.4000 Y 2.3000
    Z 0.1000
    F 20.0 G1 M97 P 11 Z -0.1300
    G90 G0 Z 0.1000




    (**** TOOL Change to Mill Finishing **** -->3 IDM12F HAAS TL # 8 )

    G65 P6901 E54 R 0.060 S 7500 T08 D08 ( call tool chg sub )

    G0 X -0.4000 Y 2.3000
    Z 0.1000
    F 20.0 G1 M97 P 11 Z -0.0300
    G90 G0 Z 0.1000




    M09
    M05
    G90 G0 G53 Z0
    G53 X-15.0 Y0
    M30


    (This file BRAD_2.SUB Date-time created 08-14-2005 11:13:20)
    (Program 981226-1009 CNC_H4.BAS, .EXE QB45)


    N 11
    G1 G41 X -0.4000 Y 2.0000
    G1 X -0.1000 Y 1.8750
    G1 X 6.7500 Y 1.8750
    G1 X 6.7500 Y 0.0000
    G1 X 0.0000 Y 0.0000
    G1 X 0.0000 Y 2.0000
    G1 G40 X 0.0000 Y 2.2000
    M99




    %
    [/CODE

    Unfortunately the preview format does not correspond with actual format.

    .]

  2. #2
    Join Date
    Jan 2005
    Posts
    1880
    What is the macros appplication? To change a current tool to a different tool when broke (lights off)?
    thanks
    Michael T.
    "If you don't stand for something, chances are, you'll fall for anything!"

  3. #3
    Join Date
    Mar 2005
    Posts
    1498
    050815-1602 EST USA

    miljnor:

    The purpose of this macro is to place the tool change details and associated details like coolant on, spindle forward, etc. that for my use almost always go together in a location outside of the point in the program where the the function is needed, and in the place of these details have the single easily read subroutine calling line.

    In particular I change the tool diameter for a selected tool in the tool table with the G10 line every time I do a tool change. So even if the same tool remains in the spindle from one tool change subroutine call to the next I can change the cutter diameter from one value to another and thus change cutter position (obviously using cutter comp). This is one way to go from roughing to finishing with the same tool and the same basic path and in the main program easily see the tool position change. This is illustrated in the sample program.

    Also one does not need to worry about making a mistake in the value for T and H, and P and D when one operates as I do in this subroutine.

    This has nothing to do with broken tools, but just normal program execution.

    In the sample calling program there is a single rectangular path that is first roughed, then finished, both with the same tool but assigning a different diameter, and last a chamfer is done with a different tool.

    .

  4. #4
    Join Date
    Jan 2005
    Posts
    1880
    ahhhhh. Thanks for the explanation man.

    This is a non cad/cam intensive way to write code. Very ingenious!

    Reminds my of my video game programing days! When you had to have massive amounts of pre-written code for the little things because assembly was a biatch to write and rewrite in. So your worth to a company was in how many progrs you already wrote and could cobble them together for a bigger end result, in very little time.

    thanks
    thanks
    Michael T.
    "If you don't stand for something, chances are, you'll fall for anything!"

  5. #5
    Join Date
    Mar 2005
    Posts
    1498
    050815-1652 EST USA

    miljnor:

    In a single part application and milling a hole to a very close tolerance like 0.0002 in 6061 I might restart at the finish tool change and run another pass to minutely change the diameter. This might be done with or without changing the cutter diameter. Alternatively one might write a loop at the finish cut with a halt in the loop for checking dia.

    Something else you might do in a production environment is create a counter that is incremented in the tool change subroutine, and every X counts make a correction in the tool wear value in this subroutine.

    Part of my reason to show this subroutine was to maybe interest some of the readers to play with useful techniques by using macros. There may be many readers that have never made use of macros, or written their own.

    .

  6. #6
    Join Date
    Jul 2005
    Posts
    12177
    Quote Originally Posted by gar
    050815-1652 EST USA
    Something else you might do in a production environment is create a counter that is incremented in the tool change subroutine, and every X counts make a correction in the tool wear value in this subroutine.
    .
    This is something we might be able to implement on our SL-10 which drifts about 0.0015 on diameter while warming up. We know more or less when to adjust the wear or offset to compensate and do it by hand now.

    On the topic of macros do you find that the technical schools teaching programmers down play the usefulness of macros? I sent a guy on a sixteen week course and whenever he started asking about macros the answer was: "you don't need macros. they are old fashioned, use CAD/CAM it's a lot easier". Needless to say he didn't learn anything about macros.

  7. #7
    Join Date
    Mar 2005
    Posts
    1498
    050815-2007 EST USA

    Geof:

    Yes you should be able to use a time modification of the X position via a macro or straight code at the beginning of the program.

    The algorithm you develop for the increment of modification per unit of time has to be non-linear and might simply come from a table, or maybe you can develop a simple equation as an approximation.

    A macro to do this would not be a part of a tool change, but a stand alone macro because I believe it is primarily a machine frame, lead screw, etc. type of growth.

    The variable #3001 would be your time base. This is the millisecond timer and is set to 0 at power on. It's range is 497 days or thereabouts. Way beyond your needs. You might need an hour to two.

    G52 can not be used directly on the lathe to accumulate the change because it is zeroed at program start. However, if your algorithm or table provides the offset from time 0 of #3001, then this value can be copied to the G52 X at the start of each program start. G52 X is at #5201. See offsets in macros in the lathe manual.

    If you develop time constant information that might be useful to share with others.

    If there was a useful single point at which to measure temperature rise that would relate to the expansion, then an external temperature monitor could be used to feed infromation back to your program.

    If the machine gets turned off and right back on, then you will need a method to handle this because you start from scratch with #3001 at 0.


    On your school question I am too far removed from this to have any knowledge. However, in the computer field there are many people today that have never worked with assembler or basic logical design ( in my school days minimization was a very important part of logic circuit design ) and these current people only know how to work in high level languages which can be very inefficient. The last time I did anything in Fortran you could not do a bitwise logical and of two words, yet the computer at assembler level had that capability.

    If you are doing a contour surface, then high level is the way to go in all probability. But if you are doing a simple production job, then you want minimum cycle time and G-code with macros is probably the best route.

    .

  8. #8
    Join Date
    Jul 2005
    Posts
    12177
    Quote Originally Posted by gar
    050815-2007 EST USA
    .....If there was a useful single point at which to measure temperature rise that would relate to the expansion, then an external temperature monitor could be used to feed infromation back to your program.....
    If I had my head screwed on correctly I would have ordered the temperature compensation option when I bought the machine!

    Your comments will be very helpful when I get the time to pursue this. The machine is used in production; turned on, run 10 hours and then off until tomorrow so the #3001 timer is appropriate.

    Thanks

  9. #9
    Join Date
    Oct 2012
    Posts
    0

    Unhappy New and need help ...Placing tool/assigning tool to component

    I have draw out a door with the lines all set in place and drawn out the ironmongery that needs machining, I have added the tool direction but I don't know how to add the tool :S ! all lines are green at the moment, what color should the lines for milling out the ironmongery be too ?

    Please can you help me ASAP

    Much appreciated for anyone of your time

    Tise87

  10. #10
    Join Date
    Jan 2005
    Posts
    1880
    The only down side to a macro in that application is the complexity. I used to do alot of bearing journals that requiered something similar (cant find my old docs) and I actually had to right something in it to compensate for idle time as well as just warm up (do to breaks for bathroom ect.) if the machine was left to sit for over about 12min. then the offset would start drifting again.

    So unless you have your guys chained to the machine (hmm sound like an idea i should implement (chair) ) you might have to wright something of this nature.

    If I can find my old macros (its been a few years, so don't get your hopes up) if will post them.
    thanks
    Michael T.
    "If you don't stand for something, chances are, you'll fall for anything!"

  11. #11
    Join Date
    Jul 2005
    Posts
    12177
    [QUOTE=miljnor] ....So unless you have your guys chained to the machine..../QUOTE]

    No I'm not suicidal (in a business sense) yet.

    The complexity you bring up will be less likely in our application. The parts only need +/-0.0005 which is less than the initial warmup but the backward drift over lunch break is not enough to worry about.

    Your comment about chaining to machines brings up the idea of having a thread titled "Are your operators allowed to wander around while their machine is running?" I figure if you have the confidence to set Power Off at M30 and leave a cycle running at quitting time or if you are doing lights out manufacturing there is no reason to insist that the operator stand there all the time peering through a dirty window. We do production work on a repeat basis on more than 200 different parts using around 600 different programs. For most of my guys it is a case of "same old same old" and I would have a revolt if I didn't let them break up the boredom somehow with cycle times ranging from 2 minutes to 2-1/2 hours.

  12. #12
    Join Date
    Mar 2005
    Posts
    1498
    050816-2043 EST USA

    My son gave me some additional information.

    He said that HAAS has a timed correction function in our machine. However, he does not use it, but rather prefers manual correction. I have not looked into this so I do not know what the HAAS algorithm is.

    His second point was that during a 30 min break he has seen the machine grow in the same direction it was moving while running. This probably means it is heat from the spindle and that there is a long time constant.

    .

  13. #13
    Join Date
    Jan 2005
    Posts
    1880
    I honestly don't think that the thermal expansion of the machine is all there is to blame. I have messured a half thou of movement in a h13 tool steel blank I made for a mold maker a couple of years ago. I machined it in the afternoon at about 87deg F. and when he decided to check the part is was about 43 deg. in the early morning. I had to convince him to check them in the afternoon (after all the machine is hot as hell when in operation). I don't think the material should have grown so much but it was customer supplied so there was nothing to say there (fortunatly).

    So with that said I think the coolant heat transfer to the part is a big cause and coolant looses its heat alot faster than the machine.

    just a thought and since I haven't done any in depth study (being since I rarley do that close tol. stuff anymore) I have no way to verify my theory. :P
    thanks
    Michael T.
    "If you don't stand for something, chances are, you'll fall for anything!"

  14. #14
    Join Date
    Mar 2005
    Posts
    1498
    050817-0729 EST USA

    This morning I looked in the HAAS manual for their timed compensation.

    There is no definition of the algorithm so it is maybe linear. See settings 109, 110, and 112.

    Maximum time is 300 minutes, and maximum compensation is +/- 2/1000".

    .

  15. #15
    Join Date
    Jul 2005
    Posts
    12177
    I had looked at that and I somehow came to the conclusion it needed the temperature sensor option. Reading too fast I guess. Next time we do the part we will try this and see if it helps.

    Thanks

  16. #16
    Join Date
    Mar 2005
    Posts
    1498
    050822-1305 EST USA

    Warning --- For those unfamiliar with G10 L12 ...etc.

    This instruction changes (overwrites) the content of the addressed location. This means for example if you are selecting the "diameter offset" ( diameter offset is what L12 specifies ) of D code ( logical address of the offset ), then you overwrite whatever is at that location with the value associated with R at the time of execution of the G10 instruction. You can change this diameter offset value many times to different values within a program.

    This means if you were to manually set the "diameter offset" before running the program and that manually set value was different from what is in the program, then your manually set value would be destroyed, i.e., have no effect.

    One execution of G10 affects one and only one location at a time. Thus, changing tool diameter has no effect on the "wear offset" for that tool.

    .

  17. #17
    Join Date
    Jul 2005
    Posts
    12177
    Advice appreciated; unfortunately I learnt it the hard way. No machine damage just tool and me scratching my head for a short while.

  18. #18
    Join Date
    Jan 2005
    Posts
    1880
    this post is very old and they wrong place to ask such a question Tise87...you need to start a new thread and ask it....I'm sure someone will have an answer for you.
    thanks
    Michael T.
    "If you don't stand for something, chances are, you'll fall for anything!"

  19. #19
    Join Date
    Oct 2012
    Posts
    0

    Assigning tools

    Right I see ... well i'm new to all this, so i suppose like most thing's, I will come to grips with it !

    Cheers though but whats do you mean by that quote at the end about fall for anything ???

  20. #20
    Join Date
    Jan 2005
    Posts
    1880
    Its a famous quote by someone unknown.

    Basically if you don't stand for your own beliefs, you will fall prey to someone else'.

    It's just part of my signature is all. I change it periodically and try to keep it snarky but somewhat meaningful. Depends on my state of mind when i change it!
    thanks
    Michael T.
    "If you don't stand for something, chances are, you'll fall for anything!"

Page 1 of 2 12

Posting Permissions

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