Method and Apparatus for Obtaining Soft Switching in all the Switching Elements Through Current Shaping and Intelligent Control