Reading Autotune logs

Hello guys,

This is the final log entries for roll:

ATUN, 1435562895, 0, 5, 10, 9.26, 10.04, 0.1149108, 0.003707649, 18.19861, 175781.2
MSG, 1435562962, AutoTune: Roll complete
MSG, 1435563069, AutoTune: Roll Rate: P:0.114, I:0.114, D:0.0037
MSG, 1435563190, AutoTune: Roll Angle P:16.379, Max Accel:175781

From the ATUN message, what parameter is the 18.198 value? Seems like Stabilize Roll P, judging from the Pitch axis log below. If so, what is the Roll Angle P parameter?

Here is the last log of the pitch axis which had to terminate due to low battery:

ATUN, 1715675887, 1, 2, 139.8349, 145.5001, 145.5001, 0.1182642, 0.003297809, 3, 161666.8

I hadn’t saved the gains so I’m going to manually enter the latest gains. Judging from the last ATUN log for roll, it seems that both P and I should be 0.118., D is 0.00329 and max accel being 161666. 3 is the initial Stabilize Pitch P that didn’t get tuned yet. Am I right?

It’s usually safe to use the same values for pitch and roll unless the copter is very asymmetric. Start there on your next run rather than trying to pick up where it left off.

Okay thanks. Can you please also answer my other queries?

Did Roll Angle really jump from 3 to 16?

Here is the log function call. The comment describes the fields in order.

// @LoggerMessage: ATUN
// @Description: Copter/QuadPlane AutoTune
// @Vehicles: Copter, Plane
// @Field: TimeUS: Time since system startup
// @Field: Axis: which axis is currently being tuned
// @Field: TuneStep: step in autotune process
// @Field: Targ: target angle or rate, depending on tuning step
// @Field: Min: measured minimum target angle or rate
// @Field: Max: measured maximum target angle or rate
// @Field: RP: new rate gain P term
// @Field: RD: new rate gain D term
// @Field: SP: new angle P term
// @Field: ddt: maximum measured twitching acceleration

Okay so correct me if I’m wrong: SP is Stabilize Roll P, which is ~18? So what exactly is Roll Angle P? And why doesn’t the I term appear in the ATUN line?

1 Like

The angle controller is proportional only. There is no I term.

My confusion is that I thought SP (which ATUN line says is 18) is same as Angle P (which the 3rd MSG says is 16). So are they the same parameter with 16 being the final value or are they different?

The field to which you refer is tuning ATC_ANG_RLL_P by changing it and measuring response during each step. Your confusion is confusing because you seem to keep saying the same thing and reaffirming the answer.

The AMC tuning guide explains how to read and use the logs of an interrupted autotune.

1 Like

I see. But there aren’t any ATUN messages after that. These four lines were continuous:

ATUN, 1435562895, 0, 5, 10, 9.26, 10.04, 0.1149108, 0.003707649, 18.19861, 175781.2
MSG, 1435562962, AutoTune: Roll complete
MSG, 1435563069, AutoTune: Roll Rate: P:0.114, I:0.114, D:0.0037
MSG, 1435563190, AutoTune: Roll Angle P:16.379, Max Accel:175781

If they were the same parameter, I thought I would have expected to see an ATUN line with the values matching the final MSG

If I followed the autotune logic correctly, when TUNE_COMPLETE is satisfied, logging stops, and the final gains are reported via GCS status text. They remain present in the parameter tree and are either saved by landing/disarming while still in autotune mode or reverted to pre-autotune values when the flight mode is changed.