This paper presents an optimal control strategy for a permanent-magnet synchronous hub motor (PMSHM) drive using the state feedback control method plus the grey wolf optimization (GWO) algorithm. First, the linearized PMSHM mathematical model is obtained by voltage feedforward compensation. Second, to acquire satisfactory dynamics of speed response and zero d-axis current, the discretized state space model of the PMSHM is augmented with the integral of rotor speed error and integral of d-axis current error. Then, the GWO algorithm is employed to acquire the weighting matrices Q and R in liner quadratic regulator optimization process. Moreover, a penalty term is introduced to the fitness index to suppress overshoots effectively. Finally, comparisons among the GWObased state feedback controller with and without the penalty term, the conventional state feedback controller, and the genetic algorithm enhanced PI controllers are conducted in both simulations and experiments. The comparison results show the superiority of the proposed state feedback controller with the penalty term in fast response.