The other day, a discussion thread on the Voron discord about hooking up fans to the Klipper Expander board caused me to dig up some schematics and do some research.
Spoiler alert: There’s a good reason why you want to run your fans through the fan ports, not the heater parts. Also, you probably want to add a diode to your Klipper Expander. And, finally, hot plugging parts is hard and ports on your motherboard are not up to it!
Inductive and resistive loads.
First, the science.
Your printer motherboard and klipper expander boards use little parts called MOSFETs to switch power on and off. MOSFETs are great little things, they can switch on and off very quickly and they let the electricity flow with very little resistance. And a giant swath of modern electrical devices use tons of MOSFETs these days, plus your computer’s CPU uses a ton of tiny little MOSFETs to compute.
They are somewhat fragile devices, however. There’s a bunch of electrical requirements that must be obeyed. They definitely don’t like little voltage spikes. Voltage spikes tend to wear down the internal structure of the device. In the schematic diagram, the metal layer looks thick, but it’s real easy to punch through it.
Heaters and LEDs are resistive loads, meaning that they are more or less equivalent to resistors. In general they do not create any voltage spikes when you turn them on and off.
Motors and fans, however, are inductive loads. See, there’s a category of devices called inductors and one thing that inductors can do is store a burst of power and release it. This is how switching power supplies work, another very popular sort of thing that revolutionized electronics. And they are remarkably simple, they are just a little coil of wire… however, your motor also has a coil of wire and while that coil of wire mostly causes the armature to spin and the motor to turn… it can work as an inductor as well. Which means that whenever you turn on and off a motor, it’s going to create a voltage spike.
It’s not hard to prevent this.
Up above is the schematic for a standard heater or fan port on a 3D printer motherboard. To the left is the heater version, where the resistor represents resistive loads like a heater or a LED strip. To the right is the fan version. See the extra diode there? That’s the snubber diode that routes the power spike away from the MOSFET.
Also, not having a snubber diode won’t kill your MOSFET instantly. It’ll do it over the long term.
Heater ports vs Fan ports
There was some conversations going on because one of the people involved in one of the filter projects had managed to zap his fan port and started recommending that you use a heater port instead.
What’s the difference between a heater port and a fan port? Well, a heater port generally is going to want to handle quite a few amps of power, so it’s going to need a beefy MOSFET with a heatsink and it doesn’t necessarily need a diode.
Meanwhile, a fan port needs a lot less power, so you can get away with a much smaller MOSFET but it definitely needs a diode.
Four pin fans
At some point along the way, PC fans went from two pins to four. The third pin was a tachometer, to monitor the fan. But eventually a fourth pin was added, where the fourth pin is a PWM port. Basically, this moves the MOSFET and snubber diode to be inside of the fan.
This makes life a heck of a lot easier for motherboard designers.
Spot checking a few boards
I spot checked a few boards.
The SKR Pico is the motherboard for my Zero. The SKR Pico had a DSS14 snubber diode on the fan ports and nothing on the heater ports, which means that if you were to use a heater port, you’d fry it.
The Klipper Expander is also on my zero. None of the MOSFETs have a snubber diode.
Conversely, checked the Manta M8P V1.1 schematic and found something interesting. For that board, the the heater ports do have snubber diodes, as do the fan ports. On the other hand, the fan ports have individual fuses, so to some degree, they are actually better protected.
A zapped fan port mystery
I went back and forth with the folks behind The Filter because they had a case where the hot-plug connector on The Filter seems to have zapped a fan port, at which point they recommended that you use the heater port instead.
Here’s what I think happened…
Hot-plug connectors are special. If you are going to make a hot-plug connector, you need to ensure that the ground will always get connected first and you also need to make sure that it is physically impossible to short power to ground.
There’s two kinds of MOSFETs, n-channel and p-channel. An n-channel MOSFET is going to sit between the minus terminal and ground, whereas a p-channel is going to sit between the plus terminal and ground. Because the n-channel MOSFETs are overall more efficient and don’t care what voltage the devices are at, the n-channel MOSFETs are the standard.
This also means that the minus terminal isn’t actually ground anymore. As far as the fan is concerned, it’s ground relative to the plus terminal, but it’s not.
The connector they were using has a ring on the outside, which was connected up to the minus terminal. As I said, that’s not actually ground. Furthermore, the MOSFET has what’s called a “Body diode” that lets current flow in one direction, basically the opposite direction. Which means that if the “ground” gets in contact with actual ground, you have a short-circuit flowing to ground.
A heater MOSFET is designed to handle a lot of power, so it can probably handle the pulse and presumably the power supply will shut off power. A fan MOSFET probably can’t handle the burst of power and so it’s going to fry. I’m assuming that’s where things went wrong.
Either way, the advice kinda works. At least some designs have snubber diodes on the heater port… and, as I said earlier, this is a progressive-damage situation regardless. And the beefier MOSFET is more likely to be able to withstand all of that power floating around, which is why it mostly worked.
If you want to do things right… well…
The SKR Manta M8P and potentially some others have individual fuses on the fan ports and that should make it harder for the MOSFET to get zapped… except that sometimes the fuse doesn’t fail fast enough to save you.
The best way is probably a four-wire fan where the connector is designed to connect the ground wire first, either because it’s got one pin that’s a smidgen longer or a shell.
You can probably switch to a terminal with just pogo pins and no shell, since there is no ground, but that’s not necessarily optimum.
You can design your motherboard with some high-side switches. This could be nice because you could, for example, use a high-side port to power down the toolhead or display entirely. Or otherwise design a board specifically to make hot-plugging work for this case.
Or you can just power your printer down before you plug things.
On the other hand, a lot of people have hot-plugged things that aren’t meant to be hot plugged. There’s a story from the origins of the Macintosh about an engineer who could slam a peripheral card into the slot of a running computer after all. There’s only one case that The Filter guys are aware of.
Okay but if the Klipper Expander doesn’t have a snubber diode, how do I keep it from getting fried?
One of the people on the discord mentioned that his Klipper Expander did, in fact, suffer a MOSFET failure from being used as a fan port. Although, there’s presumably a decent number of people who’ve been getting away with this.
If one were to make a new version of the Klipper Expander, I’d suggest that they just add the diodes. It’s not going to hurt the other uses of the MOSFET like using it for a heater or LED strip because. And it’s a lot more convenient to have it just soldered down as a minimum-sized surface mount diode than have people add it later.
However, if you already have one, the easiest solution is to get yourself a 1N5819 diode. Maybe a 1N5819 from Diodes Inc, the company that is so much about diodes that they put it in their name, but most any will do. And you can just screw it into the same screw terminals as the fan. And then the white line is the “Cathode” line which you want to have connected to the same terminal as the power, and then the other side goes into the same side as the ground.
Yeah, we’re talking about an $11 board and if you fry the MOSFET it’s probably not going to cascade. So I guess you can leave it be until it dies and then think about a dioide.
tl;dr:
- Hot plug connectors are actually hard to implement right and the connectors on the average printer motherboard were never designed for this.
- Your Klipper Expander probably needs diodes.
- Four pin fans are pretty great.
- If I were designing a board, I’d presumably want to add the snubber diodes everywhere because clearly people are going to do it wether you want it or not.