APM glitch almost crashes Skywalker

Very worrisome APM glitch for unknown reason…anybody have any ideas?
RC RSSI was strong (RTL had been tested earlier in the flight…would not have caused dive) , GPS locked with12 sats…

Mission profile here: imgur.com/Hkkg0Ht
Video showing near crash after reaching WP2 here: youtu.be/n9CfcWyJ_3Q

I have been flying the APM in the Skywalker for a while without incidents and so was not using Mission Planner to log flight…so no tlog…had loaded mission before leaving home…took off, engaged AUTO, climbs and flies to WP1 fine, turns and flies to WP2, descending…immediately after WP2, throttles up to climb straight ahead to WP3 and suddenly banks sharply back toward home and dives from 100+ ft toward ground (RTL alt is 328ft)…I switch to MANUAL, climb to 300 foot and re-engage AUTO and it turns and completes the mission perfectly(several more waypoints, climbs, descents,some loiter turns, etc)…

any ideas?..scary incident

You are much better off posting log files, can’t really debug Youtube videos.

You will have onboard dataflash logs, please post the relevant one. Thx

Unfotunately, being a relative newbie, I overwrote that log apparently by letting the MP stay connected overnight on the bench…which leads to another question:

when does dataflash logging begin when Missionplanner is not attached? it starts a new dataflash log every time I CONNECT via telemetry or USB with Missionplanner…but when does it start when flying without an MP connect? or does it?

dataflash logs start as soon as you power the APM:Plane or APM:Rover. They are not related to Mission Planner in that respect. APM:Copter starts dataflash logging as soon as you ARM.

tlogs ie telemetry logs are the raw saving on the MAVLink protocol telemetry data from the vehicle. tlogs require post processing of the data for analysis by the GCS software

I can connect the USB cable to the APM but not “connect” in the MP, thereby powering up the planes APM (ie GPS and telemetry are powered) but no dataflash logs are produced…only when I connect in the MP…

I can see in the code a new log is started on each “ground start” and that this occurs in the Arduino setup routine calling APM_initialize…so this should be called each POR as you suggest, so why are no logs created on the bench when powered thru the USB connector but not “connected” in MP?

anyway this is probably too esoteric…but is bugging me…

Are you maybe mixing up dataflash-logs (stored onboard the APM on the flash memory) and TLOGs (written by MP when it receives telemetry data)?

no, I know the difference…what was confusing me was that the plane dataflash log will indeed start with ANY power application, writing only the preamble, params, etc, as you suggest…but wont actually proceed to log anything else if USB is attached unless the MP is “connected” …however,if you power the APM without USB attached, then initialization and ground start occurs and logging proceeds normally…but not if the USB cable is attached and provides initial power…until you connect over USB which restarts a new dataflash log

Finally, I notice that 2.74b (which I am using since there are notes about 2.76 having battery monitoring issues floating around, until that is put to bed, I am not upgrading) and previous versions had an IMU bug where it could diverge under vibration and dive the plane…2.76 supposedly addressed this…I think that this might be what happened to me…it was right after throttle up to climb to another waypoint…

fyi, I have flown the same mission again, without issues…

so I will mark this one solved for now…

thanks for the inputs