I just built my first fixed-wing drone. The first flight went well except from one thing - the yaw angle is oscillating a lot. Here is an image of the desired and actual yaw from the , and as you can see they differ quite a lot. What is the best way to solve this problem? Do you think this is a tuning error that can be solved by using the autotune mode, or can this type of behavior be caused by something else?
Yaw tuning is not handled by autotune. It does not have a full PID controller, but there are 4 or 5 parameters you can change to smooth out this behavior. They are listed under the YAW tuning section of the manual tuning wiki. http://ardupilot.org/plane/docs/roll-pitch-controller-tuning.html
My advice assumes you’re not using a flying wing - they have little yaw tuning ability.
Initially it sounds like YAW2SRV_DAMP may be too high causing oscillations - but if that value is 0 like default settings, it could be your KFF_RDDRMIX or YAW2SRV_RLL values being incorrect - your ailerons could be inducing a yaw moment that the rudder isn’t correcting properly.