Need Help! Thread Milling using macro - Page 2


Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 49

Thread: Thread Milling using macro

  1. #21
    Registered
    Join Date
    Aug 2016
    Location
    India
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    Quote Originally Posted by RCaffin View Post
    M22x1.5 thread has an ID of 20.5 mm. I assume there is a hole at X0 Y0 of this size already drilled.
    The thread milling cutter has an OD of 20.0 mm and lots of teeth.
    How does the cutter diameter affect in my program for threading? We use cutter diameter of 18mm, what changes should be made in the program?

    G03 X1.00 Y1.00 Z0.188 I0.00 J1.00 F40
    G03 X-1.00 Y1.00 Z0.188 I-1.00 J0.00
    [Reference : two lines are taken from my previous post where I uploaded the program]

    I saw this two interpolation lines in my program and was baffled understanding it. Later on having a talk with the operators they told that people who gave them the program said it is necessary. And it is pitch/8. For 1.5, its 1.5/8 = 0.1875. Hence, the first and last interpolation has a pitch of 0.188 and even their radius is small. But I still don't understand it's use.
    Are these Lead in and Lead out motions? (Just a guess) Is it necessary to perform every time?

    What would be the difference if I perform it as per your syntax and NOT writing those two lines?
    o8
    s1700 f80
    m3
    g0 x0 y0 z5.0 % above middle of hole
    g01 z-19.5 % go down the middle gently
    g03 x11 y0 r5.5 % arc out in semi-circle to edge
    g03 x-11 y0 z[-19.5+1.5/2] r11 % helical upwards in two steps of 1.5/2 mm each time
    g03 x11 y0 z[-19.5+1.5] r11
    g03 x0 y0 r5.5 % disengage teeth to middle
    g0 z5 % retract
    m5
    m30

    Also, in line G41 D8 X1.00 Y-1.00 Z0.00 F80
    I couldn't get the use of tool dia. comp. Is it necessary? Since I don't see it in the program you've wrote. If it has to be added then we need to edit the co-ordinates in your program.

    Thanks in advance!

    Last edited by arshsmart; 09-03-2016 at 02:09 AM. Reason: Additional doubts added. (tool dia comp)


  2. #22
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4256
    Downloads
    4
    Uploads
    0

    Default Re: Thread Milling using macro

    We use cutter diameter of 18mm, what changes should be made in the program?
    The root diameter of an M22 thread is 22.0 mm (by definition). So the radius is 11.0 mm.
    The radius of an 18 mm cutter is 9.0 mm.
    If you run the cutter down the middle of the hole, it will have to move 2 mm outwards to cut the thread. That will mean a bit of a change in the '1.0' values, but I am not sure exactly what as i don't use IJK

    ERK! DANGER!

    Please note that I have an error in the parameter-driven program! The definition of #17 is wrong: it should read:
    #17=[#10/2-#12/2]
    Coding at speed late in the night...

    And there are also errors in the other program too: the g03 lines should read
    g03 x2 y0 r1.0 % arc out in semi-circle to edge
    g03 x-2 y0 z[-19.5+1.5/2] r2 % helical upwards in two steps of 1.5/2 mm each time
    g03 x2 y0 z[-19.5+1.5] r2
    g03 x0 y0 r1 % disengage teeth to middle
    I did not allow for the cutter diameter!!!!! Also written in haste.

    Sigh - happens when I am in a rush. Leaves me feeling stupid. More stupid than normal.

    Cheers
    Roger



  3. #23
    Registered
    Join Date
    Aug 2016
    Location
    India
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    Haha!! Happens, no worries. Even I didn't noticed that.
    Now I understand where the cutter dia matters.. But still I didn't understood why we use G41. I checked all those program generators provided by various tooling companies and found out everyone uses it. And all of those programs are almost similar (up to 95%)
    This one is provided by Vardex for M22x1.5

    %
    O0001 (TMINRH CLIMB Cycles= 1)
    (Tool cutting diameter = 0.000 mm - Fanuc 11M Controller.)
    G90 G00 G57 X0 Y0
    G43 H10 Z0 M3 S1872
    G91 G00 X0 Y0 Z-19.635
    G01 G41 D60 X1.561 Y-0.993 Z0 F6
    G91 G03 X0.993 Y0.993 Z0.135 R0.993 F6
    G91 G03 X0 Y0 Z1.500 I-2.554 J0 F22
    G91 G03 X-0.993 Y0.993 Z0.135 R0.993
    G00 G40 X-1.561 Y-0.993 Z0
    G90 G00 Z10.000
    M5
    M30
    %

    Do you have any idea about Arc-in (Lead in) & Arc-out (Lead out)? Can you shred some light regarding it's use and how to calculate those co-ordinates for that particular arcs?



  4. #24
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4256
    Downloads
    4
    Uploads
    0

    Default Re: Thread Milling using macro

    G41: cutter radius compensation.
    It is possible (easy?) to get this wrong, either with the wrong data in the tool table or with the wrong lead-in move. I rarely if ever use it: in fact I avoid it.
    But my (parametric) programing style is very different from the output of CAM SW and the output from many vendor programs, so treat my comments with caution!

    Lead out is easy: in general a straight line exit is enough imho.

    Lead in is more complex.You don't want to slam the tool into the metal, and you do want to tell the controller which side of the cutting point is the active side (when using a cutter comp). Have a look at the jpg in post 20. There are 5 turns of the spiral or helix there - ignore. There is also a smaller semi-circle at the bottom. That is the G3 lead-in. It brings the cutter gently into full contact with the metal.
    The lead-in goes from the origin (0,0) (in this case) to the start of the helix. The helix has radius R, so the semi-circle lead-in will have radius R/2. This is easy to follow when using the R format, but more difficult when using the IJK format.
    R itself is the radius of the cutter circle, which is the difference between the OD of the bolt thread and the diameter of the cutter (halved to make radius).

    Cheers
    Roger



  5. #25
    Registered
    Join Date
    Aug 2016
    Location
    India
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    Quote Originally Posted by RCaffin View Post
    .
    But my (parametric) programing style is very different from the output of CAM SW and the output from many vendor programs, so treat my comments with caution!
    Yes, sure.

    Yes, I noticed in your program you gave lead-in using interpolation but I also noticed it didn't moved up in Z direction. Like the one provided by both the vendors. Both of them used lead-in with some movement in pitch.
    G91 G03 X0.993 Y0.993 Z0.135 R0.993 F6 [Vardex]
    G03 X1.00 Y1.00 Z0.188 I0.00 J1.00 F40 [Carmex]

    May I know the difference and the reason you not using it?



  6. #26
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4256
    Downloads
    4
    Uploads
    0

    Default Re: Thread Milling using macro

    I don't move the Z axis during lead-in because that is not part of the thread. Mind you, that works fine with a single-point threadmill. I am not sure what it would do with a cutter shaped like a tap. I think there would be a bit of a groove right down the tapped hole where the cutter went in. That would not be good. I suspect I would need to have some Z travel for a multi-tooth thread mill, but how much ... dunno right now. Some complex maths needed.

    Note a major difference between how I cut threads and how those vendor programs work. I start the spiral at Xn Y0, while both vardex and Carmex seem to start the spiral at Xn Yn. I think they are leaving X0 Y0 along the X axis and curving to the north.

    As to why I do it that way - because it is fairly simple, direct, clean and works well with single-point thread mills.

    Cheers
    Roger



  7. #27
    Member christinandavid's Avatar
    Join Date
    Aug 2009
    Location
    New Zealand
    Posts
    684
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    The need to arc in/arc out at the correct helix angle becomes more important the closer the cutter size is to the hole size. If you arc in from the hole centre, moving Z axis 1/4 of the thread pitch is a reasonable approximation.

    Of course, if you approach/depart perpendicular using G1, the Z motion is unnecessary.

    DP



  8. #28
    Registered
    Join Date
    Aug 2016
    Location
    India
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    Quote Originally Posted by christinandavid View Post
    The need to arc in/arc out at the correct helix angle becomes more important the closer the cutter size is to the hole size. If you arc in from the hole centre, moving Z axis 1/4 of the thread pitch is a reasonable approximation.

    Of course, if you approach/depart perpendicular using G1, the Z motion is unnecessary.

    DP
    But why is it important to give Z motion while using G03/02 that's the main question for me? I mean, like what happens if we don't?



  9. #29
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4256
    Downloads
    4
    Uploads
    0

    Default Re: Thread Milling using macro

    why is it important to give Z motion while using G03/02 that's the main question for me? I mean, like what happens if we don't?
    All that would result is that you would have a series of parallel grooves inside the hole, rather than a spiral thread. This might not be what you were hoping for.

    Cheers
    Roger



  10. #30
    Registered
    Join Date
    Aug 2016
    Location
    India
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    All that would result is that you would have a series of parallel grooves inside the hole, rather than a spiral thread. This might not be what you were hoping for.
    Yes, I understand now thank you.
    I referred a book "CNC Programming Handbook: A Comprehensive Guide to Practical CNC Programming" and found that Z movement should be given by calculating and not by just assuming. There is a formula for finding a value for Z movement in arc-in and arc-out.
    Thread Milling using macro-capture-png Thread Milling using macro-capture1-png

    This is what I could come up with for M22x1.5, cutter dia 18mm: (I've ignored tool height comp and other basic codes. I've just wrote the main cycle for threading)

    G90 G54 G00 X0 Y0 Z5
    M03 S900
    G01 Z-19.5 F50
    G03 X2 Y0 Z-18.749 R1 {moved up 0.751mm as per calculation in "mm". A=180, P= 1.5 }
    X2 Y0 Z-17.249 I-2 J0 {clubbed the two half cycles into one by writing in I,J format}
    X0 Y0 Z-16.498 R1 {moved up same as for arc-in}
    G00 Z5
    M05 M30

    It would be of great help if can simulate this for me and let me know my corrections/suggestions. Thank you.



  11. #31
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4256
    Downloads
    4
    Uploads
    0

    Default Re: Thread Milling using macro

    That seems reasonable to me. Tested under Mach3 .062, ran OK.
    Thread Milling using macro-testthread-jpg
    The G01 Z-19.5 F50 at the start is very slow - perhaps you could speed that up a bit, but otherwise it looks fine.
    Now try it out?

    Cheers
    Roger



  12. #32
    Registered
    Join Date
    Aug 2016
    Location
    India
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    Quote Originally Posted by RCaffin View Post
    That seems reasonable to me. Tested under Mach3 .062, ran OK.
    The G01 Z-19.5 F50 at the start is very slow - perhaps you could speed that up a bit, but otherwise it looks fine.
    Now try it out?

    Cheers
    Roger
    Thanks a lot! Yes, i'll try that out.
    Cheers

    Do you think I should provide some clearance in Z direction while starting the thread? Because, the tool will go -19.5 in Z and start its helical interpolation for arc-in so by the time it reaches the start of thread it'll be 0.751mm above the actual height of thread. In that case I need to have my hole drilled around additional 0.8 to 1mm. Does this seem reasonable?

    Thank you.



  13. #33
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4256
    Downloads
    4
    Uploads
    0

    Default Re: Thread Milling using macro

    Yep, seems reasonable. You should always allow some extra room at the bottom anyhow, for the swarf. Or blow it out with an air blast. (Or do both.)

    Cheers
    Roger



  14. #34
    Member samu's Avatar
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    314
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    if operator need to change the code for each family of part, macro is the way to go!!! with macro you can create a thread milling cycle defined by surface, depth, x-y location of the hole cutter dia and thread pitch and diameter. For example you can create a G code say G125 with the format G125 C...D... Q... R... X... Y... Z... where:
    C=cutter dia
    D=thread diameter
    Q=pitch
    R=Z surface of the hole
    X=x center
    Y=Ycenter
    Z= depth of the hole

    then it is easy for the operator to change the right parameter without searching in the program the right line and calculate the right value.
    Note: You choose wath each letter in the code mean. That's juste an example. Each letter is linked with a variable number in the macro program

    C=#3
    D=#7
    Q=#17
    R=#18
    X=#24
    Y=#25
    Z=#26

    here is wath the macro prog looks like:

    O9221
    G0 G90 X#24 Y#24 (RAPID TO HOLE CENTER)
    Z[#18+1.] (RAPID 1MM ABOVE THE SURFACE)
    G1 Z[#18-#26] F200 [FEED TO THE BOTTOM)
    G91 G03 X-[[#3-#7]/2 Y0 I-[[#3-#7]/4] Z[#17/2] (HELICAL LEAD IN, HALF CIRCLE WITH A RADIUS OF (THREAD DIAMETER-CUTTER DIAMETER)/4 AND A Z MOVE OF PITCH/2)
    I[[#3-#7]/2] J0 Z#17 (THREAD CUTTING, FULL TURN AND Z MOVE OF THE PITCH)
    X[[#3-#7]/2 Y0 I[[#3-#7]/4] Z[#17/2] (HELICAL LEAD OUT, HALF CIRCLE WITH A RADIUS OF (THREAD DIAMETER-CUTTER DIAMETER)/4 AND A Z MOVE OF PITCH/2)
    G0 G90 Z[#18+1.](RETRACT 1MM ABOVE SURFACE)
    M99

    IT IS FAST WRITTEN, UNTESTED AND SOME FEATURE TO CHECK POSSIBLE WRONG VALUE(TOOL DIAMETER BIGGER THAN THREAD DIAMETER FOR EXAMPLE)SHOULD BE ADDED, ALSO, CUTTER COMPENSATION COULD BE ADDED, BUT IT IS POSSIBLE TO ACHIEVE THE SAME RESULT PLAYING WITH CUTTER DIAMETER VALUE, BUT IT INVOLVE TO SWITCH TO EDIT MODE, SO CUTTER COMPENSATION IS MORE CONVENIENT. LET ME KNOW IF YOU WANT SOME EXPLANATION, MORE DETAIL, OR A MORE REFINED VERSION



  15. #35
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4256
    Downloads
    4
    Uploads
    0

    Default Re: Thread Milling using macro

    C=#3
    D=#7
    Q=#17
    R=#18
    X=#24
    Y=#25
    Z=#26

    That mapping of letters to variables will ONLY work on some controllers - maybe only on one brand.

    Cheers
    Roger



  16. #36
    Registered
    Join Date
    Aug 2016
    Location
    India
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    First of all I'm not a professional programmer to judge this code, so I can't tell whether this is correct and will this help me or not. The format seems familiar from previous posts so I can understand what is happening with the tool. I don't know a thing about Macro, but yes I'm a quick learner and would love to learn programming in Macro (if it solves my problem).

    I see similarity between your program and Roger's program from post #20.
    The only difference I can notice is that you've used variables whereas I had used exact co-ordinates (post #30), so the first thing I need to do to make this work out for me is to check whether my m/c supports it or not. And I don't have a clue as to how to do it. If you can help on this matter it would be great.
    I use ACE Micromatic MCV 350. Here is the brochure if you want to check. Page not found | Ace Micromatic
    And if it turns out that my m/c supports Macro, then it would be a boon for me (if what you say it is easy for the operator to change the right parameter without searching in the program the right line and calculate the right value. is true)

    Thanks a lot!!



  17. #37
    Member samu's Avatar
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    314
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    [QUOTE=
    I need to know is Thread milling in macro for fanuc oi mate-md better than normal thread milling program?
    Can someone post an example of thread milling using macro for fanuc?
    Thanks in advance.[/QUOTE]

    It seems clear that we are speaking of fanuc control here, and variable mapping for Fanuc is quite standar regardless of control model, some diference for system variable, but programming format is the same for all fanuc control with macro b option.



  18. #38
    Member samu's Avatar
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    314
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    If i understand correctly, it's a Fanuc 0i mate control, so this kind of macro will work, if you have fanuc macro b otion turned on. to know it, try to run a small program like that:

    %
    O0001
    #101=1
    M30
    %

    If there is no alarm, you have macro b and we can continue this way, elsewhere, this kind of macro can be written on macro a forma that is standard(not an option) really not user friendly but we can achieve the same result. I say it is more easy for the operator, cause all the parameter is on the same line, and no calculation is needed, all calcul is take in charge by the macro, according to me, it's the way to go in your case



  19. #39
    Registered
    Join Date
    Aug 2016
    Location
    India
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    Quote Originally Posted by samu View Post
    If i understand correctly, it's a Fanuc 0i mate control, so this kind of macro will work, if you have fanuc macro b otion turned on. to know it, try to run a small program like that:

    %
    O0001
    #101=1
    M30
    %

    If there is no alarm, you have macro b and we can continue this way, elsewhere, this kind of macro can be written on macro a forma that is standard(not an option) really not user friendly but we can achieve the same result. I say it is more easy for the operator, cause all the parameter is on the same line, and no calculation is needed, all calcul is take in charge by the macro, according to me, it's the way to go in your case
    Good news!! Yes, it works on my m/c, no alarms. Never been this happy after checking something out. Thank you guys.

    Now all that is left is to write a good program using parameters/variables. I'm learning from both of your's programs that are previously posted. Other than that any help or guidelines will be much appreciated.

    And even if anyone of you can boost me up with some basics of variable programming or points that should be taken care of, or stuff like that it would be of much help.

    Let's start with M22 x 1.5 thread using cutter dia 18mm, hole depth= -19.5 + clearance, with circular interpolated Lead in and Lead out arcs, and with 0.75mm Z movement for lead-in & lead-out arcs (with correct feeds & speed).

    Let's try to convert this normal program into a parametric one:

    G90 G54 G00 X0 Y0 Z5
    M03 S900
    G01 Z-20.25
    G03 X2 Y0 Z-19.5 R1 {moved up 0.751mm as per calculation in "mm". A=180, P= 1.5 }
    X2 Y0 Z-18 I-2 J0 {clubbed the two half cycles into one by writing in I,J format}
    X0 Y0 Z-17.25 R1 {moved up same as for arc-in}
    G00 Z5
    M05 M30

    Thanks a lot!



  20. #40
    Member samu's Avatar
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    314
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    Quote Originally Posted by arshsmart View Post

    Let's try to convert this normal program into a parametric one:

    G90 G54 G00 X0 Y0 Z5
    M03 S900
    G01 Z-20.25
    G03 X2 Y0 Z-19.5 R1 {moved up 0.751mm as per calculation in "mm". A=180, P= 1.5 }
    X2 Y0 Z-18 I-2 J0 {clubbed the two half cycles into one by writing in I,J format}
    X0 Y0 Z-17.25 R1 {moved up same as for arc-in}
    G00 Z5
    M05 M30

    Thanks a lot!
    This is exactly wath I've done in my previous post!!! Read the chapter 15 of your operator manual, there is evry thing you have to know about macro.

    Before writting a macro, you have to know exactly wath you want it does. I suppose that frequently, a single part has more than one hole with the same parameter(same thread, same depth. It could be a good idea to use G66 (modal macro call) It will act like a canned cycle so just specify the x-y hole center and it automatically run the macro at this location.

    %
    O0001 (Main prog)
    .....
    ....
    ....
    ....
    ....
    ....
    M6 T8 (call thread mill tool)
    G0 G90 G17 G54 X... Y... M3 S.... (GO TO CENTER OF THE FIRST HOLE START SPINDLE)
    G43 H8 Z... M8 (ACTIVATE TOOL LENGHT COMPENSATION APPROACH AT SAFE DISTANCE OF TOP OF HOLE)
    G66 C... D... Q... R... Z... P9202 (CALL MACRO PROG O9202 AND PASS THE VALUE OF C..D..Q..R..Z..)
    X.. Y.. (THREAD MILL SECOND HOLE WITH SAME PARAMETER)
    X..Y..(THREAD MILL THIRD HOLE WITH SAME PARAMETER)
    G67(CANCEL THREAD MILL CYCLE)
    M6 T9 (CALL SECOND THREAD MILL CUTTER)
    G0 G90 G17 G54 X... Y... M3 S.... (GO TO CENTER OF THE FIRST HOLE START SPINDLE)
    G43 H9 Z... M8 (ACTIVATE TOOL LENGHT COMPENSATION APPROACH AT SAFE DISTANCE OF TOP OF HOLE)
    G66 C... D... Q... R... Z... P9202 (CALL MACRO PROG O9202 AND PASS THE VALUE OF C..D..Q..R..Z..)
    X.. Y.. (THREAD MILL SECOND HOLE WITH SAME PARAMETER)
    X..Y..(THREAD MILL THIRD HOLE WITH SAME PARAMETER)
    G67(CANCEL THREAD MILL CYCLE)
    G0 G91 G28 Z0 M9 (RETURN TO Z HOME, STOP COOLANT)
    G28 Y0 (RETUR TO Y HOME)
    M30
    %


    %
    O9202
    G1 Z[#18-#26] F200 [FEED TO THE BOTTOM)
    G91 G03 X-[[#3-#7]/2 Y0 I-[[#3-#7]/4] Z[#17/2] (HELICAL LEAD IN, HALF CIRCLE WITH A RADIUS OF (THREAD DIAMETER-CUTTER DIAMETER)/4 AND A Z MOVE OF PITCH/2)
    I[[#3-#7]/2] J0 Z#17 (THREAD CUTTING, FULL TURN AND Z MOVE OF THE PITCH)
    X[[#3-#7]/2 Y0 I[[#3-#7]/4] Z[#17/2] (HELICAL LEAD OUT, HALF CIRCLE WITH A RADIUS OF (THREAD DIAMETER-CUTTER DIAMETER)/4 AND A Z MOVE OF PITCH/2)
    G0 G90 Z[#18+1.](RETRACT 1MM ABOVE SURFACE)
    M99
    %

    macro should'nt operate the tool change and activate tool lenght offset because it should work for evry tool, that's why I do that in the main in my example, but if you want that macro do it, you can define the tool in the line of the macro call with one more argument(an argument is a value that you define in the macro call and this value is passed to the macro, each letter in the line of the macro call represent an argument),think carrfully at wath exactly you want the macro does, your the only one to know your need, and remember, with macro programming, you are the boss you choose wath each letter represent and wath this custom cycle do exactly. Give me more details and I will suggest you a way to do wath you want.



Page 2 of 3 FirstFirst 123 LastLast

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

Thread Milling using macro

Thread Milling using macro