I was wondering if anyone had done any work on orbiting or managing turns? I prototyped an idea I had last night about orbiting waypoints and realized the same algorithm works for turn prediction.

On my autopilot I have running a drift compensation routine that maps the desired location of the plane onto a line connecting the old waypoint and the next waypoint. I simply look ahead 10% farther on that line and steer toward that point instead of the actual waypoint. This helps me regain course when I'm blown off or miss it entirely.

In my simulator I added a check to see which side the next WP is -right or left- and I use a vector rotated 90° to the plane bearing to offset the WP to the left or right. This vector also allows me to orbit the target.

Here are some diagrams and a shot from the simulator showing the orbit. If anyone has done this before I'd love to hear about how it went. I hope to fly it this weekend if my replacement ESC ships by Friday.

A screen grab from the SIM

Click to view Flash sim

Views: 409

Comment by Andrus Kangro on October 28, 2009 at 2:25pm
Hi, I was thinking about that when there was an idea to have T3-2 contest with 270-degree turns around each waypoint, but I did not get very far with it. I settled with putting "helper" waypoints a bit outside of original waypoints I needed to pass, and steered using helpers only.
I'm doing something that is similar to what you do: in addition to determining direction to next waypoint I also look on previous direction value and try to predict how this direction will be on next gps fix, and use that prediction for actual calculations. I am a bit soft with turning plane in regards of course error, but I use bigger gains for waypoint direction change. Meaning, that if I get closer to waypoint, then waypoint direction change will cause bigger steering movements than course error.
I've also noticed, that if plane direction trim is off, then it will draw nice circles around waypoint. Probably it would be possible to have pretty decent circles by steering plane in order to to keep heading error on some value, probbaly having some dependency on plane (ground?)speed in order to address wind and GPS lag. I'm not going to try it any time soon, as my biggest problem is my EM-411 GPS at the moment and all turn optimization goes towards having fast turns while keeping GPS happy. U-blox unit with Sarantel antenna is already ordered, so maybe I will get into it when it arrives...

Comment by Ryan Beall on October 28, 2009 at 4:23pm
That is an interesting approach! Here is what I do and requires one equation based on your distance from the waypoint.

Orbit hold:

Track hold:

If you google vector field navigation you will most likely find the info you are looking for. This method keeps the aircraft a a controlled heading in the most tuneable/optimal way. The basic idea is you pass the equation your distance and heading to the WPT and it will give you a heading as shown in the pictures. It has the same affect as your method accecpt accounts for being inside the circle as well and always tries to keep the uav on the orbit.

The only thing missing from this method is calculating the nominal bank angle required to make the turn at that instantaneous rate of curvature. But with some Calc and Aero you can come up with the derivative of the vector feild at a given dist and jackpot. Perfect nav solution.

As far as wrapping around a way point. The most optimal way to do that is actually three orbits of min dynamic radius. (assuming you want to fly exactly over your waypoint. So a lead orbit, the actual turn over the waypoint orbit, and the lag orbit. Here is a pic of my track smoothing. This was the orbits set up such that the uav flies the same calculated straight line distance so the main turn orbit comes just shy of the waypoint. This type of approach could be used for ground track timing purposes but the algorithm is easily tunable to do anything in between. (circles should be tangent, it is an optical illusion of the spherical math I was using in the program. It had a hard time getting the radius right)


Comment by Jason Short on October 28, 2009 at 8:03pm
That looks really interesting. I'm not sure how I'd go about calculating all of that. My perennial excuse is that I went to art school and the highest math class I've ever taken is "personal finance". Do you have any examples?
Comment by Matt Fisher on October 29, 2009 at 6:53am
Very interesting work Jason - I am a professional Flash Dev during the weekdays, thus your tiny simulation app caught my eye - any chance on releasing the source for that app, its amazing.

Comment by Pete Hollands on October 29, 2009 at 8:16am
Jason, that is very interesting, and will make for some interesting software development discussion on how we can improve the navigation of the UAV Devboard, with your algorithm in mind. Thanks for sharing that.

Comment by Jason Short on October 29, 2009 at 10:12am
Here is the code. It's highly unoptimized because I just don't need to worry about cycles in Flash. Ha. It's weird moving between MCs and PCs(Macs).

Flash XFSIM zip

Comment by Jordi Muñoz on October 29, 2009 at 11:59am
Comment by Mike on October 25, 2011 at 9:50am

Jason, do you know if there has been any progress getting this implemented into APM?


I think something like this would go a long to making PID tuning much easier when it comes to accurate track following (especially in high winds), as the vehicle won't be so far off the track at the end of its turn, less corrections will need to be made.


You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service