The issue of proper modeling and control for industrial systems is one of the challenging issues in the industry. In addition, in recent years, PID controller design for linear systems has been widely considered. The topic discussed in some of the articles is mostly speed control in the field of electric machines, where various algorithms have been used to optimize the considered controller, and always one of the most important challenges in this field is designing a controller with a high degree of freedom. In these researches, the focus is more on searching for an algorithm with more optimal results than others in order to estimate the parameters in a more appropriate way. There are many techniques for designing a PID controller. Among these methods, meta-innovative methods have been widely studied. In addition, the effectiveness of these methods in controlling systems has been proven. In this paper, a new method for grid control is discussed. In this method, the PID controller is used to control the power systems, which can be controlled more effectively, so that this controller has four parameters, and to determine these parameters, the optimization method and evolutionary algorithms of genetics (EGA) and PSO are used. One of the most important advantages of these algorithms is their high speed and accuracy. In this article, these algorithms have been tested on a single-machine system, so that the single-machine system model is presented first, then the PID controller components will be examined. In the following, according to the transformation function matrix and the relative gain matrix, suitable inputs for each of the outputs are determined. At the end, an algorithm for designing PID controller for multivariable MIMO systems is presented. To show the effectiveness of the proposed controller, a simulation was performed in the MATLAB environment and the results of the simulations show the effectiveness of the proposed controller.