WHILE DO LOOP IN A CNC MILL PROGRAM

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 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
    %

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

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

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

  • @subhashgandhi7886
    @subhashgandhi7886 6 ปีที่แล้ว +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  6 ปีที่แล้ว

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

  • @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 4 ปีที่แล้ว

      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

  • @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 8 ปีที่แล้ว

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

  • @ganzorigch8146
    @ganzorigch8146 2 ปีที่แล้ว

    Mr Stikkelman, THANK YOU. Clear and helpful.

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

  • @TomStikkelman
    @TomStikkelman  4 ปีที่แล้ว

    Great!! Thanks for watching!

  • @dadoVRC
    @dadoVRC 6 ปีที่แล้ว +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 3 ปีที่แล้ว

      Are You working on Y axis lathe?

    • @dadoVRC
      @dadoVRC 3 ปีที่แล้ว

      @@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 5 หลายเดือนก่อน

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

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

      @@Sneildog you can do it simply.

  • @TheEpistemicOne
    @TheEpistemicOne 7 ปีที่แล้ว

    Very clear explanation- very helpful Tom!

  • @felixdynak4505
    @felixdynak4505 5 ปีที่แล้ว

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

  • @karlleitinger1720
    @karlleitinger1720 3 ปีที่แล้ว

    Thanks Mr. Stikkelman this is just great.

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

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

    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!

  • @HannesVanDermerwe-pv7mc
    @HannesVanDermerwe-pv7mc 5 หลายเดือนก่อน

    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

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

  • @MrCoffeypaul
    @MrCoffeypaul 5 ปีที่แล้ว

    Very nicely explained!

  • @lf559
    @lf559 4 ปีที่แล้ว

    This just helped me with an assignment

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

  • @mservice3075
    @mservice3075 3 ปีที่แล้ว

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

  • @isaskeuchiha7978
    @isaskeuchiha7978 8 ปีที่แล้ว

    isang taon mula ngaun ma2master ko rn yan!!!

  • @briannguyen6788
    @briannguyen6788 7 ปีที่แล้ว

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

  • @bikefarmtaiwan1800
    @bikefarmtaiwan1800 3 ปีที่แล้ว

    Thanks for the video Tom :)

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

  • @dmitryperminov1277
    @dmitryperminov1277 7 ปีที่แล้ว

    Thank you so much! Finally got it!

  • @fabcam64
    @fabcam64 3 ปีที่แล้ว

    Me salvastes la vida perroooo, gracias :)

  • @resbel6470
    @resbel6470 9 ปีที่แล้ว

    NicePlease, post more parametric programs.

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

  • @gsalgado0924
    @gsalgado0924 3 ปีที่แล้ว

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

  • @joshcommet137
    @joshcommet137 2 ปีที่แล้ว

    VERY NICE

  • @threeaxis359
    @threeaxis359 6 ปีที่แล้ว

    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.

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

  • @cibinmathew7075
    @cibinmathew7075 3 ปีที่แล้ว

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

  • @benbixel3252
    @benbixel3252 3 ปีที่แล้ว

    Thank you

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

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

  • @SunilKumar-cn5ro
    @SunilKumar-cn5ro 7 ปีที่แล้ว

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

  • @corymirran
    @corymirran 8 ปีที่แล้ว

    goodnight a question as it is called the simulator

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

    thnx man..

  • @fansari4728
    @fansari4728 7 ปีที่แล้ว

    I m big fan for u

    • @TomStikkelman
      @TomStikkelman  7 ปีที่แล้ว

      Faizan Ansari
      Thanks Faizan. Hope they are a help.

  • @kuei12
    @kuei12 3 ปีที่แล้ว

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

  • @nhaque5768
    @nhaque5768 3 ปีที่แล้ว

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

    • @TomStikkelman
      @TomStikkelman  3 ปีที่แล้ว

      Send it to me. tstikkelman@gmail.com

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

  • @thirugnanas6074
    @thirugnanas6074 4 ปีที่แล้ว

    Thank you sir😍

  • @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 7 ปีที่แล้ว +3

      G91 Incremental Positioning

    • @sukumar4584
      @sukumar4584 6 ปีที่แล้ว

      Plz make video in circular pocket25radius

    • @sukumar4584
      @sukumar4584 6 ปีที่แล้ว

      Which software your using

  • @fansari4728
    @fansari4728 7 ปีที่แล้ว

    nic Tom

  • @2024Felix
    @2024Felix 8 ปีที่แล้ว

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

  • @Goldstar660
    @Goldstar660 7 ปีที่แล้ว

    witch software are you using to simulate you macro command

    • @TomStikkelman
      @TomStikkelman  7 ปีที่แล้ว

      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.

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

  • @Deepanshu0809
    @Deepanshu0809 8 ปีที่แล้ว

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

  • @jagankandukuri6039
    @jagankandukuri6039 4 ปีที่แล้ว

    good

  • @diegocampos4674
    @diegocampos4674 7 ปีที่แล้ว

    improper code g. ??? help

  • @moldtron
    @moldtron 4 ปีที่แล้ว

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