Gimbal dynamic control method and device

By acquiring the two-dimensional pixel coordinates of the target object and utilizing a trigonometric function calculation module and a PID control algorithm, the positioning error and dynamic interference problems of traditional gimbal control technology in complex scenarios are solved. This achieves high-precision dynamic tracking and anti-interference capabilities of the gimbal, making it suitable for scenarios such as industrial automation, item inspection, and logistics sorting.

CN120631065BActive Publication Date: 2025-11-11BEIJING ETERNAL CREATIVE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511151858.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-15
Publication Date
2025-11-11
Estimated Expiration
2045-08-15

AI Technical Summary

Technical Problem

Traditional gimbal control technology suffers from accumulated target positioning errors in complex scenarios, struggles to cope with dynamic interference, leading to tracking lag or loss of lock, and relies on additional sensors, resulting in high costs and significant environmental impact.

Method used

By obtaining the two-dimensional pixel coordinates of the target object, the gimbal rotation angle is calculated using a coordinate transformation algorithm and a trigonometric function calculation module. Combined with PWM control signals and a stepper motor drive module, the gimbal's dual-axis motor rotation is realized. A PID control algorithm is used for real-time error correction, establishing a precise mapping relationship between image pixels and three-dimensional space.

Benefits of technology

It achieves high-precision positioning and dynamic tracking of the gimbal in complex scenarios, improves anti-interference capability and control stability, and meets the precise positioning and dynamic tracking needs of the industrial automation field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631065B_ABST
    Figure CN120631065B_ABST
Patent Text Reader

Abstract

This disclosure presents a dynamic control method and apparatus for a gimbal. The method includes: acquiring the two-dimensional pixel coordinates of a target object on a display plane; converting the two-dimensional pixel coordinates into physical space coordinates using a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal; calculating the required rotation angle parameters for the horizontal and vertical axes of the gimbal based on the pixel offset and pixel density parameters using a trigonometric function calculation module; converting the rotation angle parameters into PWM control signals, generating a corresponding number of pulse waveforms through a stepper motor drive module to control the rotation of the dual-axis motor of the gimbal; and using a PID control algorithm to correct the error in real time based on the deviation between the current position of the gimbal and the target angle, thereby achieving real-time tracking of the target object by the gimbal and maintaining its pointing position towards the target object. This disclosure solves the problem of accurate positioning and dynamic tracking in complex scenarios by using solid geometric correction technology, improving the accuracy and stability of gimbal control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of automatic control technology, specifically to a method and device for dynamic control of a PTZ (pan-tilt unit), which is particularly suitable for applications requiring precise positioning and dynamic tracking, such as industrial automation, item inspection, and logistics sorting. Background Technology

[0002] In fields such as industrial automation, goods inspection, and logistics sorting, the gimbal, as a core motion control component, directly impacts equipment performance and accuracy through its precise positioning and dynamic tracking capabilities. Traditional gimbal control technologies often rely on preset path planning or simple tracking algorithms based on two-dimensional images, such as directly mapping the pixel offset of the target in the image to the gimbal's rotation angle.

[0003] However, such methods have significant limitations in complex scenarios: target localization errors accumulate with increasing distance; moreover, they struggle to cope with dynamic interference such as conveyor belt movement and object occlusion, easily leading to tracking lag or loss of lock. Furthermore, existing correction algorithms require additional sensors, resulting in high costs and susceptibility to environmental influences.

[0004] Therefore, there is an urgent need for a dynamic control method for PTZ that can achieve high-precision positioning, strong anti-interference capability, and is applicable to complex scenarios, in order to meet the needs of the industrial automation field for precise positioning and dynamic tracking. Summary of the Invention

[0005] The purpose of this disclosure is to provide a dynamic control method and device for a gimbal, which can achieve high-precision positioning and dynamic tracking of the gimbal in complex scenarios.

[0006] To achieve the above objectives, the technical solution provided in this disclosure is as follows:

[0007] A dynamic control method for a gimbal includes: acquiring the two-dimensional pixel coordinates of a target object on a display plane; converting the two-dimensional pixel coordinates into physical space coordinates using a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal; based on the pixel offset and pixel density parameters calculated according to the physical size and resolution of the display, performing angle calculation using a trigonometric function calculation module to obtain the required rotation angle parameters for the horizontal and vertical axes of the gimbal; converting the rotation angle parameters into pulse width modulation (PWM) control signals, generating a corresponding number of pulse waveforms through a stepper motor drive module to control the dual-axis motors of the gimbal to rotate; and based on the deviation between the current position of the gimbal and the target angle, using a proportional-integral-derivative (PID) control algorithm for real-time error correction to achieve real-time tracking of the target object and maintain the gimbal pointing at the target object.

[0008] Optionally, the two-dimensional pixel coordinates are converted into physical space coordinates using a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal. This includes: calculating the horizontal and vertical pixel densities based on the physical parameters and pixel resolution information of the display, and establishing a linear transformation relationship between the pixel coordinates and the physical coordinates; calculating the pixel deviation value between the target point and the display center point based on the linear transformation relationship and the pixel coordinates of the target object, and converting it into an actual physical displacement distance; performing a coordinate system transformation on the physical displacement distance to convert the displacement in the display coordinate system into an offset parameter in the gimbal coordinate system, thereby obtaining the pixel offset of the target object relative to the center of the gimbal.

[0009] Optionally, obtaining the two-dimensional pixel coordinates of the target object on the display plane also includes a display plane calibration process: positioning the gimbal at a preset distance in front of the display, capturing the boundary feature points of the display through a camera, and obtaining the pixel coordinates of the four corner points of the display; based on the pixel coordinates of the four corner points, establishing a spatial coordinate mapping relationship using a four-point calibration algorithm to generate a geometric transformation matrix; capturing the boundary feature points of the gimbal's pitch and roll axes, eliminating assembly errors through a geometric distortion correction algorithm, and obtaining the corrected two-dimensional pixel coordinate information.

[0010] Optionally, the angle calculation module is used to obtain the required rotation angle parameters for the horizontal and vertical axes of the gimbal. This includes: obtaining the actual displacement distance of the target object and the installation distance of the gimbal; calculating the horizontal deflection angle using the arctangent function to obtain the rotation angle of the horizontal axis of the gimbal; calculating the distance of the hypotenuse using the Pythagorean theorem based on the horizontal deflection angle and the installation distance to obtain the reference side length for calculating the vertical axis angle; and calculating the vertical deflection angle using the arctangent function for the vertical displacement distance and the reference side length to obtain the required rotation angle parameters for the vertical axis of the gimbal.

[0011] Optionally, the angle is calculated using a trigonometric function calculation module, employing a layered calculation strategy, including: obtaining the position information of the target coordinates and the current coordinates, determining the direction of motion and decomposing it into horizontal and vertical components, and determining the single-axis or dual-axis motion mode; based on the motion mode and displacement components, constructing a three-dimensional motion model and calculating the spatial slant distance to generate dual-axis motion parameters; performing dynamic coordinate decomposition on the dual-axis motion parameters, calculating the theoretical rotation angles of the X-axis and Y-axis respectively, and obtaining the required rotation angle parameters of the gimbal's horizontal and vertical axes.

[0012] Optionally, the rotation angle parameters are converted into PWM control signals, and a corresponding number of pulse waveforms are generated by the stepper motor drive module to control the rotation of the dual-axis motors of the gimbal. This includes: acquiring the target rotation angles of the horizontal and vertical axes of the gimbal; calculating the required number of pulses based on the angle resolution of the stepper motors; generating PWM waveform parameters; generating a corresponding number of square wave signals through GPIO pins based on the PWM waveform parameters and the motor control frequency to drive the horizontal axis stepper motor to rotate; generating a vertical axis PWM control signal through a timer module based on the vertical axis rotation angle and pulse parameters to drive the vertical axis stepper motor to rotate; monitoring the completion status of the pulse signals based on the rotation state of the dual-axis motors to monitor the gimbal rotation according to the calculated angle; and performing real-time monitoring of the motor rotation process, verifying the rotation accuracy through position feedback signals to complete the coordinated motion control of the dual axes of the gimbal.

[0013] Optionally, the stepper motor drive module generates a corresponding number of pulse waveforms, including: acquiring the target number of rotation steps and motion speed parameters, calculating the acceleration and deceleration parameters of the S-shaped acceleration and deceleration curve, and generating speed planning data; based on the speed planning data and motor characteristic parameters, calculating the pulse frequency of each stage through the acceleration buffer, and establishing a segmented speed control sequence; performing timing control on the segmented speed control sequence, gradually increasing the PWM frequency during the acceleration stage to achieve smooth motor start-up; gradually decreasing the PWM frequency during the deceleration stage based on the motor motion state and remaining steps to achieve smooth motor stop; and performing closed-loop control on the entire motion process, adjusting the pulse timing through position encoder feedback to ensure that the corresponding number of pulse waveforms are executed.

[0014] Optionally, a PID control algorithm is used for real-time error correction to enable the gimbal to track the target object in real time and maintain its pointing position. This includes: acquiring the current angle of the gimbal and the target angle information; calculating the position error, velocity error, and integral error; generating PID control parameters; adjusting the response speed through a proportional control loop based on the PID control parameters and system response characteristics to obtain a proportional control output; processing the integral value of the position error and eliminating steady-state error through an integral control loop to obtain an integral control output; suppressing system oscillations through a differential control loop based on the error change rate and differential time constant to obtain a differential control output; and weighted summing the proportional, integral, and differential control outputs to generate the final control signal and output it to the motor driver, thereby enabling the gimbal to track the target object in real time and maintain its pointing position.

[0015] Optionally, it also includes stereo geometric correction processing based on a three-dimensional coordinate mapping model, including: acquiring camera calibration parameters and laser pointer calibration parameters, establishing a mapping relationship between image pixel coordinates and three-dimensional spatial coordinates, and generating a stereo geometric correction model; calculating the spatial position compensation of the target object based on the stereo geometric correction model and conveyor belt motion parameters, and obtaining the corrected target coordinates; detecting geometric distortion during image acquisition, eliminating perspective distortion and radial distortion through distortion correction algorithms, and generating corrected image coordinates; performing data fusion using a Kalman filter algorithm based on environmental interference factors and sensor noise to obtain stable target position information; and performing time synchronization processing on multi-sensor data, achieving data alignment through timestamp calibration and interpolation algorithms to ensure the timeliness and accuracy of real-time tracking and maintaining the position pointing to the target object.

[0016] This disclosure also provides a gimbal dynamic control device, comprising: a coordinate transformation module for acquiring two-dimensional pixel coordinates of a target object on a display plane, converting the two-dimensional pixel coordinates into physical space coordinates using a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal; an angle calculation module for performing angle calculation using a trigonometric function calculation module based on the pixel offset and pixel density parameters calculated according to the physical size and resolution of the display to obtain the required rotation angle parameters for the horizontal and vertical axes of the gimbal; a motor control module for converting the rotation angle parameters into PWM control signals, generating a corresponding number of pulse waveforms through a stepper motor drive module to control the dual-axis motor of the gimbal to rotate; and a tracking control module for performing real-time error correction using a PID control algorithm based on the deviation between the current position of the gimbal and the target angle, thereby enabling the gimbal to track the target object in real time and maintain its pointing position towards the target object.

[0017] This disclosure provides another gimbal dynamic control device, including a processor and a memory. The memory stores machine-readable instructions executable by the processor. The processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor performs the steps of the gimbal dynamic control method described above.

[0018] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a computer device, causes the computer device to perform the steps of the aforementioned gimbal dynamic control method.

[0019] As described above, this embodiment of the present disclosure achieves high-precision positioning and dynamic tracking of the gimbal in complex scenarios by establishing a precise mapping relationship between image pixel coordinates and three-dimensional spatial coordinates; it improves the accuracy and efficiency of angle calculation by using a trigonometric function calculation module; it achieves precise control of the gimbal's dual-axis motors through PWM control signal conversion and a stepper motor drive module; and it improves the stability and response speed of the gimbal control by using a PID control algorithm for real-time error correction. Therefore, this embodiment of the present disclosure can achieve high-precision positioning, strong anti-interference capability, and gimbal control suitable for complex scenarios, meeting the needs of precise positioning and dynamic tracking in the field of industrial automation.

[0020] In addition, a three-dimensional geometric correction process based on a three-dimensional coordinate mapping model was adopted, which solved the problem of accurate positioning and dynamic tracking of traditional gimbal control systems in complex scenarios. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart of the dynamic control method for the gimbal in this disclosure;

[0023] Figure 2 A flowchart illustrating the process of indicating motor deflection;

[0024] Figure 3 This is a flowchart of the coordinate transformation process disclosed in this publication;

[0025] Figure 4 This is a schematic diagram showing the placement of the gimbal and the intelligent display terminal.

[0026] Figure 5 This is a flowchart of the solution process from the perspective of this disclosure;

[0027] Figure 6 This is a flowchart of the PWM control signal conversion process disclosed herein;

[0028] Figure 7 This is a flowchart of the PID control algorithm disclosed in this publication;

[0029] Figure 8 This is a structural diagram of the gimbal dynamic control device disclosed herein;

[0030] Figure 9 This disclosure provides a schematic diagram of a computer device according to an embodiment. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0032] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0033] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0034] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.

[0035] Example 1:

[0036] like Figure 1 As shown, a dynamic control method for a gimbal includes:

[0037] In this embodiment, the gimbal dynamic control method based on stereo geometric correction mainly includes four core steps, each of which will be described in detail below.

[0038] S1: Obtain the two-dimensional pixel coordinates of the target object on the display plane, and convert the two-dimensional pixel coordinates into physical space coordinates through a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal.

[0039] This step first captures an image of the target object on the display plane using a camera, and then obtains the two-dimensional pixel coordinates of the target object through image processing technology. The system uses the display screen as the visual positioning reference, with its physical parameters clearly marked as follows: a horizontal effective display area of ​​700 mm corresponds to 1366 pixel units, and a vertical effective height of 393 mm corresponds to 768 pixel units. Calibration confirms that the display center point is located at the pixel coordinates of column 683, row 384. During equipment deployment, the pan-tilt unit maintains a standard installation distance of 500 mm from the display screen plane. Through geometric calibration, the horizontal pixel density can be calculated to be 0.512 mm / pixel (700 mm ÷ 1366), and the vertical pixel density is 0.511 mm / pixel (393 mm ÷ 768). Based on the mapping relationship between the Cartesian coordinate system and the pixel coordinate system, the system converts the target pixel offset into an actual displacement value. For example, a 100-pixel leftward movement along the X-axis corresponds to an actual displacement of 51.2 mm, thus obtaining the pixel offset of the target object relative to the center of the pan-tilt unit.

[0040] S2: Based on the pixel offset and the pixel density parameters calculated according to the physical size and resolution of the display, the angle is calculated using the trigonometric function calculation module to obtain the required rotation angle parameters of the horizontal and vertical axes of the gimbal.

[0041] This step employs a layered solution strategy. First, the pixel deviations between the target point and the center point, ΔPx = |Px-683| and ΔPy = |Py-384|, are calculated. The actual displacements Sx and Sy are then obtained through pixel density parameter conversion. Next, a right-angled triangle is constructed using the X-axis displacement to calculate the base deflection angle θx = arctan(Sx / D), where D is the fixed installation distance of 500 mm. Finally, D and Sx are used as adjacent sides to construct the hypotenuse L = Using this as a new reference edge, the Y-axis deflection angle θy = arctan(Sy / L) is calculated. This algorithm innovatively employs dynamic coordinate decomposition technology. When handling oblique positioning requirements, the system automatically constructs a three-dimensional motion model, first solving for the spatial slope distance using the Pythagorean theorem, then decomposing it into dual-axis motion parameters to achieve high-precision positioning in non-orthogonal directions, ultimately obtaining the required deflection angles for the X-axis and Y-axis motors. Figure 2 The diagram shown is a flowchart illustrating the process of indicating motor deflection.

[0042] S3: The rotation angle parameter is converted into a pulse width modulation (PWM) control signal, and a corresponding number of pulse waveforms are generated by the stepper motor drive module to control the dual-axis motor of the gimbal to rotate.

[0043] The gimbal control system employs a modular design for precise positioning. Upon receiving a target coordinate command, the main control unit first parses the coordinate parameters and converts them into motion parameters in the device coordinate system. The control system incorporates a coordinate transformation algorithm that automatically calculates the required rotation parameters for the X / Y axes by establishing a mapping between the display screen pixel coordinate system and the gimbal rotation angle. These parameters are processed by the motion planning module to generate two PWM control signals to drive the gimbal motors. Each square wave generates a 0.001-degree rotation of the gimbal, achieving precise control over each pixel. The system allows the gimbal to reach the target angle by setting the X-axis step size, reaches the target coordinates by setting the X-axis angle, and moves the gimbal to a specified position by setting the target coordinates of the X-axis. The same principle applies to the Y-axis control, thus achieving coordinated movement of the gimbal's dual-axis motors.

[0044] S4: Based on the deviation between the current position of the gimbal and the target angle, a proportional-integral-derivative (PID) control algorithm is used for real-time error correction, enabling the gimbal to track the target object in real time and maintain its position pointing towards the target object.

[0045] During the dynamic execution phase, the gimbal control system compares the current attitude with the target parameters in real time and activates the high-precision motor drive. Through a built-in PID control algorithm, the system continuously monitors the rotational displacement of the actuator and dynamically corrects the error between the target angle and the actual position. The PID control algorithm adjusts the response speed through a proportional element, eliminates steady-state error through an integral element, and suppresses system oscillations through a derivative element; the weighted sum of these three elements generates the final control signal. Based on the current angle of the gimbal and the target angle, the system calculates the position error, velocity error, and integral error, generates PID control parameters, and precisely controls the motor according to these parameters until the gimbal stabilizes at the calculated target azimuth angle, thus achieving precise indication of the target object and enabling the gimbal to track and maintain its pointing position in real time.

[0046] like Figure 3 As shown, based on Example 1, the two-dimensional pixel coordinates are converted into physical space coordinates using a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal, including:

[0047] S1.1: Based on the physical parameters and pixel resolution information of the display, calculate the horizontal pixel density and vertical pixel density, and establish a linear transformation relationship between pixel coordinates and physical coordinates;

[0048] In this embodiment, the horizontal and vertical pixel densities are first calculated based on the display's physical parameters and pixel resolution information. For example, a horizontal effective display area of ​​700 mm corresponds to 1366 pixel units, and a vertical effective height of 393 mm corresponds to 768 pixel units. Therefore, the horizontal pixel density is calculated to be 0.512 mm / pixel (700 mm ÷ 1366), and the vertical pixel density is 0.511 mm / pixel (393 mm ÷ 768). Then, based on these parameters and the pixel coordinates of the target object, the pixel deviation between the target point and the display center point is calculated and converted into the actual physical displacement distance. Finally, a coordinate system transformation is performed on the physical displacement distance, converting the displacement in the display coordinate system into an offset parameter in the gimbal coordinate system, thus obtaining the pixel offset of the target object relative to the center of the gimbal.

[0049] Specifically, in the first step of the coordinate transformation algorithm, the system calculates the horizontal and vertical pixel densities based on the display's physical parameters and pixel resolution information, establishing a linear transformation relationship between pixel coordinates and physical coordinates. The display device used in this system has clearly defined physical parameters: its effective horizontal display area is 700 mm, corresponding to 1366 pixel units; its effective vertical height is 393 mm, corresponding to 768 pixel units. Through precise calculation, the system obtains a horizontal pixel density of 0.512 mm / pixel (i.e., 700 mm ÷ 1366 pixels) and a vertical pixel density of 0.511 mm / pixel (i.e., 393 mm ÷ 768 pixels). These parameters form the basis for the linear transformation between pixel coordinates and physical coordinates, ensuring the accuracy of subsequent calculations.

[0050] S1.2: Based on the linear transformation relationship and the pixel coordinates of the target object, calculate the pixel deviation value between the target point and the display center point, and convert it into the actual physical displacement distance;

[0051] In the second step, based on the established linear transformation relationship and the pixel coordinates of the target object, the system calculates the pixel deviation between the target point and the display center point, and converts it into actual physical displacement distance. The system confirms through calibration that the display center point is located at the pixel coordinates of column 683 and row 384. When the target object is detected at specific pixel coordinates (Px, Py), the system calculates the pixel deviation values ​​between the target point and the center point: ΔPx = |Px-683| and ΔPy = |Py-384|. Using the aforementioned pixel density parameters, the system converts the pixel deviation into physical displacement: Sx = ΔPx × 0.512 mm / pixel and Sy = ΔPy × 0.511 mm / pixel. This conversion process establishes the precise physical position of the target object on the display plane.

[0052] S1.3: Perform coordinate system transformation on the physical displacement distance, converting the displacement in the display coordinate system into an offset parameter in the gimbal coordinate system, to obtain the pixel offset of the target object relative to the center of the gimbal.

[0053] In the third step, the system performs a coordinate system transformation on the physical displacement distance, converting the displacement in the display coordinate system into an offset parameter in the gimbal coordinate system, thus obtaining the pixel offset of the target object relative to the center of the gimbal. Since the gimbal maintains a standard installation distance of 500 mm from the display screen, the system needs to convert the planar displacement into angular parameters. During this process, the system establishes a mapping relationship between the display coordinate system and the gimbal coordinate system, converting the two-dimensional planar coordinates into three-dimensional spatial parameters in the gimbal coordinate system through spatial geometric transformation. This coordinate system transformation considers the installation position, attitude, and relative relationship between the gimbal and the display, ensuring the accuracy of subsequent angle calculations.

[0054] like Figure 3 As shown, based on Example 1, obtaining the two-dimensional pixel coordinates of the target object on the display plane also includes a display plane calibration process:

[0055] S1.4: Position the gimbal at a preset distance directly in front of the monitor, capture the feature points of the monitor's boundary using the camera, and obtain the pixel coordinates of the four corner points of the monitor;

[0056] In this embodiment, the gimbal is first positioned at a preset distance (e.g., 50 cm) directly in front of the display. A camera captures the display's boundary feature points, obtaining the pixel coordinates of the four corner points. Then, based on these corner coordinates, a four-point calibration algorithm is used to establish a spatial coordinate mapping relationship, generating a geometric transformation matrix. Finally, boundary feature points of the gimbal's pitch and roll axes are captured, and a geometric distortion correction algorithm is used to eliminate assembly errors, obtaining corrected two-dimensional pixel coordinate information. This ensures the accuracy of subsequent coordinate transformations.

[0057] In the first step of the display plane calibration process, the system positions the pan-tilt unit at a preset distance directly in front of the monitor. It then uses a camera to capture feature points on the monitor's boundaries, obtaining the pixel coordinates of the four corner points. The operator must first position the pan-tilt unit longitudinally at a reference distance of 50 cm directly in front of the monitor, and then align it laterally with the geometric center line of the display area, according to the system parameter settings. The camera's installation orientation is relatively flexible, only requiring a field of view for panoramic coverage (a 3° safety zone beyond the monitor's edge is recommended). However, it is crucial to ensure that the angle error between the camera's optical axis and the normal to the display plane during calibration is not too large to avoid coordinate transformation distortion caused by perspective distortion. Through high-precision image processing algorithms, the system can accurately identify the pixel coordinates of the four corner points of the monitor, providing fundamental data for subsequent spatial coordinate mapping.

[0058] S1.5: Based on the pixel coordinates of the four corner points, a spatial coordinate mapping relationship is established using a four-point calibration algorithm to generate a geometric transformation matrix;

[0059] Based on the pixel coordinates of the four corner points, the system uses a four-point calibration algorithm to establish a spatial coordinate mapping relationship and generate a geometric transformation matrix. The four-point calibration algorithm is a classic computer vision technique that calculates the transformation matrix from pixel coordinates to physical coordinates using the known actual physical coordinates and corresponding pixel coordinates of the four corner points. This algorithm can effectively handle geometric transformations such as perspective distortion, rotation, and scaling, generating accurate coordinate mapping relationships. By solving the perspective transformation equations, the system obtains a 3×3 transformation matrix, which contains complete mapping information from pixel coordinates to physical coordinates, providing a mathematical foundation for subsequent coordinate transformations.

[0060] S1.6: Capture boundary feature points for the gimbal's pitch and roll axes, eliminate assembly errors using a geometric distortion correction algorithm, and obtain the corrected two-dimensional pixel coordinate information.

[0061] The system captures boundary feature points on the gimbal's pitch and roll axes, and eliminates assembly errors using a geometric distortion correction algorithm to obtain corrected 2D pixel coordinate information. During actual assembly, slight deviations in the gimbal's installation position and attitude may occur, leading to systematic errors in coordinate transformation. To eliminate these errors, the system uses a laser pointer-assisted positioning function to fine-tune the gimbal's spatial orientation until the laser mark perfectly coincides with the system's preset reference point, completing the spatial anchoring of the monitoring device. Simultaneously, the system employs a geometric distortion correction algorithm to calculate compensation parameters for assembly errors through the capture and analysis of boundary feature points, thereby obtaining corrected 2D pixel coordinate information and ensuring the accuracy of subsequent coordinate transformations.

[0062] like Figure 4 The diagram shows the placement of the gimbal and the smart display terminal. As described in the display plane calibration process above, the core of the equipment positioning stage lies in establishing the spatial reference relationship between the gimbal and the display terminal (screen). The operator must first position the gimbal longitudinally at a reference distance of 50 cm directly in front of the display terminal, and laterally align it with the geometric center line of the display area, according to the system parameter settings. After completing the physical positioning, a calibration process must be performed: capturing the display's boundary feature points with a camera, establishing a spatial coordinate mapping relationship using a four-point calibration algorithm, and sequentially capturing boundary feature points and correcting geometric distortion for the gimbal's pitch and roll axes to eliminate coordinate system offsets caused by assembly errors. The camera's installation orientation is relatively flexible, only requiring a field of view for panoramic coverage (a 3° safety zone beyond the display is recommended), but it is crucial to ensure that the angle error between the camera's optical axis and the display plane normal during calibration is not too large to avoid coordinate transformation distortion caused by perspective distortion.

[0063] like Figure 5 As shown, based on Example 1, the angle calculation module is used to obtain the required rotation angle parameters for the horizontal and vertical axes of the gimbal, including:

[0064] S2.1: Obtain the actual displacement distance of the target object and the installation distance of the gimbal, calculate the horizontal deflection angle using the arctangent function, and obtain the horizontal axis rotation angle of the gimbal;

[0065] In this embodiment, the actual displacement distance of the target object and the installation distance of the gimbal (e.g., 500 mm) are first obtained. The horizontal deflection angle is then calculated using the arctangent function to obtain the horizontal axis rotation angle of the gimbal. For example, if the horizontal displacement of the target object is 51.2 mm, the horizontal deflection angle θx = arctan(51.2 / 500) ≈ 5.85°. Then, based on the horizontal deflection angle and the installation distance, the distance of the hypotenuse in space is calculated using the Pythagorean theorem to obtain the reference side length for calculating the vertical axis angle. Finally, the vertical deflection angle is calculated using the arctangent function based on the vertical displacement distance and the reference side length to obtain the required rotation angle parameter for the vertical axis of the gimbal.

[0066] The system acquires the actual displacement distance of the target object and the installation distance of the gimbal, calculates the horizontal deflection angle using the arctangent function, and obtains the horizontal axis rotation angle of the gimbal. When the system receives a command to move the X-axis to the left, it first converts the target pixel offset into an actual displacement value (e.g., Δx = 100 pixels corresponds to Sx = 51.2 mm), and then calculates the horizontal deflection angle of the gimbal using the trigonometric function θx = arctan(Sx / D), where D is the fixed installation distance of 500 mm. This calculation method is based on spatial geometry principles; by establishing a right triangle, planar displacement is converted into angular parameters, ensuring the accurate calculation of the horizontal axis rotation angle.

[0067] S2.2: Based on the horizontal deflection angle and installation distance, the distance of the hypotenuse in space is calculated using the Pythagorean theorem to obtain the reference side length for calculating the vertical axis angle;

[0068] Based on the horizontal deflection angle and installation distance, the distance of the hypotenuse is calculated using the Pythagorean theorem to obtain the reference side length for calculating the vertical axis angle. In three-dimensional space, when the gimbal's horizontal axis rotates, the calculation of the vertical axis angle needs to consider the changes in spatial geometry. The system constructs a right triangle with D and Sx as adjacent sides, and calculates the hypotenuse length L using the Pythagorean theorem. This hypotenuse length serves as the new reference side length for calculating the vertical axis angle, taking into account the influence of horizontal axis rotation on the calculation of the vertical axis angle, thus ensuring the accuracy of the coordinated movement of the two axes.

[0069] S2.3: Calculate the vertical deflection angle using the arctangent function based on the vertical displacement distance and the reference side length to obtain the required rotation angle parameters for the vertical axis of the gimbal.

[0070] The vertical deflection angle is calculated using the arctangent function based on the vertical displacement distance and the reference side length, thus obtaining the required rotation angle parameters for the vertical axis of the gimbal. Based on the reference side length L calculated in the previous step, the system uses the arctangent function θy=arctan(Sy / L) to calculate the vertical deflection angle, where Sy is the vertical displacement distance. This calculation method considers the changes in spatial geometry after the horizontal axis rotation, ensuring accurate calculation of the vertical axis rotation angle. For control requirements at any coordinate point (Px, Py), the system uses this hierarchical solution strategy to first calculate the horizontal axis rotation angle, and then calculate the vertical axis rotation angle based on the spatial geometry after the horizontal axis rotation, achieving precise positioning control of the gimbal's dual axes.

[0071] like Figure 5 As shown, based on Example 1, the angle is calculated using a trigonometric function calculation module, employing a layered calculation strategy, including:

[0072] S2.4: Obtain the position information of the target coordinates and the current coordinates, determine the direction of motion and decompose it into horizontal and vertical components, and determine the single-axis or dual-axis motion mode;

[0073] The system acquires the target coordinates and current coordinates, determines the direction of motion, and decomposes it into horizontal and vertical components to determine the single-axis or dual-axis motion mode. Upon receiving the target coordinate command, the system first compares the target position with the current position to determine the required motion direction and mode. If the target position differs from the current position only in the X-axis or Y-axis direction, the system will use the single-axis motion mode; if there is a difference in both directions, the dual-axis motion mode will be used. This intelligent judgment mechanism optimizes the motion path and improves positioning efficiency. For single-axis motion, the system directly uses the Euler tangent circle method to calculate the rotation angle of the corresponding axis; for dual-axis motion, a three-dimensional motion model needs to be further constructed to achieve more complex spatial positioning.

[0074] S2.5: Based on the motion mode and displacement components, construct a three-dimensional motion model and calculate the spatial slant distance to generate biaxial motion parameters;

[0075] Based on the aforementioned motion mode and displacement components, a three-dimensional motion model is constructed, and the spatial slant distance is calculated to generate dual-axis motion parameters. When dual-axis coordinated motion is required, the system uses the horizontal and vertical displacement components as the two legs of a right triangle and calculates the spatial slant distance using the Pythagorean theorem. This spatial slant distance reflects the actual distance between the target point and the current point in three-dimensional space, providing a basis for subsequent angle calculations. Simultaneously, considering the motion characteristics of the gimbal and mechanical structural constraints, the system generates parameters suitable for dual-axis coordinated motion, including motion speed, acceleration, and deceleration, ensuring the smoothness and accuracy of the motion process.

[0076] S2.6: Perform dynamic coordinate decomposition on the dual-axis motion parameters, calculate the theoretical rotation angles of the X-axis and Y-axis respectively, and obtain the required rotation angle parameters of the horizontal and vertical axes of the gimbal.

[0077] The dual-axis motion parameters are dynamically decomposed into coordinates to calculate the theoretical rotation angles of the X and Y axes, obtaining the required rotation angle parameters for the horizontal and vertical axes of the gimbal. In three-dimensional space, the position of the target point can be represented by a spherical coordinate system, which includes radial distance, horizontal angle, and vertical angle. The system uses dynamic coordinate decomposition technology to convert the angle parameters in the spherical coordinate system into rotation angles for the horizontal and vertical axes of the gimbal. This decomposition method considers the mechanical structure and motion characteristics of the gimbal, ensuring consistency between the theoretically calculated angles and the actual executed angles. By accurately calculating the theoretical rotation angles of the X and Y axes, the system can achieve precise positioning of the target point, regardless of its spatial location.

[0078] In this embodiment, the position information of the target coordinates and the current coordinates is first obtained, the motion direction is determined and decomposed into horizontal and vertical components, and the single-axis or dual-axis motion mode is determined. If only X-axis movement is required, the X-axis rotation angle is calculated using the Euler circle method; if only Y-axis movement is required, the Y-axis rotation angle is calculated using the Euler circle method; if both X and Y need to move, a three-dimensional motion model is constructed based on the motion mode and displacement components, and the spatial slant distance is calculated to generate dual-axis motion parameters. Finally, dynamic coordinate decomposition is performed on the dual-axis motion parameters, and the theoretical rotation angles of the X-axis and Y-axis are calculated separately to obtain the required rotation angle parameters for the horizontal and vertical axes of the gimbal.

[0079] like Figure 6 As shown, based on Example 1, the rotation angle parameter is converted into a pulse width modulation (PWM) control signal. A corresponding number of pulse waveforms are generated by the stepper motor drive module to control the dual-axis motor of the gimbal to rotate, including:

[0080] S3.1: Obtain the target rotation angles of the gimbal's horizontal and vertical axes, calculate the required number of pulses based on the stepper motor's angular resolution, and generate PWM waveform parameters;

[0081] The system acquires the target rotation angles of the gimbal's horizontal and vertical axes, calculates the required number of pulses based on the stepper motor's angular resolution, and generates PWM waveform parameters. The gimbal control system employs a modular design for precise positioning. Upon receiving the target coordinate command, the main control unit first parses the coordinate parameters and converts them into motion parameters in the device coordinate system. Based on the stepper motor's angular resolution (each pulse corresponds to a 0.001-degree rotation angle), the system converts the target rotation angle into the required number of pulses. For example, if the horizontal axis needs to rotate 5.85 degrees, 5850 pulses are required. Based on these pulse counts, the system generates corresponding PWM waveform parameters, including frequency, duty cycle, and pulse count, providing a foundation for subsequent motor control.

[0082] S3.2: Based on the PWM waveform parameters and motor control frequency, generate a corresponding number of square wave signals through the General Purpose Input / Output (GPIO) pins to drive the horizontal axis stepper motor to rotate;

[0083] Based on the PWM waveform parameters and motor control frequency, a corresponding number of square wave signals are generated via GPIO pins to drive the horizontal axis stepper motor to rotate. Once the PWM waveform parameters are determined, square wave signals are output via the microcontroller's GPIO pins. The frequency and number of these square wave signals are calculated in the previous step, with each square wave corresponding to one microstep of the stepper motor. The system controls the X-axis deflection angle of the gimbal by controlling the number of PWM waves generated. The following is the function implementation for generating the corresponding number of X-axis PWM waves: Through cyclic control, the system can accurately generate the required number of pulse waveforms, ensuring that the horizontal axis stepper motor rotates at a predetermined angle. Simultaneously, the system can also control the motor's rotation speed by adjusting the frequency of the PWM waveform, achieving a smooth start and stop process.

[0084] S3.3: Based on the vertical axis rotation angle and pulse parameters, a vertical axis PWM control signal is generated through the timer module to drive the vertical axis stepper motor to rotate;

[0085] For the vertical axis rotation angle and pulse parameters, a timer module generates a vertical axis PWM control signal to drive the vertical axis stepper motor. Similar to the horizontal axis control, the system calculates the required number of pulses based on the target rotation angle of the vertical axis and the angular resolution of the stepper motor. However, unlike the horizontal axis control, the system uses a timer module to generate the vertical axis PWM control signal. This method provides more precise timing control, ensuring smooth operation of the vertical axis motor. The timer module, through a hardware interrupt mechanism, can automatically generate the required PWM waveform in the background, reducing the burden on the main processor and improving the system's response speed and stability.

[0086] S3.4: Based on the rotation status of the dual-axis motor, monitor the completion of the pulse signal to monitor the gimbal rotation according to the calculated angle;

[0087] Based on the rotation status of the dual-axis motor, the system monitors the completion of pulse signals to ensure the pan-tilt unit rotates according to the calculated angle. During motor control, the system needs to monitor the generation and execution of pulse signals in real time to ensure that all pulses are executed correctly, thereby guaranteeing that the pan-tilt unit rotates at the predetermined angle. The system records the number of generated and executed pulses by setting status flags or counters. When all pulses have been executed, it indicates that the motor has rotated to the target position. This monitoring mechanism can promptly detect abnormalities in the motor control process, such as pulse loss or motor stall, providing a basis for system fault diagnosis and handling.

[0088] S3.5: Real-time monitoring of the motor rotation process, verification of rotation accuracy through position feedback signals, and completion of coordinated motion control of the dual axes of the gimbal.

[0089] The system monitors the motor's rotation in real time and verifies rotational accuracy using position feedback signals to achieve coordinated motion control of the gimbal's two axes. To ensure accurate gimbal positioning, the system employs a closed-loop control strategy, monitoring the motor's actual rotation in real time via position feedback signals. These feedback signals can come from encoders, Hall effect sensors, or other position detection devices, providing information on the motor's actual rotation angle. The system compares this feedback information with the target angle, calculates the position error, and adjusts the control strategy accordingly, such as adjusting the pulse frequency or adding compensation pulses. Through this closed-loop control mechanism, the system achieves high-precision coordinated motion control of the gimbal's two axes, ensuring the gimbal accurately points to the target position.

[0090] In this embodiment, the target rotation angles of the gimbal's horizontal and vertical axes are first obtained. The required number of pulses is calculated based on the stepper motor's angle resolution (e.g., 0.001 degrees / pulse), generating PWM waveform parameters. Then, based on the PWM waveform parameters and the motor control frequency, a corresponding number of square wave signals are generated via GPIO pins to drive the horizontal axis stepper motor. Simultaneously, for the vertical axis rotation angle and pulse parameters, a vertical axis PWM control signal is generated via a timer module to drive the vertical axis stepper motor. Next, based on the rotation status of the dual-axis motors, the completion status of the pulse signals is monitored to ensure the gimbal rotates according to the calculated angles. Finally, the motor rotation process is monitored in real time, and the rotation accuracy is verified through position feedback signals, completing the coordinated motion control of the gimbal's two axes.

[0091] like Figure 6 As shown, based on Example 1, a corresponding number of pulse waveforms are generated by the stepper motor drive module, including:

[0092] S3.6: Obtain the target rotation steps and motion speed parameters, calculate the acceleration and deceleration parameters of the S-shaped acceleration and deceleration curve, and generate speed planning data;

[0093] S3.7: Based on the speed planning data and motor characteristic parameters, calculate the pulse frequency of each stage through the acceleration buffer and establish a segmented speed control sequence;

[0094] S3.8: Perform timing control on the segmented speed control sequence, gradually increasing the PWM frequency during the acceleration phase to achieve smooth motor start-up;

[0095] S3.9: Based on the motor's motion state and remaining steps, the PWM frequency is gradually reduced during the deceleration phase to achieve a smooth motor stop;

[0096] S3.10: Perform closed-loop control on the entire motion process, and adjust the pulse timing through feedback from the position encoder so that the corresponding number of pulse waveforms are executed.

[0097] In this embodiment, the target rotation steps and motion speed parameters are first acquired, and the acceleration and deceleration parameters of the S-shaped acceleration / deceleration curve are calculated to generate speed planning data. Then, based on the speed planning data and motor characteristic parameters, the pulse frequency for each stage is calculated through an acceleration buffer to establish a segmented speed control sequence. Next, timing control is applied to the segmented speed control sequence, gradually increasing the PWM frequency during the acceleration phase to achieve smooth motor start-up. Then, based on the motor's motion state and remaining steps, the PWM frequency is gradually decreased during the deceleration phase to achieve smooth motor stop. Finally, closed-loop control is applied to the entire motion process, adjusting the pulse timing through position encoder feedback to ensure that the corresponding number of pulse waveforms are executed.

[0098] The system acquires the target rotation steps and motion speed parameters, calculates the acceleration and deceleration parameters of the S-shaped acceleration / deceleration curve, and generates speed planning data. When the system sets the stepping parameters of the gimbal's X-axis, it first receives the target rotation steps through the function `Tripod_X_Step(int32_t step)` and stores them in the `Tripod_X_Step_Mode` variable. Then, the system calls the function `Tripod_Buffer.Calculate(tripod_x_buffer, step)` to calculate the S-shaped acceleration / deceleration curve parameters. Compared to the traditional trapezoidal speed curve, the S-shaped acceleration / deceleration curve has a smoother acceleration and deceleration process, effectively reducing the impact and vibration during motor start-up and shutdown. By analyzing the target number of steps and preset maximum speed and acceleration limits, the system generates complete speed planning data, providing a foundation for subsequent motor control.

[0099] Based on the speed planning data and motor characteristic parameters, the system calculates the pulse frequency for each stage using an acceleration buffer to establish a segmented speed control sequence. The acceleration buffer is a special data structure used to store speed and acceleration information for each stage of motor motion. Based on the speed planning data generated in the previous step, and combined with the stepper motor's characteristic parameters (such as rated current, phase resistance, step angle, etc.), the system calculates the pulse frequency at each time point during the motion. These frequency values ​​form a segmented speed control sequence, describing the complete speed change process of the motor from start to stop. By precisely controlling the pulse frequency of each stage, the system can achieve smooth motor operation, avoiding problems such as mechanical resonance and step loss.

[0100] The system performs timing control on the segmented speed control sequence, gradually increasing the PWM frequency during the acceleration phase to achieve smooth motor start-up. During motor start-up, the system gradually increases the PWM signal frequency according to the pre-calculated segmented speed control sequence. This gradual frequency adjustment enables the motor rotor to accelerate smoothly, avoiding insufficient torque or overshoot caused by sudden start-up. The system precisely controls the duration of each frequency point through timer interrupts or software delays to ensure the motor operates according to the predetermined acceleration curve. Simultaneously, the system monitors the motor's actual operating status, such as current changes and position feedback, to adjust the control strategy promptly in abnormal situations, ensuring smooth motor start-up.

[0101] The system gradually reduces the PWM frequency during the deceleration phase based on the motor's motion state and remaining steps, achieving a smooth motor stop. When the motor reaches the predetermined deceleration point, the system begins the deceleration process. The deceleration point is determined based on the target number of steps, the current speed, and preset deceleration parameters, ensuring the motor stops precisely at the target position. During the deceleration phase, the system gradually reduces the PWM signal frequency according to a pre-calculated segmented speed control sequence, allowing the motor rotor to decelerate smoothly. This gradual frequency adjustment avoids overshoot or oscillation caused by sudden stops, improving positioning accuracy. Simultaneously, the system dynamically adjusts the deceleration curve based on the remaining steps to ensure the motor stops precisely at the target position.

[0102] The system employs closed-loop control throughout the entire motion process, adjusting the pulse timing via feedback from the position encoder to ensure the execution of the corresponding number of pulse waveforms. To ensure the accuracy of motor control, the system adopts a closed-loop control strategy, monitoring the actual position of the motor in real time through the position encoder. The position encoder provides high-precision position feedback signals, which the system compares with the expected position to calculate the position error. Based on the position error, the system dynamically adjusts the pulse timing, such as increasing or decreasing the number of pulses or adjusting the pulse frequency, to ensure the motor accurately executes the predetermined motion trajectory. This closed-loop control mechanism effectively compensates for the effects of mechanical transmission errors, motor characteristic deviations, and other factors, improving the system's positioning accuracy and repeatability.

[0103] like Figure 7 As shown, based on Example 1, a proportional-integral-derivative (PID) control algorithm is used for real-time error correction to achieve real-time tracking of the gimbal and maintain its pointing position on the target object, including:

[0104] S4.1: Obtain the current angle of the gimbal and the target angle information, calculate the position error, speed error and integral error, and generate PID control parameters;

[0105] S4.2: Based on the PID control parameters and system response characteristics, the response speed is adjusted through the proportional control loop to obtain the proportional control output;

[0106] S4.3: Process the integral value of the position error, eliminate the steady-state error through the integral control loop, and obtain the integral control output;

[0107] S4.4: Based on the error rate of change and the differential time constant, the system oscillation is suppressed by the differential control loop to obtain the differential control output;

[0108] S4.5: The proportional, integral, and derivative control outputs are weighted and summed to generate the final control signal, which is then output to the motor driver to enable the gimbal to track the target object in real time and maintain its position pointing at the target object.

[0109] In this embodiment, the current angle of the gimbal and the target angle are first acquired, and the position error, velocity error, and integral error are calculated to generate PID control parameters. Then, based on the PID control parameters and system response characteristics, the response speed is adjusted through a proportional control loop to obtain a proportional control output. Next, the integral value of the position error is processed, and the steady-state error is eliminated through an integral control loop to obtain an integral control output. Then, based on the error change rate and the derivative time constant, system oscillations are suppressed through a derivative control loop to obtain a derivative control output. Finally, the proportional, integral, and derivative control outputs are weighted and summed to generate the final control signal, which is then output to the motor driver to achieve real-time tracking of the target object and maintain the gimbal's pointing position towards the target object.

[0110] The system acquires the current and target angle information of the gimbal, calculates the position error, velocity error, and integral error, and generates PID control parameters. When the gimbal control system receives the target angle command, it first acquires the current angle of the gimbal through the position sensor. The position error equals the target angle minus the current angle, reflecting the deviation between the current and target positions of the gimbal. The velocity error is the rate of change of the position error, reflecting the speed of the gimbal's movement. The integral error is the accumulation of the position error over time, reflecting the long-term steady-state deviation of the system. Based on this error information, the system generates PID control parameters, including the proportional coefficient Kp, integral coefficient Ki, and derivative coefficient Kd. The selection of these parameters is based on the system's dynamic characteristics and control requirements, determined through theoretical analysis and experimental debugging to achieve the optimal control effect.

[0111] Based on the PID control parameters and system response characteristics, the system adjusts the response speed through a proportional control element to obtain a proportional control output. Proportional control is the fundamental element of PID control; its output is proportional to the position error, i.e., the proportional control output equals the proportional coefficient Kp multiplied by the position error. Proportional control provides a correction proportional to the error magnitude; the larger the error, the stronger the correction, thus accelerating the system response speed. The selection of the proportional coefficient Kp directly affects the system's response characteristics: too large a Kp leads to an overly fast system response, easily causing overshoot and oscillation; too small a Kp results in a sluggish system response, making it difficult to quickly reach the target position. The system selects an appropriate proportional coefficient based on the gimbal's mechanical characteristics and load conditions to achieve a fast-response and stable control effect.

[0112] The system processes the integral value of the position error and eliminates the steady-state error through an integral control loop to obtain the integral control output. Integral control is the component in PID control used to eliminate steady-state error; its output is proportional to the time integral of the position error, i.e., the integral control output equals the integral coefficient Ki multiplied by the integral value of the position error. When a persistent position error exists in the system, the integral term accumulates continuously, providing increasingly larger corrective effects until the error is eliminated. This mechanism effectively handles constant disturbances in the system such as friction and gravity, ensuring that the gimbal can ultimately be accurately positioned at the target location. To prevent integral saturation, the system also incorporates an integral limiting mechanism to limit the maximum value of the integral term, avoiding system overshoot and oscillation caused by an excessively large integral term.

[0113] The system, based on the error rate of change and the derivative time constant, suppresses system oscillations through a derivative control term to obtain the derivative control output. Derivative control, in PID control, is the damping component; its output is proportional to the rate of change of the position error, i.e., the derivative control output equals the derivative coefficient Kd multiplied by the rate of change of the position error. When the system response is too fast and the rate of change of the position error is large, the derivative term provides a reverse damping effect, slowing down the system response and suppressing oscillations. When the system response is stable and the rate of change of the position error is small, the influence of the derivative term is correspondingly reduced. This mechanism effectively improves the system's dynamic performance, stability, and anti-interference capability. To reduce the impact of high-frequency noise on the derivative control, the system also employs low-pass filtering technology to filter out high-frequency noise in the position signal, ensuring the smooth and effective operation of the derivative control.

[0114] The system performs a weighted sum of the proportional, integral, and derivative control outputs to generate a final control signal, which is then output to the motor driver. This enables the gimbal to track the target object in real time and maintain its pointing position. The final output of the PID control algorithm is the weighted sum of the proportional, integral, and derivative outputs; that is, the control output equals the proportional control output plus the integral control output plus the derivative control output. This comprehensive output signal reflects the system's comprehensive assessment and correction strategy for the current error, including a comprehensive consideration of the error magnitude, duration, and trend. The system converts this control signal into a form suitable for the motor driver, such as a PWM signal or analog voltage, to drive the gimbal motor. Through the continuous action of the PID control algorithm, the system can achieve real-time tracking of the target object by the gimbal and maintain a stable pointing position even in the presence of external interference, meeting the requirements of high-precision positioning and dynamic tracking.

[0115] Based on Example 1, it also includes solid geometry correction processing based on a three-dimensional coordinate mapping model, including:

[0116] A: Obtain camera calibration parameters and laser pointer calibration parameters, establish the mapping relationship between image pixel coordinates and three-dimensional space coordinates, and generate a solid geometric correction model;

[0117] B: Based on the aforementioned three-dimensional geometric correction model and conveyor belt motion parameters, calculate the spatial position compensation of the target object to obtain the corrected target coordinates;

[0118] C: Detect geometric distortions during image acquisition, eliminate perspective and radial distortions using distortion correction algorithms, and generate corrected image coordinates;

[0119] D: Based on environmental interference factors and sensor noise, a Kalman filter algorithm is used for data fusion to obtain stable target position information;

[0120] E: Time synchronization processing is performed on multi-sensor data, and data alignment is achieved through timestamp calibration and interpolation algorithms to ensure the timeliness and accuracy of real-time tracking and maintaining the position of the target object.

[0121] In this embodiment, camera calibration parameters and laser pointer calibration parameters are first acquired to establish a mapping relationship between image pixel coordinates and three-dimensional spatial coordinates, generating a stereo geometric correction model. Then, based on the stereo geometric correction model and conveyor belt motion parameters, the spatial position compensation of the target object is calculated to obtain the corrected target coordinates. Next, geometric distortion during image acquisition is detected, and perspective and radial distortion are eliminated using a distortion correction algorithm to generate corrected image coordinates. Then, based on environmental interference factors and sensor noise, a Kalman filter algorithm is used for data fusion to obtain stable target position information. Finally, time synchronization processing is performed on multi-sensor data, and data alignment is achieved through timestamp calibration and interpolation algorithms to ensure real-time tracking and maintain the timeliness and accuracy of pointing to the target object's position.

[0122] In the first step of the stereo geometric correction process, the system acquires camera calibration parameters and laser pointer calibration parameters, establishes a mapping relationship between image pixel coordinates and three-dimensional spatial coordinates, and generates a stereo geometric correction model. Camera calibration is a fundamental technology in computer vision. By photographing a calibration board of known size, the system calculates the camera's intrinsic parameters (such as focal length, principal point coordinates, distortion coefficients, etc.) and extrinsic parameters (the camera's position and orientation in the world coordinate system). Simultaneously, the system uses a laser pointer as an auxiliary positioning tool, recording the position of the laser point on different depth planes to establish a projection model of the laser pointer. The system combines these two sets of calibration parameters to construct a complete stereo geometric correction model, which accurately describes the mapping relationship between image pixel coordinates and three-dimensional spatial coordinates. This mapping relationship is the foundation for achieving high-precision spatial positioning, enabling the conversion of the target position in a two-dimensional image into its actual position in three-dimensional space.

[0123] In implementation, based on the aforementioned 3D geometric correction model and the conveyor belt motion parameters, the spatial position compensation of the target object is calculated to obtain the corrected target coordinates. In industrial automation scenarios, the target object may be located on a moving conveyor belt, and its position changes continuously over time. The system acquires the conveyor belt's motion parameters, such as speed, direction, and acceleration, and combines this with the time difference between the target detection moment and the control execution moment to calculate the target object's displacement during this time. This displacement, as the spatial position compensation, is combined with the initially detected target position to obtain the corrected target coordinates. This dynamic compensation mechanism can effectively cope with the movement of the target object, ensuring that the gimbal can accurately point to the moving target and achieve dynamic tracking functionality.

[0124] During implementation, geometric distortions during image acquisition are detected, and distortion correction algorithms are used to eliminate perspective and radial distortions, generating corrected image coordinates. In practical applications, images captured by cameras often exhibit various geometric distortions, primarily perspective distortion (caused by the camera not being perpendicular to the target plane) and radial distortion (caused by the optical characteristics of the camera lens). These distortions cause straight lines in the image to become curves, and rectangles to become trapezoids, thus affecting the accurate detection of the target position. The system employs a professional distortion correction algorithm, based on the aforementioned camera calibration parameters, to correct the acquired image and eliminate these geometric distortions. The corrected image more accurately reflects the geometric relationships of the actual scene, providing a reliable data foundation for subsequent target localization.

[0125] In implementation, a Kalman filter algorithm is used for data fusion to obtain stable target position information, taking into account environmental interference factors and sensor noise. In real-world environments, target position detection results are often affected by various interference factors, such as changes in illumination, shadow interference, and sensor noise, leading to fluctuations and uncertainties in the detection results. Kalman filtering is a classic state estimation algorithm that can optimally estimate the target's state (such as position and velocity) based on the system model and observation data. The system uses the target detection results as observation data, combines them with the target's motion dynamics model, and performs state estimation using the Kalman filter algorithm to filter out random noise and outliers, obtaining smooth and stable target position information. This data fusion mechanism significantly improves the system's anti-interference capability and tracking stability.

[0126] In implementation, multi-sensor data undergoes time synchronization processing. Data alignment is achieved through timestamp calibration and interpolation algorithms to ensure the timeliness and accuracy of real-time tracking and maintaining the target object's position. In complex industrial environments, the system may simultaneously use multiple sensors (such as cameras, laser rangefinders, encoders, etc.) to acquire target and environmental information. These sensors may have different data acquisition frequencies and processing delays, leading to temporal inconsistencies. The system addresses this by adding precise timestamps to each sensor's data, recording the data acquisition time, and then aligning the data based on these timestamps. For sensors with different sampling rates, the system uses interpolation algorithms to generate data at intermediate moments, ensuring temporal consistency across all sensor data. This time synchronization mechanism effectively solves the data fusion problem in multi-sensor systems, improves the system's real-time performance and accuracy, and ensures that the gimbal can track and point to the target object's position promptly and accurately.

[0127] like Figure 8 As shown, this disclosure provides a gimbal dynamic control device, including:

[0128] The coordinate transformation module is used to obtain the two-dimensional pixel coordinates of the target object on the display plane, and convert the two-dimensional pixel coordinates into physical space coordinates through a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal.

[0129] An angle calculation module is used to calculate the angle based on the pixel offset and the pixel density parameters calculated according to the physical size and resolution of the display, and to obtain the required rotation angle parameters of the horizontal and vertical axes of the gimbal.

[0130] The motor control module is used to convert the rotation angle parameter into a PWM control signal and generate a corresponding number of pulse waveforms through the stepper motor drive module to control the dual-axis motor of the gimbal to rotate.

[0131] The tracking control module is used to perform real-time error correction based on the deviation between the current position of the gimbal and the target angle, using a PID control algorithm to achieve real-time tracking of the target object and maintain the gimbal pointing at the target object.

[0132] Optionally, the coordinate transformation module described above converts the two-dimensional pixel coordinates into physical space coordinates using a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal, including:

[0133] Based on the physical parameters and pixel resolution information of the display, calculate the horizontal and vertical pixel densities, and establish a linear transformation relationship between pixel coordinates and physical coordinates.

[0134] Based on the linear transformation relationship and the pixel coordinates of the target object, the pixel deviation value between the target point and the display center point is calculated and converted into the actual physical displacement distance;

[0135] The physical displacement distance is transformed into a coordinate system, converting the displacement in the display coordinate system into an offset parameter in the gimbal coordinate system, to obtain the pixel offset of the target object relative to the center of the gimbal.

[0136] Optionally, the coordinate transformation module described above obtains the two-dimensional pixel coordinates of the target object on the display plane, and also includes a display plane calibration process:

[0137] Position the gimbal at a preset distance directly in front of the monitor, and use the camera to capture the feature points of the monitor's boundary to obtain the pixel coordinates of the four corners of the monitor;

[0138] Based on the pixel coordinates of the four corner points, a spatial coordinate mapping relationship is established using a four-point calibration algorithm to generate a geometric transformation matrix.

[0139] Boundary feature points are captured for the gimbal's pitch and roll axes, and assembly errors are eliminated through a geometric distortion correction algorithm to obtain the corrected two-dimensional pixel coordinate information.

[0140] Optionally, the angle calculation module described above uses the trigonometric function calculation module to perform angle calculations to obtain the required rotation angle parameters for the horizontal and vertical axes of the gimbal, including:

[0141] Obtain the actual displacement distance of the target object and the installation distance of the gimbal, calculate the horizontal deflection angle using the arctangent function, and obtain the horizontal axis rotation angle of the gimbal.

[0142] Based on the horizontal deflection angle and installation distance, the distance of the hypotenuse in space is calculated using the Pythagorean theorem to obtain the reference side length for calculating the vertical axis angle.

[0143] The vertical displacement distance and the reference side length are used to calculate the vertical deflection angle using the arctangent function, thereby obtaining the required rotation angle parameters for the vertical axis of the gimbal.

[0144] Optionally, the angle is calculated using the trigonometric function calculation module, including:

[0145] Obtain the position information of the target coordinates and current coordinates, determine the direction of motion and decompose it into horizontal and vertical components, and determine the single-axis or dual-axis motion mode;

[0146] Based on the motion mode and displacement components, a three-dimensional motion model is constructed and the spatial slant distance is calculated to generate biaxial motion parameters;

[0147] The dual-axis motion parameters are dynamically decomposed into coordinates, and the theoretical rotation angles of the X-axis and Y-axis are calculated respectively to obtain the required rotation angle parameters of the horizontal and vertical axes of the gimbal.

[0148] Optionally, the motor control module performs PWM control signal conversion on the rotation angle parameter, and generates a corresponding number of pulse waveforms through the stepper motor drive module to control the dual-axis motor of the gimbal to rotate, including:

[0149] Obtain the target rotation angles of the gimbal's horizontal and vertical axes, calculate the required number of pulses based on the stepper motor's angular resolution, and generate PWM waveform parameters.

[0150] Based on the PWM waveform parameters and motor control frequency, a corresponding number of square wave signals are generated through the GPIO pins to drive the horizontal axis stepper motor to rotate.

[0151] The vertical axis rotation angle and pulse parameters are used to generate a vertical axis PWM control signal through a timer module to drive the vertical axis stepper motor to rotate.

[0152] Based on the rotation status of the dual-axis motor, the completion status of the pulse signal is monitored to monitor the gimbal rotation according to the calculated angle;

[0153] The motor rotation process is monitored in real time, and the rotation accuracy is verified through position feedback signals to complete the coordinated motion control of the two axes of the gimbal.

[0154] Optionally, the motor control module generates a corresponding number of pulse waveforms through the stepper motor drive module, including:

[0155] Obtain the target rotation steps and motion speed parameters, calculate the acceleration and deceleration parameters of the S-shaped acceleration and deceleration curve, and generate speed planning data;

[0156] Based on the speed planning data and motor characteristic parameters, the pulse frequency of each stage is calculated through the acceleration buffer to establish a segmented speed control sequence;

[0157] The segmented speed control sequence is subjected to timing control, and the PWM frequency is gradually increased during the acceleration phase to achieve smooth motor start-up.

[0158] Based on the motor's motion state and remaining steps, the PWM frequency is gradually reduced during the deceleration phase to achieve a smooth stop of the motor.

[0159] The entire motion process is controlled in a closed loop. The pulse timing is adjusted by feedback from the position encoder so that the corresponding number of pulse waveforms are executed.

[0160] Optionally, the tracking control module employs a PID control algorithm for real-time error correction, enabling the gimbal to track the target object in real time and maintain its pointing position, including:

[0161] Obtain the current angle of the gimbal and the target angle information, calculate the position error, speed error and integral error, and generate PID control parameters;

[0162] Based on the PID control parameters and system response characteristics, the response speed is adjusted through a proportional control loop to obtain the proportional control output;

[0163] The integral value of the position error is processed, and the steady-state error is eliminated through the integral control loop to obtain the integral control output;

[0164] Based on the error rate of change and the differential time constant, the system oscillation is suppressed by the differential control loop to obtain the differential control output;

[0165] The proportional, integral, and derivative control outputs are weighted and summed to generate the final control signal, which is then output to the motor driver to enable the gimbal to track the target object in real time and maintain its position pointing at the target object.

[0166] Optionally, the coordinate transformation module is also used for solid geometry correction processing based on a 3D coordinate mapping model, including:

[0167] Obtain camera calibration parameters and laser pointer calibration parameters, establish the mapping relationship between image pixel coordinates and three-dimensional space coordinates, and generate a solid geometric correction model;

[0168] Based on the aforementioned three-dimensional geometric correction model and conveyor belt motion parameters, the spatial position compensation of the target object is calculated to obtain the corrected target coordinates.

[0169] Geometric distortions during image acquisition are detected, and perspective and radial distortions are eliminated using distortion correction algorithms to generate corrected image coordinates.

[0170] Based on environmental interference factors and sensor noise, a Kalman filter algorithm is used for data fusion to obtain stable target position information;

[0171] Multi-sensor data is processed for time synchronization, and data alignment is achieved through timestamp calibration and interpolation algorithms to ensure the timeliness and accuracy of real-time tracking and maintaining the position of the target object.

[0172] In this embodiment, the coordinate transformation module first obtains the two-dimensional pixel coordinates of the target object on the display plane, and then converts the two-dimensional pixel coordinates into physical space coordinates using a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal. The angle calculation module, based on the pixel offset and pixel density parameters, uses a trigonometric function calculation module to calculate the angles, obtaining the required rotation angle parameters for the horizontal and vertical axes of the gimbal. The motor control module converts the rotation angle parameters into PWM control signals, generating a corresponding number of pulse waveforms through a stepper motor drive module to control the rotation of the gimbal's dual-axis motors. The tracking control module, based on the deviation between the current position of the gimbal and the target angle, uses a PID control algorithm for real-time error correction, enabling the gimbal to track the target object in real time and maintain its pointing position.

[0173] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Various modifications and variations can be made to this disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.

[0174] like Figure 9 As shown, this disclosure also provides a computer device, which can also be called another gimbal dynamic control device, including a processor 91 and a memory 92. The memory 92 stores machine-readable instructions that can be executed by the processor 91. The processor 91 is used to execute the machine-readable instructions stored in the memory 92. When the machine-readable instructions are executed by the processor 91, the processor 91 performs the steps of the gimbal dynamic control method described above.

[0175] The aforementioned memory 92 includes a main memory 921 and an external memory 922; the main memory 921, also known as internal memory, is used to temporarily store the computational data in the processor 91, as well as the data exchanged with external memory 922 such as a hard disk. The processor 91 exchanges data with the external memory 922 through the main memory 921.

[0176] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the gimbal dynamic control method described in the above-described method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0177] In addition, this disclosure also provides a computer program product, which stores a computer program. When the computer program is run by a processor, it executes the steps of the gimbal dynamic control method provided in any of the above embodiments of this disclosure. For details, please refer to the above method embodiments, which will not be repeated here.

[0178] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium, which can be a volatile or non-volatile computer-readable storage medium. In another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0179] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices and apparatuses described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0180] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0181] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0182] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0183] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A dynamic control method for a gimbal, characterized in that, include: The two-dimensional pixel coordinates of the target object on the display plane are obtained, and the two-dimensional pixel coordinates are converted into physical space coordinates through a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal. Based on the pixel offset and the pixel density parameters calculated according to the physical size and resolution of the display, the angle is solved using the trigonometric function calculation module to obtain the required rotation angle parameters of the horizontal and vertical axes of the gimbal. The rotation angle parameter is converted into a pulse width modulation (PWM) control signal, and a corresponding number of pulse waveforms are generated by the stepper motor drive module to control the dual-axis motor of the gimbal to rotate. Based on the deviation between the current position of the gimbal and the target angle, a proportional-integral-derivative (PID) control algorithm is used for real-time error correction, enabling the gimbal to track the target object in real time and maintain its position pointing at the target object. The step of using the trigonometric function calculation module to calculate the angles and obtain the required rotation angle parameters for the horizontal and vertical axes of the gimbal includes: The actual physical displacement distance of the target object and the installation distance of the gimbal are obtained. The horizontal deflection angle is calculated by the arctangent function to obtain the required rotation angle parameter of the horizontal axis of the gimbal. Based on the horizontal deflection angle and the gimbal installation distance, the distance of the hypotenuse in space is calculated using the Pythagorean theorem to obtain the reference side length for calculating the vertical axis angle. The vertical displacement distance and the reference side length are used to calculate the vertical deflection angle using the arctangent function, thereby obtaining the required rotation angle parameters for the vertical axis of the gimbal.

2. The method according to claim 1, characterized in that, The two-dimensional pixel coordinates are converted into physical space coordinates using a coordinate transformation algorithm to obtain the pixel offset of the target object relative to the center of the gimbal, including: Based on the physical size and resolution of the display, calculate the horizontal and vertical pixel densities, and establish a linear transformation relationship between two-dimensional pixel coordinates and physical space coordinates. Based on the linear transformation relationship and the two-dimensional pixel coordinates of the target object, the pixel deviation value between the target point and the display center point is calculated and converted into the actual physical displacement distance; The physical displacement distance is transformed into a coordinate system, converting the displacement in the display coordinate system into an offset parameter in the gimbal coordinate system, to obtain the pixel offset of the target object relative to the center of the gimbal.

3. The method according to claim 1, characterized in that, Obtaining the two-dimensional pixel coordinates of the target object on the display plane also includes the display plane calibration process: Position the gimbal at a preset distance directly in front of the monitor, and use the camera to capture the feature points of the monitor's boundary to obtain the two-dimensional pixel coordinates of the four corners of the monitor; Based on the two-dimensional pixel coordinates of the four corner points, a spatial coordinate mapping relationship is established using a four-point calibration algorithm to generate a geometric transformation matrix. Boundary feature points are captured for the pitch and roll axes of the gimbal, and assembly errors are eliminated through a geometric distortion correction algorithm to obtain the corrected two-dimensional pixel coordinates.

4. The method according to claim 1, characterized in that, The rotation angle parameter is converted into a PWM control signal, and a corresponding number of pulse waveforms are generated by the stepper motor drive module to control the dual-axis motor of the gimbal to rotate, including: Obtain the target rotation angles of the gimbal's horizontal and vertical axes, calculate the required number of pulses based on the stepper motor's angular resolution, and generate PWM waveform parameters. Based on the PWM waveform parameters and motor control frequency, a corresponding number of square wave signals are generated through the general-purpose input / output (GPIO) pins to drive the horizontal axis stepper motor to rotate. The vertical axis rotation angle and pulse parameters are used to generate a vertical axis PWM control signal through a timer module to drive the vertical axis stepper motor to rotate. Based on the rotation status of the dual-axis motor, the completion status of the pulse signal is monitored to monitor the gimbal rotation according to the calculated angle; The motor rotation process is monitored in real time, and the rotation accuracy is verified through position feedback signals to complete the coordinated motion control of the two axes of the gimbal.

5. The method according to claim 1, characterized in that, The stepper motor drive module generates a corresponding number of pulse waveforms, including: Obtain the target rotation steps and motion speed parameters, calculate the acceleration and deceleration parameters of the S-shaped acceleration and deceleration curve, and generate speed planning data; Based on the speed planning data and motor characteristic parameters, the pulse frequency of each stage is calculated through the acceleration buffer to establish a segmented speed control sequence; The segmented speed control sequence is subjected to timing control, and the PWM frequency is gradually increased during the acceleration phase to achieve smooth motor start-up. Based on the motor's motion state and remaining steps, the PWM frequency is gradually reduced during the deceleration phase to achieve a smooth stop of the motor. The entire motion process is controlled in a closed loop. The pulse timing is adjusted by feedback from the position encoder so that the corresponding number of pulse waveforms are executed.

6. The method according to claim 1, characterized in that, A PID control algorithm is used for real-time error correction to enable the gimbal to track the target object in real time and maintain its pointing position. This includes: Obtain the current angle of the gimbal and the target angle information, calculate the position error, speed error and integral error, and generate PID control parameters; Based on the PID control parameters and system response characteristics, the response speed is adjusted through a proportional control loop to obtain the proportional control output; The integral value of the position error is processed, and the steady-state error is eliminated through the integral control loop to obtain the integral control output; Based on the error rate of change and the differential time constant, the system oscillation is suppressed by the differential control loop to obtain the differential control output; The proportional, integral, and derivative control outputs are weighted and summed to generate the final control signal, which is then output to the motor driver to enable the gimbal to track the target object in real time and maintain its position pointing at the target object.

7. The method according to claim 1, characterized in that, It also includes solid geometry correction processing based on a 3D coordinate mapping model, including: Obtain camera calibration parameters and laser pointer calibration parameters, establish the mapping relationship between two-dimensional pixel coordinates and three-dimensional spatial coordinates, and generate a solid geometric correction model; Based on the aforementioned three-dimensional geometric correction model and conveyor belt motion parameters, the spatial position compensation of the target object is calculated to obtain the corrected target coordinates. Geometric distortions during image acquisition are detected, and perspective and radial distortions are eliminated using distortion correction algorithms to generate corrected image coordinates. Based on environmental interference factors and sensor noise, a Kalman filter algorithm is used for data fusion to obtain stable target position information; Time synchronization processing is performed on multi-sensor data, and data alignment is achieved through timestamp calibration and interpolation algorithms.

8. A dynamic control device for a gimbal, characterized in that, The device includes a processor and a memory, the memory storing machine-readable instructions executable by the processor, the processor executing the machine-readable instructions stored in the memory, and when the machine-readable instructions are executed by the processor, the processor performs the steps of the gimbal dynamic control method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Control method of baseline-variable binocular holder

    CN111556309A