Secret Art of MACRO PROGRAMMING on a CNC Machine | G-Code Genius

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024

Комментарии • 215

  • @TITANSofCNC
    @TITANSofCNC  Год назад +38

    Here is the Macro used in the video for any of you that are interested.
    %
    O1090()
    #601 = 10 (T112 MAX TOOL LIFE)
    G800 A1.125 B1 C0.5 D0.1 E.03 F0.0155
    G801 A1100 B0.118 C0 D97 E2000 F.004
    G802 A0.5 B0.5 C0.5 D0.5 E1 F0.5
    G803 A2 B0 C1
    M9000
    (*** INITIALISATION ***)
    M10
    M82
    /M8
    G4 X1
    G900
    M9001
    M9002
    (*** AXIS REF ***)
    G28 U0
    G28 V0
    (*** INITIAL CUTOFF ***)
    M8
    G910
    M9003
    (*** START LOOP ***)
    N1 M120
    (*** END OF BAR TEST ***)
    G913
    G930
    M9004
    (*** FEED NEW PART ***)
    G912 B500
    G0 W0.00787 (RETRACT THE BAR IN Z)
    G0 X1.33858 T110 D0 (RETRACT THE CUT OFF TOOL X)
    G1 G94 W.65 F165.
    G28 U0
    M9005
    (*** MACHINING ***)
    M9
    G0 G95 G97 S1450 M103 P1 T112 D0 Y0
    X1.2 Z0
    G92 S5000
    G96 S330 P1
    G1 X-.05 F.007
    G0 X.775 Z.02
    G4 U1.2
    G1 Z0 F.008
    X.875 Z-.05
    Z-1.03
    X1.15
    G0 G97 X1.2
    #600 = #600+1
    G28 U0
    ()
    ()
    M9200
    (*** CUT-OFF PREPARATION ***)
    G97
    M8
    G0 X1.33858 Y0 T110 D0 M103 S5000 P1
    G911
    G1 G95 X.775 F.004
    G0 X.9
    W.045
    G1 X.875
    X.785 W-.045
    G0 X.9
    M9201
    M9202
    G1 G95 X-.045 F.004 (CUTOFF)
    M9203
    G1 X-.05 F0.00118 (END OF CUTOFF)
    G97 (CONSTANT CUT-OFF CANCELLATION)
    IF [ #600 GE #601 ] GOTO 1234
    N5678
    (*** END LOOP ***)
    M121
    M9204
    M9
    M105
    M1105
    M2105
    M9205
    M0 (STOP A END OF CYCLE)
    /M8
    G4 X1
    M9206
    M99 P1
    M2
    N1234
    #600 = 0 (RESET TOOL COUNTER)
    G28 U0
    M9
    M103 S100 P1
    G4 U1.
    M105 P1
    #3006 = 1 (CHANGE T112 CNMG TURN)
    M00
    G0 Y0 X1.2 T110 G97 S1300 M103 P1
    M112
    G1 G95 X-.05 F.007
    M105 P1
    GOTO 5678
    O1090()
    M9000
    (*** INITIALISATION ***)
    M10
    G900
    M702 M2 M22 (Z4 TORQUE LIMITER VALUE)
    M702 M3 M1181 (Z4 SERVO-LAG VALUE)
    M9001
    (*** AXIS REF ***)
    G28 W0 (REF Z4)
    G28 U0 V0 (REF X4 Y4)
    M9002
    G919
    M9003
    (*** START LOOP ***)
    N1 M120
    M9004
    G55
    M405
    M9005
    (*** MACHINING ***)
    ()
    ()
    (*** PART EJECTION ***)
    G55 (Z4 ZERO OFFSET FOR BACKWORK MACHINING)
    M405
    G28 W0 (REF Z4)
    G0 X0 T500
    M11 (OPEN THE COLLET S4)
    G4 X0.5
    M84
    M85
    G4 X0.2
    G28 W0 (REF Z4)
    G28 U0 (REF X4)
    M9200
    M9201
    (*** PART PICKOFF ***)
    G915 (SHIFTING FOR WORK IN OPERATION)
    G97
    G0 X0 Z0.07874 T400 M404 S5000 P4 (APPROACH BACK SPINDLE)
    M418 (SYNCHRO PHASE)
    M702 M4 M1 (TORQUE LIMIT Z4)
    M702 M5 M1 (ENABLE SERVO-LAG CHECK Z4)
    G924 (PART PICKOFF)
    M9202
    M9203
    G1 G94 W0.07874 F78.74016 (CHECK BREAKAGE CUTOFF TOOL)
    M702 M5 M0 (Z4 DISABLE SERVO-LAG CHECK)
    M702 M4 M0 (Z4 TORQUE LIMIT CANCELLATION)
    G95 (FOR LOOP START)
    G28 W0 (RETRACT BACK SPINDLE)
    (*** END LOOP ***)
    M121
    M9204
    M405
    M5105
    M9205
    M0 (STOP A END OF CYCLE)
    M9206
    M99 P1
    M2
    %

    • @williamjohnson7764
      @williamjohnson7764 Год назад +2

      #3006 is the same as M0 but with a message. Do you have to press cycle start twice? I use this all the time in programs, usually between tool changes, to have the operator clear scrap, fasten a part down, rotate a part, etc. He hits cycle start and program continues. #3006=1 (MESSAGE) is part of my default insert manual code in Mastercam. 👍

    • @lo77401
      @lo77401 Год назад

      😉

    • @PerlStyle
      @PerlStyle Год назад

      sooo my fanuc didnt have a internal program to do cavity type operations ... so i spent a good day at home outside of work hours..... and made this abomination. when i made it i was warking in italy so comments are in italian . not changing it for this post just google translate things :D
      %
      :0887(SVUOTAMENTO CIRCOLARE)
      (VERSIONE 2.0 PERL)

      G52X#31Y#32Z#33(POSIZIONAMENTO)

      G0G54X0Y0
      Z1
      G1Z0.1


      (---DATI FRESA---)
      (DIAM FRESA)
      #1=22.3
      (PERCENTUALE UTILIZZO FRESA - DA 1 A 100)
      #6=95

      (---DATI CAVA---)

      (DIAM CAVA)
      #2=28
      (PROFFONDITA MAX)
      #3=18
      (SOVRAMETALLO PARETE)
      #4=0
      (SOVRAMETALLO FONDO)
      #5=0
      (PARTENZA LAVORO Z - METTERE ZERO SE PARTE DA SOPRA)
      #7=0
      (NUMERO PASSATE PASSATE)
      #8=23

      (---CONTROLLO SICUREZZA---)
      IF[#2LE#1]GOTO100

      (---MATEMATICHE---)

      (DIVISIONI PER RAGGI)
      #11=[#1/2](RAGGIO FRESA)
      #12=[#2/2](RAGGIO CAVA)
      #13=[#1/100]
      #14=[#13*#6](PERCENTUALE UTILIZZO FRESA)
      #15=[#14/2](META UTILIZZO FRESA)
      #17=[#12-#4](RAGGIO PARETE CON SOVRAMETALLO)
      #18=[#3-#5](FONDO CON SOVRAMETALLO)
      #22=[#18/#8](INCREMENTO PASSATA Z CALCOLATO)
      #23=[#22/2](INCREMENTO -Z- PER FORI MINORI RAGGIO FRESA)
      #30=[#17-#11](INCREMENTO -X- PER FORI MINORI RAGGIO FRESA)


      (--- MODULI FORI MINORI RAGGIO FRESA---)
      IF[#17LT#1]GOTO1


      IF[#17GT#1]GOTO2


      N2

      #110=#22
      #111=#14
      G0X0Y0
      WHILE[#110LE#18]DO1
      #111=#14
      G1X#15Y0
      G1X-#15Z-[#110-#23]
      G1X#15Z-#110
      WHILE[#111LT#30]DO2
      G1X#111Y0
      G3I-#111
      #111=[#111+#14]
      END2
      G1X#30
      G3I-#30
      G1X[#30-1]Z-[#110-1]
      G1G40X0Y0
      Z-#110
      #110=[#110+#22]
      END1
      G0Z10
      GOTO101


      N1
      #110=#23
      G1X0X0
      G1X#30
      WHILE[#110LE#18]DO1
      G3I-#30Z-#110
      #110=[#110+#23]
      END1
      G3I-#30
      G1G40X0Y0
      G0Z10
      GOTO101


      N101
      G0Z20
      M99
      G53Y0Z0
      N100
      M30

      %

    • @PerlStyle
      @PerlStyle Год назад

      also one for radial holes .
      %
      :0885(FORATURA SU ARCO CIRCOLARE)
      (V.1 PERL)

      G52X#31Y#32Z#33(POSIZIONAMENTO)

      G16
      (#2=DIAMETRO INTERASSE)
      (#3=PARTENZA IN GRADI)
      (#4=GRADI TOTALI)
      (#5=NR.FORI)
      (---MATEMATICHE---)
      #8=[#5-1]
      #7=[#2/2](RAGGIO)
      #6=[[#4-#3]/#8]
      #110=[#6+#3]
      X#7Y#3
      WHILE[#110LE#4]DO1
      X#7Y#110
      #110=[#110+#6]
      END1
      G15
      G17
      M99





      M30
      %

    • @PerlStyle
      @PerlStyle Год назад

      and circular holes
      %
      :0886(FORATURA CIROLARE)

      (V.1 PERL)

      G52X#31Y#32Z#33(POSIZIONAMENTO)

      G16
      (#2=DIAMETRO INTERASSE)
      (#3=PARTENZA IN GRADI)
      (#4=GRADI TOTALI)
      (#5=NR.FORI)
      (---MATEMATICHE---)
      #7=[#2/2](RAGGIO)
      #6=[[#4-#3]/#5]
      #110=[#6+#3]
      X#7Y#3
      WHILE[#110LT#4]DO1
      X#7Y#110
      #110=[#110+#6]
      END1
      G15
      G17
      M99





      M30
      %

  • @mohammedalbattal77
    @mohammedalbattal77 Год назад +19

    I watched the video for the first time and then I said, boy, this video needs a cup of tea, a notebook and a pen, there is really a lot of information in this video that needs to be jotted down, thank you guys for this video, especially the rap song at the end of the video, you made me laughing alot 😂

  • @mikemcmullin149
    @mikemcmullin149 Год назад +2

    Love the video. I once altered a cnc heater band cutting tool path so it could handle differing slot lengths and any kind of clearances. Commented the living daylights out of the top page explaining what the variable did on the program. Showed the boss a simulation and asked if we could try it. Long story short, less cutting time, everything matched up, and less cutter sharpening. This also freed up the cam programmers to concentrate on one off programming. And yes I got a nice raise too boot.

  • @ShootingUtah
    @ShootingUtah Год назад +18

    As a regular computer science student and certified programmer it's interesting to see how similar but also how extremely different gcode macro coding is to other languages like c++, Java, or python. It's all the same kind of logic at the base level. This actually reminds me of coding in assembly language now that I think of it.

    • @donniehinske
      @donniehinske Год назад

      That’s interesting to hear!

    • @tj9382
      @tj9382 Год назад

      Yes macro B uses the same kind of line by line logic as the older languages such as BASIC as opposed to the OOP approach of C++ and Python.
      Who knows, perhaps CNC controls will all us to write our classes one day. 😅

    • @mikemcmullin149
      @mikemcmullin149 Год назад

      One thing I noticed is the GT LT type statements. I'm used to >, < and = (also => ,

    • @mikemcmullin149
      @mikemcmullin149 Год назад

      @@tj9382 Fun Fact, DMG uses linux on their controllers and the GUI is python based with XFCE as the display manager.

    • @tj9382
      @tj9382 Год назад

      @@mikemcmullin149 Oh really, that’s cool to know. 👍🏻

  • @bikefarmtaiwan1800
    @bikefarmtaiwan1800 3 часа назад

    Macros are super useful -keep teaching,it is always good to review

  • @CncFrezar
    @CncFrezar Год назад +3

    Very interesting video!👍

  • @Sara-TOC
    @Sara-TOC Год назад +3

    Excellent video Donnie!
    I’d get in trouble if I was caught using the macro part counter back in the day because the supervisor didn’t understand macros and was afraid the machine would crash. LOL “GOTO” on the other hand, was a lifesaver for proving out programs and picking up with where I left off in general.
    I’ve also heard you can create your own alarms too! I never had the opportunity to ask the guy who figured it out; probably for the better because you know there would be some witty intent behind it 😆

    • @Orakwan
      @Orakwan Год назад +1

      For part counter there is M54 on fanuc controllers that does just that. On some machines there will be an alarm when you reach the number you want, some other machines don't care and keep going

  • @gooblio
    @gooblio Год назад

    Have fun in Switzerland, I went to Tornos over 20 years ago and bought a couple Decos.

  • @VanillaGorilla_Machinist
    @VanillaGorilla_Machinist Год назад +3

    Donnie taught me Threadmilling macros when he was at my shop while as an application engineer for a different project and now I’ve copied that macro to all our mills and we use the crap out of it 🤘🏻🤘🏻🤘🏻

    • @donniehinske
      @donniehinske Год назад +2

      Thats awesome! What shop are you at?

    • @VanillaGorilla_Machinist
      @VanillaGorilla_Machinist Год назад +1

      @@donniehinske it’s Steve from RockTech my username won’t come up

    • @donniehinske
      @donniehinske Год назад +1

      @@VanillaGorilla_Machinist ohhhhh yea! I remember writing that with you guys! It was on an OKK if I recall! Glad it works out for you guys that’s so cool to hear!!!

  • @Jack-yl7cc
    @Jack-yl7cc Год назад +9

    Busting out a nearly 20 year old book Peter Smid at the beginning; FANUC CNC custom macros, Programming resources for Fanuc Custom Macro B users
    And yet because of how archaic G code is(Develop around the same time as FORTRAN), that book is still relevant. On the plus side G code is still being updated which is why Marcos and conditional loops are a thing. Now if only the manufacturers would actually standardize their G code and Macros.

    • @MrRtkwe
      @MrRtkwe Год назад

      It's wild seeing this as a regular computer developer. This goes right back to the earliest ways of programming with explicit GOTOs and persistent global variables called macros for some reason...

  • @dustinvinci345
    @dustinvinci345 Год назад +2

    Great video. Next video you should use the machine time to do an auto power off function!

  • @Orakwan
    @Orakwan Год назад +8

    This is what separates master machinists to machinist GODS. I've been testing macros for a year on my turret doosan, usually for knowing how long the bar stock is before changing to a new bar, or for milling polygons as Manual Guide i doesn't have a cycle for face milling polygons on my machine. You can even use macros for calculations while in a toolpath, if you want to make an elliptical shape or anything that is not a cone or a circle with some math included without a cam software. When done right, it is beautiful, efficient and, your co-workers who probably don't even know what a macro is will think you're doing some black magic and put their professional knowledge in question. On a technical note, always prefer using conditional loops such as WHILE rather than GOTO statements to avoid some nightmare situations. One interesting book about macros is CNC Programming using Fanuc Custom Macro B, by S.K Sinha. The author also replies to emails with technical questions and is much responsive on cnc forums

  • @fishsticks88
    @fishsticks88 Год назад +3

    Great for using same program for multiple sized parts.
    Or things like circles or thread mills

    • @donniehinske
      @donniehinske Год назад +1

      GREAT ideas! Thank you!!!

    • @bdude92
      @bdude92 Год назад +2

      Exactly this. We use this at my work for varying sized parts. Soo much easier having one program to make 20 sizes than 20 programs!

  • @sicstar
    @sicstar Год назад +2

    Donnie the magician introducing us into the dark arts of macro's in programming. :D Well all in all no black magic if you know what you doing, much appreciated to show a glimps of whats going on inside the blackbox for people not that familiar with it or still learning!
    Also really nice to throw the whole macro code in the comments!

  • @damionparson247
    @damionparson247 Год назад +11

    Thanks for helping make understanding macros so easy. Great video! Great job!

  • @adammiller4879
    @adammiller4879 Год назад +1

    Can we please get a video on how a Swiss machines collet system works so well and clamps well enough to
    Turn ? Pretty please

  • @tdg911
    @tdg911 Год назад +3

    Looks like Unix bash shell scripts 😁. Much love and gratitude.

    • @Jack-yl7cc
      @Jack-yl7cc Год назад +1

      If only G code had the same level of flexibility as BASH but unfortunately it can't even compare to POSIX Shell.

    • @tdg911
      @tdg911 Год назад +1

      @@Jack-yl7cc exactly. Been using Unix for 32 years now I’m learning g code so at least I have all of the different language structures down. Just need to focus on some manual programming g-code.

  • @DolphinWantsPeace
    @DolphinWantsPeace Год назад +12

    You can actually do the whole tool life macro (for all the tools) in a subprogram. This keeps your main program much cleaner and shorter.
    There are also so many more uses for these macros, for example automatically calculating the origin point of the piece (even for both spindles if your machine has them). Also for dual spindle you can calculate where the 2nd spindle should go exactly when taking the workpiece from the 1st spindle using macro and subprogram (to keep main program clean and short).
    I've done a whole system like this (more stuff than I wrote here) for myself when I was in school, even tho these things are not taught in school.
    I wish I could have a job like these guys where I can try stuff and discover better systems.

    • @cloudriz
      @cloudriz Год назад

      Why can you not have a job like this? I’ve been doing this for 17 years and I can clearly see you know what you’re talking about. You don’t have to wish anymore dude.

    • @DolphinWantsPeace
      @DolphinWantsPeace Год назад

      @@cloudriz because nobody gives me a chance to prove my skills. Maybe one day I'll also get lucky

  • @nrodondi
    @nrodondi 11 месяцев назад

    Yes more videos about macros please

  • @nathanthomas8184
    @nathanthomas8184 Год назад +2

    RAY Charles can do it Right, do it Right, twistn G50's loop de loop
    Titan academy,,,BOOM,,,

  • @gerhardvictor5475
    @gerhardvictor5475 Год назад

    Great video. I'm looking forward to more on this topic. Thanks a mill

  • @adammiller4879
    @adammiller4879 Год назад +3

    Now that Iv mastered g code… I’m on to learning macros, and boy is it so much more difficult 😂I know 2 people that add their own custom macros for in process inspection and automatic tool changed after life expires and retouch off with tool break detect too, if you ever find guys that can make programs fool proof for lights out like that, pay them in gold and never let them go

  • @mtn_sivliu
    @mtn_sivliu Год назад

    this was actually very educating. thanks a lot.

  • @Dn1sdr
    @Dn1sdr Год назад

    Love to see more information about using macros to interface with the ERP systems.

  • @jonivanart
    @jonivanart 10 месяцев назад

    Can you write a sub-macro where it can calculate the amount of travel a particular tool made while cutting and add that up to calculate actual tool wear? Then add that to any similar tool when programming it so you can change it out when it has reached its limit.
    Very cool stuff though. Similar to robotics programming, which is my field. 🤙

  • @brettmccafferty465
    @brettmccafferty465 Год назад +4

    This is control specific. Especially with fanuc controls. I highly recommend you read the machine manual AND the yellow fanuc books that come with your machine. With most fanuc controls you'll need a #3000 under your M30 or "end of record" M code.

  • @zakm0n
    @zakm0n Год назад +5

    I program at a job shop with machines that are mostly 35+ years old. Macros and Subs help me keep my programs small enough to fit in the 32k-1024k of program memory I have. Also, I make macros for simple operations so the machinists can punch in a few variables and get stuff like helical plunge operations without bothering me

    • @rkrbrts7149
      @rkrbrts7149 Год назад

      helical plunging is a waste of time prefer to plunge point for pocketing dynamic. also subroutine G91 G03 I-. Z-. for counter bores much easier to identify, edit, much faster

  • @Sk8rdkr
    @Sk8rdkr Год назад +2

    I got a 3 axis vertical mill. Fanuc control. With very little memory. I would like to run multiple vises and run more parts without creating longer programs and sometimes you may only be able to setup one or 2 vises. With each vise being assigned G54, G55, G56, etc. Is it possible to write a macro to change the work offset in each tool block to cycle through G54, G55, G56? May make for a informative video? Great job with all your doing! Helping us all means a lot!

    • @travistucker7317
      @travistucker7317 Год назад +1

      There are a few ways to do this, but sticking with what was in the video, you could do the same format, run your program in g54, hit 601, your 1234 takes you to a g55, since that's modal, your program can run assuming you don't have 100 g54s in the way, then 602 takes you to g56. Or something like that. You can sit down and write it out

    • @vladimirivanov8114
      @vladimirivanov8114 Год назад +2

      most fanuc controls can switch the work offset just by typing G54, G55 etc. (that's why they actually called G..)
      so the program will be as simple as
      G54;
      M98 P0001;
      G55;
      M98 P0001;
      ...
      M30;

  • @christophervillalpando1815
    @christophervillalpando1815 Год назад +4

    Awesome video Donnie, I'm still recovering from my workout!

  • @kevinkc3onohelijeepworld953
    @kevinkc3onohelijeepworld953 Год назад +1

    Machining & programming all in one vid 😊exciting
    010 power logo up
    020 illumination on
    030 move forward 30 paces
    040 announce hello ☺️we had a robot in elementary school and got to program it to move about the school, now I get to run a automated pick n place machine and watch it build smt pc boards 😉

  • @smokeymadden44fan
    @smokeymadden44fan Год назад +1

    How does that work without having end1 and do1 statements? Never seen it done this way. Awesome video thanks

    • @donniehinske
      @donniehinske Год назад +1

      Those statements go into a WHILE statement. This is just IF and GOTO. They work a little differently

  • @yassinesaidi2230
    @yassinesaidi2230 Год назад +3

    Great video..and in fact we really need more tutorial videos about macro program..when I was working in milling machine I tried to understand macro programming many times but I failed...not because it hard..it because I didn't find any one can explain that in easy way and further more there are really few videos in RUclips talk about this type of programming.

    • @donniehinske
      @donniehinske Год назад +5

      That’s why I am really looking forward to bringing you guys this series! I truly hope it helps

    • @donniehinske
      @donniehinske Год назад +2

      That’s why I am really looking forward to bringing you guys this series! I truly hope it helps

  • @khusco1180
    @khusco1180 Год назад +3

    Moro macros please 😁

  • @damiansz4883
    @damiansz4883 Год назад

    Great!!! More macro examples please!!!

  • @boldlyspokennoah307
    @boldlyspokennoah307 Год назад +7

    I’ve been super curious about macros so this was pretty cool would definitely like to see more. Also Donnie I’ve said this before but you got mega ninja turtle vibes my dude

    • @donniehinske
      @donniehinske Год назад +3

      Haha well thank you. Usually I get told I have golden retriever energy

    • @boldlyspokennoah307
      @boldlyspokennoah307 Год назад +2

      @@donniehinske I mean not gonna lie that too lmao but definitely more ninja turtle then golden retriever

    • @travistucker7317
      @travistucker7317 Год назад +1

      @@boldlyspokennoah307 you trying to say he hangs out with sewer rats?

    • @boldlyspokennoah307
      @boldlyspokennoah307 Год назад

      @@travistucker7317 cmon don’t rip on yourselves like that!? Jkjk although that would probably make titan master splinter

  • @brendonv101
    @brendonv101 Год назад +1

    I'm not a machinist nor do I intend on becoming one, yet I still found this highly enjoyable. ☺️

  • @Yamototamto
    @Yamototamto Год назад +4

    How about programing making a hole with an endmill with spiral toolpath?

    • @donniehinske
      @donniehinske Год назад

      Yea that’s a good one! You thinking like a circular pocket macro?

    • @tomislavsvogor3877
      @tomislavsvogor3877 Год назад +1

      do you mean just the normal helix? you don't need a macro for that. I will write you an example of how I do it (Heidennhein)
      G0 X0 Y0 Z50
      G0 Z10
      G1 Z1 F...
      G43 X=50:2 ( 50 is the diameter of the hole in millimeters )
      G41
      G3 Z-20 I0 J0 K-1 ( K-1 means that when the tool is working, the shift is 1mm downwards for one round. in this case, the tool will make 20 circles downwards )
      G3 I0 J0 ( I only do this to clean the bottom of the hole )
      G40
      G1 X0 Y0
      G0 Z100

    • @Yamototamto
      @Yamototamto Год назад

      @@donniehinske yes. I work on a 4axis mill on FANUC. Basically I use mostly build in instructions from machine. But i'm curious if it is possible to make a macro for making a circular hole but with spiral toolpath like from cam software. Normally fanuc does it like this. Drop down in pre drilled hole or pocket then it makes a circle then adjust one step into the material and then another circle upsizing hole with each circle by that step u programmed in built in cycle. It would be awesome to do it like from cam where you have constantly increasing diameter in which tooll traverses. With macro i think you can program end diameter you want and then program step of that spiral. It would need to include that incremental instructions but it is hard for me to grasp yet. Sorry for bad english. Thanks for reply love your content ppl and all of it. Best wishes from Poland! BOOM!

    • @donniehinske
      @donniehinske Год назад

      @@Yamototamto I see what you are saying. Let me start jumbling that around in my mind and I’ll think of something. I’ve written circular interpolation macros before like you are saying I’ve never had it increase diameter as it does the circular movement (spiral) like you are saying.
      It CAN be done though. Nothing is impossible! Stay tuned for a video

    • @donniehinske
      @donniehinske Год назад

      @@Yamototamto also… thank you! I am glad you enjoy our videos!!! 😀

  • @ExplodingPinappleHD
    @ExplodingPinappleHD Год назад +3

    Can we also see some mill applications for macros? I used them on 4 axis mills in a aerospace shop on tombstone type fixtures

    • @donniehinske
      @donniehinske Год назад +2

      Good idea thank you! Will be a great way to show system variables

  • @moorepower7
    @moorepower7 Год назад +1

    Can you show a way to write a macro to keep track of time from a cycle start to a cycle start?
    I am wanting an easy way to track time per part including setup for billing purposes. The machine (Haas) tells cycle time but I want to easily track part to part time. Trying to stopwatch is a pain 😆

  • @rkrbrts7149
    @rkrbrts7149 Год назад

    good vid, would prefer less cartooning during the training (off track) other than that good macro

  • @richhuntsd12
    @richhuntsd12 Год назад +1

    Awesome video, thank You, but I just can’t hear that fast! Whew

  • @adamfreeman218
    @adamfreeman218 Год назад +3

    extremely informative video, Great episode

  • @zyndapp800
    @zyndapp800 Год назад +2

    Excellent video guys, it's so good that you're showing it off on a Fanuc controller! There are just so many of them out there and macro stuff is super useful. It's just such a shame that Fanuc isn't producing anything similar...

  • @cncshorts1075
    @cncshorts1075 Год назад +3

    Donnie my favorite guy at titans by far

  • @ttools_professional5173
    @ttools_professional5173 Год назад

    Please do a course for the swiss type lathe

  • @raghvendrasingh7941
    @raghvendrasingh7941 Год назад +2

    Very useful my knowledge of cnc program

  • @TOXIXIFY
    @TOXIXIFY Год назад +2

    I'd really like to see a macro that can vary the spindle speed during a cut on a lathe to prevent chatter.

    • @Glenrok
      @Glenrok Год назад

      You can do it. I’ve written one in the past, it’s usually dependent on an added variable for the distance travelled before the chatter starts then adjusting the speed up or down as required when it reaches that point. I found it a bit awkward to use in practice because it requires trial and error for each different type of part before they can run in production.

    • @xm210c
      @xm210c Год назад

      ​@@Glenrok I think the top level comment is actually talking about a macro that constantly varies cutting speed based on a randomly generated (or a seed generated / function) pattern along the programmed path (whatever that is) around a base value. This should by itself alleviate some chatter issues by itself because it'd break up resonance from building up.
      What you seem to be implying is a cutting speed gradient along a path which is a trial and error solution but you can guesstimate from experience a bit sometimes. Something like a 50% slowdown over a 4xD distance for example. My own experience is actually more dealing with extremely long endmills, 6xD+, occasionally had to grab a 10xD here and there to mixed success.

    • @Glenrok
      @Glenrok Год назад

      @@xm210c yes, that’s exactly how my macro worked. Either way it would have to effect some change in rpm based on either time or distance- obviously I chose distance for mine. I like your idea of a randomly generated number within a specified range, unfortunately I neither know or can find a function in Macro B which would produce one, so a macro would have to be written just for that which would then be called by the chatter macro. I doubt the maths to do so is beyond me- but it is beyond what I could be bothered to mess around with to find out…….😏

  • @paulkraus4799
    @paulkraus4799 Год назад +2

    I have to say I have watched a ton of your videos but this is the first one I have saved .
    Great content

  • @flyingjeep911
    @flyingjeep911 Год назад +1

    Can y’all do a vidjeo on DO Loops

  • @brianmcbrinn7564
    @brianmcbrinn7564 Год назад +1

    A video I would like to see: Creating your own g codes and incorporating macro variables(like tornos G800/G900). These variables are used in other G codes or you can even create a torx head.

  • @kingbullol3314
    @kingbullol3314 Год назад +3

    I had no idea macros were even a thing before your thread macro video, so any video on any macro will be interesting for me. Also, are macros mostly used in swiss machines and production of big quantities of parts?

    • @donniehinske
      @donniehinske Год назад +3

      Macros can be used on almost any CNC machine. Some just may be formatted differently. Any Fanuc control with Macro B will work like this. You just may only have #500-#549 to play with

    • @havokwest4359
      @havokwest4359 Год назад +3

      Macros can be used in a wide variety of lathes and mills. I've created mill macro program to quick write center/drill/tap programs that kick out proper speeds and feeds for simple plates, a single program for making multiple simple bushings per push off our Haas Lathe w/ barfeeder just by entering the desired OD and length, and controlling stock breaks on Swiss machines when for when you find yourself swapping bar sizes every time you run a job. They definitely take a lot of upfront programming and knowledge of what your using them for, but can save a lot of time in the end for shops that find themselves making a lot of simple parts that change sizes with the wind.

    • @tomislavsvogor3877
      @tomislavsvogor3877 Год назад +2

      @@havokwest4359 when you learn to use a macro, programming becomes easier and the program is clearer and neater when written by hand on a machin. and the advantage is that you seem like God to operators who cannot learn and understand how macro works 😄

    • @Hi_Doctor_Nick
      @Hi_Doctor_Nick Год назад +3

      I ran a EDM wire 95% of the time using macros. Had it from setting up a pallet of parts, calling programs to set each position, then each program per part. Even had it changing power settings and spark gap for the same program depending on material thickness. All from changing a few numbers. Macros are brilliant and simple for operators to use. I love programming them, the harder the better. Really gets the old brain working lol.

  • @senorimotor
    @senorimotor Год назад +2

    Nice job with this video.

  • @jasonbohacek1130
    @jasonbohacek1130 Год назад +1

    Fancy BASIC

  • @moorepower7
    @moorepower7 Год назад +1

    That book is the best thing ever for learning macros!!
    Read it cover to cover 10 years ago and I haven't programmed the same since!!

  • @theoDSP
    @theoDSP Год назад

    I'm a software engineer. and looking at the Macro programming guide I can see very chaotic style of programming ther. Global variables, goto statements, implicit semantics. AKA a nightmare...

  • @stevedevney7322
    @stevedevney7322 Год назад +1

    I would love to see a multi tool change based on Useage. Is parts 1-10 on t1, parts 11-20 on t2, … parts 51-60 on t6.

  • @supremecommander2398
    @supremecommander2398 Год назад +1

    i am still waiting for the internal hexagon on the swiss cnc 😆

  • @penpal222
    @penpal222 Год назад +2

    A lot more simple than I thought it would be! Very cool!

  • @jonnywalker3610
    @jonnywalker3610 Год назад +3

    Where can i buy that book?😊

    • @Jack-yl7cc
      @Jack-yl7cc Год назад +1

      The book is written by Peter Smid, called FANUC CNC custom macros. It's nearly 20 years old, so you can find some used copies floating around somewhere online. It's also still in print if you want to buy it brand new.

    • @Hi_Doctor_Nick
      @Hi_Doctor_Nick Год назад

      Could download the pdf

  • @coreyb4073
    @coreyb4073 Год назад +1

    I did a macro program for a tapered stud for a customer, they called me in to do a new version of the stud about 2 years later, I changed 3 variables and the machine was making parts.

  • @jimcarriesa1911
    @jimcarriesa1911 Год назад +2

    Love that book.

  • @ninjaabcde
    @ninjaabcde Год назад +1

    Wait... you wrote a book too!?!?!? Is there anything in life you haven't done yet mr marine???? 😅

  • @josechavez3670
    @josechavez3670 Год назад +2

    Great video Donnie. Keep ‘em coming

  • @stevesye9114
    @stevesye9114 Год назад

    I would love to see a macro that can cut 100 grooves around 360 degrees. Thanks

  • @manfredlafs8472
    @manfredlafs8472 Год назад +2

    Really nice and informatic video im currently on a DMG Morie NLX3000, with a Mapps II OS, is it Possible to do it in a Maschine like this with the same macro code or do i have to search for the macro code for my machine?

    • @donniehinske
      @donniehinske Год назад +1

      Your machine will have #500s and up. Just find them in your offset page and make sure they aren’t being used before typing away. I know on older Mori machines the macro menu is harder to find. It’s annoying but it’s there

    • @manfredlafs8472
      @manfredlafs8472 Год назад +1

      @@donniehinske Thank you for youre reply, i found the macro page but i never used it cause im just a trainee and for our Programm wen dont really use them

    • @donniehinske
      @donniehinske Год назад

      @@manfredlafs8472 Just be careful and take your time! Learning them is one of the most powerful tools in the industry!

    • @manfredlafs8472
      @manfredlafs8472 Год назад

      @@donniehinske I first need to ask for permission to make something like this cause it takes time, and if the machines not running the company losing money

    • @tomislavsvogor3877
      @tomislavsvogor3877 Год назад +1

      @@donniehinske when we use the macro, we use it so that there is no problem even if the macro is used. for example: if I use #500 to define the offset at the beginning of the tool and another operator overwrites that macro with another variable, it's not a problem because when I start my program, macro #500 is set again to the value I defined. you mentioned that you have a macro of that thread stored next to it. if you defined those macro values in that program, you can later delete or change them without any problem, because the next time you start that threading program, your values will be written again in the macro you use.

  • @johnl5177
    @johnl5177 Год назад +1

    Next idea. Do how to engrave counting serial numbers for parts that will update and store quantity

    • @zyndapp800
      @zyndapp800 Год назад

      Yes, please start with G1025 engraving cycle that is using macro variables for serial number. This would be super useful!

  • @twcazhd
    @twcazhd Год назад +1

    Wait,,, I have a program running in a loop, the machine increases the tool count at the m30 so it's not counting. Would I have to write a macro for each tool? Or, does anyone know how to make the machine count the tool usage while in a loop? Mazak 510c nexus mill, thank you for any help or assistance!

    • @donniehinske
      @donniehinske Год назад +2

      Yes you have to add this logic for each tool if you want to do it correctly. Lots of typing at first but when it’s all done it’s worth it

    • @tomislavsvogor3877
      @tomislavsvogor3877 Год назад +1

      when I use a macro, I use it for each tool separately and I don't define the macro at the beginning of the program, but after changing the tool. I define F with a macro and then use that macro. if the operator needs to correct F, he corrects it immediately at the beginning of the tool and then he does not need to look for it in the program where everything changes the offset ( Milling )

  • @Yamahog
    @Yamahog 7 месяцев назад

    Great Vid .... Brings back memories of the 90's when I was punching G-code into my Haas VF 1 and VF 2
    Anywho, Don, a question .... Kenametal or Valenite. And what about Boron Nitride ,( CBN ).
    Stay Safe

  • @ronvonbargen8411
    @ronvonbargen8411 10 месяцев назад

    I don't understand the GE line wouldn't you want that to be a LT so that the machine keeps running while it's LT ten and then when it counts up to ten have it go to m30 or m00 etc
    Would this work?
    #601=10
    #600=0
    N1234
    Main program
    #600=#600+1
    If[#600 LT #601]N1234
    M2

  • @stuartgaylor2420
    @stuartgaylor2420 10 месяцев назад

    Is it possible to do MACRO using live axial Endmilling to make different sized hexagons or squares.
    Like, type in 12 so it will do a 12mm hexagon

  • @kevgh3869
    @kevgh3869 Год назад

    Hi. We are trying to make a macro that indexes a horizontal table (B) 15 degrees . We have tried : #1=[#1 =15.] it only works for the first index. Can any one tell us what are we doing wrong?

  • @thomashudson6008
    @thomashudson6008 Год назад

    you can also just set the count to 10 instead of using a separate macro #. So IF[#600 GE 10] GOTO 1234

  • @cloudriz
    @cloudriz Год назад

    I would enjoy and make great use of a video that could probe a bore populate a work offset. I have some parts in my shop that need reworked. The swimgarms for Polaris slingshots lol.

  • @Matt33318
    @Matt33318 Год назад

    Watching these videos I am see that an avarage US company's machine shop is lightyears ahead of my country's machine shops.

  • @gerouldiaz
    @gerouldiaz Год назад

    It takes 5 minutes for Chat Gpt to give me the code and actual syntax and commands for CNC program.

  • @heyjeeery7587
    @heyjeeery7587 Год назад

    cute video, you can also use GOTO to skip over a tool or tools in a program, just in case you have to change the order without bugging your programmer.

  • @merouanebenderradji1582
    @merouanebenderradji1582 Год назад

    wait what if the macro variable number 600 was used by the machine manufacturer and it just happens to be 0 by chance at the time you're checking it, how to figure that out ?

  • @Ramkumar-mr2cq
    @Ramkumar-mr2cq Год назад

    How to run a 200mm length work in Tsugami bo206-iii ? Give any ideas !!

  • @rahimzettili9354
    @rahimzettili9354 3 месяца назад

    Is 3006=1 work for all the machines or I need to look on manual which one it allows the message not alarm.

  • @SirW-m1g
    @SirW-m1g Год назад

    Is it possible to have the screen automatically go back to the program screen when cycle start is pressed after user defined message appears?

  • @malopomalo6563
    @malopomalo6563 Год назад

    Hey people, any g code basics video yall recommend. Im a student btw so i need THE basics.

  • @kiranbachagoudar1449
    @kiranbachagoudar1449 Год назад

    Making big components program is easy try to make micro implant screw and titanium material suggest better tools options

  • @WhitneyPerry-t5q
    @WhitneyPerry-t5q Месяц назад

    Lee Dorothy Robinson Jose Walker Jeffrey

  • @homer4889
    @homer4889 Год назад

    You could be a rapper bro! Can't catch up with what ya sayin'. S'up?

  • @sedled2829
    @sedled2829 Год назад

    I’m wondering why you chose 10 as the tool life. Is that accurate or is 100 more accurate?

    • @Glenrok
      @Glenrok Год назад

      It can be whatever you want. Usually run the tool to failure with a count on parts made, then set your counter value a comfortable number under that failure point

    • @sedled2829
      @sedled2829 Год назад +1

      @@Glenrok that make sense

  • @ntvirtue
    @ntvirtue Год назад

    Macro's are programming lite not actual code.

  • @MrRtkwe
    @MrRtkwe Год назад

    God it's the stone age of computing over in CNC land apparently. All global variables and GOTOs like it's still the 70s.

  • @michaelpawluk6791
    @michaelpawluk6791 Год назад

    We're you an application engineer for Tornos?

  • @Chiefs1582
    @Chiefs1582 Год назад

    We run a ton of macro programs at work it's super convenient

  • @nemesisbreakz
    @nemesisbreakz Год назад

    All good until you get a bad batch of material or cutting tools.

  • @cncshorts1075
    @cncshorts1075 Год назад +1

    Fuck yes

  • @darreneck3744
    @darreneck3744 Год назад

    part probing macro please

  • @Rooster121384
    @Rooster121384 Год назад

    Can you show how you would input the same macro "tool life" for multiple tools that have various tool life. Say od turn rough has 20pcs tool life. Od finish 40pcs. Cutoff 40pcs etc. I feel like your greater to or equal to main count say od turn rough of 20 would have to be in a different area. Or do you just create those macros in tandem with start at say 400 finish 401. But with all tool life? Thanks in advance

  • @falconidaes
    @falconidaes Год назад

    Never use GOTO statement in any code. Yo can learn that in the first year of University. In the next years you can learn it from experience when other try to use it.
    Anyway, series of programming CNC I found very productive. Keep it rolling.

    • @filippomontevecchi8618
      @filippomontevecchi8618 Год назад

      If you are programming fanuc cnc it is not easy to avoid GOTO. The IF statements allows the conditional execution of a single macro statement or a conditional GOTO. Therefore if you want to condionally execute a bunch of macro ans cnc lines there are little alternatives. But I agree with you that GOTO should be avoided whenever possible.

  • @tj9382
    @tj9382 Год назад

    Great video. I was pleasantly surprised to see that book, the very same one I got my company to buy me many years back. And I still use it today when I need to reference or refresh my knowledge.
    Once I discovered Macro B it was a game changer for many of my had written programs.

  • @keithkeller1025
    @keithkeller1025 Год назад

    What’s the repeatability of that specific tool holder? In the past on various Swiss machines, like a Star, you’d have to pull the whole holder out, touch off, etc m, then make an offset. Just curious

  • @ashokzala2683
    @ashokzala2683 10 месяцев назад

    Very nice i like your guidelines

  • @fernandonegrete425
    @fernandonegrete425 Год назад

    Awesome! Excellent video. A macro for compensating work offset with touch probe would be very interesting :D

  • @christiantough5
    @christiantough5 Год назад

    Easier just to use tool life menu in the offset....js....as a machinist....what he's talking about here is making the job so joe smo can come in off the street and run the machine with no experience....bye bye machinist job...

    • @chauvinemmons
      @chauvinemmons Год назад +1

      Yeah I remember them saying that back in the late 70s and things have only gotten more exciting machinists aren't going anywhere but possibly to another shop with more advanced equipment and more forward thinking owners

  • @cncmilljunkie
    @cncmilljunkie Год назад

    The only way to know if a macro is not being used is to do a deep dive to every program on the machine and check for macros that are being used. Reading the documentation that comes with the machine is a good start, but I ran machines where the machine tool builder book was wrong. On top of that, you don’t know if anyone had dip there fingers in the programs on the machine. I myself will program Marcos that will return the values to null when finished as a safety check to make sure those values can’t be used somewhere else.
    With that being said, can you go over the basic concepts to writing programs for probing?
    Like how to check for low battery State
    Calibration procedures
    How to find the safest max feed rate during a non contact move and the fastest feed rate that can be use for a measuring move.

    • @Glenrok
      @Glenrok Год назад

      That’s a good idea, but a better idea would be to read and store any value already in the variable, then return it to that value after your macro finishes. That way, if the machine is depending on an already stored variable, it’s not jeopardised from having been returned to null…..