Autonomy is considered an important criterion that characterizes the performance of electric vehicles. It is represented by the distance that could be traveled by a fully electric vehicle which mainly depends on several parameters such as the vehicle model, type of battery, type of motor, etc. In this context, to improve the autonomy of electric vehicles, this paper represents an optimization study for the electric motor based on two contributions. The first devise an energy optimization algorithm to reduce the motor losses by calculation of the stator flux reference according to the electromagnetic torque and the rotation speed. The second is concerned with controller parameters adjustment using the Particle Swarm Optimization (PSO) technique to improve the efficacy and robustness of the drive. The performance of this strategy is evaluated in terms of torque, flux ripples, and transient response to step variations of the torque control. A comparative study of the designed PI controllers based on PSO with four other control algorithms and tuning methods is established in order to prove the efficiency of PI_PSO. The analysis, modeling, and simulation results are presented to verify the validity of the proposed overall optimization study.