i'm not sure what the OP is trying to accomplish here. most UPSs only charge batteries while the incoming line supply is good, and turn on when the AC line drops out. if the device is supposed to act as a current booster, one alternative (and a far simpler one) is to connect an analog amplifier as a Negative Impedance Converter. an NIC would maintain the same phase as the power line because its input IS the power line. if the purpose is to provide a distributed power system, then a system of phase locked diesel generators (or other primary power sources) would be the way to do this. the way that the power grid maintains phase lock, is actually a consequence of the alternators at a power station, also behaving like a motor, more specifically like a synchro motor. this property of the machinery keeps all of the alternators in lockstep.