This study examines the effects of an unmanned aerial vehicle's flight control system on the longitudinal state-space model and active flow control mechanism on the wings that serve as the main carrier of aircrafts, by using the vortices that form on the wing due to the pressure difference between the wing bottom surface and the top surface. it is desired to achieve a better autonomous performance as a result of the simultaneous design of the active flow control mechanism which prevents the flow disturbances by blowing compressed air with the help of the air flow. For this purpose, four different blowing channels, symmetrically two for each wing, were determined and the changes in the performance of the straight flight were analyzed numerically by providing compressed air outflow from these areas at any time of flight. Fluent, which is a computational fluid dynamics program, was used for analysis. As UAVs’ longitudinal state space model was obtained, automatic pilot block diagram was reached and modeled with MATLAB/Simulink. Then, using these data, the flow control and autopilot system for the UAV were simultaneously designed and the cost function was tried to be minimized by using SPSA which is an adaptive stochastic optimization method. As a result, improvements in flight performance have been observed by minimizing the cost function.