ups working principle and block diagram