Gimbal control method and device, computer device and storage medium
By using inertial measurement unit data to calculate the gimbal's attitude information and update the motor control parameters, the occlusion problem of the three-axis non-orthogonal gimbal during rotation is solved, the stability of the gimbal and the accuracy of motor control are improved, and the drift of the gimbal is corrected.
Patent Information
- Application Number
- CN202211205717.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-09-30
AI Technical Summary
Existing three-axis non-orthogonal gimbals easily block the mobile phone camera or screen during rotation, resulting in reduced stability and motor rotation control accuracy, and causing the image to swing back and forth.
By estimating the first posture information of the gimbal clamp based on the inertial measurement unit data, obtaining the mechanical angle of the motor rotation, calculating the handle posture information, and updating the motor control parameters according to the target angle and posture information, precise rotation control of the motor can be achieved.
The stability of the gimbal and the accuracy of motor rotation are improved, the drift of the gimbal is corrected, and the shooting picture is stable.
Smart Images

Figure CN115373429B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of gimbal control, and in particular to a gimbal control method and device, computer equipment and a storage medium. BACKGROUND
[0002] With the development of Internet technology, mobile phone live broadcast and video recording have entered people's lives. In order to better record videos or live broadcast on mobile phones, gimbals that can stably shoot have gradually entered people's field of vision.
[0003] However, the existing gimbals will block the camera of the mobile phone or the screen of the mobile phone during rotation, and even in some angles, the mobile phone will be stuck. Based on this, a three-axis non-orthogonal gimbal is designed in the related art, which can realize non-blocking of the camera of the mobile phone and the screen of the mobile phone. However, the three-axis non-orthogonal gimbal has drift, which reduces the stability of the gimbal and the accuracy of the gimbal control of the motor rotation, and further causes the phenomenon that the picture shot by the gimbal swings back and forth. Therefore, how to enhance the stability of the three-axis non-orthogonal gimbal and improve the accuracy of the gimbal control of the motor rotation has become a technical problem that needs to be solved by the person skilled in the art. SUMMARY
[0004] Therefore, it is necessary to provide a gimbal control method and device, computer equipment and a storage medium that can enhance stability and improve the accuracy of gimbal control.
[0005] In a first aspect, the present application provides a gimbal control method. The method comprises:
[0006] estimating first attitude information of a clamping seat of the gimbal based on inertial measurement unit data of the gimbal;
[0007] obtaining mechanical angles of motor rotations of the gimbal;
[0008] calculating attitude information of a handle of the gimbal according to the mechanical angles and the first attitude information of the clamping seat;
[0009] calculating second attitude information of the clamping seat based on the target angle and the attitude information of the handle;
[0010] updating motor control parameters according to the target angle, the first attitude information and the second attitude information;
[0011] controlling the motor rotations according to the updated motor control parameters.
[0012] In one of the embodiments, the inertial measurement unit data comprises a gyroscope signal and a temperature signal of the inertial measurement unit; and the method further comprises:
[0013] Reading an initial gyroscope signal and an initial temperature signal of an inertial measurement unit in the gimbal;
[0014] Dynamically compensating the initial temperature signal to obtain a compensated temperature signal;
[0015] The initial gyroscope signal is corrected according to the scale factor and the non-orthogonal matrix to obtain a corrected gyroscope signal.
[0016] In one embodiment, estimating first attitude information of the clamping base in the gimbal based on inertial measurement unit data of the gimbal includes:
[0017] Dynamically estimate the gyroscope in the gimbal to obtain the gyro bias of the pitch and roll axes;
[0018] Determine the heading axis zero bias of the gyroscope by an encoder;
[0019] First attitude information of the clamping seat in the gimbal is calculated based on the gyroscope signal, the heading axis zero bias and the gyroscope zero bias in the inertial measurement unit data.
[0020] In one embodiment, the calculating and obtaining the first attitude information of the clamping base in the gimbal according to the gyroscope signal, the heading axis zero bias and the gyroscope zero bias in the inertial measurement unit data includes:
[0021] The sum of the heading axis bias and the gyro bias is used as the three-axis bias of the gyroscope;
[0022] Converting the three-axis zero bias to an inertial measurement unit coordinate system according to a first rotation matrix to obtain the three-axis zero bias of the gyroscope in the inertial measurement unit coordinate system; wherein the first rotation matrix represents a conversion relationship between a world coordinate system and the inertial measurement unit coordinate system;
[0023] The first posture information of the clamping base is calculated based on the gyroscope signal and the three-axis zero bias of the gyroscope in the inertial measurement unit coordinate system.
[0024] In one embodiment, the calculating the posture information of the handle of the gimbal according to the mechanical angle and the first posture information of the clamping base includes:
[0025] Calculating a second rotation matrix of the handle of the gimbal relative to the clamping base according to the mechanical angle;
[0026] Obtaining a first rotation matrix; wherein the first rotation matrix represents a transformation relationship between a world coordinate system and an inertial measurement unit coordinate system;
[0027] The posture information of the handle is calculated based on the first rotation matrix, the second rotation matrix and the first posture information of the clamping base.
[0028] In one embodiment, updating the motor control parameters according to the target angle, the first posture information, and the second posture information includes:
[0029] estimating third posture information after the gimbal rotates to the target angle based on the first posture information and the target angle;
[0030] Performing a difference calculation based on the third posture information and the second posture information to obtain a posture difference;
[0031] The motor control parameters are updated based on the posture difference.
[0032] In one embodiment, the method further comprises:
[0033] measuring a first angular velocity of rotation of each of the motors;
[0034] Determine a second angular velocity corresponding to the rotation of each motor to the target angle according to the posture difference, and determine an angular velocity difference according to the first angular velocity and the second angular velocity;
[0035] The torque difference corresponding to each of the motors is determined according to the angular velocity difference, the motor control parameters of each of the motors are updated according to the torque difference, and the rotation of each of the motors is controlled according to the motor control parameters.
[0036] In a second aspect, the present application further provides a pan / tilt control device. The device comprises:
[0037] A first attitude information estimation module, configured to estimate first attitude information of a clamping base in the gimbal based on inertial measurement unit data of the gimbal;
[0038] A mechanical angle acquisition module, used to obtain the mechanical angle of rotation of each motor of the pan / tilt platform;
[0039] A handle posture information calculation module, configured to calculate the posture information of the handle of the gimbal according to the mechanical angle and the first posture information of the clamping base;
[0040] A second posture calculation module, configured to calculate second posture information of the clamping base based on a target angle and the posture information of the handle;
[0041] a motor control parameter updating module, configured to update the motor control parameters according to the target angle, the first posture information, and the second posture information;
[0042] The motor control module is used to control the rotation of each motor according to the updated motor control parameters.
[0043] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the embodiment of the first aspect when executing the computer program.
[0044] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the embodiment of the first aspect.
[0045] In a fifth aspect, the present application further provides a computer program product, which includes a computer program that implements the steps of the embodiment of the first aspect when executed by a processor.
[0046] The above-mentioned gimbal control method, device, computer equipment and storage medium estimate the first posture information of the gimbal's clamping base based on the gimbal's inertial measurement unit data, then obtain the mechanical angle of rotation of each motor of the gimbal, and then calculate the posture information of the gimbal's handle based on the mechanical angle and the first posture information of the clamping base, and then calculate the second posture information of the clamping base based on the target angle and the posture information of the handle; then update the motor control parameters based on the target angle, the first posture information and the second posture information, and control the rotation of each motor based on the updated motor control parameters. The technical solution of the embodiment of the present application improves the accuracy of the gimbal control by determining the error between the estimated posture and the actual posture after rotation, and then updating the motor control parameters of each motor. In addition, by accurately obtaining the mechanical angle of rotation of each motor, the drift of the gimbal is corrected, thereby enhancing the stability of the gimbal. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A diagram showing an application environment of a pan / tilt control method according to an embodiment;
[0048] Figure 2 Schematic diagram of the structure of a pan / tilt platform in one embodiment;
[0049] Figure 3 Schematic diagram of a world coordinate system, an inertial measurement unit coordinate system, and a gimbal handle coordinate system in one embodiment;
[0050] Figure 4 1 is a flow chart of a pan / tilt control method according to an embodiment;
[0051] Figure 5 1 is a flow chart of a pan / tilt control method according to another embodiment;
[0052] Figure 6 A schematic diagram of a process for calculating first posture information in one embodiment;
[0053] Figure 7 1 is a flow chart of a pan / tilt control method according to another embodiment;
[0054] Figure 8 1 is a flow chart of a pan / tilt control method according to another embodiment;
[0055] Figure 9 is a structural block diagram of a pan / tilt control device in one embodiment;
[0056] Figure 10 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0058] The pan / tilt control method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal obtains the inertial measurement unit data of the pan-tilt head, and based on the inertial measurement unit data of the pan-tilt head, estimates the first posture information of the clamping seat of the pan-tilt head, and then obtains the mechanical angle of each motor rotation of the pan-tilt head, and then calculates the posture information of the handle in the pan-tilt head based on the mechanical angle and the first posture information of the clamping seat, and then calculates the second posture information of the clamping seat based on the target angle and the calculated posture information of the handle, and then updates the motor control parameters based on the target angle, the first posture information and the second posture information, and controls the rotation of each motor according to the updated motor control parameters. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0059] like Figure 2 and Figure 3As shown, in some embodiments, embodiments of the present application provide a schematic diagram of a gimbal structure and a schematic diagram of a world coordinate system, an inertial measurement unit coordinate system, and a gimbal handle coordinate system. The gimbal includes a handle 202, a three-axis motor, and a clamping base 210, wherein the three-axis motor includes a first motor 204, a second motor 206, and a third motor 208. The camera can be clamped on the clamping base. The handle 202 is the base of the gimbal, and the coordinate system of the handle is the gimbal handle coordinate system. The coordinate system of the clamping base is the inertial measurement unit coordinate system.
[0060] In one embodiment, Figure 4 As shown, a pan-tilt control method is provided, which is applied to Figure 1 Taking the terminal 102 in FIG. 1 as an example, the method includes the following steps:
[0061] Step 402 : estimating first posture information of the clamping base of the gimbal based on the inertial measurement unit data of the gimbal.
[0062] The gimbal can refer to a supporting platform for a filming device. The gimbal includes a clamping base, a handle, and a three-axis motor. The three-axis motor includes a first motor, a second motor, and a third motor. The clamping base is used to clamp the filming device, which includes but is not limited to smartphones and cameras.
[0063] The inertial measurement unit data may refer to data in the inertial measurement unit. The inertial measurement unit data may be data measured by the inertial measurement unit, including but not limited to gyroscope signals (angular velocity signals), temperature signals, and acceleration signals.
[0064] The first posture information may refer to information representing the current posture of the clamping base. It should be understood that the camera is clamped on the clamping base, and therefore, the first posture information of the clamping base may also represent the posture information of the camera. For example, if the clamping base is holding a camera, the first posture information may also represent the posture information of the camera.
[0065] In some embodiments, the inertial measurement unit data can be obtained by sensors in the inertial measurement unit. For example, a temperature signal is obtained by a temperature sensor, an acceleration signal is obtained by an acceleration sensor, and an angular velocity signal is obtained by an angular velocity sensor. It should be noted that the inertial measurement unit data can also be obtained by other means, such as collecting the data of the inertial measurement unit by the MCU (Microcontroller Unit) in the gimbal, such as detecting the data in the inertial measurement unit by an external detection device (such as an accelerometer, thermometer, etc.), such as obtaining the inertial measurement unit data pre-stored in the data storage system of the server. This application does not impose any specific restrictions on the specific method of obtaining the inertial measurement unit data, and it can be selected according to actual conditions.
[0066] In some embodiments, after acquiring the inertial measurement unit data, first posture information of the clamping base is estimated based on the inertial measurement unit data. For example, an EKF (Extended Kalman Filter) algorithm is used to estimate the posture of the clamping base to obtain the first posture information.
[0067] Step 404: Obtain the mechanical angle of each motor of the pan / tilt platform.
[0068] The mechanical angle refers to the angle occupied by each pair of magnetic poles of the motor on the inner circle of the stator. In this embodiment, the motors may refer to the first, second, and third motors in a three-axis motor, or the fourth and fifth motors in a two-axis motor. When the motors refer to the first, second, and third motors in a three-axis motor, the mechanical angle includes the mechanical angle of rotation of the first motor, the mechanical angle of rotation of the second motor, and the mechanical angle of rotation of the third motor.
[0069] In some embodiments, a Hall sensor is used to obtain the mechanical angle of rotation of each motor (first motor, second motor and third motor) in the gimbal, and the mechanical angle of rotation of the first motor, the mechanical angle of rotation of the second motor and the mechanical angle of rotation of the third motor are obtained.
[0070] In some embodiments, the original mechanical angle of each motor of the gimbal is obtained through a Hall sensor, and then the original mechanical angle is subjected to noise reduction and IIR (Infinite Impulse Response) filtering to obtain a filtered mechanical angle, thereby improving the accuracy of the obtained mechanical angle.
[0071] In some embodiments, when the gimbal includes a handle, a clamping base, and a two-axis motor, wherein the two-axis motor includes a fourth motor and a fifth motor, in this case, the mechanical angle may include the mechanical angle of rotation of the fourth motor and the mechanical angle of rotation of the fifth motor.
[0072] Exemplarily, the Hall sensor is used to obtain the mechanical angle of rotation of each motor (the fourth motor and the fifth motor) in the gimbal, thereby obtaining the mechanical angle of rotation of the fourth motor and the mechanical angle of rotation of the fifth motor.
[0073] For example, the original mechanical angle of the fourth motor and the original mechanical angle of the fifth motor in the gimbal can be obtained through the Hall sensor, and then each original mechanical angle is subjected to noise reduction and IIR filtering to obtain a filtered mechanical angle, thereby improving the accuracy of the obtained mechanical angle.
[0074] Step 406 : Calculate the posture information of the handle of the gimbal according to the mechanical angle and the first posture information of the clamping base.
[0075] The handle posture information may refer to information representing the current posture of the gimbal handle in the world coordinate system.
[0076] In some embodiments, the mechanical angles of the first motor, the second motor, and the third motor obtained through the aforementioned steps are used to determine the conversion relationship between the gimbal handle coordinate system and the inertial measurement unit coordinate system, and then the handle posture information is determined based on the conversion relationship between the gimbal handle coordinate system and the inertial measurement unit coordinate system and the first posture information.
[0077] Step 408: Calculate second posture information of the clamping base based on the target angle and the posture information of the handle.
[0078] The target angle may refer to the angle that the gimbal needs to be rotated to. For example, the user manually adjusts the gimbal to the desired direction by toggling a control button on a handle, i.e., adjusting the gimbal to the target angle.
[0079] The second posture information may refer to actual posture information of the clamping base after the pan / tilt head rotates to the target angle (ie, posture information actually calculated).
[0080] In some embodiments, the current reference heading information of the handle in the gimbal is determined based on the posture information obtained in the above steps, and then the target posture information is calculated based on the current reference heading information and the target angle. The target posture information is the second posture information after the clamping seat is rotated to the target angle.
[0081] In some embodiments, the gimbal's current state can be determined based on the handle's posture information, and the gimbal's current heading information can be determined based on the gimbal's current state. Current states include vertical, horizontal, forward, backward, left, and right. Determining the gimbal's current state based on the handle's posture information facilitates subsequent setting of the gimbal's optimal posture.
[0082] Step 410 : Update motor control parameters according to the target angle, the first posture information, and the second posture information.
[0083] The motor control parameters may refer to parameters used to control the rotation of the motor, including angle loop control parameters, angular velocity loop control parameters, and current loop control parameters.
[0084] For example, a difference calculation can be performed based on the target angle, the first attitude information and the second attitude information to obtain an attitude difference, which is then input into the active disturbance rejection controller of the gimbal to update the motor control parameters in the active disturbance rejection controller.
[0085] Step 412: Control the rotation of each motor according to the updated motor control parameters.
[0086] Exemplarily, the motor control parameters output by the anti-disturbance control controller in the aforementioned step are obtained, and then the magnetic field orientation control of the motor is performed according to the output motor control parameters, and the rotation of the motor is controlled according to the motor control parameters.
[0087] In the above-mentioned gimbal control method, the first posture information of the gimbal's clamping base is estimated based on the gimbal's inertial measurement unit data, and then the mechanical angle of each motor of the gimbal is obtained. Then, the posture information of the gimbal's handle is calculated based on the mechanical angle and the first posture information of the clamping base. Then, based on the target angle and the posture information of the handle, the second posture information of the clamping base is calculated. Then, the motor control parameters are updated according to the target angle, the first posture information, and the second posture information, and the rotation of each motor is controlled according to the updated motor control parameters. The technical solution of the embodiment of the present application improves the accuracy of the gimbal control by determining the error between the estimated posture and the actual posture after rotation, and then updating the motor control parameters of each motor. In addition, by accurately obtaining the mechanical angle of rotation of each motor, the drift of the gimbal is corrected, thereby enhancing the stability of the gimbal.
[0088] In one embodiment, Figure 5 As shown, the inertial measurement unit data includes a gyroscope signal and a temperature signal of the inertial measurement unit; the gimbal control method further includes:
[0089] Step 502: Read the initial gyroscope signal and initial temperature signal of the inertial measurement unit in the gimbal.
[0090] The initial gyroscope signal may refer to a gyroscope signal directly collected by the MCU in the gimbal, and the temperature signal may refer to a temperature signal directly collected by the MCU in the gimbal.
[0091] In some embodiments, the MCU in the gimbal reads signals such as the gyroscope, accelerometer, and temperature in the inertial measurement unit at intervals according to a specified frequency (e.g., 4 kHz) to obtain an initial gyroscope signal, an initial temperature signal, and an initial acceleration signal. It should be noted that the initial gyroscope signal, the initial temperature signal, and the initial acceleration signal can be directly acquired by the ADC sampling unit in the MCU. The initial temperature signal can be obtained by reading the temperature signal from the temperature sensor in the inertial measurement unit, the initial gyroscope signal can be obtained by reading the signal from the gyroscope, and the initial acceleration signal can be obtained by reading the signal from the accelerometer.
[0092] Step 504 : Dynamically compensate the initial temperature signal to obtain a compensated temperature signal.
[0093] By dynamically compensating the initial temperature signal, a compensated temperature signal is obtained to compensate for the temperature drift of the temperature sensor.
[0094] In some embodiments, by obtaining the zero bias change curve of the temperature sensor at different temperatures, the rate of change of the temperature zero bias with respect to temperature is obtained, and then, the zero bias at different temperatures is compensated in real time by the rate of change of temperature to achieve dynamic compensation of the initial temperature signal.
[0095] For example, by repeatedly obtaining the zero bias change curve from a temperature box ranging from -40 to 80 degrees Celsius, the rate of change of the temperature offset relative to the temperature is obtained. Then, the zero bias at different temperatures is compensated in real time using the rate of change of temperature to achieve dynamic compensation of the initial temperature signal.
[0096] Step 506 : Correct the initial gyroscope signal according to the scale factor and the non-orthogonal matrix to obtain a corrected gyroscope signal.
[0097] The scale factor can refer to the ratio of the gyroscope output to the input angular rate. A non-orthogonal matrix can refer to the matrix between the gyroscope and accelerometer in an inertial measurement unit. The gyroscope and triaxial accelerometer in an inertial measurement unit should theoretically be orthogonal (perpendicular to each other), but manufacturing processes can lead to some non-orthogonality.
[0098] In some embodiments, in the initial state (during the first correction), a model is established based on the scale factor, non-orthogonal coefficient and zero bias, and then a fitting process is performed (such as RMS fitting process, i.e., root mean square fitting process) to obtain the scale factor and non-orthogonal matrix, and the scale factor and non-orthogonal matrix are stored in the flash of the MCU. Subsequent corrections directly read the scale factor and non-orthogonal matrix from the flash, and directly perform correction processing to obtain the corrected gyroscope signal. It should be noted that the scale factor and non-orthogonal matrix can also be pre-set, and this application does not make specific restrictions on this, and can be selected according to actual conditions.
[0099] In some embodiments, as Figure 6 As shown, step 402 includes but is not limited to the following steps:
[0100] Step 602 : Dynamically estimate the gyroscope in the gimbal to obtain the gyro bias of the pitch axis and the roll axis.
[0101] In some embodiments, an extended Kalman filter algorithm is used to dynamically estimate the gyro bias in the horizontal direction of the gyroscope, where the horizontal direction includes the pitch and roll axes. Specifically, the extended Kalman filter algorithm is used to dynamically estimate the gyro bias for the pitch and roll axes. When the gyroscope is stationary, the gyroscope output is represented by an equivalent input angular velocity corresponding to the average value of the output measured over a specified time period. When the angular velocity input is zero, the gyroscope output is a slowly varying curve of a composite white noise signal, and the average value of this curve is the bias value. Therefore, the average value of this curve is the gyro bias for the pitch and roll axes.
[0102] Step 604: Determine the heading axis zero bias of the gyroscope through the encoder.
[0103] The encoder measures the heading axis zero bias in real time to determine the heading axis zero bias of the gyroscope.
[0104] Step 606 , calculating and obtaining first attitude information of the clamping base in the gimbal according to the gyroscope signal, the heading axis zero bias and the gyroscope zero bias in the inertial measurement unit data.
[0105] In some embodiments, the gyroscope signal in the inertial measurement unit data is a calibrated signal. The first posture information of the clamping base can be obtained by subtracting the heading axis zero bias and the gyroscope zero bias from the calibrated signal.
[0106] In some embodiments, step 606 includes the following steps: taking the sum of the heading axis zero bias and the gyro zero bias as the three-axis zero bias of the gyroscope; converting the three-axis zero bias into the inertial measurement unit coordinate system according to the first rotation matrix to obtain the three-axis zero bias of the gyroscope in the inertial measurement unit coordinate system; wherein the first rotation matrix represents the conversion relationship between the world coordinate system and the inertial measurement unit coordinate system; and calculating the first posture information of the clamping base according to the gyroscope signal and the three-axis zero bias of the gyroscope in the inertial measurement unit coordinate system.
[0107] In this embodiment, the heading axis zero bias and the gyro zero bias are both zero biases of the world coordinate system, and the first attitude information of the clamping base is information in the inertial measurement unit coordinate system. Therefore, it is necessary to first convert the heading axis zero bias and the gyro zero bias into the inertial measurement unit coordinate system, and then calculate the first attitude information based on the converted zero bias and gyroscope signal.
[0108] Specifically, the sum of the heading axis zero bias and the gyro zero bias is first used as the three-axis zero bias of the gyroscope, and then the three-axis zero bias is converted to the inertial measurement unit coordinate system according to the first rotation matrix to obtain the three-axis zero bias of the gyroscope in the inertial measurement unit coordinate system. Then, the three-axis zero bias in the inertial measurement unit coordinate system is subtracted from the gyroscope signal to obtain the first posture information of the clamping base.
[0109] The first rotation matrix is a direction cosine matrix, which can be represented by the direction cosines between basis vectors from two different orthonormal bases. The direction cosine matrix can be used to express the relationship between one orthonormal basis and another, or to express the direction cosines of a vector with respect to another orthonormal basis.
[0110] In some embodiments, step 406 includes but is not limited to: calculating a second rotation matrix of the gimbal handle relative to the clamping base based on the mechanical angle; obtaining a first rotation matrix; wherein the first rotation matrix represents the conversion relationship between the world coordinate system and the inertial measurement unit coordinate system; and calculating the posture information of the handle based on the first rotation matrix, the second rotation matrix and the first posture information of the clamping base.
[0111] Specifically, the mechanical angle includes the mechanical angle of rotation of the first motor, the mechanical angle of rotation of the second motor, and the mechanical angle of rotation of the third motor. The mechanical angle of rotation of the first motor, the mechanical angle of rotation of the second motor, and the mechanical angle of rotation of the third motor can be used to determine the conversion relationship between the gimbal handle coordinate system and the inertial measurement unit coordinate system, that is, to obtain the second rotation matrix. The first rotation matrix is used to represent the conversion relationship between the world coordinate system and the inertial measurement unit coordinate system. Therefore, in this embodiment, the first posture information is converted to the world coordinate system based on the first rotation matrix and the second rotation matrix to obtain the posture information of the handle.
[0112] In some embodiments, step 410 includes but is not limited to the following steps: estimating the third posture information after the gimbal rotates to the target angle based on the first posture information and the target angle; performing a difference calculation based on the third posture information and the second posture information to obtain a posture difference; and updating the motor control parameters based on the posture difference.
[0113] The posture difference may refer to the difference between the posture estimation value and the actual calculated value after the clamping base is rotated to the target angle.
[0114] Exemplarily, the first posture information and the second posture information are both represented by corresponding quaternions, and then the relative rotation is calculated between the quaternion of the first posture information and the quaternion of the second posture information to obtain the posture difference.
[0115] Exemplarily, the first posture information is an estimated posture value before the gimbal rotates to the target angle, and the second posture information is an actual calculated posture value after the gimbal rotates to the target angle. After rotating the first posture information by the target angle, an estimated posture value of the clamping base after the gimbal rotates to the target angle is obtained, i.e., third posture information after the gimbal rotates to the target angle is estimated. Then, a difference calculation is performed based on the third posture information and the second posture information to obtain a posture difference. This can be used to determine the error between the actual calculated posture value after the gimbal rotates to the target angle and the estimated posture value after the gimbal rotates to the target angle. After obtaining the posture difference, the posture difference is input into the gimbal's active disturbance rejection controller to update the motor control parameters in the active disturbance rejection controller.
[0116] Please refer to Figure 7 In some embodiments, the PTZ control method further includes but is not limited to the following steps:
[0117] Step 702: Measure the first angular velocity of each motor.
[0118] The first angular velocity may refer to the actual angular velocity of each motor during actual rotation.
[0119] In some embodiments, each motor can be sampled by the MCU in the gimbal to obtain the first angular velocity of each motor's actual rotation, or the angular velocity sensor of the inertial measurement unit in the gimbal can be used to measure the first angular velocity of each motor's rotation, or the first angular velocity of each motor can be measured by an external detection module (such as an angular velocity meter). This application does not impose any specific restrictions on this.
[0120] Step 704 : determining a second angular velocity corresponding to the rotation of each motor to the target angle according to the attitude difference, and determining an angular velocity difference according to the first angular velocity and the second angular velocity.
[0121] The second angular velocity may refer to a target angular velocity required for each motor to rotate to a target angle.
[0122] In some embodiments, the measured first angular velocity is first converted from the information in the inertial measurement unit coordinate system to the gimbal handle coordinate system through a second rotation matrix, and then the difference between the first angular velocity and the second angular velocity in the gimbal handle coordinate system is calculated to obtain the angular velocity difference.
[0123] Step 706 , determining the torque difference corresponding to each motor according to the angular velocity difference, updating the motor control parameters of each motor according to the torque difference, and controlling the rotation of each motor according to the motor control parameters.
[0124] The torque difference may refer to the difference between the torque value that the motor should have when it rotates to the target angle and the actual torque value of the motor.
[0125] After the torque difference corresponding to each motor is determined by the angular velocity difference, the target torque value corresponding to each motor is determined according to the actual torque value measured by each motor at present, and then the target torque value is converted into the corresponding three-phase voltage, and then the motor control parameters of each motor are updated according to the three-phase voltage, and the rotation of each motor is controlled according to the motor control parameters.
[0126] Please refer to Figure 8 In some embodiments, the gimbal control method includes but is not limited to the following steps:
[0127] Step 802, based on the inertial measurement unit data of the gimbal, the first attitude information of the clamping seat of the gimbal is estimated.
[0128] Step 804, the mechanical angle of the rotation of each motor of the gimbal is obtained.
[0129] Step 806, the second rotation matrix of the handle in the gimbal relative to the clamping seat is calculated according to the mechanical angle.
[0130] Step 808, the attitude information of the handle is calculated according to the first rotation matrix, the second rotation matrix and the first attitude information of the clamping seat.
[0131] Step 810, based on the target angle and the attitude information of the handle, the second attitude information of the clamping seat is calculated.
[0132] Step 812, according to the first attitude information and the target angle, the third attitude information of the gimbal after rotating to the target angle is estimated.
[0133] Step 814, the attitude difference is obtained by difference calculation according to the third attitude information and the second attitude information.
[0134] Step 816, the first angular velocity of the rotation of each motor is measured.
[0135] Step 818, the second angular velocity corresponding to the rotation of each motor to the target angle is determined according to the attitude difference, and the angular velocity difference is determined according to the first angular velocity and the second angular velocity.
[0136] Step 820, the torque difference corresponding to each motor is determined according to the angular velocity difference, and the motor control parameters of each motor are updated according to the torque difference, and the rotation of each motor is controlled according to the motor control parameters.
[0137] It should be noted that the specific steps of steps 802-820 please refer to the foregoing embodiments.
[0138] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0139] Based on the same inventive concept, an embodiment of the present application also provides a pan-tilt control device for implementing the above-mentioned pan-tilt control method.
[0140] In one embodiment, Figure 9 As shown, a pan / tilt control device 900 is provided, comprising: a first posture information estimation module 902, a mechanical angle acquisition module 904, a handle posture information calculation module 906, a second posture calculation module 908, a motor control parameter update module 910, and a motor control module 912, wherein:
[0141] The first attitude information estimation module 902 is used to estimate the first attitude information of the clamping base of the gimbal based on the inertial measurement unit data of the gimbal.
[0142] The mechanical angle acquisition module 904 is used to obtain the mechanical angle of each motor of the pan / tilt platform.
[0143] The handle posture information calculation module 906 is used to calculate the posture information of the handle of the pan / tilt platform according to the mechanical angle and the first posture information of the clamping base.
[0144] The second posture calculation module 908 is used to calculate the second posture information of the clamping base based on the target angle and the posture information of the handle.
[0145] The motor control parameter updating module 910 is configured to update the motor control parameters according to the target angle, the first posture information, and the second posture information.
[0146] The motor control module 912 is used to control the rotation of each motor according to the updated motor control parameters.
[0147] In some embodiments, the inertial measurement unit data includes a gyroscope signal and a temperature signal of the inertial measurement unit; and the gimbal control device further includes:
[0148] The signal reading module is used to read the initial gyroscope signal and initial temperature signal of the inertial measurement unit in the gimbal.
[0149] The dynamic compensation module is used to dynamically compensate the initial temperature signal to obtain a compensated temperature signal.
[0150] The correction processing module is used to perform correction processing on the initial gyroscope signal according to the scale factor and the non-orthogonal matrix to obtain a corrected gyroscope signal.
[0151] In some embodiments, the first posture information estimation module 902 includes:
[0152] The gyro bias determination unit is used to dynamically estimate the gyroscope in the gimbal to obtain the gyro bias of the pitch axis and roll axis.
[0153] The heading axis zero bias determination unit is used to determine the heading axis zero bias of the gyroscope through an encoder.
[0154] The first attitude information calculation unit is used to calculate the first attitude information of the clamping base in the gimbal according to the gyroscope signal, heading axis zero bias and gyro zero bias in the inertial measurement unit data.
[0155] In some embodiments, the first posture information calculation unit includes:
[0156] The three-axis zero bias calculation subunit is used to take the sum of the heading axis zero bias and the gyro zero bias as the three-axis zero bias of the gyroscope.
[0157] The conversion subunit is used to convert the three-axis zero bias into the inertial measurement unit coordinate system according to the first rotation matrix to obtain the three-axis zero bias of the gyroscope in the inertial measurement unit coordinate system; wherein the first rotation matrix represents the conversion relationship between the world coordinate system and the inertial measurement unit coordinate system.
[0158] The first attitude information subunit is used to calculate the first attitude information of the clamping base according to the gyroscope signal and the three-axis zero bias of the gyroscope in the inertial measurement unit coordinate system.
[0159] In some embodiments, the second posture calculation module 908 includes:
[0160] The second rotation matrix calculation unit is used to calculate the second rotation matrix of the handle in the pan / tilt head relative to the clamping base according to the mechanical angle.
[0161] The first rotation matrix acquisition unit is used to acquire a first rotation matrix; wherein the first rotation matrix represents the conversion relationship between the world coordinate system and the inertial measurement unit coordinate system.
[0162] The second attitude calculation unit is configured to calculate the attitude information of the handle according to the first rotation matrix, the second rotation matrix and the first attitude information of the clamping seat.
[0163] In some embodiments, the motor control parameter updating module 910 includes:
[0164] The third attitude information calculation unit is configured to estimate third attitude information of the holder after the holder rotates to the target angle according to the first attitude information and the target angle.
[0165] The attitude difference calculation unit is configured to calculate a difference between the third attitude information and the second attitude information to obtain an attitude difference.
[0166] The motor control parameter updating unit is configured to update the motor control parameters based on the attitude difference.
[0167] In some embodiments, the holder control apparatus further includes:
[0168] The first angular velocity measurement module is configured to measure the first angular velocity of the rotation of each motor.
[0169] The angular velocity difference determination module is configured to determine the second angular velocity corresponding to the rotation of each motor to the target angle according to the attitude difference, and determine the angular velocity difference according to the first angular velocity and the second angular velocity.
[0170] The motor rotation control module is configured to determine the torque difference corresponding to each motor according to the angular velocity difference, update the motor control parameters of each motor according to the torque difference, and control the rotation of each motor according to the motor control parameters.
[0171] The above-mentioned various modules in the holder control apparatus 900 can be all or partially realized by software, hardware and combinations thereof. The above-mentioned various modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the above-mentioned various modules.
[0172] In one embodiment, a computer device is provided, which can be a terminal, and the internal structure diagram thereof can be as shown in Figure 10As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a pan-tilt control method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0173] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0174] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned pan / tilt control method when executing the computer program.
[0175] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned pan-tilt control method are implemented.
[0176] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the above-mentioned pan / tilt control method when executed by a processor.
[0177] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0178] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0179] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A pan / tilt control method, characterized in that: The method comprises: estimating first posture information of a clamping base of the gimbal based on inertial measurement unit data of the gimbal; Obtaining the mechanical angle of rotation of each motor of the pan / tilt platform; Calculating the posture information of the handle of the gimbal according to the mechanical angle and the first posture information of the clamping base; Calculating second posture information of the clamping base based on the target angle and the posture information of the handle; estimating third posture information of the clamping seat according to the first posture information and the target angle; updating motor control parameters according to a posture difference between the second posture information and the third posture information; The rotation of each motor is controlled according to the updated motor control parameters.
2. The method according to claim 1, characterized in that The inertial measurement unit data includes a gyroscope signal and a temperature signal of the inertial measurement unit; the method further includes: Reading an initial gyroscope signal and an initial temperature signal of an inertial measurement unit in the gimbal; Dynamically compensating the initial temperature signal to obtain a compensated temperature signal; The initial gyroscope signal is corrected according to the scale factor and the non-orthogonal matrix to obtain a corrected gyroscope signal.
3. The method according to claim 1, characterized in that The estimating first posture information of the clamping seat in the gimbal based on the inertial measurement unit data of the gimbal includes: Dynamically estimate the gyroscope in the gimbal to obtain the gyro bias of the pitch and roll axes; Determine the heading axis zero bias of the gyroscope by an encoder; First attitude information of the clamping seat in the gimbal is calculated based on the gyroscope signal, the heading axis zero bias and the gyroscope zero bias in the inertial measurement unit data.
4. The method according to claim 3, characterized in that The step of calculating the first attitude information of the holding base in the gimbal according to the gyroscope signal, the heading axis zero bias, and the gyroscope zero bias in the inertial measurement unit data includes: The sum of the heading axis bias and the gyro bias is used as the three-axis bias of the gyroscope; Converting the three-axis zero bias to an inertial measurement unit coordinate system according to a first rotation matrix to obtain the three-axis zero bias of the gyroscope in the inertial measurement unit coordinate system; wherein the first rotation matrix represents a conversion relationship between a world coordinate system and the inertial measurement unit coordinate system; The first posture information of the clamping base is calculated based on the gyroscope signal and the three-axis zero bias of the gyroscope in the inertial measurement unit coordinate system.
5. The method according to claim 1, wherein The step of calculating the posture information of the handle of the gimbal according to the mechanical angle and the first posture information of the clamping base includes: Calculating a second rotation matrix of the handle of the gimbal relative to the clamping base according to the mechanical angle; Obtaining a first rotation matrix; wherein the first rotation matrix represents a transformation relationship between a world coordinate system and an inertial measurement unit coordinate system; The posture information of the handle is calculated based on the first rotation matrix, the second rotation matrix and the first posture information of the clamping base.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: measuring a first angular velocity of rotation of each of the motors; Determining a second angular velocity corresponding to the rotation of each motor to the target angle according to the posture difference, and determining an angular velocity difference according to the first angular velocity and the second angular velocity; The torque difference corresponding to each of the motors is determined according to the angular velocity difference, the motor control parameters of each of the motors are updated according to the torque difference, and the rotation of each of the motors is controlled according to the motor control parameters.
7. A pan / tilt control device, characterized in that: The device comprises: A first attitude information estimation module, configured to estimate first attitude information of a clamping base in the gimbal based on inertial measurement unit data of the gimbal; A mechanical angle acquisition module, used to obtain the mechanical angle of rotation of each motor of the pan / tilt platform; A handle posture information calculation module, configured to calculate the posture information of the handle of the gimbal according to the mechanical angle and the first posture information of the clamping base; A second posture calculation module, configured to calculate second posture information of the clamping base based on a target angle and the posture information of the handle; a motor control parameter updating module, configured to estimate third posture information of the clamping seat according to the first posture information and the target angle; and update motor control parameters according to a posture difference between the second posture information and the third posture information; The motor control module is used to control the rotation of each motor according to the updated motor control parameters.
8. The device according to claim 7, characterized in that The inertial measurement unit data includes a gyroscope signal and a temperature signal of the inertial measurement unit; the apparatus further includes: A signal reading module, for reading an initial gyroscope signal and an initial temperature signal of an inertial measurement unit in the gimbal; a dynamic compensation module, performing dynamic compensation on the initial temperature signal to obtain a compensated temperature signal; The correction processing module performs correction processing on the initial gyroscope signal according to the scale factor and the non-orthogonal matrix to obtain a corrected gyroscope signal.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Pan tilt automatically calibrating method and device and pan tilt
CN108279708A
Mechanical angle detecting method, pan / tilt head and machine readable storage medium
CN108700897A
Control method of handheld holder and handheld holder
CN110785601A