In this paper, an autonomous communication-based centralized control for DC microgrids (MG) has been developed and implemented. The proposed controller enables smooth transition between various operating modes. Finite state machine (FSM) has been used to mathematically describe the various operating modes (states), and events that may lead to mode changes (transitions). Therefore, the developed centralized controller aims at optimizing the performance of MG during all possible operational scenarios, while maintaining its reliability and stability. Results of selected cases have been presented. These results show stable transition between modes, verifying the validity and applicability of the proposed controller.