In this study, we aimed to find optimal PD controller gains to control orientation and position of a Dodecarotor UAV with minimum trajectory error. In this context, a cascaded PD controller approach which has velocity feedback in the inner loop and position feedback in the outer loop was adopted for each state (roll, pitch, yaw, altitude) in the flight control of the UAV. Subsequently, a fitness function was defined based on the system's time domain response and trajectory tracking error for each state, except the yaw angle, which is non-dominant in terms of trajectory tracking performance. Grey Wolf Optimizer (GWO) was used to obtain PD gains by minimizing the defined fitness function. At the same time, Particle Swarm Optimizer was used in order to benchmark the obtained results from GWO and to avoid a shallow solution space. The obtained PD controller parameters as a result of the optimization study of both algorithms were implemented to the system and the results were compared with each other. Finally, the gains that provided the best results for both algorithms were compared with each other and the results were discussed in terms of the time domain results and the actuator input smoothness. It has been observed that the GWO optimized controller provides a 40-46% improvement over PSO in all four different mass UAVs in terms of reducing axis position errors.