In this paper, a control strategy of STATCOM subsynchronous oscillation controller was proposed based of electrical damping calculation. First the simplified formula of electromagnetic torque and electrical damping used in power system including STATCOM was derived. And the effects of the voltage regulating function of STATCOM on subsynchronous damping were analyzed. The damping near the resonant frequency could be complicated by the voltage regulation. This would bring difficulties to the design of STATCOM controller. Therefore the influence of the torsional frequencies was taken into account, and the comprehensive optimal phase compensation was used as the object based on the formula of electrical damping. Thus the design of the controller parameters was transformed into a optimization problem, and genetic algorithm was used to solve it. Finally, the validity of the controller is proved by the eigenvalue calculation and time domain simulations.