Increasing of word demand load caused a new Distributed Generation (DG) to enter to powersystem. One of the most renewable energy is the Photovoltaic System. It is beneficial to use thissystem in both separately as well as connected to power system using power electronics interface.In this paper an optimal PID controller for Photovoltaic System systems has been developed. Theoptimization technique is applied to PID optimal controller in order to control the voltage ofPhotovoltaic System against load variation, is presents. Nonlinear characteristics of loadvariations as plant input, Photovoltaic System operational behavior demand for high qualityoptimal controller to ensure both stability and safe performance. Thus, Honey Bee MatingOptimization (HBMO) is used for optimal tuning of PID coefficients in order to enhance closedloop system performance. In order to use this algorithm, at first, problem is written as anoptimization problem which includes the objective function and constraints, and then to achievethe most desirable controller, HBMO algorithm is applied to solve the problem. In this study, theproposed controller is applied to the closed loop photovoltaic system behavior. Simulation resultsare done for various loads in time domain, and the results show the efficiency of the proposedcontroller in contrast to the previous controllers.