Seems pretty straightforward, conceptually. Sense the presence of AC voltage, and when the AC voltage goes below a certain threshold (e.g., it goes away), close some switches to connect an alternate AC supply in less time than it takes for the computer's power supply caps to completely discharge.
If they were powering it from a DC source, like a battery, that would be the way to go. However, it looks like they are powering the device with a separate AC supply. Connecting one AC supply to another -- synchronizing voltage, frequency, and phase -- turns out to be difficult.
The most practical method of doing so is by first converting to DC before converting back to AC. In fact, the interconnects that link the regional power grids in the US are high-voltage DC, because, among other reasons, that allows the grids to be unsynchronized.
The advantage of the simple sensor-and-switch approach is that one need not worry about synchronizing the replacement AC source with the original AC source. The downside is that the window for the switchover is pretty small.
Synchronizing phase, and/or hitting that switchover window is trivial for even the cheapest microcontroller. One cycle at 60Hz seems fast but its an eternity for a 20Mhz uC.
I'm going to guess "detects the drop and hits the window" simply because this is how cheap UPS units work and I'd bet a month of lattes that its made of cheap UPS guts.
Yes, 20 MHz is a higher frequency than 60 Hz. While that would help for the sensor version of the design, it would not directly help for the synchronization of the AC sources. It might help you while building a switching supply to do the AC to DC conversion, and it could help when approximating a sine wave on the DC to AC conversion.
Still, all of that is quite a bit more complicated than just quickly switching in a new source when the other source drops out.
(Credentials: I'm an electrical engineer and have designed and built power supplies.)
can you explain how synchronizing phase is trivial? the previous post made sense to me. it is hard to shift phase.
i agree that you could not try, and instead "hit the gap" (in which case synchronizing phase isn't important), but if you don't do that, and instead want to connect two supplies at once, how does a microcontroller make that easy?
Firstly, you don't need to phase shift here, because you'll need to generate AC from DC (battery), so you may as well generate it in phase with the signal from the outlet.
Secondly, if you need a phase shifting device (for something else), depending on the requirements, there are a number of options starting with something as simple as an RC unit.
Thirdly, generating "AC" [periodically changing signal] of a given voltage and an (approximate) frequency in sync with some other signal is what CRT TVs did (for the CRT).
> it is hard to shift phase.
Not to the engineers building these kinds of devices
(I'm explaining high school to freshman Physics here)
maybe instead of explaining the obvious you should read the original comments. the comment i was defending was about converting ac to ac. their conclusion was that it would need to go through dc (which no-one, including me, has disagreed with).
I think you don't understand the basic physics of electricity. There is no need to detect a drop in the voltage. If you connect two sources of electricity of the same voltage (whether DC or AC in phase), the resulting voltage is still the same. (Secondly, if you don't have access to the insides of the machine, you can only feed it with AC)
> synchronizing voltage, frequency, and phase -- turns out to be difficult.
In my real life as an electrical engineer designing power supplies, I learned that you can't just hook in a second unsynchronized AC source to a circuit and expect everything to be peachy. Frequency, phase, peak voltage, waveform shape (and therefore RMS voltage) -- all of these things are important if you're going to have multiple AC sources. Yes, the math becomes much simpler if all of those parameters (except for voltages, of course) are identical, but conditioning the sources to achieve that state is far from trivial. That gets back to my earlier comment about how in the real world, a trip through DC is often required.
If we were simply adding another DC supply in parallel with an existing DC supply, things would be much simpler. Assuming that the voltages of the supplies were identical, assuming that the resistance of the wires between the supplies, and assuming that the supplies remained linear for the expected load, then sure, just hook the new one in, disconnect the old one, and call it a day. The big difficulty is that, as you mentioned, the machines are designed to consume AC. I suppose that one could crack open the case and start hooking into the DC lines after the power supply, but the number of required voltages would make that rather difficult.
This is a problem that has been solved many times and is (relatively) inexpensive. It is called a "grid tie" power inverter, commonly used with solar panels.
At least that's my guess on how it works.