WHILE DO LOOP IN A CNC MILL PROGRAM

  Рет қаралды 66,938

Tom Stikkelman

Tom Stikkelman

9 жыл бұрын

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 Жыл бұрын
Always such a good delivery of information - watched it more than once ;)
@ganzorigch8146
@ganzorigch8146 2 жыл бұрын
Mr Stikkelman, THANK YOU. Clear and helpful.
@felixdynak4505
@felixdynak4505 5 жыл бұрын
Thank you Tom...this is an productive lesson. Its very appreciated.
@TheEpistemicOne
@TheEpistemicOne 7 жыл бұрын
Very clear explanation- very helpful Tom!
@TomZelickman
@TomZelickman 9 жыл бұрын
Thanks, Tom! As usual, a very helpful lesson as I slowly dip my toes in the CNC waters. Best wishes, Tom Z
@subhashgandhi7886
@subhashgandhi7886 5 жыл бұрын
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.
@karlleitinger1720
@karlleitinger1720 3 жыл бұрын
Thanks Mr. Stikkelman this is just great.
@dmitryperminov1277
@dmitryperminov1277 6 жыл бұрын
Thank you so much! Finally got it!
@thegoose7777
@thegoose7777 8 жыл бұрын
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
@MrCoffeypaul
@MrCoffeypaul 5 жыл бұрын
Very nicely explained!
@bikefarmtaiwan1800
@bikefarmtaiwan1800 3 жыл бұрын
Thanks for the video Tom :)
@INGRIDUNIVERSE
@INGRIDUNIVERSE 8 жыл бұрын
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?
@TomStikkelman
@TomStikkelman 3 жыл бұрын
Great!! Thanks for watching!
@lf559
@lf559 3 жыл бұрын
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
@fabcam64
@fabcam64 3 жыл бұрын
Me salvastes la vida perroooo, gracias :)
@dadoVRC
@dadoVRC 5 жыл бұрын
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 Ай бұрын
Thank you I was trying to use "number of passes" instead of "depth of each pass" !!!!!
@dadoVRC
@dadoVRC Ай бұрын
@@Sneildog you can do it simply.
@resbel6470
@resbel6470 8 жыл бұрын
NicePlease, post more parametric programs.
@myway9228
@myway9228 8 жыл бұрын
thnx man..
@benbixel3252
@benbixel3252 3 жыл бұрын
Thank you
@joshcommet137
@joshcommet137 2 жыл бұрын
VERY NICE
@anbesivamkannan
@anbesivamkannan 6 жыл бұрын
thanks for the above lesson, i wish to learn more about macro programming do you have any videos #500-#999 programs?
@isaskeuchiha7978
@isaskeuchiha7978 8 жыл бұрын
isang taon mula ngaun ma2master ko rn yan!!!
@thirugnanas6074
@thirugnanas6074 3 жыл бұрын
Thank you sir😍
@anthonyvaleriomercedes6802
@anthonyvaleriomercedes6802 5 жыл бұрын
Ing. gracias por compartir ese conocimiento, seria genial si se animara a compartirnos un tutorial minucioso de programar con Macros. gracias y un saludo
@briannguyen6788
@briannguyen6788 7 жыл бұрын
THanks for ur useful video! So what is your simulation software to show the toolpath?
@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
@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!
@mservice3075
@mservice3075 3 жыл бұрын
I​ wisa Por​gam.​ Cnc​ basis setup​ okoma​ cnc​ porgam​ tack.​My fan
@fansari4728
@fansari4728 6 жыл бұрын
nic Tom
@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
@hamzanawaz7945
@hamzanawaz7945 5 ай бұрын
@fansari4728
@fansari4728 6 жыл бұрын
I m big fan for u
@TomStikkelman
@TomStikkelman 6 жыл бұрын
Faizan Ansari Thanks Faizan. Hope they are a help.
@jagankandukuri6039
@jagankandukuri6039 3 жыл бұрын
good
@gsalgado0924
@gsalgado0924 3 жыл бұрын
hi Tom can this Program work on the lathe for deep holes
@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 жыл бұрын
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
@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.
@israelmartinez2027
@israelmartinez2027 3 жыл бұрын
Can you please share
@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.
@ashutoshdwi
@ashutoshdwi 7 жыл бұрын
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 жыл бұрын
G91 Incremental Positioning
@sukumar4584
@sukumar4584 5 жыл бұрын
Plz make video in circular pocket25radius
@sukumar4584
@sukumar4584 5 жыл бұрын
Which software your using
@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
@Deepanshu0809
@Deepanshu0809 7 жыл бұрын
hello everyone! can anyone help me to learn macro programming for a turning operation? Thanks!
@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.
@corymirran
@corymirran 8 жыл бұрын
goodnight a question as it is called the simulator
@cibinmathew7075
@cibinmathew7075 3 жыл бұрын
Plz can you give me the formula for hemisphere I want to do in vmc machine
@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
@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.
@2024Felix
@2024Felix 8 жыл бұрын
what is the software's name ??? thx a lot
@kuei12
@kuei12 3 жыл бұрын
Erasing common variables 100-199 is a default parameter setting.
@garylake4285
@garylake4285 7 жыл бұрын
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!
@diegocampos4674
@diegocampos4674 7 жыл бұрын
improper code g. ??? help
@priyeshjadhav6709
@priyeshjadhav6709 Жыл бұрын
Plz micro square pocket rouch program plz sir
@Fizzy-Bubblech
@Fizzy-Bubblech 6 жыл бұрын
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.
@moldtron
@moldtron 3 жыл бұрын
Hi, very nice. I wish you to a taper pocket If can please help Thank you Sir Stay safe...
CIRCLE MILLING USING VARIABLES
2:58
Tom Stikkelman
Рет қаралды 49 М.
Playing hide and seek with my dog 🐶
00:25
Zach King
Рет қаралды 36 МЛН
Inside Out Babies (Inside Out Animation)
00:21
FASH
Рет қаралды 23 МЛН
Secret Art of MACRO PROGRAMMING on a CNC Machine | G-Code Genius
12:03
TITANS of CNC MACHINING
Рет қаралды 106 М.
CNC Macro Programming Tutorial: IF Statements
5:33
Practical Machinist
Рет қаралды 15 М.
Use M99 To Loop, Jump, and Return! - Haas Automation Tip of the Day
7:56
Haas Automation, Inc.
Рет қаралды 84 М.
Master Cam to Macro Outer Circle Diameter.
17:07
Easy Custom Macros
Рет қаралды 2,8 М.
CANNED CYCLES FOR DRILLING AND TAPPING FOR A CNC MILL
13:28
Tom Stikkelman
Рет қаралды 38 М.
Hand Programming with M98 and M97 sub programming routines
12:17
Helical milling on a CNC milling machine - CNC training course
8:23
While Loop Java Tutorial #37
8:51
Alex Lee
Рет қаралды 309 М.
CNC macro programming - Conditional statements
7:57
Practical Machinist
Рет қаралды 7 М.