Macro for tool diameter offset


Results 1 to 15 of 15

Thread: Macro for tool diameter offset

  1. #1
    Member
    Join Date
    Jul 2014
    Posts
    221
    Downloads
    0
    Uploads
    0

    Default Macro for tool diameter offset

    how do you load a tool diameter offset from a tooltable to a variable in g code?
    for example your T2 tool diameter is 20.03 mm in diameter and you want to manipulate that value in g code?
    how do I do it?

    Similar Threads:


  2. #2
    Member dcoupar's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    2932
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    What control is this on?



  3. #3
    Member
    Join Date
    Jul 2014
    Posts
    221
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    haas vf2



  4. #4
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    Quote Originally Posted by allenp View Post
    how do you load a tool diameter offset from a tooltable to a variable in g code?
    for example your T2 tool diameter is 20.03 mm in diameter and you want to manipulate that value in g code?
    how do I do it?
    Hello allenp,
    You can Read from and Write to the control's System Variables for:
    1. Tool Diameter/Radius Geometry Offsets using System Variables #2401 - #2600

    and

    2 Tool Diameter/Radius Wear Offsets using System Variables #2601-#2800

    For example:

    #1 = #2401 (Read)

    #2401 = [#2401 - 0.05] (Write - Metric example subtracting 0.05mm from existing Offset Value)

    Regards,

    Bill



  5. #5
    Member
    Join Date
    Jul 2014
    Posts
    221
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    wow that is great!!
    thank you very much!!

    so the #2401 is the tool diameter for tool 1 or T1, I suppose?

    also if I don't want to change #2401 variable, I could load it to another one and then change that another one,right?
    for example
    #1 = #2401
    #1=#1-0.05



  6. #6
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    Quote Originally Posted by allenp View Post
    wow that is great!!
    thank you very much!!

    so the #2401 is the tool diameter for tool 1 or T1, I suppose?

    also if I don't want to change #2401 variable, I could load it to another one and then change that another one,right?
    for example
    #1 = #2401
    #1=#1-0.05
    Hello allenp,
    That's correct. Depending on the arrangement of your Macro Code, you could do something like the following:

    #1 = #[2400 + #3026]

    As #3026 is the System Variable for the Spindle Tool, the above example code can be used to programmatically obtain the appropriate Tool Radius Comp Offset number. If the Tool in the spindle were T05 then the above code would equate to the following:

    #1 = #[2400 + 5]
    #1 = #2405

    Once you have read the value from the System Variable, you can do with it what you want.


    Regards,

    Bill



  7. #7
    Member
    Join Date
    Jul 2014
    Posts
    221
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    yeah but now I have another problem/question.
    how to manipulate that tool diameter offset value only in program, not in table?

    What I want to achieve is to create a while -do loop which will use only one set of coordinates, but which will move tool in more than one passes through those same coordinates but with different tool diameter offsets.

    Basically I want to control how much my tool mills per one pass in width.

    So if I have a stock part in vise with dimensions 30mm x 30mm x 30mm and I want to mill a cube 20x20x20mm I would use a roughing mill diameter 8mm and first mill the stock to 29x29x20mm.
    2nd pass would be 28x28x20mm.
    3rd pass 27x27x20mm.
    and so on.

    So I thought I'd manipulate tool diameter in a program, but then again, how do I turn on cutter compensation with the manipulated value?

    If I did what you told me to:
    #1 = #2405+9
    I'd get #1 value of 8 (mm), but when I put in
    G01 G41 D5 X0, the mill will go directly to 20x20x20mm cube, not 29x29x20mm cube like I wanted to..

    How to use this manipulated tool diameter when I need to turn the cutter compensation on?

    thanks again!



  8. #8
    Member
    Join Date
    Jul 2014
    Posts
    221
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    or maybe...
    if i use:

    #2405=#2405+9

    and then use
    G01 G41 D5 X0

    it will do what i wanted and make my a 29x29x20mm part?

    but when the program resets and the value of #2405 stayed lets say, 3mm larger, will the tool table be changed to that value or will it reset to its original value of 8mm?



  9. #9
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    Quote Originally Posted by allenp View Post
    or maybe...
    if i use:

    #2405=#2405+9

    and then use
    G01 G41 D5 X0

    it will do what i wanted and make my a 29x29x20mm part?

    but when the program resets and the value of #2405 stayed lets say, 3mm larger, will the tool table be changed to that value or will it reset to its original value of 8mm?
    Hello allenp,
    Macro programming is limited only by your imagination; there are many ways in which you can achieve what you describe. You will find that you probably have far more Tool Offsets (Diameter and Length) than the capacity of the magazine. In most instances, some Offset Numbers may not be used in the life of the machine. Accordingly, you can use a Tool Offset number that equates to the Tool Number, for example T05 will use Tool Offset number 5, and use an Offset Number in your Macro Program that is indexed by a constant that results in an Offset Number being used that is outside the normal scope of use. For example:

    #[2400 + #3026 +100] = #[2400 + #3026]

    In the above example, if the Tool Number T05 is the Spindle Tool, Tool Offset number 105 will take on the original value of Tool Offset number 5. In your Macro program you could do something like the following:

    G01 G41 X0.0 D [#3026 + 100]

    Just before exiting the Macro, and depending on the scope of your Macro, the Working Copy of the Tool Offset should be set to Zero or Vacant as in the following example:

    #[2400 + #3026 +100] = 0

    or

    #[2400 + #3026 +100] = #0

    Regards,

    Bill



  10. #10
    Member
    Join Date
    Jul 2014
    Posts
    221
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    please tell me will #2405 value stay what I've set it in program once it finishes or will it reset to its table value after program end and reset?



  11. #11
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    Quote Originally Posted by allenp View Post
    please tell me will #2405 value stay what I've set it in program once it finishes or will it reset to its table value after program end and reset?
    Hello allenp,
    In the example shown in my previous Post, #2405 isn't being modified. A working copy of #2405 is made using the following Macro statement, then the working copy is used and manipulated in your program. Offset specified by the System Variable #2405 remains unchanged.

    #[2400 + #3026 +100] = #[2400 + #3026]

    In the above example, using T05 as the current tool, a working copy, System Variable #2505 (Offset 105), is made of System Variable #2405 (Offset 05).

    Regards,

    Bill



  12. #12
    Member
    Join Date
    Jul 2014
    Posts
    221
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    Alright thanks for the reply and clarification!



  13. #13
    Member
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    16
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    Hi Bill,
    I saw your post about how to use system variable for compensation on tools, i was wondering if you can email me a simple program or post it here with all the macro program and subprogram so I can implement what I need to do in my program, if so please consider this is simple 1in hole with 1" depth and has +/-.01 tolerance and need to be check dia. size with probe and re machine with a finishing tool, for re machining program just call sub-program in code, i need to see how you will implement it in macro programming. thanks so much in advance. Regards



  14. #14
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    Quote Originally Posted by makbari View Post
    simple 1in hole with 1" depth and has +/-.01 tolerance and need to be check dia. size with probe and re machine with a finishing tool
    hi makbari it would be nice if probe result would be passed to the macro ...

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  15. #15
    Member
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    16
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    it has haas control,



  16. #16
    Member
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    16
    Downloads
    0
    Uploads
    0

    Default Re: Macro for tool diameter offset

    hi, is that possible to post whole sample macro code so I can get idea how to manipulate mine, like general concept to correct the hole size, machine it with sub-program, check it with probe, re-machine to correct the size, thanks



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Macro for tool diameter offset

Macro for tool diameter offset