Programmable USB power for FLiP

I need to interpose a device between a USB host and a Propeller FLiP board that allows me to programmably adjust the nominal 5V USB supply voltage from zero to whatever the host is providing. This is to stress-test a system that uses the FLiP and a sensor that relies upon the FLiP's 3.3V buck converter for its supply. During the test, I need to maintain serial coms with the FLiP until it finally craps out due to a brownout reset.

Any recommendations to accomplish this?

Thanks,
-Phil
“Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery

Comments

  • Peter JakackiPeter Jakacki Posts: 8,722
    edited 2019-05-29 - 06:29:57
    I need to interpose a device between a USB host and a Propeller FLiP board that allows me to programmably adjust the nominal 5V USB supply voltage from zero to whatever the host is providing. This is to stress-test a system that uses the FLiP and a sensor that relies upon the FLiP's 3.3V buck converter for its supply. During the test, I need to maintain serial coms with the FLiP until it finally craps out due to a brownout reset.

    Any recommendations to accomplish this?

    Thanks,
    -Phil

    Why not just continue loading the USB supply until the FLIP flips? Use a duty mode DAC that feeds into an NPN + emitter resistor as a programmable constant current source (tied to VBUS) which at max should overload the USB supply or else place a suitable series resistor of around 10 ohms or so in the supply but use some extra supply filtering of around a few hundred uFs. You can monitor the supply on the scope with a slow trace or infinite persistence etc.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- The LOT --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
  • jmgjmg Posts: 14,013
    I need to interpose a device between a USB host and a Propeller FLiP board that allows me to programmably adjust the nominal 5V USB supply voltage from zero to whatever the host is providing. This is to stress-test a system that uses the FLiP and a sensor that relies upon the FLiP's 3.3V buck converter for its supply. During the test, I need to maintain serial coms with the FLiP until it finally craps out due to a brownout reset.

    Any recommendations to accomplish this?
    If you need voltage domain, a Digital pot can be simple. They come in i2c and Up/Dn controls, so should do the 'programmably' bit.
    You then just need a good Linear LDO, that the Digital pot can control.

  • You may have spotted this already... The switcher on FLiP requires minimum 4.5V to operate. Although that's probably just the startup number. It will probably run with lower VIN once it's going.

    Also... what about modifying a USB cable, to route the power from a variable bench supply, instead of sourcing from the computer ?



  • jmg wrote:
    You then just need a good Linear LDO, that the Digital pot can control.
    Actually, it would have to be an NDO (no drop-out) to do what I need, given that I'm tapping the host's USB supply.
    VonSzarvas wrote:
    The switcher on FLiP requires minimum 4.5V to operate. Although that's probably just the startup number. It will probably run with lower VIN once it's going.
    Correct, but the Prop will run until the 3.3V output from the switcher dips to 2.7V. I'm not sure at what input voltage this happens. The sensor I'm using starts misbehaving at 3.2V. So the Prop should be able to detect that before it goes into reset. My objective here is to characterize how the system behaves when, say, it's connected to a laptop whose battery is running low and to program some kind of intervention into the Prop.
    Also... what about modifying a USB cable, to route the power from a variable bench supply, instead of sourcing from the computer ?
    That may be what I'll have to do.

    -Phil

    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Tracy AllenTracy Allen Posts: 6,401
    edited 2019-05-29 - 16:53:29
    Hi Phil,
    I’d go with splitting out the 5V line from the USB cable, over to a lab supply. More precision, less headache.

    I don’t know how many sacrificial USB cables I have lying around! One very useful one has both mini and micro USB connectors and double bananas for power on the other end. And the option of the data lines either open or shorted. For the FLIP they have to be shorted when connected to a supply (charger detection), or they have to have communication to negotiate the USB, power allowed etc. FLIP needs to detect either a charger or a valid USB, or it won’t boot up and the trouble light comes on. Anyway, the lab supply connection is invaluable.

    Why do you need communication in order to test this? There may be a confounding issue with the voltage differential on the comms lines.

  • Why do you need communication in order to test this? There may be a confounding issue with the voltage differential on the comms lines.
    I need a record of the sensor's output vs. 5V and 3.3V actual voltage levels. This will go into a spreadsheet. The big problem here is that the sensor seems to suffer permanent damage if its supply voltage goes too low. The objective is to identify and characterize its misbehavior before that happens and shut off power to it altogether.

    Thanks,
    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • How about send the readings out via a side channel?
  • How about send the readings out via a side channel?
    I may have to. And who knows? I may discover that the "erratic" sensor readings are a consequence of USB comms and not the sensor itself. That would be bad, though.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • jmgjmg Posts: 14,013
    ... The big problem here is that the sensor seems to suffer permanent damage if its supply voltage goes too low. ..
    Ouch. Have you thought of a Voltage detector, used to simply power/disable the sensor to avoid any brownoout ?
    jmg wrote:
    You then just need a good Linear LDO, that the Digital pot can control.
    Actually, it would have to be an NDO (no drop-out) to do what I need, given that I'm tapping the host's USB supply.
    Yes, that's why I said 'good LDO' - you can get LDOs with dropouts in the tens of millivolts, and given the SMPS works to 4.5V guaranteed, there is enough room to insert a good LDO.

  • jmg wrote:
    Ouch. Have you thought of a Voltage detector, used to simply power/disable the sensor to avoid any brownoout ?
    Of course, but that would entail a complete PCB redesign after production quantities have already been populated. So as a short-term measure, I'm looking for a software solution. The sensor itself accepts a power-off command, but part of it still has to stay alive to monitor for a power-on command. So I'm not yet sure that would be a sufficient prophylaxis against damage.
    ... you can get LDOs with dropouts in the tens of millivolts ...
    I did not know that. Thanks for the tip!

    In the meantime, my customer is recommending to his customers that they use a good-quality powered USB hub inline between their PCs and the sensor unit, until we get this figured out.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Tracy AllenTracy Allen Posts: 6,401
    edited 2019-05-30 - 19:06:58
    How about a USB power brick between the computer and the device? The computer keeps the brick charged. When the brick runs down, in my experience, it will shut down it's 5V output abruptly. Oh, would your device handle abrupt loss of power? It sorta surprises me that power from a PC USB port exhibits droop like that. I'd think it too would simply cut off; 5V to zero.
  • Oh, would your device handle abrupt loss of power? It sorta surprises me that power from a PC USB port exhibits droop like that. I'd think it too would simply cut off; 5V to zero.
    There shouldn't be any problem with a sudden loss of power. The device records data in the Prop's EEPROM, but I've programmed around any issues that a power loss might otherwise cause.

    I'm also surprised that a PC would allow the 5V to droop instead of just cutting it off. However, I've seen PC USB power outputs that range down to 4.2V in "normal" operation, so who knows?

    I like the power brick idea and shall investigate. It would have to provide a pass-thru path for data to be useful.

    Thanks, Tracy!

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Cluso99Cluso99 Posts: 15,458
    edited 2019-05-30 - 21:26:56
    Phil,

    Postedit

    It seems you are looking to find why the problem occurs ie a power droop, and then a resolution which hopefully can be done in software. Is this correct?

    What is the sensor chip?
    Is the hardware the same at all sites? ie same laptop?

    Hardware test - but will not identify the actual problem...
    If it’s a short power droop, a hardware solution may be to just use a series resistor from the USB supply (limit the inrush current when turned on), and a largish capacitor to smooth over the power droop.

    BTW I have seen problems with SD Cards if there isn’t a bulk cap as well as the bypass cap at the socket power pins. This is because of instantaneous power requirements of the SD. Here I use a 100nF and 4.7-10uF X7R. Might this be a problem with the sensor chip?

    To test, you could use a USB cable and cut it and insert a low drop diode from USB port and then largish tantalum cap. That may cover a laptop power droop.

    To monitor the different voltage levels, that circuit needs to be as close as possible to the prop chip, so perhaps a delta sigma circuit with 3 inputs for USB 5V, both before and after the diode (or a resistor - value depends on current requirement), and the 3V3 rail.

    You could also think about using a pcb with this circuit and another flip (or cheap micro with ADC) between the computer usb and your boards. Youvwould then need a way to monitor this though.

    I guess there isn’t enough info to give better suggestions since I don’t know quantity and cost allowances, etc.

    Feel free to pm or email me.
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,462
    edited 2019-05-30 - 23:42:16
    Cluso99 wrote:
    It seems you are looking to find why the problem occurs ie a power droop, and then a resolution which hopefully can be done in software. Is this correct?
    Yes.

    What is the sensor chip?

    It's actually a smart sensor module, with the sensor on a PCB. I can't really divulge the part number at this time, though.

    Is the hardware the same at all sites? ie same laptop?

    No. Customer provides the laptop, PC, or other way to provide USB power and download the data. There's a PC GUI program on the front-end that someone else wrote for collecting and displaying the data.

    Hardware test - but will not identify the actual problem...
    If it’s a short power droop, a hardware solution may be to just use a series resistor from the USB supply (limit the inrush current when turned on), and a largish capacitor to smooth over the power droop.


    It's not short-term. The power may die overnight and not be noticed until the next day.

    BTW I have seen problems with SD Cards if there isn’t a bulk cap as well as the bypass cap at the socket power pins. This is because of instantaneous power requirements of the SD. Here I use a 100nF and 4.7-10uF X7R. Might this be a problem with the sensor chip?

    That stuff is built into the module. But I've also added a 10uF ceramic filter cap at the end of the short cable that connects to the module.

    To test, you could use a USB cable and cut it and insert a low drop diode from USB port and then largish tantalum cap. That may cover a laptop power droop.

    Interesting thought! I've got some schottky diodes that I could try.

    To monitor the different voltage levels, that circuit needs to be as close as possible to the prop chip, so perhaps a delta sigma circuit with 3 inputs for USB 5V, both before and after the diode (or a resistor - value depends on current requirement), and the 3V3 rail.

    There are plenty of spare pins left on the FLiP to accomplish this.

    You could also think about using a pcb with this circuit and another flip (or cheap micro with ADC) between the computer usb and your boards. You would then need a way to monitor this though.

    Also doable. Thanks!

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Cluso99Cluso99 Posts: 15,458
    edited 2019-05-31 - 04:54:43
    To test, you could use a USB cable and cut it and insert a low drop diode from USB port and then largish tantalum cap. That may cover a laptop power droop.

    Interesting thought! I've got some schottky diodes that I could try.

    To monitor the different voltage levels, that circuit needs to be as close as possible to the prop chip, so perhaps a delta sigma circuit with 3 inputs for USB 5V, both before and after the diode (or a resistor - value depends on current requirement), and the 3V3 rail.

    There are plenty of spare pins left on the FLiP to accomplish this.

    You could also think about using a pcb with this circuit and another flip (or cheap micro with ADC) between the computer usb and your boards. You would then need a way to monitor this though.

    Also doable. Thanks!

    -Phil
    @Phil,
    Read the end first. I had done the rest before I found this. I suggest you jumper the props 3V3 to the spare pin on the Flip and mod the base board to use this pin instead, if that's possible??

    I was thinking you could build a pcb the same size as the Flip and sandwich it between the Flip and the board it plugs in to. There are female sip connectors available with long pins. I have plenty of 9pin versions which need minor sanding to but up to one another or can be forced depending on pcb hole dia. Note the Flip can be built with 1x20 or 2@1x10 SILs and the holes are 0.95mm to accommodate either without sanding.

    On the Flip you have connections for 5V after the U301 RT9728, Vin (5-9V) both of which go via shottky diodes (D100 & D101 RB068MM-40) to the buck regulator, 3V3_Protected_Out, and GND/Vss, plus J504-1 which is a NC. This NC pin could be valuable to wire a sample point from the Flip.

    Do you have height in the box (presuming the boards are in a box of some sort)?
    Would the USB cable still connect with either the base board or the Flip moving to accommodate the new board?

    I am thinking that you could place the sigma-delta resistors on this pcb to connect to the Flip/Prop, and then be able to measure the voltages 5V, 3V3_Protected_Out, and possibly provide for extras, particularly one on the NC Flip pin.

    Also, you could potentially provide for an extra ceramic X7R cap perhaps via a series resistor on the 5V line to accommodate any brownouts. Similarly on the 3V3_Protected_Out line, and/or possibly the 3V3 via the NC Flip pin.

    Examining the Flip circuit a few things to note that could be causing you problems...

    The shottky diode D101 will drop ~450-550mV for 100-400mA at 25C (worse if colder)
    The switcher at 3V3 out and 100-400mA will be ~80-86% efficient giving ~825-537mV loss, plus Rds(on) 380mohm @ 3V3in to 240mohm @ 12V so say 360mohm and at 100-400mA gives ~36-40mV. So we will drop say ~860-580mV for 100-400mA.
    So we need at least 1.3V+3V3=4.6V from the USB just using typical characteristics. So there isn't much headroom here for a USB voltage dip.

    Next, the series MOSFET Q510 for 3V3 to 3V3_Protected_Out gives ~52-100mohm at neg2.5-4.5V Vgs so ~25mV worst case. But the Diode Forward Voltage vs Current tells a differnet story. The graph starts at around 0.4V drop at zero current, and estimating at this difficult area of the curve that a voltage drop of 0.4V might be closer to where low current operation might be, which would be about 2.9V.

    So have you checked the 3V3_Protected_Out as you said above that the sensor starts to fail at 3.2V.

    Postedit: Easy to short Q501 D-S by linking the Drain to the nearby J503:9 (ie 3V3_Power_out) - can use bare wire for this.
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,462
    edited 2019-06-01 - 02:46:57
    I think I may have found a solution to my conundrum. But first, a little more background. The FLiP plugs into a carrier board that drives an 8-digit 7-segment LED display. The carrier board also has a connector to a cable that runs to a satellite board that plugs into the sensor module. The cable carries the FLiP's 3.3V power to power the sensor and some signal lines to the satellite board. It would've been better, given 20-20 hindsight, to run 5V down the cable and regulate it to 3.3V on the satellite board, but I did not.

    However, there's a chip that could be my savior: the LTC1682-3.3 (switched-capacitor voltage doubler with post- regulation). This chip will accept an input voltage as low as 2.5V and convert it to a regulated 3.3V @ 50 mA with noise levels in the hundreds of microvolts. Moreover it has a /shutdown input that can be controlled by a supervisor chip to trip at, say, 2.8V. The main takeaway here is that I would not need to modify the main carrier board; just to create a new tiny satellite board. The supervisor could also be wired to the sensor's serial output to cause a BREAK condition that the Prop could detect before it, too, shuts down.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • I've now been able to characterize the FLiP's 3.3V regulation under the influence of a failing USB voltage. I used an ST Micro LDCL015 ultra-low dropout adjustable linear regulator inline with the USB 5V supply. (Thanks JMG for suggesting an LDO.) I "programmed" it with a screwdriver and a 10-turn pot. I started at the USB high voltage which, in this case, was 5.17V and brought it down slowly, recording both the diminished USB voltage and the "3.3V" regulated voltage. Here's a graph of the results. (Read from right-to-left for the proper time sequence.)

    FLiP_voltage_regulation.png

    At about 2.85V on the 3.3V rail, the Propeller quit responding due to the brown-out reset. But the switching regulator kept trying to output something. I did not try to characterize a startup voltage for the regulator, however. The regulator voltage did not begin to falter until the input sank to about 4.0V, whereupon it began to fall off precipitously. Also note, that I did not attempt to characterize the 3.3V supply under various loads. I suspect that it will begin to fall off sooner as the 3.3V load stiffens.

    Anyway, I plan to go ahead with the switched-cap boost converter mentioned in my previous post, along with a voltage detector to shut it off and signal the Prop when the FLip's 3.3V supply drops to about 3.0V. Then the Prop can go into a holding state until the voltage comes back up.

    -Phil
    656 x 487 - 19K
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
Sign In or Register to comment.