PrintRite Uses TensorFlow To Avoid Printing Catastrophies

TensorFlow is a popular machine learning package, that among other things, is particularly adept at image recognition. If you want to use a webcam to monitor cats on your lawn or alert you to visitors, TensorFlow can help you achieve this with a bunch of pre-baked libraries. [Eric] took a different tack with PrintRite – using TensorFlow to monitor his 3D printer and warn him of prints gone bad – or worse.

The project relies on training TensorFlow to recognize images of 3D prints gone bad. If layers are separated, or the nozzle is covered in melted goo, it’s probably a good idea to stop the print. Worst case, your printer could begin smoking or catch fire – in that case, [Eric] has the system configured to shut the printer off using a TP-Link Wi-Fi enabled power socket.

Currently, the project exists as a plugin for OctoPrint and relies on two Raspberry Pis – a Zero to handle the camera, and a 3B+to handle OctoPrint and the TensorFlow software. It’s in an early stage of development and is likely not quite ready to replace human supervision. Still, this is a project that holds a lot of promise, and we’re eager to see further development in this area.

There’s a lot of development happening to improve the reliability of 3D printers – we’ve even seen a trick device for resuming failed prints.

14 thoughts on “PrintRite Uses TensorFlow To Avoid Printing Catastrophies

      1. Agreed, I’d be willing to bet this just isn’t going to work very well. Normally I wouldn’t wanna dunk on someone’s personal project, but this could end up being a safety hazard if you convince yourself it’s reliable.

        1. Additional layers of safety/protection can’t be bad right, I presume the guy is running a firmware without thermal protection in order to detect/test dangerous scenarios that he’s designing the system to ultimatelly avoid.

          Not a replacement for traditional thermal runaway protection, but an additional safety net.

          if a temp sensor comes dislodged, and remains in near proximity to the hot end, the feedback loop is still in effect, and false positives unlikely, but possible for traditional thermal runaway detection… if cheap 3D printers find themselves in every home in the next few decades, then these situations, unlikely as they are can and will happen. part of making 3D printing a plug and play, mass consulmer experience, is improving safety.

          also this research could be extended to saving prints, comparing the nozzle-camera to a preview generated from the same offset distance, a computer vision or machine learning system could identify a failing print and maybe compensate! again, contributing to the reliability of 3D printing as a reliable, repeatable, consumer friendly, experience.

          1. Yes, I’m aware of this and haven’t addressed it yet. The printer lacks hysteresis protection which can cause a thermal runaway if the thermister get decoupled from the heater, This is unlikely since the thermister is held in with a screw. They do this so the printer doesn’t shut down while heating up. This requires new firmware, which from what I’ve read introduces dimensional inaccuracy. Which is why I haven’t tackled it yet.
            The more glaring problem is the wiring to the heat bed, which can be fixed with a mosfet. I only heat the bed for the first few layers to minimize this, and I certainly would watch any print personally for that long anyway.
            PrintRite has “looking for smoke” in the future, but this will of course only be an additional safety feature. It’s not going to guarantee “no fire”.

            For that I think the solution is to build an enclosure for the printer, and maybe fill it with a CO2 atmosphere.

          2. @Eric Mockler – My understanding is that those printer fires we read about a while ago? The ones that were the result of the heater cartridges slipping out combined with unsafe firmware.. Those also had screws to hold the heater cartridge in. Didn’t they?

            My guess would be that all that thermal cycling that happens every time one uses the printer walks the screw out until it is loose enough to release the cartridge.

            Personally I miss the days when our “heater cartridges” were axial-lead resistors. There were so many reasons that those things were NOT coming out. They were glued in with muffler putty. Their leads extended out both sides, not just one so even if it did come loose it couldn’t go far. That wouldn’t really happen though because the leads were usually bent 90 degrees. Then the whole thing was usually wrapped in Kapton and/or silicone tape!

            I don’t understand why heater cartridges with axial leads are not a thing. It would be safer!

            Anyway.. recompiling your firmware to fix that problem is quick and easy. It’s much better to just pull that bandage now than gauze on burns later!

      2. This. A device that has to run for hours is prone to be left unattended at some point. It should not be (allowed to be) built in such a way so that it can catch fire just because of bad input data (like an unstable model that collapses), common electrical fault (heated bed thermostat failing) or some easily made user errors.

        (sorry accidentally clicked report on your comment)

  1. I am doing something similar.
    Its for my semester project in computer vision.
    But rather than hammering the problem with ML i am trying to do it more deterministic.
    The goal is that during print, take the G-code, render it to the actual layer that is being printed and compare it with the webcam image. And tell if its going OK or something bad has happened. I am not trying for it to be real time, doing this check just once per layer will make this much easyer for me and required computational power.

    Btw, if you have some long timelapses that failed on you with their respective G-codes i would appreciate if you consider sharing them with me for testing purposes.

      1. Sure, but dont get your hopes high. Its one thing to make it work on my setup but its complete another thing to make it work for different cameras, beds, lighting, .. and so on.
        Its too early now to share anything, just doing my research, collecting datasets ( timelapses with g-codes ) …
        But i will definitely publish it on github and maybe here on hackaday.io, if I fail or succeed.
        First working prototype should be done in ~5 weeks.

          1. Not much, since i am only now learning all this. Just something that can be said on most projects… don’t bite more than you can chew :) . Start easy (baby steps), so you dont get discouraged and overwhelmed and that even 10 minutes/day will eventually add up to complete project. And good luck :).

  2. Ain’t easier to fetch an 1 inch steel enclosure with ceramic insulators for power cables and seal it tight with the 3d printer inside. If it catches fire it cannot propagate outside and the thick wall and solid lid lock will prevent anything in flames to come outside of it. And being air tight will prevent extensive combustion of the printer. You can also pump out a big part of the air. It will allow the print to slowly cool if you add a fan inside and submerge the enclosure in water.
    Basically all you need is a submarine. Off you go now.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.