A new controller is designed for performance improvement of a photovoltaic based microgrid (PVMG) system in this paper. The photovoltaic system is integrated to grid via an H-bridge voltage-source inverter (VSI). To enhance the power conversion from the solar panel, an incremental conductance (I&C) Maximum-Power-Point-Tracking (MPPT) controller is designed. The proposed controller comprises of two units namely for accomplishing power quality improvement and MPPT tasks. We design a sliding mode controller for improving power quality. This controller is designed to control the power-flow injection to the PVMG. The results are compared with that of the proportional-integral+proportional-integral-derivative (PI+PID) hybrid controller to evaluate its effectiveness. From the transient performance analysis, it is found that with the proposed controller, it is faster in response, with lesser harmonics and more robust compared to the PI+PID hybrid controller. Also, this system is capable controlling both active and reactive power of the line.