A Single-Stage Dual-Active-Bridge AC–DC Converter Employing Mode Transition Based on Real-Time Calculation