Electric vehicles have become more popular as they help in reducing pollution and require no gasoline in comparison to other automobiles. As a result, it is essential to develop fastcharging terminals for electrical vehicles (EV) where terminals are operated through dc microgrids. This will help us to alleviate concerns about power quality and increase the efficiency. This work proposes the model predictive control (MPC) and Proportionalintegral (PI) techniques to control a bidirectional Buck-Boost converter that is utilized to exchange power between a dc-microgrid and energy storehouse devices. This presented system comprises 2 solar panels with attached converters, storehouse systems, dc loads, and ports for Electric Vehicle charging, and a converter for AC utilities. By controlling the gating of proposed converter by PI and MPC control techniques, the flow of power between battery and microgrid is controlled. Using MATLAB, a bipolar DC microgrid under different climatic conditions and for various loads is simulated and examined voltage unbalance issues.