This work presents a new control method to track the maximum power point of a grid-connected photovoltaic (PV) system. A backstepping controller is designed to be applied to a buck-boost DC-DC converter in order to achieve an optimal PV array output voltage. This nonlinear control is based on Lyapunov functions assuring the local stability of the system. Control reference voltages are initially estimated by a regression plane, avoiding local maximum and adjusted with a modified perturb and observe method (P&O). Thus, the maximum power extraction of the generating system is guaranteed. Finally, a DC-AC converter is controlled to supply AC current in the point of common coupling (PCC) of the electrical network. The performance of the developed system has been analyzed by means a simulation platform in Matlab/Simulink helped by SymPowerSystem Blockset. Results testify the validity of the designed control method.