MACROS misbehaving #2847
Unanswered
matejprokop
asked this question in
Help
Replies: 2 comments 2 replies
-
Can you give a scenario that doesn't work and show us the error reported from the controller? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi Matej
Have you checked that coordination system is G53 or G54 or G5[x] the same during the "it works" and "it does stupid things". In your macros there is no reference to G5[x] set and this may change of you use other gcode in between.
Cheers
Maciej
Sent from Proton Mail Android
-------- Original Message --------On 01/08/2025 15:02, matejprokop wrote:
Hello, I've been playing with MACRO on CNC all day and I think I figured it out, but sometimes it works and sometimes it does completely stupid things. Please could someone take a look at the coding and maybe they'll find some stupidity right away
Quick description >
The reason for the code is that I wanted to make fixed positions for milling the sides and front of the glasses. I only have two sizes of stock material and two different positions for milling (pos01 and pos02)
CNC.schematic.02.jpeg (view on web)
I often change tools in both positions and that's why I have Macro to measure tool length.
I use GRBL and the macros are programmed in UGS.Small table cnc with basic NEMA 17 motors (no encoder or close loop)
Problems >
It often happens to me that when I activate a macro, the machine goes to a completely different position than it should. It works without any problems if I use the macro right after Homing , but if I use more than 3 or 4 macros it starts doing strange things.
Very often we all break down Macro 03, and I have no idea why. For example Macro 02 or 05 always throws an error when it starts to find the probe (it doesn't even get to the part of the code where it should go slowly to measure tool length)
An example of trouble-free operation - Cutting and engraving
HOME machine
Macro 04 - XY settings
Macro 05 - Z settings with probe
Clamping material
Macro 06 - move to X0Y0 Z6
Manual jogging to the exact position and press X0 Y0
Load Code and start milling
End Milling
Manual jogging Z+50
Manual tool change
Macro 05 - Z settings with probe
Load new code and start code.
MACROS >
POSITION 01 - FRONT MILLING
MACRO 01 - SET X0Y0
G30;G91 X105 Y-63 Z-40;G38.2;G92 X0 Y0;G0 Z20;G21;G91;G90;M30
MACRO 02 - SET Z0 (Also tool change)
G30;G91 Z-40 F600;G38.2 Z-25 F100;G92 Z-6.2;G0 Z20F500;G21;G91;G90;M30
MACRO 03 - MATERIAL LOAD / UNLOAD
G0 Z25 f500; G30 F600; G91 X102 F600;
POSITION 02 - TEMPLE MILLING
MACRO 04- SET X0Y0
G30;G91 X11 Y-63 Z-30;G38.2;G92 X0 Y0;G0 Z10;G21;G91;G90;M30
MACRO 05 - SET Z0 (Also tool change)
G30;G91 Z-40 F500;G38.2 Z-25 F100;G0 Z5 F200;G38.2 Z-10 F50;G92 Z-4.0;G0 Z20 F500;G21;G91;G90;M30
MACRO 06 - FINE TUNE
G90 z30 F500; G90 X0 Y0 F500;G90 Z6 F300;
Thanks a lot for any feedback
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
[
{
***@***.***": "http://schema.org",
***@***.***": "EmailMessage",
"potentialAction": {
***@***.***": "ViewAction",
"target": "#2847",
"url": "#2847",
"name": "View Discussion"
},
"description": "View this Discussion on GitHub",
"publisher": {
***@***.***": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I've been playing with MACRO on CNC all day and I think I figured it out, but sometimes it works and sometimes it does completely stupid things. Please could someone take a look at the coding and maybe they'll find some stupidity right away
Quick description >

The reason for the code is that I wanted to make fixed positions for milling the sides and front of the glasses. I only have two sizes of stock material and two different positions for milling (pos01 and pos02)
I often change tools in both positions and that's why I have Macro to measure tool length.
I use GRBL and the macros are programmed in UGS.Small table cnc with basic NEMA 17 motors (no encoder or close loop)
Problems >
It often happens to me that when I activate a macro, the machine goes to a completely different position than it should. It works without any problems if I use the macro right after Homing , but if I use more than 3 or 4 macros it starts doing strange things.
Very often we all break down Macro 03, and I have no idea why. For example Macro 02 or 05 always throws an error when it starts to find the probe (it doesn't even get to the part of the code where it should go slowly to measure tool length)
An example of trouble-free operation - Cutting and engraving
MACROS >
POSITION 01 - FRONT MILLING
MACRO 01 - SET X0Y0
G30;G91 X105 Y-63 Z-40;G38.2;G92 X0 Y0;G0 Z20;G21;G91;G90;M30
MACRO 02 - SET Z0 (Also tool change)
G30;G91 Z-40 F600;G38.2 Z-25 F100;G92 Z-6.2;G0 Z20F500;G21;G91;G90;M30
MACRO 03 - MATERIAL LOAD / UNLOAD
G0 Z25 f500; G30 F600; G91 X102 F600;
POSITION 02 - TEMPLE MILLING
MACRO 04- SET X0Y0
G30;G91 X11 Y-63 Z-30;G38.2;G92 X0 Y0;G0 Z10;G21;G91;G90;M30
MACRO 05 - SET Z0 (Also tool change)
G30;G91 Z-40 F500;G38.2 Z-25 F100;G0 Z5 F200;G38.2 Z-10 F50;G92 Z-4.0;G0 Z20 F500;G21;G91;G90;M30
MACRO 06 - FINE TUNE
G90 z30 F500; G90 X0 Y0 F500;G90 Z6 F300;
Thanks a lot for any feedback
Beta Was this translation helpful? Give feedback.
All reactions