Continuous yaw coming in auto modes

I rig up my copter with lithium ion battery 6s 17.5 Ah and did a flight with px4 v1.6.5 stable release.
when i put my copter in hold mode or position an any other auto mode the copter is yawing continuously.Below are the flight logs could anyone help me out?

You can see what the yaw controller is trying to do here.

Could you describe how it works from your perspective in manual and altitude control modes? Did you check that the heading is correct in QGroundControl?

The heading is coming correct in qgc as the quad is moving in hold mode heading is changing on qgc as well.
in mannal it works fine, in position mode there is oscillations when i give roll or pitch.

Can you tell what is the plot between thrust and magnetic field describes?

It’s plotting both to show you if the throttle is creating a magnetic field that impacts your compass.

so in our logs thrust is creating a magnetic field that is affecting our compass that might be the reason?