###### Abstract
The result in the MG is a less complex system to control [6]; even a higher efficiency is reached in DC distribution [7]. These are the reasons to select a DCMG able to interacts with mains for this development. PECs are an important part of the DCMG architecture because they add control and flexibility to the system to work in a harmonic way. In order to reach this system condition, the most popular option is to implement a coordinated control structure. Agreed with norm ISA-95, several layers of control can be established in a hierarchical control structure [8]. Operations such as voltage and current regulation, maximum power point tracking (MPPT), battery state of charge (SoC) estimation and some other basic functions take place at zero level [9;10]. At level number one: droop control, virtual impedance loop and power calculation that can be performed with variables measured and processed in the own converter [11; 12; 13]. The local control stage includes level zero and level one of the hierarchical control structure. In higher levels, supervisory control brings extended functions to MG such as: secondary control to eliminate voltage deviations, tertiary control to manage connection-disconnection events with mains and the ability to change the operation mode in a specific converter [14;15]. All of these tasks can be combined as algorithms of an EMS, which fulfill one of several specific system purposes. Coordinated control is reached when local control and supervisory control works together. A popular option to implement zero level of local control is a cascade control configuration with an internal current loop and a external voltage loop. Control cascade schemes are reported using different strategies for controllers; proportional-integral (PI) classical controller is the most popular because is easy to tune, brings zero error in steady state and adds robustness [16]. Some other designs for loops are based in: classical proportional-derivative (PD) as filter [17], fuzzy logic [18] and boundary controller [19]. For level one, there are two possible techniques for droop control design: select power as signal output [5] or choose current as feedback signal [20]. In droop control strategy, droop coefficients influence system stability and current sharing, and there is a trade-off between current sharing and voltage bus deviation [21;22]. Sometimes, a virtual impedance loop, droop controller and power calculator strategy can be included. In this paper, a linear technique is selected to design a state feedback as local controller to reach well regulated buses, to support equally shared current distribution and get over input voltage variations; all of these issues are possible because all the dynamics in the PEC feedback Once the local control stage has been defined and taking into account the benefits of state feedback control, an EMS is included as a higher coordinated control level. Coordinated control provides an improved power collected manage, and bus stability can be enhanced [23]. An EMS allows to harness power collected from DGs to the loads in a defined way. The DCMG structure and the EMS design can be diverse, and they are made up in accordance with the specific objectives that are desired to be achieved. Some of EMS are reported perfoming basic tasks such as management of the energy between source and load based on optimal scheduling [24] and power flow management depending on ESS batteries Soc [25], using virtual impedance [26], or based in fuzzy logic [27]. In this paper, a novel EMS is focused to harness all the power harvested in PV arrays to supply the loads, to charge the ESS batteries or to inject to mains is presented. The EMS is conceived in a similar way to an industrial production system, under the premise that all of the energy that is produced in the DGs is consumed in its entirety. The EMS is modeled as a Petri net and has three stages: startup test, source condition establishment stage and load condition establishment stage.