In this paper, a four-power-semiconductor-switch-based three-phase inverter is proposed for renewable energy source integration to a generalized microgrid system. The proposed topology b-4 of three-phase inverter is investigated to make the commercial microgrid system to be cost effective and hardware optimized. A simple sine-pulse-width-modulation-based (SPWM) control strategy is proposed for the b-4 inverter topology instead of the traditional complex four-switch-based space vector techniques. The overall control structure is implemented using the Lyapunov function-based nonlinear controller to track the inverter current directly in the a-b-c frame so that a specific amount of active and reactive grid power flow to the grid can be controlled in a decoupled manner along with low total harmonic distortion of grid currents in the presence of nonlinear load at the point of common coupling (PCC). A novel technique of using the spatial repetitive controller (SRC) is also proposed to eliminate the effect of midpoint voltage fluctuation of the dc link even in the case of asymmetrically split dc-link capacitors without any extra voltage or current sensors unlike conventional methods. Detailed experimental results are provided to show the efficacy of the proposed hardware system for grid-connected applications in the microgrid.