Imperial March on a fast switching valve

Word of warning - physically connecting and disconnecting an inductive load like that
generates very high frequency high voltage transients in the contact arcing that can
trash the driver (even if it has protection). Power down before disconnecting
is the rule.