I am making a controller for loitering using PIDs. The equation which is used to find the radius of circle given bank angle and speed is in following link: How to calculate angular velocity and radius of a turn?
What i did was give the speed and current bank angle of aircraft to find the radius it will make. By subtracting this radius value with the required radius of circle i got the difference between them. This difference was given to PID "Roll from Radius Error loop", this generated the required roll value which is given to "Aileron from Roll loop" and in this way the required circle radius was achieved. But there was a problem. The Loiter is around a point but with above simulation the aircraft do not loiter around the required point. In other words the center of circle was shifted. My question is how can i loiter around a point what is the math behind it or how can i loiter around a specific point.