Included Angle Z plunge - Bad failure mode RC4

I failed to set an included angle for my chamfer mill (V-bit). It generated some g-code that had a very bad failure mode. The tool path generated sent it to Z- which would have been catastrophic. I wasn’t running anything (just checking the generated g-code, so maybe it would have not sent it to the machine.
Here is the generated g-code:

;MillMage 0.8.00-RC-4 @ 08d0b7c Qt6.5.7
;Custom GCode device profile, absolute coords
;Bounds: X9.5394 Y1 to X9.5394 Y1
;Project Units: Inch
;Safe Retract = 1.25
;Stock Thickness: 0.3937
;Z Zero: Bottom
;G54 origin is at the Bottom Left
G00 G17 G40 G20;Restore imperial mode
G54
G90;Restore absolute mode
G0 Z1.6437
G90;Restore absolute mode
;Chamfer Profile @ 50 in/min, 18000 RPMs

M5
T0.0787
M3 S18000
G0 Z1.6437
G0 X9.5394Y1Z1.6437
G1 Z-2147483648.F25
G0 Z1.6437
M9
M5
G90;Restore absolute mode
M2

It gave me a few weird error dialogs, but the one that made me check the tool definition was something about having zero tool length. Made sense once I saw the included angle was 0. Perhaps a more appropriate default, like 90.

Can you provide us with your .mage file?

V-Bit Crash.mage (10.8 KB)
Step 1 - Tool 1 2FL CH.gc (504 Bytes)

Here is a representative .mage file and the output .gc

Granted, this creates an error message and asks if you want to continue, but when you do it generates a tool path that will crash any machine that doesn’t have soft limits enabled.

James

After creating that file I tried to Preview and it froze MailMage. I had to Force Quit the app. Once I fixed the included angle on the chamfer mill, it previewed without issue.

Has this been resolved? I’m trying to find a simple but complete solution for our students to generate Toolpaths for our XCarve. If MillMage still generates improper g-code that will crash the machine, it is pretty much a non-starter.

The tool that is defined for the chamfer op has 0 set for included angle.

Which produces the spurious gcode.

If you change this to say, 30 degrees, the code previews beautifully.

To edit this, go to CNC Tools > Tool Library > Select the tool, then click the Edit pencil, and enter an included angle on the tool.

This should be a warning when generating the GCode, I would think, so I’ll poke into that detail, but if you’re getting a bad or no preview, check that your tools are defined fully in the Tool Library.

I understand why it happened. I posted that earlier. CAM software should never generate invalid g-code. It should have errored out and not produced any toolpath for the invalid tool. The fact that it chose -MAXINT shows that it recognized an error, but failed to abort out completely.

It has been - an included angle of less than 1 is now an error, and if the calculated depth exceeds the project depth, you get a warning with an option to stop:

Having said that, any cnc package could generate tool paths that could crash the machine. If I set up my project settings to use a 15mm material, and then use that project on 1/8" plywood, it’s going to go straight through the material into the bed, and there’s no way we could detect that.

We’ll obviously do what we can to prevent things from going wrong based on the settings we’ve been given, and will warn when a path will cut through your material, but sometimes that’s intended (drill operations, for example, usually need to cut slightly through).