I am trying to create a circuit that will allow me to control the polarity of the current flowing through a coil in order to attract or repel a magnet. I would like to use two MOSFETs in series since activating a single MOSFET will half wave rectify the current by flowing through the body diode of the other MOSFET.
I have attached a simplified version of what I have envisioned. A microcontroller (not shown) would control through the Opto-coupler. The circuit works fine until the bottom MOSFET is activated. When that happens, on the negative AC power cycle the power flows through the bottom MOSFET, takes a least path of resistance shortcut at the problem point to the bridge rectifier and back to it's home in 110VAC. Poof.
In theory, a battery could operate this circuit fine, but my I would like to design this circuit so it works completely on AC power. How can I control these MOSFETS without shorting the circuit?
simulate this circuit – Schematic created using CircuitLab