This paper proposes an optimal trajectory planning model for automated onâramp merging. The minimum cost path based on the optimal control theory is selected as the optimal trajectory of the onâramp merging vehicle, which could avoid potential collisions and satisfy the kinematic constraints on the vehicle motion. Moreover, an optimal control strategy is presented to solve the trajectory planning problem of the facilitating vehicle. An analytical closedâform solution is derived by using the Hamiltonian analysis and the path information of the merging vehicle. Particularly, the proposed planning process also considers the lateral movement of the onâramp merging, which is more efficient in the application. Owing to the location and time that the onâramp vehicle merges into the mainline can be obtained endogenously by its planning process, the model has high adaptation to various onâramp environments. Solutions to the above two optimal methods are implemented in a model predictive control framework to cope with possible external disturbances. Several numerical simulations and PreScanâSimulink CoâSimulation illustrate the effectiveness of the proposed model. Furthermore, this methodology is compared with a typical CACC strategy to demonstrate its potential to reduce fuel consumption, as well as improve passenger comfort.