Compared with other electric vehicles, the ride comfort of the electric vehicle with the in-wheel motor as a dynamic vibration absorber has significantly improved. However, the in-wheel motor is used as a dynamic vibration absorber, aggravating the motor vibration, thus affecting motor performance and life. In addition, the space inside the wheel is limited, so the vibration displacement of the motor relative to the hub needs to be constrained. In fact, the literature on ride comfort of the electric vehicle with the in-wheel motor as a dynamic vibration absorber has hardly considered motor vibration. So, this article comprehensively investigates the ride comfort and motor vibration of this electric vehicle. Firstly, the vibration model of the electric vehicle with the in-wheel motor as a dynamic vibration absorber is established. Then, the optimisation model of this electric vehicle is founded. Next, the multi-objective particle swarm optimisation algorithms based on adaptive grid and crowding distance are used to optimise the model, and these two algorithms are compared. The optimal solutions in three typical cases are obtained. Finally, the vibration responses of this electric vehicle model before and after optimisation, the traditional electric vehicle model, and the in-wheel motor drive electric vehicle model are compared in case 1. The results show that all vibration responses are improved to different degrees after optimisation; the algorithm based on crowding distance can seek out the optimal solutions faster, but it takes longer to complete the whole optimisation process.