Developer

Orbiting and Turn Prediction

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

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • 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.

  • Developer
    http://tom.pycke.be/mav/101/circle-navigation, is a good friend of mine...
  • Developer
    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
    http://jasonshort.com/simv3/XFSIMv3.zip
  • Developer
    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.
  • 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.
  • Developer
    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?
  • Developer
    That is an interesting approach! Here is what I do and requires one equation based on your distance from the waypoint.

    Orbit hold:
    http://diydrones.com/photo/orbit_hold15radius-1?context=user

    Track hold:
    http://diydrones.com/photo/straightlinehold-1?context=user

    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)

    http://diydrones.com/photo/track_smoothing-1?context=user
  • T3
    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...
This reply was deleted.