Using the parametric modelling feature in Solidworks software, a three-dimensional solid model of a planetary gearbox with linear reciprocating motion of the output shaft was constructed. By conducting theoretical calculations related to the kinematics of the transmission system and combining Adams virtual prototyping simulation technology, a dynamic simulation model of the planetary gear transmission mechanism was established to analyse the motion laws and dynamic characteristics. The simulation results were compared and analysed against the theoretical calculation results, and they showed good agreement and consistency. The study also investigated the impact of counterweights on the inertia forces and moments of the output shaft in the transmission mechanism. The results indicated that adding counterweights effectively reduced the inertia impact caused by inertia forces at the start and end positions of the stroke, as well as the inertia torque caused by changes in angular acceleration during the startup and stopping phases, thereby enhancing the smooth operation of the mechanism. Additionally, different thicknesses of counterweights had varying effects on balancing the inertia forces and moments of the output shaft. The study aimed to find the optimal thickness of counterweights to achieve the best balance effect. Furthermore, the study examined the influence of different speeds of the driving gear on the inertia forces of the output shaft. The results showed that at a driving gear speed of 1500 rpm, the horizontal thrust generated by the output shaft was 63566 N, which could provide the required thrust for the rolling mill operation, and the inertia forces of the output shaft tended to stabilize.