WHILE DO LOOP IN A CNC MILL PROGRAM

Поділитися
Вставка
  • Опубліковано 27 сер 2024
  • Learn how to use "WHILE DO" statements in a CNC Mill program to change your depth of cut using common variables and relational operators.
    O0001(WHILE DO LOOP)
    (2.00 X 2.00 SQUARE)
    #100=.250 (FIRST DEPTH OF CUT)
    #101=.250 (DEPTH PER PASS)
    #102=1.500 (TOTAL DEPTH)
    N300
    G0G17G40G80G49
    G91G28Z0.
    T3M6
    S2500M3
    G90G0G54X-.25Y.5
    G43H3Z1.M8
    WHILE[#100LE#102]DO1
    G1Z-#100F50.
    G1Y.25F20.
    G1X2.25
    G1Y-2.25
    G1X-.25
    G1Y.3
    G0Z.25
    G0X-.25Y.5
    #100=#100+#101
    END1
    G0Z1.
    M5
    M9
    G91G28Z0.
    G28Y0.
    G90
    M30
    %

КОМЕНТАРІ • 82

  • @bikefarmtaiwan1800
    @bikefarmtaiwan1800 Рік тому +1

    Always such a good delivery of information - watched it more than once ;)

  • @subhashgandhi7886
    @subhashgandhi7886 5 років тому +1

    Mr. Stikkleman, your instrution videos are the most understanding and pleasing to watch. You take time in explaining the rudements of CNC. I have seen in some other videos where they are showing of their talents by moving cursor fast and changing geometry. Please keepup the excellent work.Thank youSubhash

    • @TomStikkelman
      @TomStikkelman  5 років тому

      Subhash Gandhi Thank you very much for that feedback. I hope you learn a lot.

  • @ganzorigch8146
    @ganzorigch8146 2 роки тому

    Mr Stikkelman, THANK YOU. Clear and helpful.

  • @TomStikkelman
    @TomStikkelman  3 роки тому

    Great!! Thanks for watching!

  • @thegoose7777
    @thegoose7777 9 років тому +1

    Wow... Brings me back to the days I was writing macros!!!!! One of my first ones was when I added an aluminum sub-plate to the machine and I wrote a macro to center drill, drill, countersink and tap using one short program. Great job

    • @israelmartinez2027
      @israelmartinez2027 3 роки тому

      Hi, new to macro programming. Could you please share this code if you still have it or direct me towards a site of videos further explaining macros? Thank you

  • @TomZelickman
    @TomZelickman 9 років тому +2

    Thanks, Tom! As usual, a very helpful lesson as I slowly dip my toes in the CNC waters.
    Best wishes,
    Tom Z

  • @INGRIDUNIVERSE
    @INGRIDUNIVERSE 8 років тому +3

    My english it's not good but i understand almost all what you said and I'm learning a lot of things from these videos!
    Thank you very much Tom!

    • @TomStikkelman
      @TomStikkelman  8 років тому

      That's great Dolk Anoj. Thank you for that feedback and thanks for watching my channel. Tom

    • @rexeekhong1274
      @rexeekhong1274 7 років тому

      Tom Stikkelman mr Tom can you teach us some basic of programming. Please. Where is your current location?

  • @dadoVRC
    @dadoVRC 5 років тому +2

    This is a good starting point.
    I'm used to do this with a different aproach, because sometimes you need to fix depth parameters, and it is useful to do the dividing job to the CN.
    For example (using millimeters, I can't understand why using medieval units on a NC machine 😉):
    #100=0(starting plane, Z0 for example)
    #101=20(finished depth of the cut)
    #102=5(number of passes)
    #103=[[#100-#101]/#102]
    WHILE[#100NE#101]DO1
    (Starting position coordinates)
    G1Z#100+1F1000
    #100=[#100-#103]
    G1Z#100F150
    (Working coordinates)
    G0Z5
    END1
    This can be a little bit more complex, but when you starting using it it isn't.
    It allows you to adjust depth parameters without problems only modifying the #102 parameter.
    It is also a lot useful when you work, like me, on a lathe with live tooling when you have to mill complex surfaces with a round edge mill on the diameter.
    Adding some parameters you can work with C-Z interpolation making a potentially infinite number of passes, with the same program style, adding also calculation for conicity you can rough and finish for example a conical pocket.
    This is only my way of working, I started with basical parametric programmation and then I applied some logic to do what I need with shorter programs.

    • @TheVist7
      @TheVist7 2 роки тому

      Are You working on Y axis lathe?

    • @dadoVRC
      @dadoVRC 2 роки тому

      @@TheVist7 Yes, it is since 2017 that I changed factory and I haven't the Y here, but the same approach work also on the Y machines.

    • @Sneildog
      @Sneildog 2 місяці тому

      Thank you I was trying to use "number of passes" instead of "depth of each pass" !!!!!

    • @dadoVRC
      @dadoVRC 2 місяці тому

      @@Sneildog you can do it simply.

  • @karlleitinger1720
    @karlleitinger1720 3 роки тому

    Thanks Mr. Stikkelman this is just great.

  • @TheEpistemicOne
    @TheEpistemicOne 7 років тому

    Very clear explanation- very helpful Tom!

  • @mservice3075
    @mservice3075 3 роки тому

    I​ wisa Por​gam.​ Cnc​ basis setup​ okoma​ cnc​ porgam​ tack.​My fan

  • @felixdynak4505
    @felixdynak4505 5 років тому

    Thank you Tom...this is an productive lesson. Its very appreciated.

  • @lf559
    @lf559 3 роки тому

    This just helped me with an assignment

  • @MrCoffeypaul
    @MrCoffeypaul 5 років тому

    Very nicely explained!

  • @anthonyvaleriomercedes6802
    @anthonyvaleriomercedes6802 5 років тому +1

    Ing. gracias por compartir ese conocimiento, seria genial si se animara a compartirnos un tutorial minucioso de programar con Macros. gracias y un saludo

  • @ralphschubert3376
    @ralphschubert3376 3 місяці тому

    Mr Stikkelman, keep up the great work...I am thoroughly enjoying your tutorials. I am very new to this so I have a question. Can this be used along with the circle milling variable? Do they have to be integrated or do they run inline? and if so, which goes first?
    Thanks!

  • @bikefarmtaiwan1800
    @bikefarmtaiwan1800 3 роки тому

    Thanks for the video Tom :)

  • @joshcommet137
    @joshcommet137 2 роки тому

    VERY NICE

  • @isaskeuchiha7978
    @isaskeuchiha7978 8 років тому

    isang taon mula ngaun ma2master ko rn yan!!!

  • @dmitryperminov1277
    @dmitryperminov1277 6 років тому

    Thank you so much! Finally got it!

  • @HannesVanDermerwe-pv7mc
    @HannesVanDermerwe-pv7mc 2 місяці тому

    Hi Tom my name is Hannes. I have been following your videos on macro b programming. We are incorporating the probe on a VTL lathe but I am having issues using the while loop on machining inside and outside diameters. Please could you share some InSite into how the while do will work on diameters when machining a profile that consists of chamfers and two or three different diameters. I will really appreciate the help. I have done a CNC program that uses a canned cycle to rough the profile to 5 mm from size. I want to use the while do statement to machine off the balance of the material before the probe goes and measures the dimension again. Once measured I will make an offset and rerun the same final profile cycle to recut the diameter in question. Thank you in advance

  • @fabcam64
    @fabcam64 3 роки тому

    Me salvastes la vida perroooo, gracias :)

  • @mousongie
    @mousongie 9 років тому

    Hi Tom, once again thanks so ever for this video. You really helping us to get our feet into cnc. As stated, would you please provide us with some MASTERCAM SURFACING ( parallel, raster, waterline, scallop, optirough, opticore.......) videos

  • @resbel6470
    @resbel6470 8 років тому

    NicePlease, post more parametric programs.

  • @benbixel3252
    @benbixel3252 3 роки тому

    Thank you

  • @anbesivamkannan
    @anbesivamkannan 6 років тому +1

    thanks for the above lesson, i wish to learn more about macro programming do you have any videos #500-#999 programs?

  • @ernestoterrazas3480
    @ernestoterrazas3480 4 роки тому

    Mr Stikkelman Thank you for your clear explanations on G programing. Could you explain us how to program a NPT thread in a milling machine by interpolation? I did oone time ago in it was a lot of calculations for a 1 inch NPT

  • @jagankandukuri6039
    @jagankandukuri6039 3 роки тому

    good

  • @threeaxis359
    @threeaxis359 5 років тому

    Always remember on using variables in macro b programming that Null is not zero it is nothing at all data empty and that zero is a location in the coordinate system on your machine never confuse the two.

  • @kuei12
    @kuei12 3 роки тому

    Erasing common variables 100-199 is a default parameter setting.

  • @briannguyen6788
    @briannguyen6788 7 років тому

    THanks for ur useful video! So what is your simulation software to show the toolpath?

  • @gsalgado0924
    @gsalgado0924 3 роки тому

    hi Tom can this Program work on the lathe for deep holes

  • @shabbirabbas1718
    @shabbirabbas1718 2 роки тому

    Hi... I made some program based on the video but some program is working and some give an alarm but it shows well on Cimco simulation. If I send the program can you help me to find my mistake?

    • @TomStikkelman
      @TomStikkelman  2 роки тому

      You can email me the code
      tstikkelman@gmail.com

  • @fansari4728
    @fansari4728 6 років тому

    I m big fan for u

    • @TomStikkelman
      @TomStikkelman  6 років тому

      Faizan Ansari
      Thanks Faizan. Hope they are a help.

  • @thirugnanas6074
    @thirugnanas6074 3 роки тому

    Thank you sir😍

  • @renatoalmeida9622
    @renatoalmeida9622 9 років тому

    Hello how are you? I've watched all his videos are very good. I see that you know very well of parametric programming. I will dare to ask for a video made in Mastercam Mill, using surfaces strategies. I am very grateful.

    • @TomStikkelman
      @TomStikkelman  9 років тому

      RENATO CAD/CAM/CNC Thanks for the feedback Renato. I will do a video on that soon. Tom

    • @renatoalmeida9622
      @renatoalmeida9622 9 років тому

      Thank you very much.

  • @myway9228
    @myway9228 8 років тому +2

    thnx man..

  • @hamzanawaz7945
    @hamzanawaz7945 6 місяців тому

  • @cibinmathew7075
    @cibinmathew7075 3 роки тому

    Plz can you give me the formula for hemisphere I want to do in vmc machine

  • @fansari4728
    @fansari4728 6 років тому

    nic Tom

  • @ashutoshdwi
    @ashutoshdwi 7 років тому +1

    Sir I'm not getting why yoju are using G91 in line G91G28G0 ?
    Please respond
    Thanks

    • @ramk285
      @ramk285 7 років тому

      G91 is absolute positioning in which the machines takes the coordinate entered when taken zero point on the object and G28 is used to tell the machine to travel to the point of G91 and G0 is rapid force. so totally it mean to move the spindle to the absolute position at rapid speed.

    • @thojh22
      @thojh22 7 років тому

      because machine home position not program position.
      here are examples: 1.) G0G91G28Z0. (safety codes at the beginning and at the end of the program) this means your tools is above your part 10+ inches (depends how big is your machine) away. 2.) G0G90G28 Z.1(never write like this. I just give u for an example to make it clear why using G91 in that line as u had mention) this means your tools are above your part Z.1

    • @rrnepal98450
      @rrnepal98450 6 років тому +3

      G91 Incremental Positioning

    • @sukumar4584
      @sukumar4584 5 років тому

      Plz make video in circular pocket25radius

    • @sukumar4584
      @sukumar4584 5 років тому

      Which software your using

  • @longcivix
    @longcivix 7 років тому

    can you use the variables to do the calculation for speed and feed rate too? Basing on this tutorial?

    • @TomStikkelman
      @TomStikkelman  7 років тому +2

      Long Pham Nguyen Yes you can! Thanks for watching.

  • @SunilKumar-cn5ro
    @SunilKumar-cn5ro 7 років тому

    sir how can make in cnc milling concave radius ball nose cutter in macro

  • @Fizzy-Bubblech
    @Fizzy-Bubblech 6 років тому +1

    Never ever use #100-#199 variables for such simple loop! Because machine builder maybe have one of #100 to #199 in use. It is much saver to use #1-#33 in such a case of simple loop.

  • @nhaque5768
    @nhaque5768 3 роки тому

    Hi, i am using your method but i have a little problem. can you help me with the macro?

  • @corymirran
    @corymirran 8 років тому

    goodnight a question as it is called the simulator

  • @jaysin011584
    @jaysin011584 4 роки тому

    Hey I tried a macro facing program could you look over it for any mistakes. Or maybe run it in you simulator.

  • @priyeshjadhav6709
    @priyeshjadhav6709 2 роки тому

    Plz micro square pocket rouch program plz sir

  • @garylake4285
    @garylake4285 7 років тому +1

    A gosub would have been easier with increments.

    • @MrCoffeypaul
      @MrCoffeypaul 5 років тому

      A Gosub, I haven't seen that statement in over 30 years!! It's a bit like the Goto Statement!

  • @Goldstar660
    @Goldstar660 6 років тому

    witch software are you using to simulate you macro command

    • @TomStikkelman
      @TomStikkelman  6 років тому

      Philippe Parizeau I’m using Mastercam to show the solid model and the Gwizard editor from CNCcookbook to test and simulate the code. Thanks for watching.

  • @2024Felix
    @2024Felix 8 років тому

    what is the software's name ??? thx a lot

  • @diegocampos4674
    @diegocampos4674 7 років тому

    improper code g. ??? help

  • @Deepanshu0809
    @Deepanshu0809 7 років тому

    hello everyone!
    can anyone help me to learn macro programming for a turning operation?
    Thanks!

  • @moldtron
    @moldtron 4 роки тому

    Hi, very nice.
    I wish you to a taper pocket
    If can please help
    Thank you Sir
    Stay safe...