My 3d printer's USB link is crazily EMI sensitive - Page 1
Forum section: electronics / beginners

author: Whales
author_rank: Super Contributor
timestamp: October 05, 2021, 09:44:59 am
content: Took the blankets off my bed. Heard lots of static electricity. 5 seconds later my 3d printer stops (halfway through a multi-hour job, now junk). The printer sits about a meter away from my bed, up on a bookshelf, but my bed has an electric blanket that's plugged into the same powerboard as the printer.On my computer (software: Pronterface)QuoteAccording to dmesg all of my USB devices on the relevant hub reset. Presumably the static electricity took everything out and (by design) the USB hubs auto-reset.I know that I can't turn on and off large mains loads (eg drill press, vacuum cleaner) whilst my printer is running because that has caused a similar problem before on a few ocasions. The USB link between my computer and my printer seems to be very sensitive.What can I do to fix this?I've tried adding a ferrite core to the USB cable and using a different cable, no dice.I'm going to try the 'send to SD card' feature of my printer, that should allow it to survive USB failures.Is there a proper solution? Is the USB hub on my motherboard too sensitive and I should use a PCIe USB addon card instead? Add capacitors to the data lines?

author: jeremy
author_rank: Super Contributor
timestamp: October 05, 2021, 10:52:31 am
content: I use these everywhere:https://www.olimex.com/Products/USB-Modules/USB-ISO/(you can get them from digikey, e14, etc)Perhaps that will solve your problem ?Edit: Digikey # is 1188-1019-ND and mouser # is 909-USB-ISO ; apparently not sold at e14 anymore

author: xrunner
author_rank: Super Contributor
timestamp: October 05, 2021, 11:20:16 am
content: Quote from: Whales on October 05, 2021, 09:44:59 amI know weird issues can happen when a powered USB connection is applied to the USB port on my Ender. It's a common issue because the port on the printer is already powered. The solution was to make a USB cable that has the power wire cut from the outside connection.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 05, 2021, 11:28:02 am
content: The proper method is to inspect the shielding along the entire signal chain.Grounds must be tied together solidly, with few (preferably no) gaps.Common mistakes/oversights/cheats are: impedance (anything from a tiny bypass capacitor, to actual ferrite beads, or nothing at all!) between shield and ground, at USB connectors; poor shielding contact (connectors should have fingers to mate the shields); poor cable assembly (shield does not mate to braid without gaps); and poor cable in general (leaky braid, screen, or none at all).Additionally, devices should recover gracefully, from whatever is possible in hardware, to also software handling drops and re-enumeration automatically if at all possible.Probably, very few if any of these, you can actually inspect; molded connectors you'd pretty much have to x-ray (or get identical extras to tear down, hoping they are actually identical). You can inspect whatever connectors are onboard things (PC, hub, printer?), and potentially improve them. Software, good luck, there's many levels of abstraction in play, and if you're not into writing drivers, you'll be looking into it for a good while at least. Hardware obviously is fixed, at best you can test the immunity of a selection of devices; which, I've got to say would be quite welcome to see a list of common hub devices and their immunity and recovery behavior. That would make an excellent blog post or video.You can do some work with general immunity. Avoid creating loops. Likely you have some loops between power supplies, USB cables, hub, etc. Route cables in parallel as much as possible, to avoid creating loop area between nodes. This may simply not be feasible, say if your printer is on one side of the room, plugged into a different outlet. In this case especially, a USB isolator such as above may prove invaluable. Even just for everything on the same tabletop, one or more may be desirable.Do inspect the isolator itself. The above linked one most likely has a capacitor across the isolation barrier; this reduces noise generated by it, and improves its susceptibility, at the cost of conducting more noise along the signal path -- worsening isolation, maybe not solving the problem after all. You can try removing the capacitor, but of course it's not guarantee it'll behave, or as well as in the original state. Isolators rated for high voltage, low capacitance, medical/reinforced, etc. should do better than those without.Power supplies similarly vary in isolation, most of them using capacitors to reduce noise emission. You can try medical grade supplies, which use smaller capacitors. Maybe this will help break some of those loops.Ferrite beads, FWIW, are the right idea, but the scale is completely wrong unfortunately -- the impedance of a single bead is on the order of 100 ohms, while the impedance of cables in space is ballpark 150 ohms. Basically the same scale. So you can imagine the equivalent circuit of, say a long length of cable with a bead in the center: from one side, there's a transmission line characteristic, which acts as a shunt (shield to ground) impedance; then a series bead; then another transmission line section. It has a roughly CLC characteristic, (except the transmission lines aren't really capacitors except at low frequencies*) so it looks like an attenuator or lowpass filter.(*What's missing is, when the cable resonates, the ferrite bead should be placed at a current maxima (antinode) to do the most work; which isn't often in the middle, but at either end. Which indeed, is why most cables you see, have lumps at one or both ends. Why introduce it in the middle first? Just for sake of imagining the equivalent circuit.)Anyways, given an impedance divider like that, and setting resonances aside, you can imagine the attenuation ratio is modest: with similar impedances all around, it amounts to maybe 6dB here and there. You need a HUGE stack of ferrites to do much (like 10 to get to 20dB, 100 for 40dB, etc.).And ESD is huge, kilovolts. So you need a hell of a lot more than 20dB to get it down -- much of the difference should be afforded by the cable/connector shields themselves, but even with 80dB of shielding, at every cable and connector (and any one connection with less than that, will be the weakest link), that's 1/10 000th or still several volts at the signal lines. USB is only a 3.3V interface, so it can't tolerate much noise before glitching. (Hopefully glitching is momentary and error-detected, but repeated interruption usually causes the connection to drop entirely.)A broken shield affords basically zero shielding, of course, and a broken shield with a wire link shorting across it (as is the case for naively terminated cables -- i.e. gather up the braid into a wire, stuff that into a pin, plug it onto a header, that sort of thing) will only do maybe 10-30dB of shielding, depending on where the ESD strike is, relative to the cable (because it's a risetime / frequency response thing).For the isolator to do its job, it needs an impedance between sides, at ESD frequencies, of some kohms -- even a few pF is kind of a lot. So it's a challenging task, even with good parts (these values are typical of the components used in these devices -- the completed device will be somewhat worse!).The other other alternative, is to not do it at all in the first place. Does the printer not have a thumbdrive / memory card mode or something? Can you run it from a SBC, Raspberry Pi or something, mounted on the printer? USB is an unreliable communication medium, to begin with; get rid of it entirely, or at least make it very short to minimize its exposure.Tim

author: Whales
author_rank: Super Contributor
timestamp: October 05, 2021, 08:37:51 pm
content: Quote from: xrunner on October 05, 2021, 11:20:16 am!This board can be powered either by USB or it's own 5V supply, and I suspect it might not be using diodes. I'll have a look. Perhaps this is putting the USB port failure-detection on edge.QuoteYes it has a store-on-SDcard feature I'm going to try. Alas the wires to the SD card are a couple of a feet long, so I'm half expecting that link to also go down when I turn my bed into a natural disaster again.

author: wraper
author_rank: Unknown
timestamp: October 05, 2021, 08:54:09 pm
content: You may have crappy USB connector in your printer. In cheap USB-B connectors (which IME are often used in quite expensive devices) ground leaves are not springy and are permanently bent inwards once plug is inserted. So no longer make a good shield contact. Also the whole topic of USB grounding in sink devices is full of shenanigans. Engineers often use all sorts of nonsense in series with USB connector shield to GND connection without any understanding why they do so, and what is the result. If there is something, try to connect USB connector shell directly to GND plane and see if it helps.https://www.unit3compliance.co.uk/hdmi-more-like-hdm-why-thoughts-on-cable-shield-grounding/