In this article, we investigate the problem of flexible energy management in future reconfigurable factories and propose some Smart-Grid solutions required to use volatile renewable energy resources for its energy supply. Modular architecture of the factory is assumed, where the modules are autonomous also in terms of their energy supply. OPAL-RT simulations are conducted and prototype power electronics solution for rectifier and inverter are presented.