William Premerlani

Waypoint firmware for the UAV DevBoard is revised


Sigh....I am going to give Peter Hollands an award for finding the "juiciest bug" in the released waypoint firmware for the UAV DevBoard. The bug has been fixed, and the firmware has been re-released as version 1.8b.

The bug was in the yaw drift gyro compensation calculation. It would only show up for waypoint legs with a heading between 327 degrees and 360 degrees. The result was that the actual heading would slowly vary between 327 and 360 degrees. The symptoms were barely noticeable.

The way that Peter discovered the bug was with a combination of ground testing and telemetry, while he was testing out some really nice programs that he wrote for processing telemetry. Peter noticed an anomoly during ground testing for headings between 327 and 360 degrees.


Waypoint firmware for the UAV DevBoard is available in both MatrixNav version 1.8 and AileronAssist version 1.8 from the UAV DevBoard home page, with the following features:

• Waypoints are 3D.
• Location of the points is specified relative to the initialization location of the board.
• You have the option of using either cross-track error navigation, or using navigation toward target waypoints.
• Arrival at a waypoint is based on the concept of a "finish line". This produces a reliable assessment of arrival, without any chance of loitering.
• The primary source of steering is the direction cosine matrix, so steering continues reliably and smoothly even when the GPS loses lock during banked turns.
• Rudder-elevator mixing in MatrixNav, based on the values of the direction cosines, prevents loss of altitude during turns.
• You can specify more than 1000 waypoints.

Just to be clear, the X and Y coordinates of each waypoint are specified with respect to the power up point. It is not specified with respect to the previous waypoint in the list. The X coordinate is the distance, in meters, along the east direction, from the power up point. The Y coordinate is the distance, in meters, along the north direction, from the power up point.

Best regards,
Bill Premerlani

Views: 176

Chris Anderson Comment by Chris Anderson on September 15, 2009 at 8:11pm
Congrats on this achievement--very exciting! How are waypoints entered?
Chris Anderson Comment by Chris Anderson on September 15, 2009 at 8:18pm
Whooops sorry; should have read before I spoke. From the documentation:

"The waypoints are defined in the file waypoints.h that is a header file in the
project source code for the firmware. There are two items you need to specify
in the file:
• whether or not you want to use cross-tracking
• the coordinates of the points."

They are in the form:

"const struct relative3D waypoints[] = {
{ 0 , 0 , 100 } ,
{ 100 , 173 , 100 } ,
} ;"

Or, even cooler:

#define CROSSTRACKING
#define CORNER 100
#define CLEARANCE 25
const struct relative3D waypoints[] = {
{ CORNER , CORNER , CLEARANCE + 100 } ,
{ CORNER , - CORNER , CLEARANCE + 75 } ,
{ - CORNER , CORNER , CLEARANCE + 50 } ,

No provision for absolute lat/lon waypoints?
William Premerlani Comment by William Premerlani on September 15, 2009 at 9:10pm
Hi Chris,

Absolute lat/lon waypoints are on my list of things to do. I can see that they can be useful. I plan to eventually offer the options of relative points, and/or absolute points.

In order to get something working in time for this month's T3 contest, I decided to release the firmware with just one option, and finish the other option later.

Personally, I find the relative points in meters much easier to work with than absolute points in lat/lon, it takes only a few minutes with the ruler function in GoogleEarth to measure the locations of your waypoints with respect to the place that you intend to power up.

Plus, by specifying the waypoints with relative coordinates, you wind up with a portable pattern. You can move the waypoints without having to reprogram them.

For example, at the field that I do most of my flying, more often than not there are strong winds that could come from pretty much any direction on a given day, they can even shift direction in an hour. I like to keep my plane upwind, just in case. I find it very convenient to be able to make a last minute decision on the location of the origin, even though I might have to walk a considerable distance to get it just where I want it.

Best regards,
Bill
William Premerlani Comment by William Premerlani on September 15, 2009 at 9:18pm
Hi Chris,

Something I forgot to mention in my previous comment: the example waypoint list that is included in the waypoint firmware is the pattern for this month's T3 contest. All you have to do to use it at any location is to initialize the board where you want the center of the pattern to be.

Bill
Peter Meister Comment by Peter Meister on September 15, 2009 at 9:51pm
Uploading it now, will test tomorrow. I want to congratulate Bill on an amazing accomplishment. This is a monumental day for DIY Autopilots.
William Premerlani Comment by William Premerlani on September 20, 2009 at 9:57am
Hi Rana,

I thought that I replied to you earlier here, but for some reason my comments do not appear here, I am not sure why.

I am pleased that your plane made it back ok. I also agree with you that no one else should try what you did. Its best to always keep you plane in visual range.

After thinking about it some more, I believe that your plane traversed your course several times.

The default settings for altitude hold will perform an aggressive climb, but they will not perform an aggressive descent. You would have to change the altitude hold pitch settings to do that. The way the software is released is with sailplane pilots in mind. Once your plane gets more than 10 meters above the desired height, it shuts off the motor and glides. And, unless you change the default setting for that situation, the controls will then perform a level glide.

In the case of your flight, once your plane got to 400 meters height, the fastest it was going to come down was going to be a level glide. Assuming a 10 to 1 glide angle, that means it would travel 4 kilometers before it came down.

So, what I think happened was that your plane went around and around your course several hundred meters high, until it ran out of power. Then it continued to traverse your course while gliding. I would also guess that the waypoint that it landed near had the lowest height, so that is why it landed there!!

It looks like you are the first one to use MatrixNav to perform an autonomous landing.

Best regards,
Bill
William Premerlani Comment by William Premerlani on September 21, 2009 at 3:58am
Rana,
Merging MatrixNav with AileronAssist is on our list of things to do. Ben Levitt is heading it up. What he is doing is developing a single version of the firmware with many options, including V-tails, elevons, etc. For example, you will be able to control rudder, ailerons, elevator, and throttle if you want. Ben figured out how to achieve 5 PWM inputs and 6 PWM outputs.
Best regards,
Bill
William Premerlani Comment by William Premerlani on September 21, 2009 at 4:08am
Rana,

Regarding your question about using AileronAssist on your wonderful plane...if the plane has ailerons, you should definitely try using AileronAssist, but be careful at first to be ready to switch to manual control, until you get the gains adjusted.

After that, obviously, you can use waypoints.

When Ben and I get his firmware working, you will be able to control rudder and ailerons.

Best regards,
Bill
Chris Anderson Comment by Chris Anderson on September 21, 2009 at 7:33am
Bill,

While you're working on merging the code bases, do you think you add a few notes on the UAVDevBoard next to the links to each code download to explain what the differences are between these firmwares? I used to think it was something like this:

--Aileron Assist: just a RC-helper, like the FMA CoPilot
--MatrixNav: A full autopilot

But now they both do waypoints, so I'm confused!
William Premerlani Comment by William Premerlani on September 21, 2009 at 7:52am
Hi Chris,

Thanks for the suggestion. I've been so busy writing and testing firmware, that I have gotten behind in the documentation.

Both AileronAssist and MatrixNav are full autopilots. AileronAssist is for aircraft with ailerons. MatrixNav is for rudders. Either version will work either as an RC-helper, or as a full autopilot. Its your choice.

Ben Levitt has unified the firmware into a version that will control rudder and/or aileron. We will release it after we test it.

The out-of-the-box UAV DevBoard only has enough connectors for rudder or ailerons, but Ben Levitt figured out a way to get more PWM I/O channels, if you are willing to make a special cable.

Best regards,
Bill

Comment

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

Join DIY Drones

© 2012   Created by Chris Anderson.

Badges  |  Report an Issue  |  Terms of Service