Copter Crash in AltHold mode

Hi all.
I’m using ArduCopter 4.2.2
I took off the copter using Stabilize mode and switched to AltHold mode. Suddenly my drone became unstable and spun around in the air. In this test, I used a Raspberry Pi board to send GPS data to PixHawk via mavlink.
I noticed that the values of AHR2 and ATT didn’t match at the moment of the crash. Why?
Can anyone help to have a look at the log and parameters file to see what happened?

Here is my log:
https://drive.google.com/file/d/1GaSySjgsO63mat-IHL9_ZqSt-m8GC6jg/view?usp=sharing

@rmackay9
@andyp1per
Can you please help me?

Does anyone have an idea about this?
Could it be a software bug?
@dkemxr
@amilcarlucas

These kinds of problems are esc/motor failure 96% of the time.

it’s true. But after this hardware problem, the engine’s pwm had to be changed to maintain stability. isn’t it?
But no attempt has been made.
I noticed that the values of AHR2 and ATT didn’t match at the moment of the crash. Why?

I don’t see an obvious reason. Looks like you are using an internal compass? No current logging.

I didn’t find a lot in the log. You have fine vibration and RATE noise values. The position estimates going all over the place at the moment of the crash would probably be normal since the issue causes movement the copter does not expect.

What alt source do you use, the barometer or the GPS module. Have you tested the motors again after the crash?

I would try the drone without the raspberry pi to ensure that it’s no issue with the other hardware of parameter setup. Than maybe try a normal GPS module, if possible. Since the log looks quite fine, the only thing that’s unique here is the raspberry pi for gps data.

I just used the internal compass and forgot to calibrate it before flying.
PreArm_Check = 72(INS +GPS_LOCK) and I forgot to activate other items.
Could this be the cause of the crash?
Thanks for your attention.

I sent lat, long and HDOP to ardupilot via mavlink and the barometer was enable. But I don’t know which alt source was used in autopilot.
I have tested the motors and ESCs after the crash and I haven’t see any problem.
Could incorrect transmission of GPS data be the cause of the crash?
Why the values of AHR2 and ATT didn’t match at the moment of the crash? What is the difference between the two?
Thank you I really appreciate your help.

Internal compass’s usually perform poorly. I would add an external one.

Alright. Poor compass lead to drift in yaw position.
Can it lead to a fall?

@rmackay9
@ppoirier
@peterbarker
Would you please help me find the cause of the crash?
Thanks in advance.

Please do not tag people asking for help, it is not the way we work here. We are a community based support and the people that helped you so far are excellent, so please be patient and appreciative of the help you are receiving.

If your problem require urgent technical support, you can check for paid support here:
https://ardupilot.org/planner/docs/common-commercial-support.html

I apalogize for my behavior.
I just wanted to find out the cause of the crash early to avoid future risks.

No worry, just apply previous recommendations from @dkemxr and report back
Good luck

I always use an external compass. However, in this test, because I wanted to send the GPS data to the autopilot via Mavlink, I disabled it. My question is that the inaccuracy of the compass can lead to this crash.
Thanks very much for your help.

The compass is still required

Hi Dave.
I checked the log and found the following


I don’t understand what you mean.
Can you please explain more?
Do you think the main cause of the crash was the compass?

You do not have current logging. Sometimes this can indicate what the problem may be.

I don’t know what the cause of the crash was based on this log, I was just suggesting that an external compass should be used.

Thank you very much.
Good luck.