In this paper, a novel voltage controller of energy storage system (ESS) in DC microgrids (DC-MG) is proposed to enhance the DC-bus voltage stability. At first, a mathematical model of the DC-MG is developed in a state-space form. Then, the voltage controller of the ESS is designed by using the methodology of the IDA-PBC (interconnection and damping assignment-passivity-based control) with an integral action. System stability has been analyzed with passivity-based stability criterion (PBSC). The proposed controller gives the robust performance to the parameters variation. The validity of the proposed control scheme has been verified by the hardware-in-the-loop simulation (HILS) results.INDEX TERMS Active damping, DC microgrids, DC-bus voltage stability, ESS, IDA-PBC.