Trouble with H-Bridge

One more thing: 1N4004 are really really slow (reverse-recovery time) and thus not suitable for use as catch diodes. You need faster diodes, e.g. a Schottky of some sort. Using slow diodes while PWMing the motor current can put high-voltage spikes back into your DC bus, and can also blow up the FETs by exceeding their Vdsmax (V = L * dI/dt).