I'm making a Quadcopter simulator game with Unity (5.6.0f3). My quadcopter has four evenly spaced "rotors" attached to a central body (and legs) with Fixed Joints. It flies (currently only upwards) by applying force to the rotors (rigidbody.AddForce method). I'm using PID controllers to stabilize the copter, and I've done enough tuning that it stabilizes pretty well when subject to outside forces...
However, when I rotate the copter around the Y-Axis (yaw) and the forward axis of the copter comes near -90 degrees, the stabilization freaks out and pitches the copter up or down dramatically (and for some reason, it alternates between up and down if I keep applying Yaw in the same direction after the copter stabilizes again, and it happens at the same -90 degrees every time).
I can't figure out what's wrong-- the PID controllers I'm using only stabilize Pitch (rotation around the X axis) and Roll (rotation around the Z axis), so changing the Y rotation shouldn't affect anything.
I'm only using the transform.Rotate method to rotate the copter (so there's nothing to do with forces or another PID controller for Yaw).
Has anyone else come across a similar problem when working with a PID controller?