Electronics-Related.com
Forums

How do UPS trigger circuits work?

Started by bob prohaska May 8, 2023
On Wednesday, May 10, 2023 at 3:07:25 PM UTC-4, boB wrote:
> On Tue, 9 May 2023 11:09:03 -0700 (PDT), Fred Bloggs > <bloggs.fred...@gmail.com> wrote: > >On Monday, May 8, 2023 at 5:57:48?PM UTC-4, bob prohaska wrote: > >> After using a pair of inverter/charger circuits as UPS units for > >> some months I've become curious as to how the trigger decides > >> when to switch from line power to the battery and inverter. > >> > >> Supposedly they trigger on wrong voltage or frequency, but they > >> do it in less than a half-cycle, so it seems to be more than a > >> simple relay. A cursory web search found nothing but I don't > >> know the proper name for such an "AC comparator". > >> > >> The units in question are from Amazon: > >> https://www.amazon.com/Ampinvt-Inverter-Charger-Frequency-Batteries/dp/B098QL2VBZ/ref=sr_1_1?crid=1ID8F7MUJFYH8&keywords=ampinvt+800+W+inverter&qid=1683582424&sprefix=ampinvt+800w+inverte%2Caps%2C557&sr=8-1&ufe=app_do%3Aamzn1.fos.f5122f16-c3e8-4386-bf32-63e904010ad0 > >> > >> The docs are useless and tech support is worse. No point asking them. > >> Apart from those gripes, the units seem to work OK for the price. > >> > >> I don't need to build anything, but I am curious as to how it's done. > >> > >> Thanks for reading, any any hints. > >> > >> bob prohaska > > > > > >That's not a UPS, it's battery charger/ generator combination. The AC output is isolated from its AC input. If you want to power AC loads with its AC output, you must do so manually or use what's usually a high priced transfer switch. > >The product will blow up if you disconnect the battery while its charging. It may also blow up if you connect a battery while its AC input is live. > >It's manufactured by Luckysolar. The product design was probably done by Haveaniceday LTD or maybe Goodluckwiththis Design Group. Hard to say. > An inverter/charger will work instead of a "UPS"... But might or > might not have a lot of transfer time.
Good luck finding the answer to that one.
> > The only question is, does this have a built in charger as well as an > inverter ?
Yes, but they give inconsistent information, saying it handles any battery type, but charges them all to 13.8VDC. Typical Chinese spec.
> > Batteries not included of course as a real UPS would have.
Right, it's not a UPS.
> > boB
On 5/9/2023 3:05 PM, Don wrote:
> bob prohaska wrote: >> boB wrote: >>> ..... >>> all it has to do is wait for the AC >>> input to go away >>> .... >> >> That's the core of my question. How is the decision made? Is >> there a dedicated power management IC for the purpose? > > The AC-OK sensor circuit of an old UPS design is found on Sheet 1, in > the upper right corner (D8 - C5): > > <https://electronics-components.ru/files/2015/732pschem_765.pdf> > > AC's apparently applied to a transformer, rectified, and compared > against a zener diode reference. It's relatively simple circuit.
I think you'll find that the purpose of that "AC_OK" signal is to enable the front panel buttons to power on the UPS. I.e., all it does is enable a fused 24V battery connection to the rest of the circuitry. The *5A* fuse on a 24V battery would clearly not be enough to support a 1400VA load! If, in stead, you examine the connection of that same XFORMER tap to the ADC at IC10 (sheet2), you can see that the MCU (IC12) reads the (scaled) mains voltage, there. This allows the MCU to detect an outage before the filtered DC at the comparator has seen its effects (look at the RC).
Don Y wrote:
> Don wrote: >> bob prohaska wrote: >>> boB wrote: >>>> ..... >>>> all it has to do is wait for the AC >>>> input to go away >>>> .... >>> >>> That's the core of my question. How is the decision made? Is >>> there a dedicated power management IC for the purpose? >> >> The AC-OK sensor circuit of an old UPS design is found on Sheet 1, in >> the upper right corner (D8 - C5): >> >> <https://electronics-components.ru/files/2015/732pschem_765.pdf> >> >> AC's apparently applied to a transformer, rectified, and compared >> against a zener diode reference. It's relatively simple circuit. > > I think you'll find that the purpose of that "AC_OK" signal is to > enable the front panel buttons to power on the UPS. I.e., all it > does is enable a fused 24V battery connection to the rest of the > circuitry. The *5A* fuse on a 24V battery would clearly not be > enough to support a 1400VA load! > > If, in stead, you examine the connection of that same XFORMER tap to > the ADC at IC10 (sheet2), you can see that the MCU (IC12) reads the > (scaled) mains voltage, there. > > This allows the MCU to detect an outage before the filtered DC at the > comparator has seen its effects (look at the RC).
Yes, your analysis makes sense. Thank you. T1 functions as a fairly foolproof sensor. Its PHAS-REF and IN-RECT outputs signal AC availability. IC21 is technically a Precision Programmable Reference. The circuit's topology utilizes it as a temperature compensated, 2.5 VDC reference. D20 and D21 function as an "or power gate," so to speak. To enable energy to flow from either the battery or AC. Why? Because if the battery's been drained it's unable to provide 24V and AC must be used instead. Open question, does: 1. the fully-charged battery or 2. T1, provide the requisite energy for 24 VDC, during normal use? The 87C51 inputs PHAS-REF on pin 14. It probably serves as an interrupt. The IN-RECT passes through an ADC0831 Multiplexer on its way to pin 28. From where the 87C51 decides whether the AC failed. Danke, -- Don, KB7RPU, https://www.qsl.net/kb7rpu There was a young lady named Bright Whose speed was far faster than light; She set out one day In a relative way And returned on the previous night.
On 5/11/2023 9:58 AM, Don wrote:
> Don Y wrote: >> Don wrote: >>> bob prohaska wrote: >>>> boB wrote: >>>>> ..... >>>>> all it has to do is wait for the AC >>>>> input to go away >>>>> .... >>>> >>>> That's the core of my question. How is the decision made? Is >>>> there a dedicated power management IC for the purpose? >>> >>> The AC-OK sensor circuit of an old UPS design is found on Sheet 1, in >>> the upper right corner (D8 - C5): >>> >>> <https://electronics-components.ru/files/2015/732pschem_765.pdf> >>> >>> AC's apparently applied to a transformer, rectified, and compared >>> against a zener diode reference. It's relatively simple circuit. >> >> I think you'll find that the purpose of that "AC_OK" signal is to >> enable the front panel buttons to power on the UPS. I.e., all it >> does is enable a fused 24V battery connection to the rest of the >> circuitry. The *5A* fuse on a 24V battery would clearly not be >> enough to support a 1400VA load! >> >> If, in stead, you examine the connection of that same XFORMER tap to >> the ADC at IC10 (sheet2), you can see that the MCU (IC12) reads the >> (scaled) mains voltage, there. >> >> This allows the MCU to detect an outage before the filtered DC at the >> comparator has seen its effects (look at the RC). > > Yes, your analysis makes sense. Thank you. > > T1 functions as a fairly foolproof sensor. Its PHAS-REF and IN-RECT > outputs signal AC availability. > > IC21 is technically a Precision Programmable Reference. The circuit's > topology utilizes it as a temperature compensated, 2.5 VDC reference. > > D20 and D21 function as an "or power gate," so to speak. To enable > energy to flow from either the battery or AC. Why? Because if the > battery's been drained it's unable to provide 24V and AC must be used > instead. Open question, does: 1. the fully-charged battery or 2. T1, > provide the requisite energy for 24 VDC, during normal use?
Different models have different start-up requirements. E.g., some won't start if mains are unavailable. Others don't seem to care. [I learned this during an outage when I figured I could drag *charged* UPSs to various spots around the house to power small lighting loads: "Why won't this one turn on?? But, this other one *did*?!"]
> The 87C51 inputs PHAS-REF on pin 14. It probably serves as an interrupt. > > The IN-RECT passes through an ADC0831 Multiplexer on its way to pin 28. > From where the 87C51 decides whether the AC failed.
The key is to think about what the rest of the circuit HAS to normally do. I.e., SOMETHING has to track the phase/frequency of the mains in order to be able to "step in" without introducing an unconstrained disturbance to the load (e.g., mains was at the 90 degree point in its cycle but the rest of the circuit wants to start up thinking 0 degrees to be a more *logical* place to "start" from) So, you can see the MCU is responsible for generating the sine wave "reference" for the inverter -- in sync with the mains (to some specific degree). And, if so, it can look at the mains at any/many instant to verify it is *still* available. I suspect they select the various relays for short switching times as they tend to cite 2-4ms as a switchover time. [Note that they also detect if relay contacts get welded; I suspect they had a few "spectacular" examples of that! :> And, reactive component of load]
Don Y <blockedofcourse@foo.invalid> wrote:
> > So, you can see the MCU is responsible for generating the sine wave > "reference" for the inverter -- in sync with the mains (to some > specific degree). And, if so, it can look at the mains at any/many > instant to verify it is *still* available. >
This largely answers my question. I'd been trying to think of a way to detect mains loss without a local replica. Evidently that's not how it's done. Thanks for writing! bob prohaska
On 5/12/2023 2:02 PM, bob prohaska wrote:
> Don Y <blockedofcourse@foo.invalid> wrote: >> >> So, you can see the MCU is responsible for generating the sine wave >> "reference" for the inverter -- in sync with the mains (to some >> specific degree). And, if so, it can look at the mains at any/many >> instant to verify it is *still* available. >> > > This largely answers my question. I'd been trying to think of a way > to detect mains loss without a local replica. Evidently that's not > how it's done.
It depends on how *quickly* (and reliably) you want to be able to signal a loss of mains. In products, I typically just run the rectified AS to a pin on the processor and "watch" to see that I get a zero-crossing event every 8.3 (60Hz) or 10 (50Hz) milliseconds. If I "miss" one or two, I figure the AC power has failed and I am now operating off "stored charge" (either in filter caps or backup battery). But, I'm not concerned with how *quickly* I can notice that condition. Rather, I use it to determine what the mains frequency is (50 vs 60) and to frequency lock sampling algorithms to it's instantaneous frequency -- as well as timekeeping functions. UPS wants to detect sooner because loads may not be able to carry themselves for very long in the absence of power. Figure out what your needs (response time) are and that will drive your decision as to how to detect.
<https://electronics-components.ru/files/2015/732pschem_765.pdf>

Time to update my analysis. :)

Q41 acts as a switch to more-or-less "square up" PHAS-REF. It's off time
is skewed slightly due to the 0.7 VDC required to turn it on. So it 
stays off a little longer than ideal.
    When Q41's off the 87C51 pulls P3.4 up to 5 VDC. If the UPS is 
supposedly powered-on but P3.4 stays stuck on one (5 VDC), the software 
knows there's no AC present at T1. Otherwise the frequency of P3.4 
indicates one component of AC health.

Danke,

-- 
Don, KB7RPU, https://www.qsl.net/kb7rpu
There was a young lady named Bright Whose speed was far faster than light;
She set out one day In a relative way And returned on the previous night.

On 5/12/2023 9:52 PM, Don wrote:
> <https://electronics-components.ru/files/2015/732pschem_765.pdf> > > Time to update my analysis. :) > > Q41 acts as a switch to more-or-less "square up" PHAS-REF. It's off time > is skewed slightly due to the 0.7 VDC required to turn it on. So it > stays off a little longer than ideal. > When Q41's off the 87C51 pulls P3.4 up to 5 VDC. If the UPS is > supposedly powered-on but P3.4 stays stuck on one (5 VDC), the software > knows there's no AC present at T1. Otherwise the frequency of P3.4 > indicates one component of AC health.
Mainly, it (and the associated R+D) act as a buffer/level-translator to ensure the MCU doesn't see anything outside it's normal input voltage range (PHAS-REF likely exceeds Vcc and falls below ground). It relies on the (weak -- ~10K?) pullups in the I/O port to source current for the input stage. As it's such a low bandwidth signal (i.e., wasteful of a device pin), I like to multiplex other information onto it; the most common use being *state* of the power supply (or, battery backup). E.g., periodic "edges" (coincident with zero-crossings) let you know that the mains are present AND their nominal frequency/phase. When the mains "go away", a DC level (i.e., no edges) tells you this. And, the "other" DC level tells you when your primary power (filter caps, battery, etc.) is about to go tits up... time to move persistent data into NVRAM and bring the field to an orderly shutdown (before the hardware forces a RESET)
Don Y <blockedofcourse@foo.invalid> wrote:
> > Figure out what your needs (response time) are and that will > drive your decision as to how to detect. >
No real need, merely curiosity. Especially how mains loss might be detected without recourse to a microprocessor. I started out thinking in terms of using comparators and RC filters. Clearly I'm out of date! Thanks for writing, bob prohaska
On 5/14/2023 11:10 AM, bob prohaska wrote:
> Don Y <blockedofcourse@foo.invalid> wrote: >> >> Figure out what your needs (response time) are and that will >> drive your decision as to how to detect. >> > No real need, merely curiosity. Especially how mains loss might > be detected without recourse to a microprocessor. I started out > thinking in terms of using comparators and RC filters. Clearly > I'm out of date!
Again, depends on how quickly you need to come to that conclusion. You can filter the rectified AC and let that decay at a known rate until it falls below some threshold. You can trigger a (retriggerable) one-shot at each zero-crossing with a period slightly longer than a half-cycle and wait for it to time-out. [These -- and variations -- are the most obvious approaches] But, note that you not only have to determine that it has "failed" but, also, when it has returned to a stable state! You wouldn't want to be "chattering" as power flickered, came back, failed and then returned with a whimper. And, while power is out, you would need to synthesize a nominal sine wave (even if you aren't a pure-sine inverter) that's relatively stable. MCUs are just too inexpensive NOT to use for such a variety of tasks.