300km

Fly away - saved at 1.8km - help with logs please

I had a pretty exciting flight on the weekend. My plane with APM2.5 flew most of a circuit in Auto mode correctly, but towards the end it just flew off to sea!

I wanted to monitor the strength of the telemetry link by flying ever increasing loops. Each loop took me 300, 400, 500 and 600m away respectively. It flew the first loops fine but as it started the 600m loop it just wasn't quite on target. The GCS announced that it passed through two points on that loop, even though it passed 100m or more to the left of those points.

As it passed by the furthermost point it turned slightly to the right, and headed out to sea. Gasp. 

I had a strong telemetry link (RFD900) and the GCS map seemed reliable. The plane icon and yellow line both pointed to the next WP, but the other heading lines pointed out to sea. When I realized it wasn't coming back I used the RC radio to switch mode to RTL. The GCS text-to-speech announced the mode change, but it didn't change course. I thought all was lost as it was over the sea about 1.5km away.

In the GCS I tried the right click > Fly To Here command (I think it’s called Guided mode) but no change. My RC radio link started failing and I heard the GCS announcing the throttle failsafe modes (short = circle, long = RTL) as it drifted in and out of RC range. That didn’t help and it kept heading out to sea.

Finally it occurred to me to try flying back in Stabilize mode. I’d just do a right turn and watch the GCS map to see when it was tracking in the right direction. I held the RC radio up above my head, switched to Stabilize and put in a right turn for 5 sec or so and watched the GCS map. The RC radio was still drifting in and out of range but after a few attempts it started heading in the right direction.

After several minutes I could hear the plane, and soon after I could see it. The day was saved.

 

Now I want to know what went wrong. Can anyone help me? I’ve got complete logs but don’t know what to look for.

When I play back the log in Mission Planner, during the fly away the plane icon (and the heading in the HUD) is correctly pointing to the WP/home (a heading of 90 degrees to start with) but the plane is moving due North.

The Mag Declination reading shows .38 for the whole log replay. Xtrack error is mostly +/-15 as the plane flies correctly around the circuit, but it gets to around 200 during the fly away. There was almost no wind at all (at ground level).

I’ve attached the log file, the param files and a youtube link to a screen capture of the log playback. The APM2.5 uses firmware 2.66.

https://www.youtube.com/watch?v=_wGe8orUAkk&feature=youtu.be

From about WP12 it’s getting more and more off track, after WP15 it just heads out to sea.

Any help appreciated.

raptor 2012-11-18.param

2012-11-18 06-34-00.tlog

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

Join diydrones

Email me when people reply –

Replies

  • 300km

    Hi again

    My navigation gremlin is back. 

    I was out this weekend attempting to fly a larger grid with a camera mounted and the navigation was a bit hit and miss. 

    3692554275?profile=original

    (The WP labels are a bit confusing, they appear above and to the right of the WP, in the scale of this image that puts them directly above the WP to the right.)

    You can see from the purple trail that it was OK heading north. (At the far end it lost RC signal and went into short FS (circle mode). The circles weren't centred around the same spot, I'm not sure what that means. Also it got about twice as far last week before losing the RC signal).

    Anyway on the way back it had a shocker missing WP11 by a lot, it did a late 90 degree turn to reach WP12, it was close to WP13 then headed off course for WP14.  It was obvious things weren't quite right so I switched to RLT (which worked well thankfully) and brought it back.

    I tried again later with a much shorter grid and it did a pretty reasonable job.

    3692554305?profile=original

    Both flights are in the same log file, as attached. 

    Any ideas? 

  • 300km

    After making the recommended changes I did a test flight this morning on the same circuit (with one extra loop added) and it was rock solid.

    Thanks for all your help.

    3692549748?profile=original

  • Hi,

    Moglos just got in touch with me about this problem. We claim some of the credit for his exciting flight! 

    He used an ancient param file for the bixler that we at conservationdrones.org tested on APM 1.0 in Feb 2012. 

    At that time the “AHRS” series of parameters didn’t exist for the firmware (I don’t remember what version it was then). That param file was left unused until many firmware versions later now, when Moglos loaded it to the new firmware. My guess is that when the new firmware loaded the ancient param file something must have gotten lost in translationm including erroneously setting to zero both AHRS_YAW_P and AHRS_GPS_USE.

    We have corrected our param files for all models now.

    Good catch!

    -LP

  • Developer

    Hi again Moglos,

    The more I look at this flight log, the more I like it! I'm glad you did this flight, as it is the first time we've had a real flight log with no yaw drift correction reference vector. It's fascinating.

    As I'm sure you know, gyros tend to drift over time and need correcting. You normally correct the heading using the compass or GPS, and correct the roll and pitch using the accelerometers. In your flight, the correction from the compass and GPS was disabled, so it just did accelerometer based correction. The interesting thing is how well that worked.

    The accelerometers can contribute nothing to the yaw correction when the plane is level, and the gravity vector is perpendicular to the yaw rotation plane. When the plane is rolled over the accelerometers can correct the yaw however, and that is what happened in your flight. In each turn, it took advantage of the acceleterometers to correct the yaw a bit, then as it straightened out it started drifting off course again. Your expanding diamond flight pattern shows this really well, as the straight parts got longer and longer.

    3692549158?profile=originalThe above graph shows the effect during the long auto part of your flight. The red line is the difference between your GPS heading and the DCM heading (the heading it was flying with). You can see it getting worse and worse, getting to 120 degrees of error. What is great is seeing how the error reduces when the plane turns (the green line is the roll), due to the impact of the accelerometers on the drift correction.

    When you turned it to fly back home, that turning also caused it to roll enough to start correcting the yaw using the accelerometers, so it actually had a reasonable yaw value when you brought it home.

    It is also fascinating to see the crosstrack correction working. As long as the yaw error wasn't too large, it still navigated OK due to the crosstrack correction. It was only once the yaw error got really large that crosstrack couldn't keep up, and it completely failed to navigate.

    Great stuff!

    Cheers, Tridge

  • Developer

    Hi Moglos,

    Well saved! I'm glad the flight ended well, even if it was more exciting than you would have liked :-)

    Michael and I had a look at your log, and we think we know why it went off course. The log shows that your plane was setup with AHRS_YAW_P set to zero. That means you were doing no yaw drift correction at all - ie. neither your compass nor your GPS was being used for heading, you were only using the gyroscope, plus a very small component from the accelerometers when at larger bank angles.

    So what happened was your z-gyro slowly drifted out of alignment with reality, eventually getting to the point that it was completely off. At that point the APM had no idea what its heading was (or more accurately, its idea of the heading was completely different from the true heading). Do you know why your AHRS_YAW_P was set to zero? Is that something you changed yourself? The correct AHRS_YAW_P setting should be around 0.4, although values down to 0.1 will work.

    I also notice that your compass offsets are very poor, and you have COMPASS_LEARN disabled. That didn't affect this flight, as you essentially had disabled the compass via the AHRS_YAW_P setting of zero, but when you fix that you should also enable COMPASS_LEARN so it fixes the offsets in flight. Running a fit of your mag values against your GPS heading shows that your compass offsets should really be around (-10,-35,99).

    Cheers, Tridge

  • 3D Robotics

    I'll ask the dev team to take a look at those logs. Good thinking under pressure!

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…