Shorten Your G-Code Using a WHILE Loop! | CNC Macro Programming Tutorial

preview_player
Показать описание
@GCodeTutor demonstrates how to remove a large amount of material writing only 9 lines of G-code.

As we saw in other videos in this series of CNC programming tutorials, Macro B variables are a great way to simplify your G-code programs and make them easier to read and modify.
In this video, Marc Cronin shows how to write a Macro program using a WHILE loop.

Stay tuned for more machining videos!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Recommended CNC programming books:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Practical Machinist is the largest and most engaged metalworking community across the web. With more than 160,000 registered members and 300,000+ social media followers, Practical Machinist is the easiest way to learn new techniques, get answers quickly, and discuss common challenges with your peers. Visit Practical Machinist today to join the community and start connecting with your peers.

#Gcode #CNCprogramming #macroprogramming
Рекомендации по теме
Комментарии
Автор

I usually use go-to subs for that sort of thing with G91 moves, but this technique seems like it is a good tool to have in the box of tools to use. I've heard some folks get wound up about mixing G90 & G91 but the fella that taught me G-code basics 30 years ago used both routinely without thinking much about it.

faradynemotors
Автор

You guys are like free school. Thanks for all the info

lcmac
Автор

These examples are very helpfull indeed, thank you!

iliandimitrov
Автор

I kept having a 1 in 100 intermittent tool change issue where the machine would throw tools randomly against the walls, fixture, parts, etc. Maintenance wouldn't believe me--they'd watch it do ten tool changes and walk away. So then the machine would throw a drill randomly, nobody would notice, then try to bore a non existent hole, and have a cascading effect of tool destruction and scrap material. I eventually wrote a while loop that would do a continuous (user specified) loop of tool changes to prove I wasn't crazy. Well it worked, but it blew the thermal breaker on the ATC system almost immediately and I just about shit myself thinking I destroyed the machine. Lucky it just took a hard reset and was fine. I added a G04 dwell between tool changes before I showed off my fancy macro to anyone. Be careful, and always test your code with a variety of inputs.

somethingelse
Автор

Muito shoy este tutorial de repetição do Parabéns!👏👍

---MarcosVanzuita---
Автор

Is this kind of stuff even needed with modern CAM software?

shaunybonny
Автор

Why do you count down? Isn’t there a “less than” or “less than or equal” ann increment to that?

KoenBrader
Автор

I wonder why the programming language enigneers didn't use "<=" for GT or "=>" for "LT" like in other programming languages.

Bagginsess