Create mission from manual flight - replay for real!

Had a disconcerting accident tonight - flying quad in the dark with 2 x 4S 5000s to test duration.
Not content with just hovering behind the car, I went on a 4km trip…

When I brought it back, I discovered that one of the batteries was missing and the other was just hanging by its cable! Argh!
Fortunately I have a log this time (previous 10 missions just recorded 0xFFs until I changed sdcard).

Was hoping to find something conclusive in the data to identify the moment that it became half a kilo lighter and the weight shifted to the right so it had to compensate with more lift to the right rotors, the battery was also swinging so that would affect accels. Found a few candidates but nothing in-your-face conclusive because the signals are a bit noisy, but there is a noticeable reduction in current usage towards the latter half of the flight.

What I really want to do, however, is to make a new mission from the logs to be able to slowly retrace its steps in daylight at a lower altitude to look for the lost battery. It probably fell from about 100m, so not holding out too much hope, but you never know.

It would be an interesting project to be able to retrace, but as there aren’t any options to be able to import a kml file into mission planner, I’ll have to write a small php script to extract the values and write a mission to text, then manually pare down the hundreds of waypoints to a reasonable minimum.

That’s my task for tonight!

If anyone has any good ideas, it would be nice to know!

(I also noticed a bug in kml export - the relative altitude is added to the height of the terrain below, and particularly noticeable flying over hills etc. The kml should contain absolute coordinates derived from the absolute altitude at arming as the reference, or the altitude that google earth reports at time of arming - assuming take off starts from the ground!)
(I wrote a small php script to correct the kml to produce abs altitude from start alt if anyone is interested)

Post your log. I’m someone can look at it and see where the event occurred. There should be a lot of clues. There will be a change in the voltage slope at the event, as the craft is now lighter, but also drawing on only one battery.

You didn’t say which flight controller you have, but a Pixhawk logs craploads of data by default. The RCOUT gives you the power to each motor, as you mention, Also the IMU vibration logs may have clues.

Writing a replay of the mission seems like too much work to me. I’d just identify the likely event, look at the nearest GPS point recorded, load it onto my GPS and talk a walk.

Thanks for your reply, yes it’s a pixhawk, 3.2 rc14, carbon fibre H700 quad.
4km through bushes and fields is harder work than writing a program, and I like challenges - I’ve just finished it! :slight_smile:
Log file, and corrected kml and derived mission attached.

My first point of call would be the return to launch at new WP 42, and the loop where I was trying to get orientation - a hanging battery would have obscure the nav lights - also the bit where I hammered it in stabilize mode.

Expected to rain today, so have to be up early to give it a try - I expect I’ll be trudging the course too!

Cheers,
Andy.

This is a good puzzle!

In looking as your various log components I see one or possibly two events. The first event, which is a possible one, occurs just about at 6 minutes. For no good reason there’s a big yaw error. The altitude also shows some bobbling. I suppose it could be a gust, but it could also be the battery pack slipping loose and dangling, but with both batteries still attached.

I think the battery release drop occurred around 8:45 into the flight, maybe near line 132,000. There are several curious things happening then, like big changes in the throttle out and another good sized yaw error. But if you look at the throttle out after this period it’s clearly at a lower level than before. This would be consistent with a sudden reduction in weight. Big swings in your voltage from 8 to 9 minutes too which continue after your planned descent. It’s conceivable the buffeting and accelerations during the descent worked the dangling battery free…

My location estimate would be near 47.49513, 18.83629. Based upon your “recovery mission” plan that would be very close to WP 88. If you find it, please post the results. I’d be interested to see where it ended up.

Some good deductions there - I also make it around that area - perhaps the biggest sign I could find is EKF1.VD - quite a large spike around 132448 and just following your estimate.

Have to say that the lack of consistent units is driving me nuts!
Log lines as x axis units??
They should be in hh:mm:ss or seconds since arming, to make it easier to match to video.
Mission planner, qgroundcontrol, apm planner etc still need an awful lot of work.

Good news - My reconstructed recon mission worked first time and followed the recorded flight exactly at the new altitude without crashing into anything! See attached Google Earth image.

However, I think rc14 has some issues still - yaw control was hopeless - I mean really hopeless - the quad spent most of the time flying backwards and sideways and really did not have a clue.
Spline waypoint glitches still haven’t been fixed. (I’d recommend Catmull-Rom splines, and a programmer that has some experience with 3D graphics software like Blender)

Bad news, I didn’t find the battery, the weather was terrible - 20 mph wind, rain, dark and cloudy, and the video I recorded was almost unusably jelloed. I could upload to youtube, but it isn’t pretty, though it may help debugging.

(My gimbal lost its IMU sensor in a bad crash last week, so I used a Mobius attached to the frame instead via a vibration isolator, but the rubber balls were too stiff. Props were balanced, but last week’s crash may have bent a motor or two. Jello is the bane of my life!
If I can’t get a new IMU board in time for the next try, I’ll just use the gimbal and hold it in place with hot glue. At least the mass will help decoupling.)

I’ll attach the log too - perhaps someone can use it to debug the random yaw.

Update:

I’ve just made a video of my third attempt to locate the battery - it’s going to be harder than I thought but I don’t give up easily!

youtu.be/ymieq3zRujs

Apologies for the weather and time of day, it was half an hour before sunset, but it allows me to refine the altitude for the next attempt in hopefully sunny weather.

I hope the developers can finally fix the waypoint glitches soon!
Still waiting for a new IMU, so fixed the gimbal with splints and hotglue, and to cap it all my FPV transmitter died just before this run, but fortunately wasn’t necessary this time.