This paper investigates the design of a robust non-linear backstepping controller for the DC-AC microgrid comprising a photovoltaic source and a battery energy storage system with grid integration, all feeding a non-linear load, to improve its power quality and dynamic stability. A unidirectional DC-DC boost converter and a bidirectional back boost converter are used on the DC side to connect the photovoltaic module and battery storage to the DC bus. The three phases of the voltage source inverter are connected to the electrical grid via an inductive filter on the AC side. The control objectives are fourfold: i) Produce the maximum power from the photovoltaic system regardless of variations in weather conditions (temperature and irradiation); ii) Keep the DC link voltage constant and close to a given reference value under various conditions to ensure a balance of power between the DC and AC sides; iii) Active power control by injecting excess power into the grid; iv) Propose an energy management strategy to optimize the energy consumption of each source: the solar source, the grid, and the battery storage. Simulation results under different operating conditions, parameter variations, and load disturbances are presented and discussed to verify the performance satisfaction of the proposed controllers. An improvement in the overall dynamic performance of the microgrid is demonstrated, with a reduction in voltage overshoot (4.8%) and settling time (5.6ms) on the DC bus, along with reduced total harmonic distortion (THD) in grid current (0.29%) when compared with the other controllers in this work: the proportional integral controller (voltage overshoot (5.8%), settling time (15.5ms); grid current THD (6.53%)) and sliding mode controller(voltage overshoot (4.6%), settling time (15ms), grid current THD (3.53%). finally, several tests have been conducted on the proposed microgrid to evaluate the controller's efficiency in maintaining power balance during irradiation distortion and non-linear load imbalance.