The dynamic systems of unmanned aerial vehicles (UAVs) are susceptible to parametric uncertainties, unmodeled dynamics, and external vibrational disturbances during motion control. Although proportional–integral–derivative (PID) controllers are widely used in UAVs, the manual tuning process is time-consuming, and the resultant control performance is vulnerable to uncertainties in varying flight conditions, leading to suboptimal flight control throughout the entire hovering flight envelope. To address this issue, the present study designs and optimizes a novel piecewise flight controller based on a hybrid data-driven approach combining gradient-based methods and pattern search algorithms. The optimization process is validated through comprehensive flight testing, comparing the piecewise controller with the baseline controller across a wide range of flight conditions. The study examines the objective functions and design parameters, demonstrating the robustness of the optimized piecewise controller in the presence of disturbances. The results reveal significant variations in the system model under different flight conditions, and the piecewise optimized controller demonstrates a response that is more than twice as fast as the benchmark, with acceptable overshoots and steady-state errors under the predefined trajectories. The salient features of the proposed piecewise flight controller and design optimization process are verified through flight testing, which is expected to provide a framework for future UAV flight control designs.