I am trying to power an ultrasonic transducer using an H-bridge inverter design to convert an Arduino signal into a higher power AC square wave (shown in the circuit below).
It was working well, then suddenly I started getting high voltage spikes in the rising and falling edge of the square wave. I am using a high varying driving voltage of 15-60 V (VDC in the schematics) and I have seen that increasing this voltage distorts the output more. I am hoping to drive the transducer from 20 kHz to 30 kHz.
This is a zoomed in picture of it:
You can see that the top of the square wave is collapsed slightly as well as the spikes on the bottom left of the picture.
I've tried rebuilding the circuit using new components on a different PCB but I'm still encountering the same problem. I am thinking it might have something to do with the MOSFETs (IRF4227), but I have changed them to a different type of MOSFETs (IRF540n) and the problem still continues. I have also changed the bootstraps capacitors to a larger value of 330 nF from the 22 pF in the schematics but it did not do anything for the distortion.
Thank you very much for any help you can give.