PID target vs achieved

Hi, I am trying to use PIDR(P).Tar and PIDR(P).Act to tune my plane and I would like to have some advice as I’m not sure to well understand those metrics. In my case (Roll tuning here) it seems that my PIDR.Act is to high or low, bouncing around PIDR.Tar :


So I included all Roll PIDs terms (P, I, D, F) to know what could cause that. At the same scale as PIDR.Act and PIDR.Tar it is impossible to see anything :

So I decided to set PIDs terms in another axis, scale it to make PIDs values more visible and zoom into a smaller timeframe :

Now what I can see is that P term seems to be inversely proportional to the achieved PID. My first question is : is it normal that the values of P Term are opposed to achieved PID ? Is is just a bug of logged values or is it due to phase lag and the P term I observ is actually trying to counteract the previous Roll action ?
My second question is more general about PIDR(P).Tar : how the system can know the PID target ? To me the system knows the setpoint and try to achieve it through PID loop but don’t know in advance the PID it will use for that.
And my last question is : is it a good way to use PID target vs achieved to tune a plane ?
Thanks

The target value of the roll angle (deg) is recorded in PIDR.Tar, and the measured value of the roll rate (deg/sec) is recorded in PIDR.Act.
Note that Tar and Act use different units, so they cannot be simply compared. From your first graph, you can see that the Act represents the change rate of Tar.

Since the value of PIDR.P is proportional to the deflection of the aileron surface, the larger the value of PIDR.P, the larger the PIDR.Act (roll rate). So your third graph shows correct behavior.

The PID controller for attitude control uses the attitude angular rate as the target value (see here).For AutoTuning, the target attitude rate is set according to the AUTOTUNE_LEVEL. For example, if AUTOTUNE_LEVEL is set to 7, the target rate is set to 90 deg/sec (see here).

Since PIDR.Tar is the target value of attitude angle, I don’t think it is very appropriate to refer to PIDR.Tar for tuning.

Here is my recent AutoTuning of the roll (AUTOTUNE_LEVEL=7), showing that the roll rate is initially large, close to 200 deg/sec, and as the tuning progresses we can see it approaches 90 deg/sec.

Thanks a lot for this very detailed response.