I am looking at your log. It seems the auto-takeoff began spinning the prop at 97.3 sec, and the altitude begins rising around 98.75 sec. But at that point, comparing ATT.Roll to ATT.DesRoll, it’s clear that the actual roll goes fast to -65[deg] (in about 2 sec!) while the desired roll is still 0.
Looking at RCOU.C1, immediately on takeoff, the ailerons are commanded a negative value (value drops from 1600 to 1400) for about .3 sec, then they are commanded a positive value (rises from 1400 to 1750) for the next 2 sec, which seems to recover the craft’s bad roll.
Unfortunately I don’t know enough to determine why RCOU.C1 drops and rises so aggressively, while ATT.DesRoll remains at 0. Can someone else help from here?
That hypothesis is always possible. However, the plane was able to recover and complete the rest of the flight. It would be strange, but possible, for a loose connection or a damaged servo to malfunction for a short time (3-4sec?), then return to working order.
Here’s a useful idea: If the servo is the problem, you will encounter the same issue in manual mode. If this is some ArduPlane or configuration problem, the plane will not show any problems in manual mode, only in AUTO or other ArduPilot-assisted modes.
Try putting your plane into manual mode, and wiggling the ailerons repeatedly. If you see unexpected behavior, investigate what is wrong.
From the log, I found that plane always rolls after the MSG of holding course( Holding course 16628 at 12m/s(-32.4))! Also dont know whats the meaning of -32.4!
as @Firefly mentions it starts after/during “Holding course 16628 …” which is at ~16:22 time
I found the code here which nav_controller->update_heading_hold(steer_state.hold_course_cd); with 166degree
perhaps @tridge or @magicrub have more info about this.
also heading value gets modulo operation in this time frame as in the
About rapid YAW change , I had a similar problem last year with a copter.
I found out the problem was the I2C bus of the Pixhawk family board where the external compass is connected, if I remember well after a while the reading of the heading by the compass diverge from the initial reading and the EKF routine suddenly correct it . With the copter the result was a sudden 90° rotation on yaw axis.
I solved changing the Pixhawk board with a reliable one .
For plane , I suggest to disable the compass and rely only on GPS for heading.
@lucamax so you think its because of compass error? I got this problem with several different plane, same type! I will check the log of yaw and compass.
@lucamax
I got a good log, during takeoff(before ended altitude) the plane rolled and hit a tall building ,crashed badly. But it seems not the compass problem.
In the case of the copter , the change in compass reading by EKF leaded to a very rapid change, about 90° in the Yaw axis of the copter .
With the plane I do not know if the same event happens, what will do the autopilot.
For this reason I suggest to disable the compass and use only the Gps for plane heading.
In the first log of Tomi what is weird is the big difference in min ATT_Des_Roll value and min ATT_Roll value