Hacker News new | ask | show | jobs
by serf 1294 days ago
please read and understand any third-party gcode before running it on any machine, anywhere.

While I understand the need for it in this case, there are a lot of good reasons why the slicer/cam suite is supposed to be intimately meshed with the machine and environment itself.

1 comments

Can you elaborate on this?
Not OP, but the firmware on the printer executing the G-Code assumes it is trusted and does not check it any further, apart from certain kinematic limits. With kinematic limits, I mean simply mean that the X/Y/Z position, velocity and acceleration is limited based on printer/user settings. These limits (especially the position limits) ensure that you can't slam the printhead into the physical limits of an axis with full force, which might cause damage on the mechanics.

However, there are a number of movements that could sneak past those kinematic limits and still cause significant damage.

For example, the Z lower limit is usually a few millimeters below the print bed since the bed position varies (due to bed leveling, thermal expansion during heating and so on). A malicious G-Code file could move the Z axis gradually lower, in small increments, but with high overall speed. The nozzle/printhead would then slam into the bed, generally causing damage.

A malicious G-Code file could also try to drag the nozzle across the print bed in patterns, gradually lowering the Z position so that it will certainly touch the bed at some point. Such a file has the potential of completely destroying a print surface.

Finally, nothing prevents a malicious G-Code file from first printing an object normally, just to finally lower the Z position and crash into the object with high speed. Such a movement would likely cause damage to the printhead and possibly other parts, depending on how well the printed part adheres to the print surface.

Those are a few possibilities that I just thought of. Luckily, for a 3D printer the damage is contained to the printer itself. But for other machines operating on G-Code the risk could be far more severe. For example, if a tool-changing CNC router (read: $$$) slammed a tool somewhere it shouldn't with full force, it would not only cause thousands in damage to the machine itself, but could also wreak havoc to its environment by catching fire or other outcomes I won't enumerate here.

G-code is mostly a list of instructions that tell the machine how to move. As result, it can tell the machine to move in ways that might damage the machine, like bonking into itself or pushing the nozzle into the bed or print. There are nice visualizer that will draw the toolpath so you can see it.

Not a huge deal in my opinion.