Magnet field control