Need Help! Thread Milling using macro


Page 1 of 3 123 LastLast
Results 1 to 20 of 49

Thread: Thread Milling using macro

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

    Red face Thread Milling using macro

    Hello guys! I'm new to this forum. And as per my research I've seen amazing threads and they've helped a lot.
    I need to know is Thread milling in macro for fanuc oi mate-md better than normal thread milling program?
    which of this two is easy to adapt, saves time and is more efficient?
    Can someone post an example of thread milling using macro for fanuc? I use 3-axis VMC, but for most of threads I use inserts and holders and not a threading tool.
    Thanks in advance.

    Similar Threads:


  2. #2
    Registered
    Join Date
    Oct 2007
    Location
    usa
    Posts
    88
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    Can you provide more info on needs? Macro programs can get hard to write, but once they are proven out, they are user friendly, if you write them to be. As far as efficient, Thread Milling is slow. I form tap every chance possible. rigid thread, fast, and repeatable.



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

    Default Re: Thread Milling using macro

    My firm makes threads daily for various cavities and ports like SAE08-2, TH 04, G1/4", G3/8", G3/4", G1 1/4", M6, M8, M22, M38, M45 and many more. Many who uses the CNC's are layman and they can't run them efficiently. All I need is to reduce the time required for programming threads for each and every cavity and to reduce the machining time. Currently the workers over here edit the programs every time they make a thread for a respective cavity. Many times there are dimensional corrections to be made in programs so I need to know is it easy to do such changes every time in macro or normal thread milling? Cause every time they crack their brain for one cavity and then again for another and on and on.
    Currently the programs for thread milling are provided by respective insert's or tool providers, but I think they are not much efficient and I want to change them. We use taps for materials like Cast steel, but for Aluminium and MS we use inserts from Iscar and Carmex.



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

    Default Re: Thread Milling using macro

    Currently the programs for thread milling are provided by respective insert's or tool providers, but I think they are not much efficient and I want to change them.
    So - you don't know very much about thread milling, but you are sure that the vendor experts have done it the wrong way?
    Good Luck.

    Actually, writing the code to do thread milling is quite easy, but you do need to know how to program properly. Perhaps it might be better to teach the staff how to write the programs correctly? And it might also be a good thing to recognise that writing g-code is a skilled occupation, and that you should not be trying to get 'laymen' to do it cheaply. Both might have a much bigger yield in the long term.

    Cheers
    Roger



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

    Default Re: Thread Milling using macro

    Thanks Roger. Yes, I truly agree with you. The thing is that many times they are not able to understand the program given. They make mistakes while calculating the X,Y co-ordinates, thread diameter etc in incremental. Since, they provided only one program we've to edit it every time a new cavity is being machined and calculate those co-ordinates.
    This is the program I received for M22x1.5. Can you explain it to me? Since, I could not find a simulator which simulates a thread milling program.

    %
    O0008 (M22X1.5)
    G0 G90 G54 G17 G43 H8 X0.00 Y0.00 Z50.00
    S1700 M03
    G0 Z5.0
    G01 Z-19.5 F5000 M07
    G91
    G41 D8 X1.00 Y-1.00 Z0.00 F80
    G03 X1.00 Y1.00 Z0.188 I0.00 J1.00 F40
    G03 X0.00 Y0.00 Z1.500 I-2.00 J0.00
    G03 X-1.00 Y1.00 Z0.188 I-1.00 J0.00
    G01 G40 X-1.00 Y-1.00 Z0.00 F5000
    G01 Z25.0
    G90 X0.00 Y0.00 Z50.00
    M5
    M9
    M99
    %

    By reading other threads on this forum I could understand most of part, but I've a doubt that will writing the interpolation cycle with R syntax would be easy or using I J format is easy? [It would save calculations up to an extent]
    Using R format with tool radius comp. on, is there a chance that tool might interpolate in opposite direction for full circle?
    Why writing G17 G43 H8 is necessary?



  6. #6
    Member Maroslav4's Avatar
    Join Date
    Apr 2015
    Location
    Czech Republic
    Posts
    327
    Downloads
    7
    Uploads
    0

    Default Re: Thread Milling using macro

    G17 - select plane XY (If you switch before in a program some other plane G18 G19, by this command you will return XY plane, is better have this in a code)
    G43 H8 - Tool lenght compensation. Without this machine does not know lenght of tool.
    You can use for programming radius both of variant R - radius size, I,J,K - center of radius.

    Thread Milling using macro-thread-jpg

    Postprocessors, VBA macros, .NET programming.
    www.ccsoftcz.com


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

    Default Re: Thread Milling using macro

    First of all, that is not a program. It's a subroutine, returning to the calling program via the M99 at the end. OK, we can deal with that.

    Now, all that preparatory stuff - it's there because the CAM writer decided it should be there. Most of it is junk. Also, the way the second line is written is awful.

    What the program does is to drop a multi-tooth thread milling cutter down the middle of a hole, then bring it out to the edge in an arc, do one complete revolution to cut the full thread, leave the thread in another arc, return to centre and retract.
    Thread Milling using macro-threading2-jpg
    The programming style is pretty bad imho, and no wonder the operators have trouble with it.

    I would do it more or less like this:
    Apparent details:
    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.
    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

    You will notice that I use the R format rather than the IJK format. The IJK may be OK for a CAM system, but it is a right pain to understand. The R version is obvious.

    Now, I have written this out in numbers, but that is NOT how I would do it in practice. I would use parameters instead, This would let me just change the parameters and have the code alter to suit - automatically.

    Cheers
    Roger



  8. #8
    Registered
    Join Date
    Oct 2007
    Location
    usa
    Posts
    88
    Downloads
    0
    Uploads
    0

    Default Re: Thread Milling using macro

    RCaffin is right on track, so long as your machine is set-up to use the R instead of the IJK. I have written Thread Mill Macros before at other jobs, but do not have anything with me that is proven out. With that sasid, i would still form tap everything. With the correct coolant, there should be no issues tapping all of your listed materials. Faster and more rigid thread, by far.



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

    Default Re: Thread Milling using macro

    Hi Chunky

    Form tapping is fine for small holes (and I use it), but this is M22x1.5 - close to 1" BSP. I would like to see you form tap that!

    Cheers
    Roger



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

    Default Re: Thread Milling using macro

    Quote Originally Posted by Maroslav4 View Post
    G17 - select plane XY (If you switch before in a program some other plane G18 G19, by this command you will return XY plane, is better have this in a code)
    G43 H8 - Tool lenght compensation. Without this machine does not know lenght of tool.
    You can use for programming radius both of variant R - radius size, I,J,K - center of radius.

    Thread Milling using macro-thread-jpg
    Thanks a lot Maroslav4, for explaining it! Cheers!! I now understand the need for that codes..



  11. #11
    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
    Now, all that preparatory stuff - it's there because the CAM writer decided it should be there. Most of it is junk. Also, the way the second line is written is awful.

    What the program does is to drop a multi-tooth thread milling cutter down the middle of a hole, then bring it out to the edge in an arc, do one complete revolution to cut the full thread, leave the thread in another arc, return to centre and retract.
    The programming style is pretty bad imho, and no wonder the operators have trouble with it.
    First thing first, thanks a lot for your explanation Roger. I'm much grateful for all the help I'm getting through this forum

    See this is what I meant by "Currently the programs for thread milling are provided by respective insert's or tool providers, but I think they are not much efficient and I want to change them." I hope you now understood what I was talking about.

    Yes, this is a sub-program. This is what normally happens here when we've to make a cavity or a port. There is the main program, all the operations are performed in the sequence they have to and for thread milling we've sub-programs provided by tool suppliers. The tool is called to centre of the hole already drilled to it's respective size.

    Yes, I see that R format is much simpler to understand.

    Can you be more specific about what all parameters you are saying?



  12. #12
    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
    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
    I just tried to run your program [without all the parameters, just to see the toolpath] on my simulator and I got something like this Thread Milling using macro-toolpath-png
    When I had a look closely I found these two linear interpolation path which by all means I don't know how it happened. Is there something I missed in my program or is my simulator not giving proper results?(I use CNC Sim Pro) Thread Milling using macro-toolpath-2d-jpg

    Can you run it on your simulator so that I can see the toolpath?



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

    Default Re: Thread Milling using macro

    Quote Originally Posted by chunkymonkey View Post
    RCaffin is right on track, so long as your machine is set-up to use the R instead of the IJK. I have written Thread Mill Macros before at other jobs, but do not have anything with me that is proven out. With that sasid, i would still form tap everything. With the correct coolant, there should be no issues tapping all of your listed materials. Faster and more rigid thread, by far.
    Yes, I agree form taps are easy, for programming, for machining time. Just a tapping cycle with correct feed, speed and coolant you can do it quickly.
    But as Roger said form taps are fine for small holes like in my case SAE08-2, TH 04, G1/4", G3/8", G3/4", M8 (even I use taps for these holes). But for G1 1/4", M22, M38, M45 I haven't used taps with the only fear to break the tap because of the load on it. For Aluminium we don't use taps even for small holes since the material gets stuck with the tap and it wears easily and also damages the thread sometimes.

    I wanted to know if programming using Macro is not much of a headache than thread milling.



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

    Default Re: Thread Milling using macro

    Can you be more specific about what all parameters you are saying?
    Yes, but first, are you familiar with the use of parameters in g-code? Can your machine handle parameters (some can't)?

    Cheers
    Roger



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

    Default Re: Thread Milling using macro

    I just tried to run your program [without all the parameters, just to see the toolpath] on my simulator and I got something like this Thread Milling using macro-toolpath-png
    When I had a look closely I found these two linear interpolation path which by all means I don't know how it happened. Is there something I missed in my program or is my simulator not giving proper results?(I use CNC Sim Pro)
    If those jpgs come from running my exact code, then your simulator is at fault.
    I suspect it cannot handle helical interpolation, which makes it pretty useless if you are doing any threading.

    What you should get is a very nice smooth helix, like this side view:
    Thread Milling using macro-threading3-jpg

    I can be pretty confident about this as I have been using helical interpolation for threading for several years now.

    Cheers
    Roger



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

    Default Re: Thread Milling using macro

    I wanted to know if programming using Macro is not much of a headache than thread milling.
    It turns out that this question, or the word 'Macro', can create all sorts of fierce arguments where the two sides don't realise that they are talking about different things! Been there myself.

    In one world a macro will have a name such as m1000 which can be used just like any other m-command, in-line in the g-code. The macro itself will be in a special directory: for example if using Mach3 it will be c:\Mach3\macros\MachMill\m1000.m1s . It is written in a version of Basic, with a few mach-specific extensions. The use of such macros in Mach3 is entirely free.

    However, on some legacy machines with Fanuc controllers etc the word 'macro' seems to have a somewhat different meaning, and I gather you may have to pay extra to be able to have a few 'macro commands'. But I am hazy on the details there as I don't use such legacy controllers.

    However, in this case Mach3 users don't even need a macro. We just program it in NIST-standard g-code using helical interpolation. The great thing about doing it this way, especially with single-point thread mills, is that you are not restricted to what is available in common taps and dies. You want M42x0.5 (camera filters I think)? You program it.

    Cheers
    Roger



  17. #17
    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
    Yes, but first, are you familiar with the use of parameters in g-code? Can your machine handle parameters (some can't)?

    Cheers
    Roger
    No, I don't have a clue about that. Just by saying parameters in g-code I can't recollect anything like that. But if you name some, I can come to know if I've used them. Also, I can read about it elsewhere to get a grip about what it is. Please name some of them, a basic explanation and how should I check it on my machine? I use ACE Micromatic MCV 350. Here is the brochure if you want to check. http://www.acemicromatic.net/sites/d...es/MCV-350.pdf
    Thanks!



  18. #18
    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
    If those jpgs come from running my exact code, then your simulator is at fault.
    I suspect it cannot handle helical interpolation, which makes it pretty useless if you are doing any threading.

    What you should get is a very nice smooth helix, like this side view:
    Thread Milling using macro-threading3-jpg

    I can be pretty confident about this as I have been using helical interpolation for threading for several years now.

    Cheers
    Roger
    Yes, I ran the exact code you gave. You can see it in 2nd image from that post.
    Yes, I'm having a tough time finding a simulator which supports threading (helical interpolation). Your's seems to handle helical interpolation very well. Can I know which one do you use? I want to try that, since the one I'm using right now is a trial version.



  19. #19
    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
    [I]
    It turns out that this question, or the word 'Macro', can create all sorts of fierce arguments where the two sides don't realise that they are talking about different things! Been there myself.
    Then for me it means I should continue programming in G-codes and master it until I learn more about macro and start getting grip of it slowly. Thanks!!



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

    Default Re: Thread Milling using macro

    The Micromatic machines use Fanuc, Siemans or Mitsubishi controllers - all proprietary. At the risk of getting some people upset, I will say that these are all strange beasts of ancient heritage and mostly incompatible with the rest of the world. They may be found on many machines, but they remain dinosaurs, and will eventually die out.

    I am using Mach3 on a PC. It follows a pure National Institute of Science and Technology (NIST) g-code format, and does not have many of the strange features found in on those proprietary controllers. Mach3 is its own simulator. I have a copy on my office PC which simulates - because it knows it has no hardware attached. The jpg I presented is simply a screen-capture off Mach. I could get the same jpg off my machine PC of course: it too displays what the program will do. It's a very good example of 'what you see is what you get'.

    Parameters ... what you are talking about has almost no relationship to what I am talking about. Sorry! For us it means a blank set of variables which the program can freely use. A very simplified version of a thread mill program for a single point tool follows. This is different from the multi-tooth thread mill you are using.

    #10=22.00 % M22x1.5 OD
    #11=1.50 % M22x1.5 pitch
    #12=20.00 % thread mill OD
    #13=10.00 % Z depth of hole
    #14=2000 % spin rpm
    #15=50 % feed mm/min
    #16=20.0 % safe Z
    #17=[#10/2-#11/2] % circle radius for thread milling
    #18=5 % 5 spirals

    s#14 f#15
    m3

    #1=[0-#13] % working Z variable
    #2=#11 % working variable for pitch
    g0 z#16 % Z safe
    g0 x0 y0 % middle of pre-drilled 20.5 mm hole
    g0 z#1 % go down to bottom of hole
    g2 x#17 y0 z#1 r#17 % arc out to engage cutter
    m98 p100 L#18 % cut thread in rising helix, 5 full rotations
    g0 x0 y0
    g0 z#16

    o100
    #1=[#1+#2/2] % half a thread upwards
    g3 x[0-#17] y0 z#1 r#17
    #1=[#1+#2/2] % half a thread upwards
    g3 x#17 y0 z#1 r#17
    m99

    Thread Milling using macro-threadingexample1-jpg

    The thing to note here is that by changing the definitions of the variable #10 to #18, you can change what size of thread this cuts, from M1.0 to M100, and at whatever pitch.
    Of course, if you get the variables wrong, the hole is wrong (or you break the cutter ...). Sometimes a tap is 'safer'.

    Cheers
    Roger



Page 1 of 3 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