The solution to all of the ATX power supply integration issues. Fully supported by Octoprint. This board will make the process of using an ATX power supply on your 3d printer a lot simpler.
Overview – the long process to get here
It has been a long process. Working with a lot of very smart people, all of which I will list at the end, we have been able to come out with a solution to a constant problem in the space. Power management. I started down this path in the early summer 2017. The original idea came from the continual posting on how to use a ATX power supply on a RepRap based 12v 3d printer. I cannot tell you the amount of posts that ask about this. Over the course of several weeks, I did some research, some trial, and some testing and came up with, what I thought at the time, was a pretty good solution to the problem. I built a few prototypes, tested, and posted the idea out on the Facebook groups. The little board interfaced with Octoprint and the PSUControl plugin from Shawn Bruce. It worked really well. I was overwhelmed with folks wanting to participate. In the end the beta was a totally bust. Both testers involved either blew up their printer or was not willing to make the attempt. The process to make it work was very complicated, and could be daunting for someone with very little electronics experience. Very disappointing. As a side note, I am still using the original to control my printer and it works without any fuss.
In late October 2017, Steve contacted me about this project and he suggested some changes that would make the idea a much more viable product. After many discussions and ideas, we came back with the ATXPiHat 1.0. I will make everyone understand the version number, it is important. Here are the features for the 1.0 board;
- Open source, based on Creative Commons Attribution-ShareAlike 4.0 International License, everything is being released.
- Fully compatible with Octoprint 1.3.6 or greater.
- Directly power the Raspberry Pi 3B, no more external power source.
- ATX 24 Molex connector, no more cutting up the supply cables
- Amperage support to handle 19 amps at 12v for heat bed and hot end
- Screw connectors make easy connection to the main board, External Mosfet, etc
- Direct 12v RGB LED support, can also be controlled by GCODE
- Emergency power off (EPO)
- Power On/Off monitoring
- Visual indicator of the 12v supply being active and powering the external devices
- 12v monitored (RPM) cooling fan port
- Upon fan failure it can be configured to automatically shuts the printer down
- Auxiliary 5v support for external powered items
- Monitoring of the 12v rail, for amperage and voltage
- Automatic shutdown when an amperage threshold is reached. Meltdown protection
- Switchable 12 or 5 v connector for controlling external items via GCODE
- Power On monitoring
- Octoprint ready, Initial plugin is available as of this note, not all features are complete
- Plugin is available via the Plugin repository
- Integrates heavily with the connection manager
- EPO gracefully shuts down the printer and refreshes the connections.
- Integrated LED and switch support
Steve sent me the first prototypes in December and started the work on the plug in for Octoprint. I have been working with software and hardware for 30+ years, however python is new for me. Lots of questions back and forth with Gina and Shawn, on January 25th,2018 the 1.0.0 plug in was released. As of the writing on this entry, the software is not finished. The GCODE parsing is not complete, amperage and voltage calculations are still not right, amperage overload protection is not available, and I am not finished with what I would consider to be the most important feature. Calculating the power costs of a print. As long at the printer is fully powered via the ATXPiHat, using the amperage measurement, we can calculate the cost of the power. Everyone talks about the cost of the print based on supplies and time. I have never seen anyone add in the cost of the power. Until we started working on the project, I never considered this. However, the plugin is good enough to be used with the board. I am using it today on my printer (Anet A8), and I am not sure how I could ever live without it.
Here is the standard disclaimer – you must understand and agree to this!
Understand this, this board has not been tested by an independent lab such as UL, or anyone else. You use it at your own risk. Each board is shipped tested and should work properly out of the box. They are designed to work with a Raspberry Pi 3b and Zero. However, all the work has been done on Pi 3b’s. I will work hard with the user to make sure that everything is good, however like anything in the RepRap space, you are responsible if you burn you house down. Never, and I mean never, use this board and or your printer unsupervised. I will not be held accountable for anything that happens while using this board. Again, use it at your own risk.
Getting into the details
There are few different software libraries involved with putting this together. Some of which require installation prior to installing the plug in. This in not installation instructions, these are coming separately, however I wanted to talk about the choices that we made on the hardware and software.
The single 24 pin Molex connector. This is what makes the serious difference. Plug and play. No cutting, understanding what color, etc. Plug the ATXPiHat into the PI, ATX supply into the ATXPiHat, and power up up the ATX supply.
For the ADC we use the MCP3422 chip, this is a low-cost chip that albeit on the slower side, was chosen for of the footprint and cost. This is used for the voltage and amperage sampling. It is one of the most critical pieces of the board. The PI controls it by the built in I2C interface on address 0x68. The boards plugin is specifically designed for control and monitoring of this chip.
The EPO port was critical, I cannot tell you how many times I have had problems with the hot end smashing into the heat bed and having to reach over and kill the power to the printer. This can cause all sorts of havoc with a PI if you must hard shut down the ATX power supply directly. This will shut down the external power source and keep the PI running.
The fan port is needed to cool the board and the PI under very long usage at high amperage. The board itself under serious load can generate temperatures of 60c (140f). The fan is not required, however it made sense to us to have it is as option. We also wanted to make sure that if the user elected to cool the board externally, that if the fan failed it would shut the whole thing down and stop a possible meltdown and/or fire.
These are the thermal pictures while the board is under load.
The LED strip support is there, because why not.
The 5/12 volt switch is here for several reasons. First is can be controlled via PWM (dimmable) or on/off. This is a fantastic feature for hot end lighting. One of the major features of the Octoprint is remote control and camera support. However, without lighting, it is impossible to see what is going on under the print head. There are all sorts of Thingiverse files for adding LEDS to the head for just this reason.
I cannot tell you how many sketchy setups I have seen out in the community to support connecting ATX supplies to these printers. Some of the boards out of China are not rated for this sort of amperage draw.
This is the ATXPiHat, fully loaded; EPO, LED strip, Monitored Fan, 12v PWM switched Light, connected and running my Anet A8 and being controlled from Octoprint.
I did not use the standard RPi.GPIO for monitoring and controlling the board. Standard PI’s cannot handle true PWM monitoring due to their lack of real time operating system, like an Arduino. There is a library that gets you close, pigpio from Joan at abyz.me.uk. This application provides the PI with real time PWM monitoring and very good switch de-bounce support. Albeit works well on the PI, Octoprint cannot install it using PIP; it must be installed ahead of time using an installation script. We use the RPi.GPIO library for figuring out what version of the PI is present, but for nothing else.
Out of the box, Raspbian does not have the I2C interface on by default. It has to be enabled. Additionally, smbus support is needed to drive the ADC chip. It is available via PIP, however due to the serious lack of documentation in the standard smbus and smbus-cffi libraries, I chose to go with the smbus2 library from Karl-Petter Lindegaard.
The initial plugin was designed with the MCP34xx driver from Steve Marple. This was a short cut and I am working on a more direct solution and as the board evolves over time, and this is where the version comes into play, you will be able to select the board version and get the correct I2C support.
The Octoprint plugin is based on several already available plugins for Octoprint. However, when discussing this, we felt that trying to provide a turnkey system for doing this, as well as providing a more visual control solution would make the implementation go more smoothly. The ADC is not supported by any plugin that we could find. If you have a favorite plugin that you would like to use for a feature in the board, you are able to shut off most of the features.
The fine print
The EPO is powered by the 12v supply, meaning that the switch does not have any power supplied to it during power off. To sense the state of the EPO, the unit will power up quickly and check the EPO state. It needs to be wired correctly to a REAL EPO switch, on the red side.
If there is an LED strip installed and the print bed is using PID to control the heat, the LED’s will dim slightly during this process. Marlin out of the box, should have this set to BANG-BANG, so the dimming is much less noticeable. We are working on a few different solutions to this problem in the long term.
If the power to the printer is off, but the ATX supply is on, it is likely that you will see a small voltage and amperage reading. Unknown to me, and with some testing, the 12v rail leaks voltage in a non-powered state while the supply is on. We have tested several different supplies, even the gold rated ones and they all have the issue.
After all the work, Steve sent me the first set of production boards this past week. I am selling boards in this lot at $65 US each. I promise the price will come down over time as demand grows. Shipping is separate. I am making close to nothing for these. With the effort to bring this to the market, with all of the hardware and software development, there is no margin for this first batch. There are other products that do essentially one thing and charge $60-$70. Please no flaming, I am not picking on Tim, I am just trying to make sure that everyone understands the amount of effort went into curbing costs of this product. What good is a product if no one sees the value or is willing to spend it.
Each package comes with;
- The ATXPiHat 1.0 board
- 1 – 2 pin JST connector for the EPO port
- 1 – 4 pin JST connector for the LED port
- 1 – 4 pin Molex connector for an PCIe cable for the ATX supply. (Note, the color coding on these are not correct. In future batches I will get the right ones).
Shipping must be separate. I am located in the US, and I am working on trying to get a store, or something, inside the UK/EU to handle these for that area of of the world. I want to make these available for the same price with cheaper shipping cost for the UK and EU. In the meantime I will ship overseas, however I have not done a lot of this and not sure how it is going to go.
Here are the Amazon affiliate links to hardware that can be used and has been tested with the ATXPiHat;
I am hoping that if we get enough interest, we will purchase in bulk and create complete kits for everything that you need. For now, we want to gauge the market.
If you are interested in purchasing one of these, please contact me to start the process. I should have these up on my ebay site soon as well as the installation instructions complete.
For some of the plastics that were created to support this project, please go to Thingiverse for all of the designs. I also provided all off the Solidworks files as well. There are more items coming. I have been really focused on the software and need to design a top for the mount to hold the fan.
The detailed installation instructions are coming soon.
I want to send a special thanks for Gina for all of her help and putting up with all of my questions. I wish you all of the luck with your product and I hope that we can continue to contribute.
Please note, customizing 3d printers, custom electronics, etc are done at your own risk. This is provided as an approach to solving a problem. I am not responsible for any issues that a user runs into during the use of this equipment.
Reference Material and Attribution
If I left anyone out, please let me know and I will update this article.
- Steve Smith – https://www.facebook.com/Xygax
- OctoPrint – Gina Häußge – https://foosel.net/
- PSUControl – Shawn Bruce – https://github.com/kantlivelong/
- mcp342x – Steve Marple – https://github.com/stevemarple/python-MCP342x
- LEDStripControl – https://github.com/google/OctoPrint-LEDStripControl
- Smbus2 – Karl-Petter Lindegaard – https://github.com/kplindegaard
- Power Supply Stand https://www.thingiverse.com/thing:2222342