Smart grids have their basis in distribution systems, and to take advantage of their full potential, the incorporation of distributed generation must be taken into account. This new strategy allows the decentralization of power generation and the microgrid represents a very important element in this generation scheme. With this perspective and considering the importance of power converters, this paper presents the development and operation of a reconfigurable photovoltaic inverter; which aims to operate in grid-connected mode and disconnected from this. To achieve this goal, a hierarchical control is proposed that serves as the basis to develop controllers at level one and level two. Particularly, in grid-disconnected operation, in level one of the hierarchical control a droop controller is implemented whose objective is to give the reference to be followed by the voltage loop controller; as well as allow that between inverters parallel connected, these can be distributed the active and reactive power demanded by the load. In level two of the hierarchical control, the controllers of the current and voltage loops are implemented for both modes of operation. Particularly, in grid-disconnected operation, the following contributions are made to this work: an integral sliding mode controller is implemented; which is a novelty for this application. The goal of this controller is to reduce the total harmonic distortion of the voltage signal that is delivered to the local load in this operation mode. Also, it presents a good performance at the moment of the transition of grid-disconnected operation to the connected operation to this. In addition, a synchronization algorithm was implemented for the inverter reconnection with the grid, as well as an algorithm for the detection of islanding.INDEX TERMS Photovoltaic inverter, reconfigurable, hierarchical control, integral sliding mode control scheme, droop scheme, microgrid.