The use of batteries is one of the most important technologies for energy storage. Nowadays, there exist diverse types of batteries with different characteristics under charging and discharging conditions; their usage varies according to the specific application. Different power electronics circuits can be used to control the charge and discharge of a battery; one of the most implemented is the DC-DC Buck-Boost converter. Typically, the controllers for this kind of converters depend on the inductor and capacitor parameters, which differ for every application depending on the desired voltage and current at the output of the converter. The objective of this work is to develop a neural controller with on-line identification of the control variables for the battery bank charge and discharge processes required to be connected to a DC Microgrid. The proposed controller does not depend on the converter parameters; for this reason, it can be used under different voltage and current requirements without considering changes in its implementation. Another advantage of the proposed controller, is that a unique control law can be employed for both buck and boost discharging and charging operations.