Yaw

From STorM32-BGC Wiki
Jump to navigation Jump to search

The yaw angle is a somewhat difficult topic for gimbals which are based on 6DOF inertial sensors (gyroscope, accelerometer), and this page aims at providing at least some insight into the implications and how the STorM32 controller handles yaw.

The fundamental issue with such a gimbal setup is that yaw cannot be measured in absolute terms (e.g. with respect to North) and that moreover the yaw angle drifts quite significantly with time (typically several degrees per minute). This is in striking contrast to the pitch and roll angle which using the accelerometers can be determined with respect to the gravitation axis.

Fundamentally, due to the limitations set by the available sensors, the STorM32 controller has no notion of an absolute yaw, in the sense that yaw could be referenced to a specific direction, like North (aka yaw in earth frame, or absolute yaw) or the gimbal forward orientation (aka yaw in vehicle frame, or relative yaw). Accordingly, it uses what one may call a synthetic yaw reference. The STorM32 controller tries its best to adjust the yaw reference such that the reported yaw angle may make sense to a user, but this very much depends on the operation conditions, and depending on the particular operation condition and the pervious history it is more or less successful in achieving this. However, fundamentally, the yaw reference wanders with time, and along with it does the reported yaw angle.

For instance, the yaw angle shown in the GUI's DataDisplay can drift substantially, while the camera itself may not move at all. This by itself is not worrysome as it only shows that for the current operation condition the synthetic yaw reference can not be maintained to a constant value but wanders. Unfortunately, the displayed yaw angle may also drift due to a malfunction, like an exessively drifting gyro sensor or incorrect IMU orientation, and it is not always easy to distinguish the root cause.

In order to produce a yaw angle which is aligned with the gimbal forward orientation, the STorM32 tries as best as it can to make use of its knowledge of the gimbal motor positions, but this also depends very much on the operation conditions and in addition on the gimbal construction (no encoders and no 2nd IMU, no encoders with 2nd IMU, with encoders). Obviously, an encodered gimbal provides the best information on the motor positions while a gimbal with no encoders and unpowered motors cannot provide any information.

The situation improves substantially if the STorM32-Link is available. Then the STorM32 controller does know the orientation of the gimbal base in absolute terms, and can adjust its synthetic yaw reference by using the motor positions (as far as these are known, see previous paragraph), such as to achieve a synthetic yaw reference which has a fixed relation to the North direction. However, obviously, if this works well or not depends on how accurate the yaw angle is, which is provided by the STorM32-Link. So, it is important to provide an accurate yaw angle, which can be difficult to achieve.

The STorM32 controller provides several means to read out a yaw angle, like serial commands or MAVLink messages, and what is reported as yaw angle depends on the particular method and operation condition. In some cases it reports the yaw angle with reference to its synthetic yaw reference, in other cases it reports its best guestimate for the relative yaw angle, and if the STorM32-Link is available it also can provide absolute yaw angles.

This can be admittedly confusing to the user, but this page hopefully helps at least insofar as to better understand why it is that confusing.