Under the surface-mounted permanent magnet synchronous linear motor (SPMLSM) for constant load obstruction which is known and unknown circumstances, using port-controlled dissipative Hamiltonian (PCHD) method, making the surface-mounted permanent magnet synchronous linear motor models, giving the closed-loop expected Hamiltonian function, and designing the desired interconnection and damping matrix of the system"s controller, analyzing the equilibrium point of the system. However, the load resistance is unknown, and the observer is designed, the simulation results show that the proposed scheme for the text to known and unknown load with good position tracking performance and good disturbance resistance and strong robustness.