Development of a Closed-loop degaussing system