How an Automatic Transfer Switch (ATS) Works with a Generator