One way of looking at the UD problem is that the FC isn't properly allocating the available forces. I.e. more force should be allocated to lift and less to lateral motion. The record type CtrlAllocation has data that shows how the FC is allocating these forces and what happens during a UD. Here is an example, taken from FLY061, where a UD was successfully arrested.
View attachment 100470
Full elevator (green) caused some altitude (red) deviations but, over all, there was no descent. Instead, speed (blue) was sacrificed.
This was achieved by limiting tilt (red).
View attachment 100472
Also shown is the lift_diff that DatCon computes from the raw_lift and fix_lift data in the CtrlAllocation record.
Finally, the CtrlVelVert vel_cmd and vel_fdbk data provide a slightly different perspective. The UD is indicated when the vel_cmd > 0.0 and vel_fdbk < 0.0.
View attachment 100474
About 1 sec later the FC starts adjusting the tilt_scale and lift_diff so that vel_cmd and vel_fdbk become more or less equal.
Later in FLY061 there was a UD that wasn't arrested
View attachment 100475