This paper presents three different LQ controllers, which are used to attenuate rotor vibrations in an electrical motor. The controllers are compared in performance and control effort. A method of solving the related Riccati equation is discussed to overcome the issue of finding the solution, when the model including disturbance dynamics is not stabilizable. One LQ controller is calculated utilizing particle swarm optimization, and the benefits of doing so are evaluated with respect to the cases when no optimization was used in tuning the controller.