Hi,
I’ve been studying the implementation of yaw weighting in PX4’s AttitudeControl, and I’d like to verify my understanding of the design.
My current understanding is as follows:
- Yaw weight geometrically redefines the attitude error on SO(3). By first aligning the thrust vector (body z-axis) and then applying only a weighted portion of the remaining yaw rotation, it deprioritizes yaw in the overall attitude control.
- My understanding is that yaw weight mainly addresses the geometric priority during large attitude errors. By deprioritizing yaw in the overall attitude control, it allows the controller to align the thrust vector first, enabling the position controller to achieve the desired translational acceleration more quickly.
MC_YAW_P, on the other hand, mainly addresses the difference in control authority and closed-loop dynamics among the three rotational axes. Since a multicopter naturally has much less yaw control authority than roll and pitch, using a smaller yaw proportional gain helps make the response dynamics of the three axes better match their respective physical capabilities, rather than redefining the geometric attitude error.
If this understanding is correct, I still have one question.
After yaw weighting, the controller has already recomputed the attitude error vector eq, where the yaw component has already been deprioritized according to MC_YAW_WEIGHT.
Immediately afterward, the controller computes:
Vector3f rate_setpoint = eq.emult(_proportional_gain);
Since the default gains are different (MC_ROLL_P = 4, MC_PITCH_P = 4, MC_YAW_P = 2.8), this applies an anisotropic scaling to the rotation vector (Lie algebra error), meaning that the direction of the commanded angular velocity changes again.
My question is:
If yaw weighting has already geometrically deprioritized yaw in the overall attitude control, why is it still necessary to use different proportional gains that further change the direction of the commanded angular velocity?
From a geometric point of view, this seems to deviate from the descent direction obtained after the tilt-prioritized attitude error is computed.
My current hypothesis (which may be incorrect) is that:
- Yaw weight mainly addresses the geometric priority during large attitude errors. By deprioritizing yaw in the overall attitude control, it allows the controller to align the thrust vector first, enabling the position controller to achieve the desired translational acceleration more quickly.
MC_YAW_Pmainly addresses the difference in control authority and closed-loop dynamics among the three rotational axes, allowing the response of roll, pitch, and yaw to better match their respective physical capabilities.
In other words, although both affect yaw behavior, they operate at two different levels: yaw weight defines the geometric control objective, while MC_YAW_P compensates for the different dynamic capabilities of the three axes.
Is this interpretation consistent with the original design intent of the controller? Or is there another reason why MC_YAW_P has a smaller default value even after yaw weighting has already been applied?
@bresch