Common-mode current is one of the major challenges in transformerless grid-connected photovoltaic (PV) inverters. This current is affected when the PV arrays are exposed to different environmental conditions and its value increases. This paper attempts to investigate the effect of mismatched condition on voltage balance of PV arrays, which leads to the increment of common-mode current. A new circuit structure is presented for compensating for voltage drop caused by partial shading and ambient temperature and removing the effect on the common-mode current. To validate the proposed structure, a laboratory prototype of this circuit is implemented.