• PoE, dV/dt and ESD

    06/29/2019 at 17:29 0 comments

    Why I don't like USB in the lab

    When lab setups don't fall into disuse and get scrapped, they are usually passed down through generations of PhD students - and there doesn't always seem to be an incentive to spend time to improve a working setup.

    ... and then one ends up with such organically grown USB cancer:

    While USBTMC (USB Test and Measruement Class, [1]) allows ease of use of a subset of lab equipment, one is usually at the mercy of manufacturers to support newer platforms and control software implementations to properly handle USB devices.
    Practically such equipment communication ends up being vulnerable to faults by re-enumeration and broken handles to once-functional virtual COM ports.
    Let's change the requirements too and ask to allow multiple control PCs and setups sharing measurement equipment - and USB stops making so much sense altogether.

    To spice things up, I'm adding transients of 1 .. 20 kA/µs and 10-50 kV/µs into the mix. Under these conditions, and with setups not enclosed in metal test cells, with filters added to all cables crossing the shielding walls, USB struggles through common mode (CM) noise and yet-to-be-identified perturbations.

    On a side note: the only cables we've found to make a difference are "CU-HQ-20". They have honest copper cross-sections, proper shielding braid and ferrite filters on both ends. Expect to play 15€/pc.

    Ethernet and PoE in the lab?

    Ethernet enables multiple pieces of equipment, actuators, sensors, control interfaces and PCs to be connected, both locally and remote, and satisfies the requirements for maximum flexibility with cheap and ubiquitous components.

    Thus we should be looking at the 10BASE-T and 100BASE-TX physical layers in terms of noise immunity and voltage handling capabilites and see how PoE fits into the picture.


    Ethernet has become very popular in industrial applications [2]. As far as noise immunity is concerned, common-mode filters are often part of integrated-magnetics RJ45 connectors (commonly called "MagJack", which happens to be a name trademarked by BEL). Having the filter magnetics right behind the connector pins in a shielded can connected to the enclosure and bypass capacitors right next to the connectors is the a best effort approach to mitigating conducted and radiated emissions into a network enabled device. The PoE lines are commonly outfitted with ferrite beads to block common-mode transients coupling into the DCDC converter circuitry.

    Below two types of MagJack circuits are shown [3]. The right one is outfitted with separate PoE pins which hook up to full bridge rectifiers and an isolation converter that also handles the PoE communication. Power is transmitted courtesy of a common-mode potential difference between differential pairs.

    It is to be expected that the patch cable shield is connected to ground of the switch chassis. We have found our first issue: high frequency CM voltage components drop across the CM filter and to a lesser degree across the signal transformer. Additionally, low frequency and DC components are blocked by the signal transformer alone.

    Are they really being blocked?

    Let's look at the signal transformer:

    These parts tend to be produced as a multifilar toroidal winding, e.g. on a small NiZn ferrite core. The windings have maximized overlap to optimize coupling and to marginalize stray inductance, but then again this also enhances capacitive coupling. This inter-winding capacitance is a low-impedance path for high frequency common-mode noise.

    Faraday shields eliminate inter-winding capacitance. For transformers this requires the addition of one or mulitple shielding foils or wire windings in between primary and secondary sides, along with added insulation. I haven't seen them used in ethernet magnetics though.

    What would be the best effort? Lacking a teardown survey of PoE switches marketed for industrial applications (please contact me if you happen to have a box of interesting stuff...

    Read more »

  • Generating Nice Threads In OpenSCAD

    05/26/2018 at 23:52 9 comments

    [Hello future reader. This article refers to OpenSCAD 2018.05.05, please check if it still applies later on]

    3D printing internal and external threads is interesting for many reasons.

    Unlike gears that invariably wear rapidly and cannot measure up compared to cast or subtractively machined parts, they are pretty functional and allow the common maker to interface with custom and standardized bolts, pipes, valves, soda bottles and canisters - and that's on top of the liberty to create your own threaded mating components within the confines of your design.

    The generalized approach presented here supports arbitrary thread geometries and numbers of starts.

    Shown below are single start inside and outside threads as well as a swivel nut with a "faster" 3-start thread, all modelled to match commercial water bottles - the small one is "PCO-1881" known from 1.5L soda bottles, the larger one is "48-41" for 3-5L jugs:

    Only right-hand threads are supported but left-handed threads are easy to get by applying mirror([0,1,0]) to the output. That's the OpenSCAD way :)

    While the core idea of a straight thread - the helical profile wrapped onto a cylinder - is rather straight forward, generating nice geometry that does not disintegrate along the way from model rendering thru .stl export to the slicer tool deserves a little bit of attention.

    What do I mean by "nice geometry"?

    • "embossed threads" on a curved surface or
    • manifold additive threads (demonstrated here, imho more universal)
    • regular mesh / regular connectivity of trangles / quadrilaterals (no crazy pointy aspect ratios and cell size changes)
    • low polygon count and accurate / efficient reproduction of the thread profile
    • geometry matched to the rest of the model

    in short, what we don't want is unnecessary structure, gaps, holes and mismatch of resolution of the threads and the rest of the geometry.

    What I'm going to walk you through here is a way to create helical thread forms just like the ones you'd strip when overtightening a bolt:


    Since OpenSCAD is am open source work in progress, users do not necessarily work with a version that has the latest features, documentation may not be up to date and forum posts claiming "it cannot be done" are repeatedly being invalidated by software revisions, adding to the confusion.

    Let's go over what doesn't work (hopefully gaining some insights), then look at my proposed approach. If you just want the answers, please scroll down :)


    As an example: without an operator that creates dedicated helical structures people are using linear_extrude() with twist to get something helical:

    The problem here is that like fanning a deck of cards you'll end up with tucked-in faces and serrated outsides - as seen on Thingiverse:

    And here's another one with a bit of discussion from 2014:



    Unfortunately as of now rotate_extrude() which should be closer to creating helical objects has learned partial rotations (not supported in 2015 builds for Windows) but cannot create helical extrusions. There's also no special treatment for the ends.

    One could create a...

    Read more »

  • Kaleidoscopes of Sorts

    05/25/2018 at 23:39 0 comments

    I was looking for a way to image a credit card-sized area the other day. The only catch is that it would fundamentally be the sidewall of a < 8 mm wide duct and I haven't really seen a type of borescope that would be capable of imaging under these conditions.

    Organic Photodiodes

    It seems we're living in the early days of organic photodiodes (OPDs) and image sensors so maybe we'll get to see combined flat panel illuminator - lightfield camera foils which you can stick into the gap between capacitors, heat sinks and other stuff that's in the way to read part numbers and have a look at possible faults, but such a future is not there yet.





    On the geometrical optics side of things, Travis (Microsoft Research, 2012) presented a paper on wedge optics for imaging and projection: 


    Defects and apologies aside, the fact that everything is in focus despite the different optical path lengths across the object (Fig. 21 is slightly misleading) eposes the small acceptance angle at every given point of the imaged area so light collection efficiency will be a bit of a struggle or a trade-off with image contrast.

    All things being equal this will be a good starting point to cobble together a demonstrator. Think machining a PMMA wedge on a sine plate.

    Light Pipes

    If you've ever taken apart a DLP projector you may have come across a beam homogenizer / rectangular light pipe / mixing rod


    they come in two basic flavours: total internal reflection and boxed first surface mirror and for non-imaging elements they have some interesting properties.

    In the paper from Zhang 2013 it is pointed out that looking back through a light pipe, the real source is seen surrounded by an array of virtual sources (hence virtual sources array). It's not easy to make out in the illustration below but another way of looking at it is that light emitted at increasingly oblique angles ends up in increasingly "higher order" virtual images farther away from the center.


    In fact one can image the entrance aperture plane of the light pipe along with the array of virtual source images and consider it a scrambled integral light field image (ordinary light field images don't have the additional mirroring).

    Here's the collimating lens and light homogenizer assembly from an IBM DLP projector:

    in the magnesium casting there are four mirrors glues into a rectangular tunnel shape followed by a collimating lens assembly. Since in a direct imaging scenario the angle at which the enters (aka the "source" in the context above) is equal to the angle at which the camera has to capture it, a rather wide angle macro lens is required.  Using the collimating lens to image a ceiling light though should deliver the basic idea of what they mean by "virtual sources array":

    So in essence this could be an easy way to implement light field microscopy if it were not for the awful out of the box working distance.

    What Zhang et al. are proposing is a means to transform a light source with a large solid angle into a well-behaved array of small solid angle fractions of the source which are sufficiently controllable to be fed through polarizing beam splitters and half-wave plates to achieve near-100% yield instead of <50% by just discarding the wrong polarization component.

    Going full circle this might be another way of looking at the combined wedge optics /...

    Read more »