Skip to main content

Gimbal Management

Overview

The PSDK gimbal management function supports the simultaneous management of gimbal payloads mounted at different positions on the aircraft. This includes setting the gimbal mode, centering the gimbal, and controlling gimbal rotation. Developers can use the interfaces provided by the gimbal management system to design control logic, enabling the ability to rotate the gimbal to specific angles during aircraft flight.

Basic Concepts

Gimbal Joints and Gimbal Joint Angles

The gimbal joints are structural components that drive the rotation of the payload on the gimbal, as shown in the diagram below. The gimbal motors are responsible for turning the joints. The gimbal joint angle refers to the angle of rotation of the gimbal motor. This tutorial uses the body coordinate system to describe the gimbal joint angles.

image

Gimbal Attitude and Gimbal Attitude Angles

The gimbal attitude is illustrated in the diagram below. Based on user control instructions, the gimbal can adjust its attitude. The gimbal attitude angle refers to the angle of the payload on the gimbal, described using the Earth coordinate system (NED, North-East-Down coordinate system). This angle is also called Euler angles.

image

Gimbal Limiting Angles

Note:

  • When PSDK controls the Yaw axis of the gimbal with an absolute angle (the set angle is based on the Earth coordinate system, with 0 degrees representing the true north direction), if n > 0, the gimbal will rotate n degrees clockwise from the true north position. If n < 0, the gimbal will rotate n degrees counterclockwise from the true north.
  • When PSDK controls the Yaw axis of the gimbal with a relative angle (the set angle is based on the current angle), if n > 0, the gimbal will rotate n degrees clockwise from its current angle. If n < 0, the gimbal will rotate n degrees counterclockwise from its current angle.
Model Gimbal Mount Type Pitch Yaw Roll
EVO Max 4T Fusion 4T -90°~30° - -
EVO Max 4T XE Fusion 4T XE -90°~30° - -
EVO Max 4N Fusion 4N -90°~30° - -
EVO Max 4NZ V2 Fusion 4NZ -90°~30° - -

Gimbal Control

  • Control Methods
    • Absolute Angle Control: Using the gimbal developed with PSDK, the gimbal rotates from its current position to the specified position within a given time based on the user's instructions.
    • Speed Control: The user can control the rotation speed of the gimbal developed with PSDK.

Note:

  • In angle control mode, the time taken for the gimbal to rotate is limited by the maximum rotation speed and maximum acceleration of the gimbal, while the actual rotation angle is constrained by the gimbal's limit angles.
  • In speed control mode, the gimbal will rotate for 0.5s at the speed specified by the user. When the gimbal reaches its limit angles, it will stop rotating.
  • Gimbal Mode: Currently, PSDK's gimbal control function only supports free mode. In this mode, when the aircraft's attitude changes, the gimbal will not move.

Gimbal Status Information

Applications developed using PSDK can retrieve information about the current status of a specific gimbal.

Using the Gimbal Management Feature

  1. Gimbal Management Module Initialization To control the gimbal, a load device developed with PSDK needs to first call the interface to initialize the gimbal management module.
if(UAV_ERROR_SYSTEM_MODULE_CODE_SUCCESS != UAV_GimbalManager_Init()) {
LOG_ERROR("UAV_GimbalManager_Init failed");
return;
}
  1. Set Gimbal Mode Before controlling the gimbal, the UAV_GimbalManager_SetMode() interface needs to be called to set the working mode of the specified gimbal.
if(UAV_ERROR_SYSTEM_MODULE_CODE_SUCCESS != UAV_GimbalManager_SetMode(gimbalMode)) {
LOG_ERROR("UAV_GimbalManager_SetMode failed");
return;
}
  1. Control Gimbal Rotation The UAV_GimbalManager_Rotate() interface is called to control the gimbal to rotate according to the expected angle and speed.
T_UAVGimbalManagerRotation rotation = {UAV_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, 20, 0, 0, 0.5};
if(UAV_ERROR_SYSTEM_MODULE_CODE_SUCCESS != UAV_GimbalManager_Rotate(rotation)) {
LOG_ERROR("UAV_GimbalManager_Rotate failed");
return;
}
  1. Control Gimbal to Reset Applications developed with PSDK support resetting the gimbal’s pitch and yaw axes to their neutral positions by calling the UAV_GimbalManager_ResetEx() interface.
if(UAV_ERROR_SYSTEM_MODULE_CODE_SUCCESS != UAV_GimbalManager_ResetExEx(mountPosition,resetMode)) {
LOG_ERROR("UAV_GimbalManager_ResetEx failed");
return;
}
  1. Get Gimbal Status Developers can use the subscription data items UAV_SUBSCRIPTION_TOPIC_GIMBAL_ANGLE and UAV_SUBSCRIPTION_TOPIC_GIMBAL_STATUS to obtain the gimbal's attitude angles and status at different positions.