Vehicle safety and stability in various driving conditions is the key issue for multi-axle heavy vehicles on long haul routes. Due to the characteristics of high center-of-gravity height and high inertia of multi-axle vehicles, these vehicles are more prone to instability and rollover during high-speed maneuvers, which affects the driving safety. Aiming at the problem of safe trajectory planning in the obstacle avoidance process under the adaptive cruise driving situation, this paper considers the obstacle avoidance stability of the vehicle while driving and creates a safe driving trajectory for the five-axle vehicle with automatic driving function. First, the vehicle dynamics model is established in this paper. Then, considering the current and future motion state of the multi-axle vehicle and its surrounding vehicles, the vehicle collision risk model and the obstacle avoidance stability model are established. Finally, a local path-speed collaborative planning method based on the model predictive control (MPC) method is developed, to generate a safe and stable driving trajectory of the multi-axle vehicle. The simulations and experiments show that, compared to the traditional planning method, the yaw and roll motion of the vehicle can be reduced about 28.5% and 25.7% when driving along the trajectory planned by the proposed method, and the risk of driving collision can be reduced effectively.