To improve the efficiency of electric vehicles (EVs), a planetary two-speed transmission is proposed, which consists of a brushless direct current (BLDC) motor, a turbo-worm reducer, two multi-disc wet brakes, and a Simpson planetary gearset. Based on the devised electronic actuator for shifting, the rotation direction of the BLDC shaft determines the gear ratio of the transmission. For acquiring smooth shift, the state-space equations with control variables of transmission are derived, and a three-stage algorithm is suggested. During the brake engagement process, the optimal control strategy has been developed using linear quadratic regulator control, considering the jerk and friction work of the brake. The simulation results show that the proposed optimal control strategy could reduce the slipping friction work of the brake and improve the shifting quality of EVs. The optimal control trajectory of the BLDC motor was conducted on the electronic shifting actuator bench test.