Robotic manipulators play a pivotal role in modern intelligent manufacturing and unmanned production systems, often tasked with executing specific paths accurately. However, the input of the robotic manipulators is trajectory which is a path with time information. The resulting core technology is trajectory planning methods which are broadly classified into two categories: maximum velocity curve (MVC) methods and multiphase direct collocation (MPDC) methods. This paper concentrates on addressing challenges associated with the latter methods. In MPDC methods, the solving efficiency and accuracy are greatly influenced by the number of discretization nodes. When dealing with systems with complex dynamics, such as robotic manipulators, striking a balance between solving time and path discretization errors becomes crucial. We use a mesh refinement (MR) algorithm to find a suitable number of nodes under the premise of ensuring the path discretization error. So, the actual device can effectively implement the planned solutions. Nonetheless, the conventional application of the MR algorithm requires solving the original problem in each iteration; these processes are extremely time-consuming and may fail to solve when dealing with a complex dynamic system. As a result, we propose a sequential optimal trajectory planning scheme to solve the problem efficiently by dividing the original optimal control (OC) problem into two stages: path planning (PP) and trajectory planning (TP). In the PP stage, we employ a DC method based on arc length and an MR algorithm to identify key nodes along the specified path. This aims to minimize the approximation error introduced during discretization. In the TP stage, the identified key nodes serve as boundary conditions for an MPDC method based on time. This facilitates the generation of an optimal trajectory that maximizes motion performance, considering constant velocity in Cartesian space and dynamic constraints while keeping the path discretization error. Simulation and experiment are conducted with a six-axis robotic manipulator, ROCR6, and show significant potential for a wide range of applications in robotics.