This research aims to propose an optimal controller for controlling the speed of the Direct Current (DC) motor. Based on the mathematical equations of DC Motor, the author builds the equations of the state space model and builds the linear quadratic regulator (LQR) controller to minimize the error between the set speed and the response speed of DC motor. The results of the proposed controller are compared with the traditional controllers as the PID, the feed-forward controller. The simulation results show that the quality of the control system in the case of LQR controller is much higher than the traditional controllers. The response speed always follows the set speed with the short conversion time, there isn't overshoot. The response speed is almost unaffected when the torque impact on the shaft is changed.