tested new PI rate loops p_rate = 17 i_rate = 9 works Ok,need some more work on tuning the attitude loop.