|Abstract Taking a single magnet levitation system as the object, a nonlinear numerical model of the vehicle–guideway coupling system was established to study the levitation control strategies. According to the similarity in dynamics, the single magnet-guideway coupling system was simplified into a magnet-suspended track system, and the corresponding hardware-in-loop test rig was set up using dSPACE. A full-state-feedback controller was developed using the levitation gap signal and the current signal, and controller parameters were optimized by particle swarm algorithm. The results from the simulation and the test rig show that, the proposed control method can keep the system stable by calculating the controller output with the fullstate information of the coupling system, Step responses from the test rig show that the controller can stabilize the system within 0.15 s with a 2 % overshot, and performs well even in the condition of violent external disturbances. Unlike the linear quadratic optimal method, the particle swarm algorithm carries out the optimization with the nonlinear controlled object included, and its optimized results make the system responses much better.