How to build an H-bridge using MOSFETs?
Here's a basic MOSFET H-bridge:







simulate this circuit &ndash; Schematic created using CircuitLab

It's more common for L1 to be a motor, but as far as the H-bridge is concerned, an inductor is the same. A motor is just an inductor that happens to produce mechanical motion.

There are many ways you might drive these MOSFETs. Search for H-bridge drivers at your favorite electronics supplier: they are commodity components. Proper selection is not a trivial topic. I suggest:


Need help choosing H bridge driver
How to reduce MOSFET turn-off delay
What is MOSFET gate drive capability and why do I care about it?


If switching speed is not critical, you may be able to the MOSFETs directly with a microcontroller. Also you could consider a discrete driver.

Note that the diodes drawn need not actually be diodes, they can be the inherent body diode of the MOSFETs if your design parameters allow. There will be current in the diodes only transiently as the H-bridge is changing states, so depending on how fast the switching is, and what the current in that time is, you may remain within the MOSFET's operating parameters. Read the datasheet.

The rate at which you can reverse the current in L1 is limited by the inductance and the voltage you can apply to it (in this case, determined by C1). This is a fundametal property of inductors:

$$ v(t) = L \frac{\mathrm di}{\mathrm dt} $$

It follows that if you want to reverse the current very quickly, you must minimize inductance and maximize voltage.

Also bear in mind that when you change directions on the H-bridge, the inductor will reverse the direction of current in the capacitor and charge it. This will continue until the current has decreased to 0, at which point the capacitor will start discharging and current will start flowing in the opposite direction.