EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: xani on December 22, 2016, 12:05:41 pm

Title: Power management and MUXes - building rpi cluster
Post by: xani on December 22, 2016, 12:05:41 pm
So I'm building a small (8-12 node) rPi clone (mixed odrodi/orangepi) and I am in need of management/power distribution board (so far it looks like this: http://imgur.com/a/ZK87L (http://imgur.com/a/ZK87L) )

I need to:


My plan is to put a small ARM MCU + some silicon to switch power to boards + four 16:1 MUXes (2 uarts to 16 3.3V serial) to handle serial ports.
Whole thing is powered from meanwell RD125 5/12V power supply. So I got few questions:

What is easiest way to switch on/off 5V using 3.3V micro (need 3.3v IO for rest of the system) ? Each boards eats from 0.5 to 2A (worst case, with extra USB stuff attached) and I can drop around 0.3-0.5V over whole path (power supply can be adjusted up to 5.5, but I'd like to keep it around 5.3V for other peripherals. I'd prefer some "vanilla" parts but I would want to avoid having 16 MOSFETs on board.... I was thinking about just using a bunch of motor controllers but the most "vanilla" one can have pretty severe voltage drop.

Are there any 16:1 MUX chip with latch ? Only one I could find was some Analog Device part that was hideously expensive and getting even one of those would be more expensive than just using a bunch of cheap MCUs as extra UARTs or getting a FPGA, or just adding vanilla latches at cost of board space
Title: Re: Power management and MUXes - building rpi cluster
Post by: ealex on December 22, 2016, 12:47:23 pm
Hello

for power switching you could look at dedicated power switch ic's - some of them are designed for USB use
for example AP2411S-13 : http://ro.mouser.com/ProductDetail/Diodes-Incorporated/AP2411S-13/?qs=sGAEpiMZZMuCmTIBzycWfC1zfq461WqEmLNOgFJHk5A%3d (http://ro.mouser.com/ProductDetail/Diodes-Incorporated/AP2411S-13/?qs=sGAEpiMZZMuCmTIBzycWfC1zfq461WqEmLNOgFJHk5A%3d)
they have enable inputs, current limiting, etc - all you should need. also, SO8 packages are easy to assemble by hand.

about the uart - i don't think i've seen a mux with latch, but you can use a chain of serial to parallel registers before the muxes - you will have 2 ic's for the muxing part.

it should all fit on a PCB the same size as the other boards, so you can just stack it under / above them
Title: Re: Power management and MUXes - building rpi cluster
Post by: xani on December 22, 2016, 01:51:17 pm
Didn't even know those were a thing, I thought USB controller did the power switching. Current limit is a nice bonus, as I planned to polyfuse each channel

I wonder if there would be an interest for project like that, now that I think about it I am considering making a separate power board with just shifter input + clk + latch pin to control (or maybe some tiny mcu with serial bus) so it can be reused in other projects
Title: Re: Power management and MUXes - building rpi cluster
Post by: rstofer on December 22, 2016, 02:21:06 pm
I wouldn't want any voltage drop across the switching device so I think I would probably use a relay.  It's pretty easy to find small relays with 3A or 5A contacts and a coil current in the < 50 mA range.  More current than an MCU can handle but pretty easy for a transistor.
Title: Re: Power management and MUXes - building rpi cluster
Post by: xani on December 22, 2016, 10:54:02 pm
Is it really that much of a difference ? On resistance of electronic switches is in 50-100 miliohm range which in worst case would be ~200mV drop (which I plan to compensate anyway by powering whole thing with 5.3V - boards support it).

Then there is extra cost, board space, and I'd have to fuse it which would add ~ 90mOhms to relay anyway
Title: Re: Power management and MUXes - building rpi cluster
Post by: sokoloff on December 24, 2016, 05:59:38 pm
I would solve the DHCP delay problem on the RPi side. (Retry DHCP renew if there is no DHCP lease.)

Never (or rarely) solve in hardware what can be trivially solved in software.
Title: Re: Power management and MUXes - building rpi cluster
Post by: mmagin on December 25, 2016, 03:20:36 pm
I would solve the DHCP delay problem on the RPi side. (Retry DHCP renew if there is no DHCP lease.)

Never (or rarely) solve in hardware what can be trivially solved in software.

I would agree with this.  Though it's no reason to abandon the idea of using some high-side power switch ICs to build a 5 volt software-controllable PDU.  At the very least, even if you don't bother with the control side, most of these products offer overcurrent protection -- and I would want some individual overcurrent protection if I was running all these off one supply.  In addition to the Diodes Inc part mentioned above, TI makes a whole bunch of high side switch ICs intended for USB applications (like TPS2024/2034 if you want easy-to-solder, difference is enable low/high).  Also Infineon has all the ProFET products, though these are more intended for higher voltage applications (Automotive/Industrial), some may be suitable at 5V.

BTW, the totally lame but effective software solution might be to just insert a random delay before the DHCP request to avoid the 'thundering herd' of clients hitting the DHCP server, if this is in some startup script written in bash,
Code: [Select]
sleep $(($RANDOM / 1000))
should give you a random sleep between 0 and 32 seconds.
Title: Re: Power management and MUXes - building rpi cluster
Post by: xani on December 26, 2016, 06:44:13 pm
I need controls anyway as one of things I'm going to use it for is testing how software works under sudden node restart, or for testing stuff that can potentially hang the board and require power cycle. But yeah, worth for added protection alone (especially considering that power supply can output 15A on 5V bus), it even have discharge control.

It also allows for doing neat tricks like "scale down to one node when there is no jobs to run in cluster, scale up when there is work to do"

Solving it in software is easy enough (and I did it while testing) but it needs to be done for every single image I try to use with it which makes testing new (as in "not made/modified by me(yet)") ones annoying as I'd have to power on whole thing then power on single board after switch booted, then ssh to it and add modifications (or try to fix it "blindly" by mounting SD card directly). I will probably add that anyway as a second layer, or just use static IPs, it's not like that will change often


BTW, the totally lame but effective software solution might be to just insert a random delay before the DHCP request to avoid the 'thundering herd' of clients hitting the DHCP server, if this is in some startup script written in bash,
Code: [Select]
sleep $(($RANDOM / 1000))
should give you a random sleep between 0 and 32 seconds.

It was not that problem, it was just "switch booted longer than ARM boards, long enough for DHCP to timeout". And I "fixed" it with simple sleep. Then modified some boot options and it stopped working because boot took longer... "real" fix was just trying it in loop until it worked but that ain't exactly pretty.

I wonder why those TI parts are 5x as expensive as diodes one.... they pretty much do same thing
Title: Re: Power management and MUXes - building rpi cluster
Post by: Monkeh on December 26, 2016, 07:32:42 pm
I wouldn't want any voltage drop across the switching device so I think I would probably use a relay.  It's pretty easy to find small relays with 3A or 5A contacts and a coil current in the < 50 mA range.  More current than an MCU can handle but pretty easy for a transistor.

Or you could use a P-channel MOSFET.

To pull one out of my posterior: http://www.digikey.com/product-detail/en/toshiba-semiconductor-and-storage/TPN4R712MD,L1Q/TPN4R712MDL1QCT-ND/5323105 (http://www.digikey.com/product-detail/en/toshiba-semiconductor-and-storage/TPN4R712MD,L1Q/TPN4R712MDL1QCT-ND/5323105)

To pull a relay out of my posterior: http://www.digikey.com/product-detail/en/omron-electronics-inc-emc-div/G6DN-1A-DC5/Z5439-ND/5864613 (http://www.digikey.com/product-detail/en/omron-electronics-inc-emc-div/G6DN-1A-DC5/Z5439-ND/5864613)

MOSFET: Max on-resistance <10mohm, 3.3x3.3mm, 80 cents in single quantity + a resistor or two. A 5V tolerant micro would be beneficial.
Relay: Max on resistance <100mohm (order of magnitude alarm), 20x5.08x12.5mm, $1.78 in single quantity + drive circuitry. Oh, and it needs 110mW just to hold it on.

But alas, both solutions pale compared to the earlier suggestion of dedicated power switches: http://www.digikey.com/product-detail/en/diodes-incorporated/AP22800HB-7/AP22800HB-7DICT-ND/5030392 (http://www.digikey.com/product-detail/en/diodes-incorporated/AP22800HB-7/AP22800HB-7DICT-ND/5030392)

45 cents, 22mohm max (at 1A, at 2A.. even if you got to 30, oh no, 60mV dropped, all will end in tears), soft-start (fairly important), discharge capability.. external components range from zero (excluding input and output caps you will need with any switch) to three (two resistors and a cap). No drive transistors, no need for 5V tolerance.. And as above you can get more easily soldered packages if small DFNs aren't your thing, usually by compromising on-resistance.
Title: Re: Power management and MUXes - building rpi cluster
Post by: xani on December 26, 2016, 08:10:54 pm
Yeah those chips seem like a way to go, especially considering the extra power limiting (at the very least, polyfuse) I'd have to have for other solutions. For $0.40 they are a steal ;)

But now that I'm thinking about it I might put bigger MOSFET on few channels just in case I'd need to add something bigger to the project.

Anyway, back to KiCAD, thanks for all the help :D