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

  Рет қаралды 19,856

Practical Machinist

Practical Machinist

Күн бұрын

Пікірлер: 9
@lcmac4765
@lcmac4765 3 жыл бұрын
You guys are like free school. Thanks for all the info
@faradynemotors9147
@faradynemotors9147 2 жыл бұрын
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.
@---MarcosVanzuita---
@---MarcosVanzuita--- Жыл бұрын
Muito shoy este tutorial de repetição do WHILE...... Parabéns!👏👍
@iliandimitrov4857
@iliandimitrov4857 6 ай бұрын
These examples are very helpfull indeed, thank you!
@somethingelse4424
@somethingelse4424 Жыл бұрын
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.
@KoenBrader
@KoenBrader 3 жыл бұрын
Why do you count down? Isn’t there a “less than” or “less than or equal” ann increment to that?
@rfigueroa93rf
@rfigueroa93rf 3 жыл бұрын
You can write which ever which way you’d like to orient your positives and negatives. But using absolute positioning, and with your Y0 at the top left, it makes more sense to leave it moving DOWN by 10. Hence the minus. In summary, it’s best if you choose a system and stick to it. Up and right= positive, down and left= negative.
@Bagginsess
@Bagginsess 3 жыл бұрын
I wonder why the programming language enigneers didn't use "" for "LT" like in other programming languages.
@somethingelse4424
@somethingelse4424 Жыл бұрын
That would make way more sense to me too. The most reasonable answer I can come up with is that the < and > symbols don't exist on fanuc controllers pre-macro era. However the brackets [ ] also didn't have a pre-macro language use... So that kind of torpedoes my theory that all the characters making up LT GT GE EQ all had existing uses prior to "complex" macro logic. Having had a little C++ and VB experience before getting into GCODE, that also frustrates me. Maybe brackets were the bare minimum addition to the keypad to enable higher logic, as parenthesis would be interpreted as comments. They could get by with using E Q L T G without adding keys and losing backwards compatibility.
CNC Macro Programming Tutorial: IF Statements
5:33
Practical Machinist
Рет қаралды 17 М.
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 23 МЛН
WHILE DO LOOP IN A CNC MILL PROGRAM
10:27
Tom Stikkelman
Рет қаралды 68 М.
Secret Art of MACRO PROGRAMMING on a CNC Machine | G-Code Genius
12:03
TITANS of CNC MACHINING
Рет қаралды 115 М.
Haas Control Training Video
29:41
G Code Programmer
Рет қаралды 71 М.
Unlimited Part Sizes With This Genius Macro Program
11:11
TITANS of CNC MACHINING
Рет қаралды 58 М.
Programming CNC Macros - Part 2
19:40
CamInstructor
Рет қаралды 27 М.
Basic Movements with G-Code
8:32
Practical Machinist
Рет қаралды 68 М.
Cnc Custom Macro Variables.
17:57
Easy Custom Macros
Рет қаралды 1 М.