How do UPS trigger circuits work?...

B

bob prohaska

Guest
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
 
On Mon, 8 May 2023 21:55:47 -0000 (UTC), bob prohaska
<bp@www.zefox.net> 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

Partly depends on the topology of the inverter/charger or UPS.
Not sure about the one on Amazon.

An inverter/charger like the one you referenced could use either a
separate charger circuit not shared with the inverter OR it could use
the same circuitry for charging than it does for inverting.

If it is a separate charger, then all it has to do is wait for the AC
input to go away and turn off its AC input relay but keep inverting
off the battery storage.

If combined inverter/charger, it can be more difficult to know when
the grid AC is gone so that the inverter does not try to drive the AC
input line since the AC load output would be connected directly to the
grid or shorepower input. That is more or less how a grid tie
inverter works that can sell power back to the grid or AC input.
That is called anti-islanding and has strict regulations the company
must follow but I don\'t think this inverter/charger does this
function. So that inverter/charger might take a couple of seconds to
find that the AC input went away and invert properly.

Usually, when the AC grid goes away, there will be a short time where
there is NO AC output until things stabilize. If it uses a completely
separate charger and inverter, the it can be truly UPS or
uninterruptabe power when the grid goes away.

One or two AC cycles is typical for a good/fast inverter/charger to
transfer. Relays take a couple milliseconds to switch.

Lettuce know if you happen to take it apart. The inverter company
support or sales people probably won\'t know how it works. The manual
won\'t say either.

boB
 
On 5/8/2023 2:55 PM, 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

Or \"harmful transients\", etc. Depends on the UPS and the UPS\'s
topology.

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\".

A UPS has limits on what it expects of the AC line. E.g., most will gripe
if you connect it to a 67Hz 145V supply -- it\'s not what the device
expects.

Within the operating limits of the device, you assume a sine wave is
present at the input. You know what a sine wave looks like for any
given frequency and peak voltage. So, if what you are seeing *now*
deviates from what you *expected*, the AC line is not compliant.

An online topology just alarms on this condition; it\'s already been
powering the load from battery power even with mains voltage present.
They are (amusingly) more common for *big* loads.

An offline (standby) UPS will use this signal to activate a relay that
routes power from the inverter to the load (the inverter, hopefully,
having been kept in phase with the mains). They are common for tiny
loads (and people with limited resources)

A line-interactive UPS is a bit of a combination; an autotransformer
works to boost/buck under/over-voltage line conditions. The inverter
takes over when the UPS has determined that the mains are malfunctioning
beyond those limits. This tries to bridge the load/cost for modest
sizes at modest costs.

In each case, you don\'t need to see the mains \"gone\" in order
to determine that it is \"going away\". You just notice that the
input isn\'t what it should be -- if it was behaving according to the
operating constraints placed on the UPS by its designer.

UPSs often gripe when connected to a \"synthetic\" mains source (e.g., genset)
because the genset often exhibits variations in frequency and voltage
that go beyond what the UPS *expects*. So, it engages more often than
*might* be necessary (depends on how tolerant your loads are of these
variations)

[Try powering a UPS from other UPSs of varying grades to see how
it likes *their* outputs! :> ]

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
 
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.
 
boB <boB@k7iq.com> 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?


away and turn off its AC input relay but keep inverting
off the battery storage.


Lettuce know if you happen to take it apart. The inverter company
support or sales people probably won\'t know how it works. The manual
won\'t say either.

I did take a few photos of the insides, but to me they weren\'t
very informative:
http://nemesis.zefox.com/~bob/ampinvt/2nd_inverter/board_photos/

Rumor has it that most inexpensive inverters are clones or outright
copies of commonplace designs. If anybody recognizes this one it
would be helpful.

Thanks for reading,

bob prohaska
 
Don Y <blockedofcourse@foo.invalid> wrote:
An offline (standby) UPS will use this signal to activate a relay that
routes power from the inverter to the load (the inverter, hopefully,
having been kept in phase with the mains). They are common for tiny
loads (and people with limited resources)

That\'s what I\'m dealing with.

In each case, you don\'t need to see the mains \"gone\" in order
to determine that it is \"going away\". You just notice that the
input isn\'t what it should be -- if it was behaving according to the
operating constraints placed on the UPS by its designer.

But how is the expetation generated and tested, in a timely fashion?

Thanks for writing,

bob prohaska
 
On 5/9/2023 2:12 PM, bob prohaska wrote:
Don Y <blockedofcourse@foo.invalid> wrote:

An offline (standby) UPS will use this signal to activate a relay that
routes power from the inverter to the load (the inverter, hopefully,
having been kept in phase with the mains). They are common for tiny
loads (and people with limited resources)

That\'s what I\'m dealing with.

They tend not to switch to \"backup\" as quickly.

In each case, you don\'t need to see the mains \"gone\" in order
to determine that it is \"going away\". You just notice that the
input isn\'t what it should be -- if it was behaving according to the
operating constraints placed on the UPS by its designer.

But how is the expetation generated and tested, in a timely fashion?

Likely purely in the time domain. An ADC watching the mains (through
a divider of some sort) and its own internal timebase. It can sample
the line voltage thousands of times per second (so scores per AC cycle?).

[It has to do this in order to keep its own sine-wave generator *tracking*
the mains so that the inverter will have the proper frequency and phasing
if/when activated]

Whether that sine-wave reference/generator is a physical device
or a virtual device (e.g., keeping track of what the mains should be
so that it can drive the inverter to that instantaneous output
voltage), it can compare the reading from the mains to the expected
value from the sine-wave generator. When some difference is detected,
conclude that the mains has failed.

If, for example, the mains just had a positive going zero-crossing
~4ms ago, you would expect the (scaled) mains voltage available at
your ADC to be roughly the peak AC mains voltage (within the tolerance
of the UPS). If, a millisecond later, it\'s *0* volts, then obviously
something is wrong -- because a sine wave doesn\'t decay to 0 volts
for another 4 ms (at 60Hz). I.e., at 4ms it was \"nominal\" but at
5ms it\'s clearly not as expected so switch to the inverter. If the
mains voltage reappears, then you can switch BACK -- after imposing
some hysteresis -- to the mains.

Keep in mind that the UPS has to accommodate variations in frequency
as well as voltage (and disturbances) BUT ONLY TO THE EXTENT ADVERTISED
FOR THE UPS.

[The same measurements also let a line-interactive UPS know when to boost
or trim the mains WHILE they are available]

If you want to use a UPS as an inverter, all you have to do is lie to it
about the availability of mains power! :>

Thanks for writing,

bob prohaska
 
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.

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.
 
Correction: Sheet 1, upper LEFT corner

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 LEFT 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.

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 Tue, 9 May 2023 11:09:03 -0700 (PDT), Fred Bloggs
<bloggs.fredbloggs.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.

The only question is, does this have a built in charger as well as an
inverter ?

Batteries not included of course as a real UPS would have.

boB
 
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.

 
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.
 

Welcome to EDABoard.com

Sponsor

Back
Top