welding generator working principle