3D Printing Defect Detection

Discussion in 'Motion System' started by Amr, Sep 18, 2019.

  1. Amr

    Amr Well-Known Member

    Joined:
    Jun 2, 2019
    Messages:
    130
    Likes Received:
    31
    Hi All
    There is a lot in my mind that I want to share but I will try to keep the first post brief to get as many people to read as possible. I will elaborate on my thoughts and progress in future posts hopefully not far apart.

    I once mentioned briefly that I was intending on making some sort of detection mechanism for printing artifacts, I had a few hurdles to pass before I was able to get things started, the first one was a way to take Images synchronously with layer changes with out having to rely on OctoPrint (I have no gripe with Octoprint I just wanted the solution to not have many parts.I am sure once this is done some one will create a plugin for octoprint) So my solution for Image capture was a script that communicates with Duet through telnet, and a small gcode on layer changes to issue the capture command. At first I was ruining the script on a Linux Virtual machine, and the camera was an esp32-cam module fixed on the printer I since moved away from that for the same reason less parts, so currently the script and the camera are running on a pi zero w.

    Next Hurdle was the data to train the AI for detection of printing defects, I don't have many of that and I am hoping the community comes to my help here by sharing pictures of failed and successful prints on the printer bed I could not figure out a way to have those images collected in an easy manner so far (If you have ideas please do share them, file sharing websites are not ideal as the mechanism those websites deploy prohibits public uploads for security reasons. Thought of GitHub but it is not the most user friendly interface out there).

    So I Generated a fake data-set to test out the feasibility of the idea and it is going great so far but that brings me to the next hurdle. The hardware to implement this AI on, the Pi Zero W is not the fastest and to be honest it barley functions as a WiFi camera, So my next step is to try this on an Nvidia Jetson nano, Ordered the SBC and waiting for it to arrive.

    So if you want to help please share your feed back questions and comments and your 3d printing pictures of course.
     
  2. Ian Porteous

    Ian Porteous Member

    Joined:
    Oct 5, 2018
    Messages:
    2
    Likes Received:
    1
    With your system, do you want to detect if the print doesn't match the model, or just that something went wrong? If you want to detect whether something went wrong, there is a related project https://www.thespaghettidetective.com/
     
  3. Amr

    Amr Well-Known Member

    Joined:
    Jun 2, 2019
    Messages:
    130
    Likes Received:
    31
    My Aim is to be able to detect as many types of failures as possible and to keep it on an SBC Granted PI is out of the question, but the jetson Nano if works is still just a 100$. Thespaghettidetective is only detecting "Spaghetti" prints and needs a real computer if you are going to run it locally or for fees if you are going to use the cloud service they are offering
     
  4. Ian Porteous

    Ian Porteous Member

    Joined:
    Oct 5, 2018
    Messages:
    2
    Likes Received:
    1
    It sounds like a fun project. I help run a makerspace and we've talked about working on the problem. But I guess it has never been high enough on the list of priorities. You probably already know all of this, but getting enough training samples that's diverse enough so that the NN learns enough to identify problems in general and not specifically for the type of photos in the training set will be difficult. You will probably want to split the training / test / validation by the source of the images. That way the test / validation set will have plenty of lighting, printer, filament combinations that were not in the training set.

    In any case good luck. It would be great to have a robust detector.
     
    Amr likes this.
  5. Amr

    Amr Well-Known Member

    Joined:
    Jun 2, 2019
    Messages:
    130
    Likes Received:
    31
    yup, thst is why I am asking the community to help with sharing there images with no restrictions on size, angle, lighting, etc no restrictions what so ever, any picture is a good picture.
     
  6. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    483
    Likes Received:
    213
    FWIW, Duet 3 is designed to use a RPi or other SBC for networking, storage and HMI, and a user already has It working with a Jetson Nano.
     
  7. Joe Pomo

    Joe Pomo Well-Known Member

    Joined:
    Sep 21, 2019
    Messages:
    107
    Likes Received:
    41
  8. Amr

    Amr Well-Known Member

    Joined:
    Jun 2, 2019
    Messages:
    130
    Likes Received:
    31
    I am following the thread on the duet forum, I am unfortunately was unable to get a Duet3 it was out of stock, while it is a tempting upgrade, the idea behind this effort is to make detection of printing errors easy and accessible to the masses, that is why I started with a pi. I have been working with ML/DL solutions for quite some time, and I know I can run this model on any of the servers I have at the office but this will not make this solution accessible as the cheapest server/computer for that mater that can comfortably run DL Inferences is going to be a few hundred if not thousand $$$. I went for the Jetson Nano for the price(99$) (PS: I still don't know if this will work or not, with tensorrt and all the hype around it my hopes are up), I have a few Jetson TX2 that I use to demos for my clients when showing Edge inference but again the price for those is in the Thousands so not a good choice to what I am trying to achieve. I am sure I will at some point try the new duet3 for my own but the premium on that would still limit the reach of my solution so I am not limiting the solution to it. Any 3D printer with any firmware/Controller Board is my target, I started with the duet for two reasons I have one that is on a platform that will accelerate the process (The ToolChanger). and it is the easiest to integrate with. once I get a working model I will start working on adding more boards and firmware to it if no one else gets to the punch line before me (Open Source and all).

    Thanks Joe I am sure this will come handy If I put my hands on a duet3 :)
     
  9. Joe Pomo

    Joe Pomo Well-Known Member

    Joined:
    Sep 21, 2019
    Messages:
    107
    Likes Received:
    41
    @Amr If a problem is detected on a print, what sort of actions would the printer take?

    Thanks!
     
  10. Amr

    Amr Well-Known Member

    Joined:
    Jun 2, 2019
    Messages:
    130
    Likes Received:
    31
    Currently I think it will be an alert on screen(DWC for now octoprint and maybe marlin in the future) or telegram or any other useful alerting mechanism and the user decides the action, and those decision are going to be fed back to the model with the image for further training, when we get a consistent and reliable system then we can add the feature to either pause or stop print
     

Share This Page