cross tracking

42 views
Skip to first unread message

William Premerlani

unread,
Apr 14, 2013, 8:24:40 PM4/14/13
to uavdevboard-dev
Team,

Paul Bizard inspired me to polish up cross tracking, so that is what I am working on right now.
The first step that I took was to add a damping term based on the perpendicular projection of
the IMU ground velocity onto the desired track. I tried that once before a couple of years ago,
it made things much worse. I now realize I had the sign wrong then. I had it wrong at first this time
too, but I figured it out and flipped it. The result is much improved performance, with less
overshoot on turns.

Attached are a couple of images from a HILSIM test flight of a Cessna which consisted of:

1. Totally autonomous take off. (I shut off the TX and release the brakes.)
2. One circuit around a rectangular pattern.
3. Totally autonomous landing.
There are two images, one is for the first turn after take off, the other is for the landing.

If you would like to try it out, simply substitute the navigate.c file from MP_WJP_research branch for the one that you are using.

To minimize overshoot, set WAYPOINT_RADIUS in your waypoints.h file to match the turning radius of your plane.

So far, I have tested only with waypoint mode, but I think that it will work with LOGO as well.

There is still some room for improvement, I am going to try:

1. Eliminate the use of angles in the cross-tracking computation, and use vectors only.
2. Use centimeter resolution for the cross-tracking error, instead of meter resolution.

If I can do those two things, the resulting performance should be ultra-smooth. Once I have it working
as best as I can manage, I will release it to trunk.

Best regards,
Bill
NewCrossTrackingFirstTurn.jpg
NewCrossTrackingLanding.jpg

crashmatt

unread,
Apr 15, 2013, 10:01:10 AM4/15/13
to uavdevb...@googlegroups.com
Bill,

I have been wondering about applying the predictive navigation technique to cross track. The aim would be to remove airspeed and roll rate limitation from the cross-track gain estimate.  I don't really know how much of a problem that is. Does it really need fixing?

Regards Matt

crashmatt

unread,
Apr 15, 2013, 10:28:41 AM4/15/13
to uavdevb...@googlegroups.com
One more idea. If you are cross tracking and want to merge nicely into a waypoint radius, this might work


It doesn't work if you are not cross tracking because you have no fixed point of reference.

William Premerlani

unread,
Apr 15, 2013, 10:30:29 AM4/15/13
to uavdevb...@googlegroups.com
Hi Matt,

The revised cross-tracking algorithm is working a lot better now, it works really well on straight paths, and there is not
much of a transient at a sharp turn.

That said, there is still more testing to do with other types of aircraft, so possibly some predictive computations might help.

Let me get back to you after more testing.

Best regards,
Bill

--
You received this message because you are subscribed to the Google Groups "uavdevboard-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

William Premerlani

unread,
Apr 15, 2013, 10:31:20 AM4/15/13
to uavdevb...@googlegroups.com
Hi Matt,
That is also on my list of things to try out. Thanks.
Best regards,
Bill

--

William Premerlani

unread,
Apr 15, 2013, 8:58:02 PM4/15/13
to uavdevboard-dev
Team,
Here is an update on navigation improvements, a work in progress, MP_WJP_research branch.
Navigation is now using 16 bit vectors instead of angles for both desired and actual bearing.
Cross tracking performance is now very accurate. See the attached flight track for an HILSIM
flight of a Cessna. Totally autonomous take off and landing. Takeoff is yellow, landing is green.
Both tracks are right along the center of the runway.
More improvements are still in the works, mainly I am going to look into using centimeter resolution
for the cross tracking computations.
Best regards,
Bill
CrossTracking16bit.jpg

crashmatt

unread,
Apr 16, 2013, 7:28:43 AM4/16/13
to uavdevb...@googlegroups.com
Bill,

How about cross tracking and cross wind?  Could the crosswind correction could get the same 16bit vector improvement?

/Matt

William Premerlani

unread,
Apr 16, 2013, 7:45:04 AM4/16/13
to uavdevb...@googlegroups.com
Matt,

Regarding cross wind correction....

Better yet, now that I am using course over ground instead of heading for navigation, the cross wind correction is no longer used or needed in the navigation computations. So, there is actually some code that I will eventually delete.

The only reason the cross wind correction is still in my research code is that OSD depends on it.

Best regards,
Bill

crashmatt

unread,
Apr 16, 2013, 9:42:38 AM4/16/13
to uavdevb...@googlegroups.com
Bill,

I am not totally convinced that will work well if cross tracking is switched off.  

Say you have a headwind and make a 90deg course change.  Does the aircraft turn by 90deg or does it turn by less than 90deg due to the wind correction?

In other words, is there a feedforward that estimates the correct aircraft heading due to wind?

Some autopilot flight modes don't have a waypoint so they can't use cross tracking.  Course over ground could be used in feedback but there would be over/undershoot errors.

Regards Matt

crashmatt

unread,
Apr 17, 2013, 2:51:28 AM4/17/13
to uavdevb...@googlegroups.com
Bill,

Now I am convinced that wind correction can't be removed for non cross tracking. The autopilot can't possibly know the correct angle it needs to rotate the aircraft through unless it is given this advanced information.

The correction needs to be done on the desired heading, before any attempt to turn it into navigation error. This is going to clash with navigation by cog. The heading correction can't be done twice.

The alternative is wind gains but that directly influences roll rate which is not good for all use cases.

/Matt

crashmatt

unread,
Apr 17, 2013, 1:51:34 PM4/17/13
to uavdevb...@googlegroups.com
Having said that, most people want standard waypoint mode or standard stabilize so no worries.

William Premerlani

unread,
Apr 17, 2013, 9:28:02 PM4/17/13
to uavdevboard-dev
Team,

First of all, I want to thank Paul Bizard again for motivating me to dig into cross-tracking again.

I did some more polishing of cross-tracking in MP_WJP_research branch and tested with HILSIM Cessna in a 30 knot wind. Performance was better than I hoped for. Flight track is attached.

Here is how it works. Its not exactly like anything else that I am aware of, though its has bits and pieces of a lot of published techniques, and some ideas of my own.

1. A 32 bit "cross" vector is formed from a weighted sum of IMU velocity and IMU vector to the goal.
2. The cross vector is rotated by the vector between waypoints. The Y component of the result is the cross error.
3. Another "rotation correction" vector is formed by setting the X component to be a cross margin, and Y component to be the cross error.
4. The rotation correction vector is normalized.
5. The desired bearing vector is vector between waypoints rotated by the correction vector.

All operations are vector addition, normalization or rotation. There is a rotation routine that will handle a 32 bit vector.

As you can see, navigation performance was good, in spite of the 30 knot wind from the west and the plane
flying at 90 knots.

Turns were crisp, with very little under/overshoot, and the flight path was very close to the lines between the waypoints.

As soon as I clean things up a bit, I will commit to trunk.

Best regards,
Bill


On Sun, Apr 14, 2013 at 8:24 PM, William Premerlani <wprem...@gmail.com> wrote:
CrossTracking32bitCrosswind.jpg

ben levitt

unread,
Apr 18, 2013, 12:44:03 AM4/18/13
to uavdevb...@googlegroups.com
Bill, this looks fantastic!  I look forward to trying it out myself.  Thanks again for continuing to innovate and improve the core of MatrixPilot, and for keeping our performance at the head of the pack.

Ben


William Premerlani

unread,
Apr 18, 2013, 8:37:42 AM4/18/13
to uavdevb...@googlegroups.com
Hi Ben,
Regarding "keeping our performance at the head of the pack", that has been a team effort.
I am very appreciative of the contributions that our community of developers has made
to the performance and features of MatrixPilot. Once again, I thank you all.
Best regards,
Bill

William Premerlani

unread,
Apr 18, 2013, 8:58:39 PM4/18/13
to uavdevboard-dev
Team,

Attached are flight tracks from some comparison HILSIM test flights that I just ran for three different navigation techniques.

The flights were under identical conditions, except for navigation techniques. It was a Cessna flying a butterfly pattern at about 90 knots with a 40 knot cross wind from 255 degrees true direction. Wind gain adjustment was turned off. The navigation techniques for the three pictures were:

HeadingAndCrossWind.JPG : this is the default (non-cross tracking) navigation technique presently in trunk. It is based on the attitude of the aircraft. The wind is included in the geometry computations. Desired heading is according to the desired course over ground from the aircraft to the next waypoint, using feedback only, no feed forward. The feedback loop drives the actual heading (yaw attitude) to match the desired heading.

CourseOverGround.JPG : this is a new non-cross tracking navigation technique in MP_WJP_research branch. The wind is entirely ignored in the navigation computations. The feedback loop drives the actual course over ground to match a desired course over ground to move toward the next waypoint.

CrossTracking.JPG ; this is a new cross tracking navigation technique in MP_WJP_research branch. The wind is entirely ignored in the navigation computations. The feedback loop drives the cross track error and cross track velocity to zero.

The reason that the wind can be ignored in the two new methods is that when the feedback loop drives the actual course over ground to match the desired course over ground, the difference between the two will be zero. When the two courses match, the "crab angles" for the cross wind that would go into a heading computation is the same for the two courses, so it cancels out in the subtraction, and is not needed.

Once again thanks to Paul Bizard, who sent me down this path by pointing out that, because of transient side slip, navigation controls perform better based on course over ground. Interestingly, that is how MatrixPilot started out. It used GPS course over ground for navigation. Although that obviated the need for wind computation, the latency caused control issues. So, we moved to heading based controls, which required wind estimation. We have come full circle now. With high bandwidth dead-reckoning, latency in course over ground is no longer an issue.

My plans for next steps is for Phil, Tom, and myself to flight test the new techniques. If all goes well, I will port to trunk.

Best regards,
Bill


On Sun, Apr 14, 2013 at 8:24 PM, William Premerlani <wprem...@gmail.com> wrote:
HeadingAndCrossWind.jpg
CourseOverGround.jpg
CrossTracking.jpg
Reply all
Reply to author
Forward
0 new messages