I have been an EE for over forty years and never did find out the right answer to this one....
How do power-stations and transformer switching stations ensure that the power they are feeding into the grid is in-phase with the existing power on the lines.
I know they are VERY serious about setting the line frequency to a ridiculously good accuracy. However, obviously, you can not connect a power line to another line that is 180degress out of phase. Even a small deviation would presumably cause a huge drain on the system and generate a rather strange, and out-of-spec AC waveform.
OK I can imagine a solution at the power station that uses the target line frequency to synchronize the alternators before flipping the switch perhaps. However, that switching station 100km away maybe switching onto a line from a different alternator that is much closer or farther away and consequently at a different point in the phase cycle...
How do they do that...
Note his is NOT the same as "How to synchronize a generator on the electrical grid?" That article only pertains to a local generator and is not, in my mind, the same as the main power grid and transformer switching.