Reasonable operation of each excavator joint under path constraints directly affects operation efficiency and energy consumption. Efficiency and energy consumption are considerably important performance indicators, particularly for large equipment, such as excavators. Therefore, we propose a quadratic trajectory optimization method based on time–energy consumption. With the pseudo‐path velocity, acceleration, and equivalent convex jerk as constraints, the interior‐point method was used to obtain the time–energy consumption optimal trajectory of an excavator. The time and energy consumption values for different weight coefficients were obtained, and the optimal trajectory planning of the excavator was achieved. Furthermore, the simulation results of the proposed method for lifting 70 kg of materials for a weight coefficient of 0.5 were compared with the result of second‐order cone programming. Experimental results showed that using proposed method to plan the motion of each joint reasonably and effectively reduced the pseudo‐path jerk, acceleration, and velocity peaks by 40.67%, 25.03%, and 12.54%, respectively, ensuring smooth excavator movement. It also improved the working efficiency of the excavator; reduced unnecessary energy consumption; and improved the stability, efficiency, and energy saving of the autonomous operation of the excavator.