synchronous generator working principle