Insane Roll/Pitch Behavior in GUIDED Mode Only (4.0.3)

Hello! I have a problem I’ve been stuck on for quite some time, and would be delighted to borrow other people’s wisdom in the diagnosis of the issue :grinning:

[PROBLEM]
When flying in GUIDED mode, the drone aggressively rotates out of control along the pitch and roll axes. I am testing a very simple dronekit script to takeoff and land. The drone flies fine in LOITER mode right before attempting the script. This happens consistently when attempting this GUIDED mode dronekit script, and it is all so confusing because it consistently flies fine in any non-GUIDED/AUTO mode.

This is a simple script I have ran successfully many times in the past, and even on this drone.

[HARDWARE/SETUP]

Navio2
Raspberry Pi 4
OS Image: Buster
ArduCopter Version: 4.0.3
Pi Cam with shielded/insulated ribbon cable
External M8N GPS and Compass connected via UART port
TF Mini Rangefinder connected via USB->UART

[LOGS]
92.bin (926.5 KB)
93.bin (625.5 KB)
94.zip (530.4 KB)

92.bin is a manual and successful LOITER flight right before the crashes
93.bin is a GUIDED mode crash powered by a dronekit script
94.bin is a another GUIDED mode crash powered by a dronekit script (had to zip it)

In 93.bin and 94.bin, the actual pitch/roll is way higher than the desired pitch/roll in the ATT log type. There don’t appear to be any errors flagged by the FC until the drone crashes.

[WHAT I AM SUSPICIOUS OF]
I am wondering if this is an ESC synchronization issue (I honestly don’t know much about this), and the takeoff command in the GUIDED script occurs too quickly and the motors respond differently. In the past, occasionally the ARMING MOTORS command in the dronekit script would only successfully arm 3 of the motors, and the drone would immediately flip when the TAKEOFF command provided thrust, which also makes me suspicious of maybe an ESC sync issue?

Once I fix the drone after the crash(es), I am going to attempt a dronekit script once it is already in the air to test this hypothesis.

[HELP ME :)]
Does anyone see anything suspicious in the log files, or have any ideas on what may be causing the crazy pitch/roll behavior in GUIDED mode?

Thanks so much! :smile:

We dropped Navio2 some years ago because of strange behaviours like the one you describe. Since using Pixhawk never had strange probs anymore.

Ah I see! Thanks for the heads up. I have a pixhawk laying around so will try that and report back :grinning:

Ended up downgrading to AC-3.5.5 and everything worked fine. Great GUIDED mode flight. Same setup and parameters. There seems to be something off about AC-4.0.3 GUIDED mode flight on the NAVIO2. Of note, when using my external compass in AC-4.0.3, the heading was 180 degrees off, while on 3.5.5 the heading was correct. May be related, might be a separate issue.

Hello Caleb,
My TF Mini just arrived and I’m planning to integrate into my NAVIO2/Raspberry Pi drone.
If you have any guidance, I’d really appreciate it.
(Hardware or software)
I’m guessing that you are doing your own Ardupilot builds?
regards,
Bernie