I really hope someone can help me out in here. I got into building my own quadcopter controller. All has been going well and had plenty of successful flights. The rate pid is on top of stab pid like described in here: http://ghowen.me/build-your-own-quadcopter-autopilot/
However ocassionally I do get a very strange behaviour. Basically, at certain position (flight angle), the quadcopter gets into a 'lock' and does not return to its neutral position. I can reproduce it when having the quadcopter in my hand. I basically rotate the quad around on 50% throttle and at certain angle the quad wants to fly consistently sideways rather than return to its netural position.
When I disable yaw pid all works as expected. When I enable it feels like the yaw is overshadowing quadcopter's pitch and roll stabilization efforts leading to a crash. It only happens when yaw gets significantly away from its target (like 20-30 degrees), due to for example wind gust.
Should there be a dedicated logic to deal with yaw, like for example disabling yaw stabilization when quadcopter has pitch or roll greater than 15 degrees?
I tried to play around with yaw pid and decrese it but it did not seem to solve the problem.
Should I constrain the yaw pid to lets say 10% of the throttle? Would this be standard practice?