Looking for beta testers - Safety Printer

In the past few months i was developing my first project (first time with python, first octoprint plug-in, first time using git-hub, etc..) and now I think its time for the next phase: Beta tests.
I bought my first printer this year and I become afraid of leaving it unnantended during the night in some long printing works, so I had the idea of using a second microcontroller to shutdown the printer in case of problem (in fact it's the same concept that is used on the process industry where i work for). So I developed an Arduino firmware and hooked to an Arduino Nano: 1 smoke detector, 1 emergency button, 2 flame detectors (unreliable, not 100% sure about theses guys), 1 redundant hot end temperature sensor and 1 relay for the printer power supply. Next step was to create an Octoprint Plugin to monitor all sensor status (the hardest part for me).
Now i'm looking people to test it or help me develop this project.
The project is opensource and is hosted at: GitHub - SinisterRj/SafetyPrinter: This projects aims to improve the FDM 3d printers safety.
The tester must have some basic arduino skils (since he/she must compile the firmware) and some basic skills with electronics (to assembly your own board) and, of coarse, a FDM printer with Octoprint.
I started a small wiki on github with more information: Home · SinisterRj/SafetyPrinter Wiki · GitHub.
I really hope that you enjoy it and it helps to improve the FDM printers Safety.


This is something thats been on my list to do as well so will def look at setting up and testing soon :grinning: One thought that ocurred to me on the flame detection area was to see if a ML algorithm like spaghetti detective could be trained to look for this.

1 Like

It's definitely a good idea, but I have no experience with AI. I think that in this case we need a more powerful CPU and the complexity of system will increase a lot, that's something undesired for safety applications. But I'll think about it. Do you have any experience with ML?

I'm using an ESP with MQTT and also Raspian as MQTT member/and broker for savety implementations like powerdown heatbed, powerdown system, ... .

MQTT needs the ethernet infrastructure and, as you mentioned, another CPU as broker, so, IMO it adds many unecessary points of failure. Of corse its more elegant than a bulky arduino full of wires, but it is more reliable. But what kind of sensors do you use? What logic shuts down the printer?

In my case, the Pi itself is the broker and provides a dediceted AccessPoint while the HomeNet is connected via LAN. MQTT packages are routed to the AP. Senors are temperature Sensors and a "Soft Emergeny Stop".
The ESP controls the relais for the bed power and the source for the Powersupply.where the Pi and the ESP are connected to via step downs.
Further I created a shutdown.sh which send a messgage first before shutdown is called. I connected the Pi's PowerOff overlay pin to the ESP, so the ESP switches off the Supply after the Message is received and the Overlay changes its state.

Sounds similar to my Tasmota plugin approach, without the MQTT complexity (although I wrote a Tasmota MQTT plugin as well). I do also incorporate sensor data, but no actions based on sensor data, just thermal runaway from printer reported temperatures.

My thinking was more to have an ML as a discrete unit acting as another sensor to feed into the unit actually controlling shutdown - that way as you identify if the more comple unit doing the AI failed it would at worst trigger a shutdown when none was needed and at best simply send no input to the control unit. I’ve been working with ML in $dayjob for a couple of years - the biggest difficulty might well be finding sufficient relevant images to train it on. I’ve started to build a setup of your beta, and it looks from your sketch as though registering another sensor as outlined above would be straightforward,

1 Like

I don't have experience with MQTT but i think I understand you aproach. It works, but for a safety system it must be reliable aswell. If a high temperature happens in your printer's bed it will shut it down, but for it happens all of these equipment must be running (hardware and software): temperature sensor, Raspberry Pi, ESP, Printer PSU, 2 step downs, relay and ethernet router. It means that the probability of a failure of this safety system is the sum of the probabilities of each individual equipment, and seems a little bit fragile to me. It will be worse if any failure mode is what we call "dangerous undetected", that is a failure that happens in a way that it cannot bring the system to a safe position again (shuting down the bed heater as a example) and the user can't notice that. I don't know your system in detail, but what happens if the ESP set down converter failures? There is a alarm? The printer will stop or not?
This is why we always must try to keep the safety reladed systems as simpler as possible. :grinning_face_with_smiling_eyes:
In my project I tried to keep it simple. Just 1 arduino with sensors and 1 relay. The octoprint plugin is just for configuration and display purposes only. The safety function still works if you shutsdown octoprint.

You got the idea! If we can produce a ML fire sensor reliable it will be nice! But keep in mind that reliable for safety system not necessary means "no failures", it means that everytime we have an incident it triggers the alarm and also most failures triggers the alarm.
The idea is to use a regular webcam and train the AI do identify the flames right? It is possible to combine the image data with the data from another sensor (i.e. a infra red sensor)?

I enjoy the threat of danger as it keeps me on my toes. If I think everything it taken care of I will relax and bad things will happen anyways. It's like the people who think the tesla will drive for them so they need not pay attention. Well they are at fault for not understanding the system. Same concept though.

So disable your cars air bags and cut all the seat belts! LOL
Joke aside I got your point. This idea came when I need to print a 22 hours print. I think that nobody is able to take care of a machine for such a long time (not me at least). In other hand, at least now, the system is not finish and people need to develop their own safety printer, so nothing better to be aware of the risks than developing a system to avoid them.

1 Like

Good answer. I have a bit of an odd approach to beta testing. I think integrating some critical thinking into the setup process would do something towards making it sort of a feature. A test to see if the person understand what they are doing. As 3d printing grows to the masses. The are unexpected scenarios that will start to arise. Especially with the ability to download and print.

Now I don't know if I understand. What do you suggest? Give me an exemple.

This is something I've been meaning to do for a while, so I'll definitely check into putting it up and testing it out soon :grin: On the topic of flame detection, one idea that sprang to me was to investigate whether a machine learning algorithm like spaghetti detective might be trained to look for this.

1 Like

This was also proposed by @Blink and it's been considered. But i need help because I have no experience with ML. If you can yout help will be welcomed.

I need to get sign off from my boss that he’s happy for me to work on this in my own time - my contract requires his OK for anything that will be publicly released. Once I’ve got that I’ll start fleshing out my ideas on this area and d see what we can do

1 Like

I like the idea of a stand-alone safety device for 3D printing a lot. For now I have assembled the basic set-up (Nano, 2x flame sensor, temperature sensor). Emergency switch is still on the to-do list and the temperature sensor seems to require some recalibration. As a smoke sensor I plan to use a standard household smoke detector which I modified to provide an external HIGH signal if smoke is detected. However, smoke detector HIGH is 9V, which I expect to be unsuitable as a digital input for the Nano...
Although I have an engineering background, my experience with electronics is very limited, so it involves a lot of try-and-error on my side...

Unfortunately, I have not yet been able to make the OctoPi plugin work. No error message during install, but I could not "see" it in OctoPi plugin list. But again, that may be me not looking in the right places...

Generally, flame sensors and temperature probe (although still showing wrong temperatures...) seem to work and trigger the interlock!

Nice to hear that! I'm glad that you liked it!
Let's try to answer your questions:

  1. Temperature sensor calibration: I borrowed a Marlin thermistor table (thermistor_1.h), and you can change the table to better fit your thermistor (look for "temptable" on SafetyPrinter.ino). Check here: https://github.com/MarlinFirmware/Configurations/blob/2da68828301adcb74d0b52dda90fca1765962d51/config/default/Configuration.h on line 421 (Thermal Settings) for more information.

  2. Smoke sensor: it's always better to use a standard smoke detector (already tested and, sometimes certified) than cheap arduino modules, so you're right in your decision. But it is always preferable to use LOW signal to trigger an alarm, because you can detect sensor and cabling malfunction. So, if you can change this, it would be better. 9V is too high for an arduino and it will damage it. I'm not an electronics expert, but if you send me a sketch of what you're doing and sensors brand/model maybe I can help. The best sensor type is the "dry-contact" as it works as a simple switch, so you can use the arduino 5V on it. Consult your smoke detector manual to see if it is possible to use it in dry-contact mode, "normally open" (opens the switch with no power).

  3. Octoprint Plugin: If you installed but there is no "Safety Printer" on plug-in list, it means that an error has occured (probably a python one). I updated the plug-in (and firmware) today on github. Please download it again, flash the arduino and install it again. If the problem persists, please give me more information such as: the system that you are running it (Octopi, linux, windows), Octoprint version and the log files (octoprint.log and the new plugin_SafetyPrinter_console.log).

Thanks and good luck!

Thanks for the quick update!
Temperature sensor: Lightly assuming "one NTC 3950 is like the other" I purchased this sensor. How to figure out the right calibration file from the source code? There are 5 references to "3950" type sensors :thinking:

Smoke sensor: Agreed, NC sensors are safer with respect to cable faults.
A few months before I learned about your projects I got this sensor and modified it according to this source (sorry, German only). So the output is NO, unfortunately. While certainly adding complexity, shouldn't it be possible to invert the signal right at the sensor to achieve NC effect?

Flame detector: I am using KY-026 sensors, which are also NO, so the same problem to detect cable faults applies.

Octoprint Plugin: I will check later this week!