Control circuit for electromagnetic device