how to fix residual magnetism in generator