Bullet proof power supply?

Hi All
Using the prop 1 for measuring then logging current draw of various domestic clothes washers and dryers. I've evolved a configuration that uses an op amp to amplify the output of a 200:1 current transformer. The op amps output is adjusted by a digital potentiometer communicated to by I2C which then gives a calculable level. Only need a rough reading so an ADC would be overkill.

The circuit works perfectly as designed except for one fatal flaw. On just some machines the prop very sporadically reboots loosing all data before it can be stored to persistent memory. I've tried valiantly to replicate the problem in the lab so I can analyze it but could not.

I've got BOE hooked to ground. A 1K resistor to VSS and a 1uF cap to ground on the RES pin. Also the trace to the reset pin is very short and nothing is hooked to it during operation. Using a stand alone packaged power supply (RAC02-05SGA) simply because I couldn't build a custom one for less.

There are two PCBs in the device aprox 20 centimeters apart with a 4c#22 cable interface. The power supply, CT and some 5V relays (not active during operation) are on one. The main controller with the prop has everything else on it, including a 3.3V regulator (MIC5504-3.3YM5-TR) and a 16x2 LCD.

So I'm pretty sure this problem would have something to do with the fact that the power supply is fed from the same AC line that feeds the appliance where heavy loads are turned on and off during the cycle but I'm not certain.

Would anyone here know how to reliably power the prop from such a noisy AC source?

Comments

  • Wuerfel_21Wuerfel_21 Posts: 893
    edited 2020-07-22 - 19:37:29
    You could try putting a really big capacitor between the 3.3V supply to the prop and ground. But that's kinda an obvious thing, so I'd assume you already tried it.

    Another thing you could do is to make your code more resilient against random power loss by continuously writing data in a way that can be continued after a reset. Maybe incorporate an RTC to timestamp the data, so you can tell where the gap in the data is.
  • JRoarkJRoark Posts: 548
    edited 2020-07-22 - 19:47:12
    Before you go down the power supply route: I had the same problem until I put a pair of Schottkey diodes across the CT terminals in inverse parallel to act as a snubber. These things are notorious for sending fast, hard spikes to the downstream monitoring bits when the device being monitored throws an inductive surge. After this fix the spikes would hit about 250 mV and then get clamped. Since the output of the current transformer peaked about 100 mV, there was no contention issue.

    There are likely better ways to do this, but I had them at hand and it worked a treat.
  • The prop is sensitive to A/C inductive loads in my experience. An isolated prop power supply from your current circuit is a start. Total opto isolate the CT ciruit from the prop even better.
  • Can you post photos and schematics please. The problem may be very obvious then. As for big caps on regulated outputs, I would never do that, just let the regulator do its job instead of giving it a sluggish load which btw appears as a short circuit at power-up. If you do use big caps, use them on the input to the regulator but if they really only help if there are brown-outs and in that case I also put a diode in there to stop the charge back feeding to other devices. If you must have 5V relays then at least feed them from their own regulator and not from the same one that feeds the 3.3V to the Prop.

    The most sensitive part of the circuit though is the oscillator and all too often there are tracks snaking off to a big HC49 can somewhere. One little EMI glitch on these "antennas" and the whole CPU can be glitched.

    But once you post that extra info we should be able to make a more specific recommendation.
  • Would there be anything wrong in powering your circuit with a battery?

    -Phil
  • +1
  • Hey thank you all for your technical input on this question.

    Wuerfel as Peter noted further on, the large caps basically just protect against brown outs. I suppose also a software trap to overcome the effects could be a helpful work around to the resetting but ultimately the objective should be to prevent them in the first place.

    I definitely will consider the Schottkey snubber on the CT JRoark. The more I think about this, the more sense this makes to protect the circuit from rogue spikes even if I end up opto isolating that circuit as DigitalBob suggested. Thanks for this.

    And you are right Phil, running this off of batteries would definitely simplify the design and solve this problem but it would require too much required maintenance in the long run of the device in its intended application.

    At this point I’m merle collecting data to develop an AI algorithm that the prop in this device will eventually run.

    So suggested by Peter here are schematics and pictures of these two circuit boards. You may notice by these boards I'm primarily involved in the software side of things and generally fumble around with hardware until I can get it to work. Any insight you guys can give on not just the reset problem but other design improvements and details overlooked would be so helpful.

    The power supply board is dual purpose for 120volt or 240volt. I just use different relays and capacity of the prefabed AC to DC converter.
    400 x 300 - 29K
    1736 x 904 - 1M
    400 x 300 - 28K
    1104 x 878 - 434K
    838 x 894 - 581K
    1022 x 880 - 108K
    400 x 300 - 35K
    400 x 300 - 27K
  • Cluso99Cluso99 Posts: 16,603
    edited 2020-07-23 - 21:20:35
    Is there a schematic error or are not all 4 VCC pins connected to the power rail? If not, you run a high chance of killing the props PLL.

    I don’t see proper bypass caps at the vcc-gnd pins on the prop. You need 100nF and a bulk cap of 1-10uF preferably tantalum especially in your case. The bypass need to be X7R or similar, not Z5U and such. I put a 100nF on every pair ie qty 4, and one bulk for the lot close by.

    The 3V3 regulator doesn’t appear to be bypassed correctly. You should have (right at the pins) an input bulk of 10-22uF preferably tantalum in your case. You need to consult the specs for the recommended output caps, but again likely should be 10-22uF and preferably tantalum, plus a 100nF bypass X7R cap.

    The Prop reset is unusual. I use a 10K pull-up only, no cap. Here, you’re just slowing the reset time so probably ok. This is probably not your problem tho.

    TIP: You can solder caps on the top of caps - a 1206 stacked on 1206, or 0805 stacked on 0805 works. You can also solder a 0.1” thru hole cap (bulk tantalum or bypass) onto a 1206 or 0805 cap.

    I would definitely ensure you have fly back diodes in place.

    I would be trying these fixes before you try anything else. Next I would try a battery supply to the regulator to see if this fixes your problem as you need to diagnose what is causing the reset. As a last resort try isolation.

    This should keep you going. Report back your results and we can take it from there.

    Posted it: on your power board what is the purpose of the 15A relay? It needs a diode squelch across the coil.
  • Peter JakackiPeter Jakacki Posts: 9,635
    edited 2020-07-24 - 00:14:29
    Thanks for that info, although the photos could be be higher res for sure as it is really hard to make out any detail. Can you generate hires pdfs of the schematic and supply the gerbers for the artwork? (I understand if you don't as it is a commercial project).

    The problem I saw was that you let the autorouter do the work for you but even if you did do that you should place the components yourself so that they are close to where they need to be in relation to other components or in a straight as possible path. Besides all the dumb horizontal/vertical routing which sees tracks going from layer to layer when they don't need to, there are tracks that are just too thin when it comes to power and ground. Is your board multi-layer with separate layers for the ground and power? If not then maybe you either need to because of the limitations of the autorouter or else manually route the board. I myself will always manually place and route because placement is the key to a good board, and then being able to visualize what that connection needs to do and how it interacts with other signals along the way certainly helps.

    Quick summary of problems I see.
    * Reset line should not be a long track unless you have a good ground around it as a shield. The cap probably helps here to reduce noise though rather than aid reset.
    * The schematic symbols doesn't show Vdd & Vss on the Prop but it's important that the pcb have all these are connected and have suitable bypass caps very close.
    * You shouldn't really connect 2 leds in parallel, they are not passive components, just give each one a resistor and they will be equally bright.
    * The button inputs act as an EMI receiving antennas so the 2.2M resistors are only fine if the tracks are short or well shielded.
    * Autorouter is shocking (I'm at a loss for words)

    However I'd like to say "well done!" in getting this far. As you said, hardware is not your forte, but keep this up and it will be. The overall design looks excellent.




    As an example of what you can pack into a double-side board have a look at my P2D2, I've attached the gerbers which you can unzip and drop onto this 3d web viewer.
  • I had a similar issue driving an 24 VAC Gas valve and 3 24 Volt Relays. Prop would reset every time the gas valve kicked on due to the magnetic inductor in the gas valve. Everything was driving off a 24 VAC transformer. I tried all sorts of stuff to clean it up. Finally ended up going to 12 volt relays and this. See attached image.
    1061 x 205 - 17K
Sign In or Register to comment.