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

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024

ความคิดเห็น • 217

  • @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
      %

  • @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.

  • @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

  • @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 😂

  • @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!!

  • @Jack-yl7cc
    @Jack-yl7cc ปีที่แล้ว +10

    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...

  • @ShootingUtah
    @ShootingUtah ปีที่แล้ว +19

    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. 👍🏻

  • @cncshorts1075
    @cncshorts1075 ปีที่แล้ว +3

    Donnie my favorite guy at titans by far

  • @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

  • @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

  • @bikefarmtaiwan1800
    @bikefarmtaiwan1800 หลายเดือนก่อน

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

  • @christophervillalpando1815
    @christophervillalpando1815 ปีที่แล้ว +4

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

  • @damionparson247
    @damionparson247 ปีที่แล้ว +11

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

  • @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

  • @penpal222
    @penpal222 ปีที่แล้ว +2

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

  • @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

  • @Tablebreaker77
    @Tablebreaker77 ปีที่แล้ว

    Thank you so much for this its really helping Me fill in the gibberish after starting my job as a cnc operator.

  • @CncFrezar
    @CncFrezar ปีที่แล้ว +3

    Very interesting video!👍

  • @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...

  • @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 😆

  • @berntinulkshredder
    @berntinulkshredder ปีที่แล้ว

    Fan and work, make the production a million times smoother! just cool to be seeing this sessions and love it. Just killing it all the time.

  • @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!

  • @gooblio
    @gooblio ปีที่แล้ว

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

  • @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;

  • @brendonv101
    @brendonv101 ปีที่แล้ว +1

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

  • @josechavez3670
    @josechavez3670 ปีที่แล้ว +2

    Great video Donnie. Keep ‘em coming

  • @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

  • @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!!!

  • @dustinvinci345
    @dustinvinci345 ปีที่แล้ว +2

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

  • @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.

  • @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

  • @raghvendrasingh7941
    @raghvendrasingh7941 ปีที่แล้ว +2

    Very useful my knowledge of cnc program

  • @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

  • @davidsum8924
    @davidsum8924 ปีที่แล้ว

    yes. marco is very useful. as early as the 6M series, i myself have created quite a variety of marco.

  • @master8laster49
    @master8laster49 ปีที่แล้ว

    Awesome Donnie, I have one for you that I've wanted for quite some time: A macro that can turn really long parts with seamless transitions, no lift just turning all the way to 35" and lets do it in Titanium, I could really use that!

  • @achpek13
    @achpek13 ปีที่แล้ว

    Love this guy. Natural vlogger!

  • @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.

  • @shaniegust1225
    @shaniegust1225 ปีที่แล้ว

    Wow! Great video Donnie! Looking forward to more 👍

  • @gerhardvictor5475
    @gerhardvictor5475 ปีที่แล้ว

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

  • @CD3DP
    @CD3DP ปีที่แล้ว

    Thank you for the lesson you’re a great teacher!

  • @jimcarriesa1911
    @jimcarriesa1911 ปีที่แล้ว +2

    Love that book.

  • @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.

  • @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.

  • @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

  • @senorimotor
    @senorimotor ปีที่แล้ว +2

    Nice job with this video.

  • @backyardengineer916
    @backyardengineer916 ปีที่แล้ว

    Donnie is such a vibe

  • @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

  • @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!

  • @mtn_sivliu
    @mtn_sivliu ปีที่แล้ว

    this was actually very educating. thanks a lot.

  • @fernandonegrete425
    @fernandonegrete425 ปีที่แล้ว

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

  • @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.

  • @Yamahog
    @Yamahog 9 หลายเดือนก่อน

    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

  • @jonivanart
    @jonivanart 11 หลายเดือนก่อน

    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. 🤙

  • @Dn1sdr
    @Dn1sdr ปีที่แล้ว

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

  • @nrodondi
    @nrodondi ปีที่แล้ว

    Yes more videos about macros please

  • @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.

  • @dimsum5567
    @dimsum5567 ปีที่แล้ว

    You guys produce great content!

  • @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 😉

  • @ashokzala2683
    @ashokzala2683 11 หลายเดือนก่อน

    Very nice i like your guidelines

  • @Chiefs1582
    @Chiefs1582 ปีที่แล้ว

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

  • @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.

  • @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!!! 😀

  • @rcandcnc9684
    @rcandcnc9684 ปีที่แล้ว

    Cool, really well explained.

  • @mikhaildavydenko6841
    @mikhaildavydenko6841 ปีที่แล้ว

    You miss to tell about #3901's variables which is about workpieces counter. In many cases, when we have a looped workflow we need to deal with that thing

  • @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

  • @Hani13ful
    @Hani13ful 19 วันที่ผ่านมา

    Is there any post processor which generates these type of macro logics if commanded

  • @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…….😏

  • @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

  • @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.

  • @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…..

  • @younhap
    @younhap ปีที่แล้ว

    Thank you for the video!

  • @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!

  • @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 TH-cam 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

  • @flyingjeep911
    @flyingjeep911 ปีที่แล้ว +1

    Can y’all do a vidjeo on DO Loops

  • @damiansz4883
    @damiansz4883 ปีที่แล้ว

    Great!!! More macro examples please!!!

  • @dakotareid1566
    @dakotareid1566 ปีที่แล้ว

    Can y’all do more videos like this for mills and lathes?

  • @ttools_professional5173
    @ttools_professional5173 ปีที่แล้ว

    Please do a course for the swiss type lathe

  • @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.

  • @stuartgaylor2420
    @stuartgaylor2420 ปีที่แล้ว

    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

  • @richhuntsd12
    @richhuntsd12 ปีที่แล้ว +1

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

  • @rahimzettili9354
    @rahimzettili9354 5 หลายเดือนก่อน

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

  • @williamlind2843
    @williamlind2843 ปีที่แล้ว +2

    Dude!! I have guys with me that can barely write G-code. They are so afraid of it and make it harder than it is. My 1st supervisor left me to go to the mill dept after 2 years operating experience. He said you're the new lathe supervisor, G1 is feed, G0 is rapid and walked away forever!! 35 years later I'm running a CNC division at a large manufacturer, and I can't get these guys to get it!!! I'm literally here watching TITAN'S of CNC on my own time!! They won't do it!!!

    • @DannyWallsPratt
      @DannyWallsPratt ปีที่แล้ว

      You're so fuckin awesome. You're a great expert. Bet your company would fold without you....punk

  • @sondreheggnes8321
    @sondreheggnes8321 ปีที่แล้ว

    i'd love to see a macro for siemens, i have a siemens 840d sl controller, and the machine is automated with a robotic arm from ABB, however the camera that sends the coordinates for the part to pick to the robot is not that good. when i use marposs probe i want to be able to limit the probe if i have a part sticking out on the one side for milling it so i don't have to machine my jaws over and over again

  • @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.

  • @rkrbrts7149
    @rkrbrts7149 ปีที่แล้ว

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

  • @ronvonbargen8411
    @ronvonbargen8411 11 หลายเดือนก่อน

    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

  • @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

  • @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?

  • @moosedeuce2307
    @moosedeuce2307 ปีที่แล้ว

    I’d love to get some videos on macros for setting machine offsets

  • @Ramkumar-mr2cq
    @Ramkumar-mr2cq ปีที่แล้ว

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

  • @malopomalo6563
    @malopomalo6563 ปีที่แล้ว

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

  • @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 ?

  • @supremecommander2398
    @supremecommander2398 ปีที่แล้ว +1

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

  • @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...

  • @khusco1180
    @khusco1180 ปีที่แล้ว +3

    Moro macros please 😁

  • @michaelpawluk6791
    @michaelpawluk6791 ปีที่แล้ว

    We're you an application engineer for Tornos?

  • @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