The shaft riveting assembly process is a very effective method for assembling lightweight, integrated, and highly reliable automobile wheel hub bearings. This paper proposes a method to determine the motion equation of a rivet head during the shaft riveting process based on a theoretical derivation, on-site test results, and structural equipment parameters. Based on the structure of the riveting machine, the motion equation of the rivet head is deduced through the combined application of a rectangular spatial coordinate system and the Euler angle method. In addition, the axial displacement and axial riveting force of the spindle were measured during the shaft riveting process using a newly developed on-site testing system. The axial velocity of the rivet head is determined using the spline function method based on the measured axial displacement–time curve. Subsequently, the motion equation of velocity and three-axis angular velocity of the rivet head can be obtained based on the deduced motion equation of the rivet head, test data, and structural equipment parameters. Finally, the motion equation of the rivet head is validated by simulating the shaft riveting process using the finite-element (FE) method, and then comparing the simulated axial riveting force and final geometric shape of the riveted hub shaft with the experimental ones. The result shows that the method proposed in this paper lays the foundation for the numerical simulation and optimization of the shaft riveting technology for a wheel hub bearing unit.