Pan-tilt structure angle calculation method and system based on unmanned aerial vehicle attitude
By calculating the attitude angle difference between the gimbal and the UAV, the motor structural angle and magnetic pole number are directly calculated, which solves the problems of long self-checking of the gimbal and environmental interference in the existing technology, and achieves fast and accurate calculation of the gimbal structure angle. .
Patent Information
- Application Number
- CN202410880265.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-22
AI Technical Summary
Existing micro gimbal equipment needs to pass a three-axis motor rotation self-test during initialization, which takes a long time and is prone to self-test failure due to environmental interference, making it impossible to correctly calculate the structural angle.
By obtaining the difference between the attitude angle of the gimbal and the UAV, the structural angle and electrical angle of the motor are calculated, and it is judged whether the actual electrical angle and the calculated electrical angle are the same magnetic pole, and then the structural angle of the gimbal is calculated to avoid prior rotation self-test.
It greatly shortens the self-test time of the gimbal, avoids self-test failures caused by interference from environmental objects, and ensures the ability to correctly calculate the angle of the gimbal structure.
Smart Images

Figure CN118816807A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pan / tilt devices, and in particular to a method and system for calculating initial values of pan / tilt structure angles based on the attitude of an unmanned aerial vehicle. Background Art
[0002] At present, Hall sensors are mostly used as motor angle sensors in micro-pan-tilt devices. The Hall sensors sense the magnetic field strength and can calculate the angle within the current magnetic pole.
[0003] And as Figure 1 As shown in the figure, the magnetic fields of different poles are the same. When the machine is just turned on, the current magnetic pole cannot be distinguished only by the magnetic field, and thus the correct structural angle cannot be obtained. Therefore, during initialization, it is necessary to determine the magnetic pole when the motor rotates to the limit position through the gimbal self-test, and then calculate the gimbal structural angle. Among them, the gimbal self-test means that when the machine is turned on, the three-axis motor of the gimbal rotates to the limit position, and after the gimbal structural angle is calculated, the image stabilization is entered.
[0004] However, the above gimbal self-check takes a long time, and when the distance between the gimbal and the ground is small, the raised soil, stones, and growing grass on the ground may interfere with the gimbal self-check, causing the gimbal self-check to fail, and then the gimbal structural angle cannot be correctly calculated. Summary of the invention
[0005] To solve the above problems, the present invention proposes a method and system for calculating the gimbal structure angle based on the attitude of the UAV, which does not require the three-axis motor to rotate first, complete the gimbal self-check, and then calculate the gimbal structure angle, thereby greatly shortening the self-check time.
[0006] To achieve the above object, the technical solution adopted by the present invention is:
[0007] On the one hand, a method for calculating the angle of a gimbal structure based on the attitude of an unmanned aerial vehicle is provided, which comprises the following steps:
[0008] Get the attitude angle difference ΔAngle between the gimbal attitude angle GAngle and the drone attitude angle PAngle;
[0009] Obtain the motor structure angle MAngle according to the attitude angle difference ΔAngle;
[0010] Obtain the calculated electrical angle value EAngle1 of the motor according to the motor structural angle MAngle;
[0011] According to the difference ΔEAngle between the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1, it is determined whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole;
[0012] According to whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole, the actual magnetic pole number RealCnt corresponding to the actual electrical angle RealEAngle is obtained;
[0013] And, the actual gimbal structural angle RealMAngle is obtained according to the actual magnetic pole number RealCnt, the actual electrical angle RealEAngle, and the electrical angle ZeoEAngle when the motor is in the structural zero position.
[0014] Preferably, before obtaining the attitude angle difference ΔAngle, the motor coordinate system of the gimbal motor is rotated to the earth coordinate system, so that the coordinate systems of the gimbal motor, the gimbal attitude, and the drone attitude remain consistent.
[0015] Preferably, the step of obtaining the motor structure angle MAngle according to the attitude angle difference ΔAngle comprises the following steps:
[0016] If the gimbal has no azimuth attitude, the azimuth motor is adjusted to the structural zero-degree position;
[0017] According to formula (1), the motor structure angle MAngle [MAngleX MAngleY MAngleZ] is obtained:
[0018] ΔAngle=Ty*(Tx*MAngle) (1)
[0019] Wherein, Tx is the pitch rotation matrix of the pitch motor of the gimbal, Ty is the roll rotation matrix of the roll motor of the gimbal; and MangleY=(GAngleY-PAngleY)÷cos(PAngleX)
[0020] MAngleX=((GAngleX-PAngleX)-MAngleY*sin(PAngleX)*sin(PAngleY))÷
[0021] cos(PAngleY)
[0022] MAngleZ=0.
[0023] Preferably, the step of obtaining the motor structure angle MAngle according to the attitude angle difference ΔAngle comprises the following steps:
[0024] If the gimbal has an azimuth attitude, the motor structure angle MAngle[MAngleXMAngleY MAngleZ] is obtained according to formula (2):
[0025] MAngle = Tz*(Ty*(Tx*(GAngle - PAngle))) (2)
[0026] Wherein, Tx is the pitch rotation matrix of the pitch motor of the gimbal, Ty is the roll rotation matrix of the roll motor of the gimbal, and Tz is the azimuth rotation matrix of the azimuth motor of the gimbal;
[0027] And MAngleX=cos(PAngleZ)*(sin(PAngleY)*(PAngleZ*cos(PAngleX)+
[0028] sin(PAngleX)*(GAngleY-PAngleY))+cos(PAngleY)*(GAngleX-PAngleX))+
[0029] sin(PAngleZ)*(cos(PAngleX)*(GAngleY-PAngleY)-PAngleZ*sin(PAngleX))
[0030] MAngleY=cos(PAngleZ)*(cos(PAngleX)*(GAngleY-PAngleY)-PAngleZ*sin(PAngleX))-sin(PAngleZ)*(sin(PAngleY)*(PAngleZ*cos(PAngleX)+sin(PAngleX)*(GAngleY-PAngleY))+cos(PAngleY)*(GAngleX-PAngleX))
[0031] MAngleZ=sin(PAngleY)*(GAngleX-PAngleX)-cos(PAngleY)*(PAngleZ*cos(PAngleX)+sin(PAngleX)*(GAngleY-PAngleY)).
[0032] Preferably, obtaining the calculated electrical angle value EAngle1 of the motor according to the motor structure angle MAngle includes the following steps:
[0033] According to formula (3), the electrical angle conversion value EAngle0 is obtained:
[0034] EAngle0=MAngle÷(360÷Pole)*360+ZeoEAngle (3)
[0035] Wherein, Pole is the number of motor pole pairs; ZeoEAngle is the electrical angle when the motor is in the structural zero position;
[0036] If MAngle>0, the electrical angle conversion value EAngle0 is divided by 360, and the remainder is taken, and the remainder is the electrical angle calculation value EAngle1 of the motor;
[0037] If MAngle<0, the calculated electrical angle value EAngle1 is converted to a positive value in the manner of EAngle1=EAngle1+360.
[0038] Preferably, when |ΔEAngle| is less than a first preset value, it is considered that the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole; when |360-ΔEAngle| is less than a second preset value, it is considered that the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 do not correspond to the same magnetic pole.
[0039] Preferably, according to whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole, obtaining the actual magnetic pole number RealCnt corresponding to the actual electrical angle RealEAngle includes the following steps:
[0040] If the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole, the actual magnetic pole number RealCnt corresponding to the actual electrical angle RealEAngle is obtained according to formula (4):
[0041] RealCnt = ZeoCnt +EAngle2 (4)
[0042] Among them, ZeoCnt is the magnetic pole number corresponding to the zero position of the structure; EAngle2 is obtained by dividing the electrical angle conversion value EAngle0 by 360 and taking the integer.
[0043] Preferably, according to whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole, obtaining the actual magnetic pole number RealCnt corresponding to the actual electrical angle RealEAngle includes the following steps:
[0044] If the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 do not correspond to the same magnetic pole, first obtain the calculated magnetic pole number RealCnt' corresponding to the actual electrical angle RealEAngle according to formula (5):
[0045] RealCnt' = ZeoCnt +EAngle2 (5)
[0046] Among them, ZeoCnt is the magnetic pole number corresponding to the structural zero position; EAngle2 is obtained by taking the integer after dividing the electrical angle conversion value EAngle0 by 360;
[0047] If the calculated electrical angle EAngle1 > the actual electrical angle RealEAngle, then the actual magnetic pole number RealCnt = RealCnt'+1;
[0048] If the calculated electrical angle EAngle1 < RealEAngle, then the actual magnetic pole number RealCnt = RealCnt'-1.
[0049] Preferably, the actual pan-tilt structure angle RealMAngle is obtained according to the actual magnetic pole number RealCnt, the actual electrical angle RealEAngle, and the electrical angle ZeoEAngle when the motor is at the structural zero position, including the following steps:
[0050] The actual pan-tilt structure angle RealMAngle is obtained according to formula (6):
[0051] RealMAngle = (RealCnt - ZeoCn)*(360÷Pole)+(RealEAngle - ZeoEAngle)÷360*(360÷Pole)(6).
[0052] On the other hand, a pan-tilt structure angle calculation system is also provided, which includes:
[0053] An attitude angle acquisition unit, which is used to respectively acquire the pan-tilt attitude angle GAngle[GAngleX GAngleY GAngleZ] in the earth coordinate system and the UAV attitude angle PAngle[PAngleXPAngleY PAngleZ] in the earth coordinate system;
[0054] An attitude angle difference acquisition unit, which is used to obtain the motor structure angle MAngle according to the attitude angle difference ΔAngle;
[0055] A calculated electrical angle acquisition unit, which is used to obtain the calculated electrical angle EAngle1 of the motor according to the motor structure angle MAngle;
[0056] A magnetic pole judgment unit, which is used to judge whether the actual electrical angle RealEAngle and the calculated electrical angle EAngle1 correspond to the same magnetic pole according to the difference ΔEAngle between the actual electrical angle RealEAngle and the calculated electrical angle EAngle1;
[0057] A magnetic pole number obtaining unit, which is used to obtain an actual magnetic pole number RealCnt corresponding to an actual electrical angle RealEAngle;
[0058] The gimbal structure angle acquisition unit is used to acquire the actual gimbal structure angle RealMAngle according to the actual magnetic pole number RealCnt, the actual electrical angle RealEAngle, and the electrical angle ZeoEAngle when the motor is in the structural zero position.
[0059] The beneficial effects of using the present invention are:
[0060] This application does not need to first rotate the three-axis motor to complete the gimbal self-check and then calculate the gimbal structural angle. Therefore, the self-check time can be greatly shortened, and the problem of gimbal self-check failure and inability to calculate the structural angle through self-check can be avoided due to the gimbal touching the environmental objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a schematic diagram of the structure of the magnetic pole of the pan / tilt motor in the prior art;
[0062] Figure 2 is a flowchart of the steps of the method for calculating the angle of the pan / tilt structure in the present invention;
[0063] Figure 3 are the gimbal attitude angle and the UAV attitude angle in the geodetic coordinate system of the present invention;
[0064] Figure 4 It is a schematic diagram of the rotation of the motor coordinate system to the earth coordinate system in the present invention;
[0065] Figure 5 This is a structural diagram of the drone and the gimbal in the present invention;
[0066] Figure 6 It is a schematic diagram of the structure of the pan / tilt structure angle calculation system in the present invention. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the technical solution more clear, the technical solution is further described in detail below in conjunction with specific implementation methods. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the technical solution.
[0068] Embodiment 1:
[0069] This embodiment provides a method for calculating the angle of the gimbal structure based on the posture of the drone. Figure 2 As shown, it includes the following steps:
[0070] S1, such as Figure 3As shown, the gimbal attitude angle GAngle[GAngleX GAngleY GAngleZ] in the earth coordinate system and the drone attitude angle PAngle[PAngleX PAngleY PAngleZ] in the earth coordinate system are obtained through the structures such as the gimbal IMU unit and the drone IMU unit respectively;
[0071] S2, obtaining the attitude angle difference ΔAngle between the gimbal attitude angle GAngle and the drone attitude angle PAngle, and ΔAngle=GAngle-PAngle;
[0072] S3, such as Figure 4 As shown, the motor coordinate system of the gimbal motor is rotated to the earth coordinate system through the rotation matrix, so that the coordinate systems of the gimbal motor, the gimbal attitude, and the drone attitude are consistent;
[0073] S4. Obtain the motor structure angle MAngle according to the attitude angle difference ΔAngle, wherein the motor structure angle MAngle is the rotation angle of the gimbal motor relative to the drone body, that is, the difference between the current rotation angle of the motor and the angle of the drone body; specifically, Figure 5 As shown, when the gimbal 100 is mounted on the drone and placed horizontally, the motors of the gimbal (including the azimuth motor, the pitch motor, and the roll motor) and the drone body 200 are all at the structural zero position. When the motors of the gimbal rotate, the rotation angle of the motor relative to the drone body 200 is the inclination angle of the motor relative to the structural zero position, and this inclination angle is the motor structural angle MAngle;
[0074] Specifically, step S4 includes:
[0075] If the gimbal has no azimuth attitude, the gimbal's azimuth motor completes self-test, and after the self-test is completed, the azimuth motor is adjusted to the structural zero-degree position;
[0076] According to formula (1), the motor structure angle MAngle [MAngleX MAngleY MAngleZ] is obtained:
[0077] ΔAngle=Ty*(Tx*MAngle) (1)
[0078] Wherein, Tx is the pitch rotation matrix of the pitch motor of the gimbal, and Ty is the roll rotation matrix of the roll motor of the gimbal; and
[0079] Expand to get:
[0080] MAngleY=(GAngleY-PAngleY)÷cos(PAngleX)
[0081] MAngleX=((GAngleX-PAngleX)-MAngleY*sin(PAngleX)*sin(PAngleY))÷
[0082] cos(PAngleY)
[0083] MAngleZ = 0;
[0084] If the gimbal has an azimuth attitude, the motor structure angle MAngle[MAngleXMAngleY MAngleZ] is obtained according to formula (2):
[0085] MAngle = Tz*(Ty*(Tx*(GAngle - PAngle))) (2)
[0086] Wherein, Tz is the azimuth rotation matrix of the azimuth motor of the gimbal, and the meanings of Tx and Ty are the same as those in formula (1) and will not be repeated here;
[0087] and
[0088] Expand to get:
[0089] MAngleX=cos(PAngleZ)*(sin(PAngleY)*(PAngleZ*cos(PAngleX)+sin(PAngleX)*(GAngleY-PAngleY))+cos(PAngleY)*(GAngleX-PAngleX))+
[0090] sin(PAngleZ)*(cos(PAngleX)*(GAngleY-PAngleY)-PAngleZ*sin(PAngleX))
[0091] MAngleY=cos(PAngleZ)*(cos(PAngleX)*(GAngleY-PAngleY)-PAngleZ*sin(PAngleX))-sin(PAngleZ)*(sin(PAngleY)*(PAngleZ*cos(PAngleX)+sin(PAngleX)*(GAngleY-PAngleY))+cos(PAngleY)*(GAngleX-PAngleX))
[0092] MAngleZ=sin(PAngleY)*(GAngleX-PAngleX)-cos(PAngleY)*(PAngleZ*cos(PAngleX)+sin(PAngleX)*(GAngleY-PAngleY))
[0093] S5, obtaining the calculated electrical angle value EAngle1 of the motor according to the motor structural angle MAngle, which specifically includes the following steps:
[0094] According to formula (3), the electrical angle conversion value EAngle0 is obtained:
[0095] EAngle0=MAngle÷(360÷Pole)*360+ZeoEAngle (3)
[0096] Wherein, Pole is the number of motor pole pairs; ZeoEAngle is the electrical angle when the motor is in the structural zero position;
[0097] If MAngle>0, the electrical angle conversion value EAngle0 is divided by 360, and the remainder is taken. The remainder is the electrical angle calculation value EAngle1 of the motor. At this time, the electrical angle calculation value EAngle1 is a positive value;
[0098] If MAngle<0, the calculated electrical angle value EAngle1 is converted into a positive value, and EAngle1=EAngle1+360 is used as the calculated electrical angle value EAngle1 of the motor;
[0099] S6, obtaining the actual electrical angle RealEAngle of the motor in real time through sensors and other components, and judging whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole according to the difference ΔEAngle between the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1;
[0100] Since the actual electrical angle RealEAngle is obtained through the sensor, and the calculated electrical angle value EAngle1 is calculated through the motor structure angle MAngle, the two should theoretically correspond to the same magnetic pole. However, due to installation errors, shock absorption deformation and other reasons, it is possible that the two may not correspond to the same magnetic pole. Therefore, it is necessary to first determine whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole;
[0101] Specifically, when |ΔEAngle| is less than the first preset value, it is considered that the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole; when |360 - ΔEAngle| is less than the second preset value, it is considered that the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 do not correspond to the same magnetic pole; in this embodiment, the first preset value and the second preset value can be set according to factors such as the deformation amount at the connection between the pan-tilt and the drone, and the two can be the same, such as both being 40, or different;
[0102] S7. If the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole, then the actual magnetic pole number RealCnt corresponding to the actual electrical angle RealEAngle is obtained according to formula (4) (i.e., the RealCnt-th magnetic pole):
[0103] RealCnt = ZeoCnt +EAngle2 (4)
[0104] Wherein, ZeoCnt is the magnetic pole number corresponding to the structural zero position; EAngle2 is obtained by taking the integer after dividing the electrical angle conversion value EAngle0 by 360;
[0105] If the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 do not correspond to the same magnetic pole, then first obtain the calculated magnetic pole number RealCnt’ corresponding to the actual electrical angle RealEAngle according to formula (5):
[0106] RealCnt’ = ZeoCnt +EAngle2 (5)
[0107] Wherein, the meanings of ZeoCnt and EAngle2 are the same as those in formula (4) and will not be elaborated here;
[0108] If the calculated electrical angle value EAngle1 > the actual electrical angle RealEAngle, then the actual magnetic pole number RealCnt = RealCnt’ + 1;
[0109] If the calculated electrical angle value EAngle1 < RealEAngle, then the actual magnetic pole number RealCnt = RealCnt’ - 1;
[0110] And S8. Obtain the actual pan-tilt structure angle RealMAngle according to the actual magnetic pole number RealCnt, the actual electrical angle RealEAngle, and the electrical angle ZeoEAngle when the motor is at the structural zero position;
[0111] Specifically, the actual gimbal structure angle RealMAngle is obtained according to formula (6):
[0112] RealMAngle=(RealCnt-ZeoCn)*(360÷Pole)+(RealEAngle-ZeoEAngle)÷360*(360÷Pole)(6).
[0113] Therefore, this embodiment is based on the characteristics that when the gimbal is placed horizontally, the motors of the gimbal and the drone body are in the structural zero position. First, the difference between the drone attitude and the gimbal attitude is obtained, and then the deviation angle of the motor (i.e., the motor structural angle MAngle) is calculated, and then the actual electrical angle and the calculated electrical angle are further determined to determine whether they correspond to the same magnetic pole, and the actual magnetic pole number is obtained, and finally the actual gimbal structural angle is obtained to enter the image stabilization. This method does not need to first rotate the three-axis motor to complete the gimbal self-check, and then calculate the gimbal structural angle, so it can greatly shorten the self-check time, and can avoid the problem of the gimbal self-check failure due to the gimbal touching the environmental objects, and the inability to calculate the structural angle through self-check.
[0114] Embodiment 2:
[0115] This embodiment provides a pan-tilt structure angle calculation system for implementing the pan-tilt structure angle calculation method described in Embodiment 1, such as Figure 6 As shown, it includes:
[0116] An attitude angle acquisition unit 1 is used to respectively acquire the gimbal attitude angle GAngle[GAngleX GAngleY GAngleZ] in the earth coordinate system and the drone attitude angle PAngle[PAngleXPAngleY PAngleZ] in the earth coordinate system;
[0117] A coordinate system conversion unit 2, which is used to rotate the motor coordinate system of the pan / tilt motor to the earth coordinate system through a rotation matrix;
[0118] An attitude angle difference acquisition unit 3 is used to acquire the motor structure angle MAngle according to the attitude angle difference ΔAngle, and the specific process is the same as step S4;
[0119] The electrical angle calculation value acquisition unit 4 is used to acquire the electrical angle calculation value EAngle1 of the motor according to the motor structure angle MAngle, and the specific process is the same as step S5;
[0120] A magnetic pole determination unit 5 is used to determine whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole according to the difference ΔEAngle between the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1. The specific process is the same as step S6.
[0121] The magnetic pole number obtaining unit 6 is used to obtain the actual magnetic pole number RealCnt corresponding to the actual electrical angle RealEAngle, and the specific process is the same as step S7;
[0122] The gimbal structure angle acquisition unit 7 is used to acquire the actual gimbal structure angle RealMAngle according to the actual magnetic pole number RealCnt, the actual electrical angle RealEAngle, and the electrical angle ZeoEAngle when the motor is in the structural zero position. The specific process is the same as step S8.
[0123] To sum up, the present invention does not need to first rotate the three-axis motor to complete the gimbal self-check and then calculate the gimbal structural angle, so the self-check time can be greatly shortened, and the problem of gimbal self-check failure and inability to calculate the structural angle through self-check can be avoided due to the gimbal touching the environmental objects.
[0124] The above contents are only preferred embodiments of the present invention. For ordinary technicians in this field, many changes can be made in the specific implementation methods and application scopes based on the ideas of the present technical content. As long as these changes do not deviate from the concept of the present invention, they all fall within the scope of protection of this patent.
Claims
1. A method for calculating the angle of a gimbal structure based on the attitude of an unmanned aerial vehicle, characterized in that: The steps include: Get the attitude angle difference ΔAngle between the gimbal attitude angle GAngle and the drone attitude angle PAngle; Obtain the motor structure angle MAngle according to the attitude angle difference ΔAngle; Obtain the calculated electrical angle value EAngle1 of the motor according to the motor structural angle MAngle; According to the difference ΔEAngle between the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1, it is determined whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole; According to whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole, the actual magnetic pole number RealCnt corresponding to the actual electrical angle RealEAngle is obtained; And, the actual gimbal structural angle RealMAngle is obtained according to the actual magnetic pole number RealCnt, the actual electrical angle RealEAngle, and the electrical angle ZeoEAngle when the motor is in the structural zero position.
2. The method for calculating the angle of a pan / tilt structure according to claim 1, wherein: Before obtaining the attitude angle difference ΔAngle, rotate the motor coordinate system of the gimbal motor to the earth coordinate system so that the coordinate systems of the gimbal motor, gimbal attitude, and drone attitude remain consistent.
3. The method for calculating the angle of a pan / tilt structure according to claim 1, wherein: The method of obtaining the motor structure angle MAngle according to the attitude angle difference ΔAngle comprises the following steps: If the gimbal has no azimuth attitude, the azimuth motor is adjusted to the structural zero-degree position; According to formula (1), the motor structure angle MAngle[MAngleX MAngleYMAngleZ] is obtained: ΔAngle=Ty*(Tx*MAngle) (1) Wherein, Tx is the pitch rotation matrix of the gimbal's pitch motor, and Ty is the roll rotation matrix of the gimbal's roll motor; And MAngleY=(GAngleY-PAngleY)÷cos(PAngleX) MAngleX=((GAngleX-PAngleX)-MAngleY*sin(PAngleX)*sin(PAngleY))÷ cos(PAngleY) MAngleZ=0.
4. The method for calculating the angle of a pan / tilt structure according to claim 1, wherein: The method of obtaining the motor structure angle MAngle according to the attitude angle difference ΔAngle comprises the following steps: If the gimbal has an azimuth attitude, the motor structure angle MAngle[MAngleX MAngleYMAngleZ] is obtained according to formula (2): MAngle=Tz*(Ty*(Tx*(GAngle-PAngle))) (2) Wherein, Tx is the pitch rotation matrix of the pitch motor of the gimbal, Ty is the roll rotation matrix of the roll motor of the gimbal, and Tz is the azimuth rotation matrix of the azimuth motor of the gimbal; And MAngleX=cos(PAngleZ)*(sin(PAngleY)*(PAngleZ*cos(PAngleX)+ sin(PAngleX)*(GAngleY-PAngleY))+cos(PAngleY)*(GAngleX-PAngleX))+ sin(PAngleZ)*(cos(PAngleX)*(GAngleY-PAngleY)-PAngleZ*sin(PAngleX)) MAngleY=cos(PAngleZ)*(cos(PAngleX)*(GAngleY-PAngleY)-PAngleZ*sin(PAngleX))-sin(PAngleZ)*(sin(PAngleY)*(PAngleZ*cos(PAngleX)+sin(PAngleX)*(GAngleY-PAngleY))+cos(PAngleY)*(GAngleX-PAngleX)) MAngleZ=sin(PAngleY)*(GAngleX-PAngleX)-cos(PAngleY)*(PAngleZ*cos(PAngleX)+sin(PAngleX)*(GAngleY-PAngleY)).
5. The method for calculating the pan / tilt structure angle according to claim 1, wherein: Obtaining the calculated electrical angle value EAngle1 of the motor according to the motor structural angle MAngle includes the following steps: According to formula (3), the electrical angle conversion value EAngle0 is obtained: EAngle0=MAngle÷(360÷Pole)*360+ZeoEAngle (3) Wherein, Pole is the number of motor pole pairs; ZeoEAngle is the electrical angle when the motor is in the structural zero position; If MAngle>0, the electrical angle conversion value EAngle0 is divided by 360, and the remainder is taken, and the remainder is the electrical angle calculation value EAngle1 of the motor; If MAngle<0, the calculated electrical angle value EAngle1 is converted to a positive value in the manner of EAngle1=EAngle1+360.
6. The method for calculating the angle of a pan / tilt structure according to claim 1, wherein: When |ΔEAngle| is less than the first preset value, it is considered that the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole; when |360-ΔEAngle| is less than the second preset value, it is considered that the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 do not correspond to the same magnetic pole.
7. The method for calculating the pan / tilt structure angle according to claim 1, characterized in that: According to whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole, the actual magnetic pole number RealCnt corresponding to the actual electrical angle RealEAngle is obtained, including the following steps: If the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole, the actual magnetic pole number RealCnt corresponding to the actual electrical angle RealEAngle is obtained according to formula (4): RealCnt=ZeoCnt+EAngle2 (4) Among them, ZeoCnt is the pole number corresponding to the structural zero position; EAngle2 is obtained by taking the integer after dividing the electrical angle conversion value EAngle0 by 360.
8. The method for calculating the angle of a pan / tilt structure according to claim 1, wherein: According to whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole, the actual pole number RealCnt corresponding to the actual electrical angle RealEAngle is obtained, including the following steps: If the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 do not correspond to the same magnetic pole, then first obtain the calculated pole number RealCnt’ corresponding to the actual electrical angle RealEAngle according to formula (5): RealCnt’ = ZeoCnt + EAngle2 (5) Among them, ZeoCnt is the pole number corresponding to the structural zero position; EAngle2 is obtained by taking the integer after dividing the electrical angle conversion value EAngle0 by 360; If the calculated electrical angle value EAngle1 > the actual electrical angle RealEAngle, then the actual pole number RealCnt = RealCnt’ + 1; If the calculated electrical angle value EAngle1 < RealEAngle, then the actual pole number RealCnt = RealCnt’ - 1.
9. The method for calculating the pan / tilt structure angle according to claim 1, wherein: According to the actual pole number RealCnt, the actual electrical angle RealEAngle, and the electrical angle ZeoEAngle when the motor is at the structural zero position, the actual pan-tilt structure angle RealMAngle is obtained, including the following steps: Obtain the actual pan-tilt structure angle RealMAngle according to formula (6): RealMAngle = (RealCnt - ZeoCn) * (360 ÷ Pole) + (RealEAngle - ZeoEAngle) ÷ 360 * (360 ÷ Pole) (6).
10. A pan / tilt structure angle calculation system, characterized in that: Including: An attitude angle acquisition unit, which is used to respectively acquire the pan-tilt attitude angle GAngle [GAngleX GAngleY GAngleZ] in the earth coordinate system and the UAV attitude angle PAngle [PAngleX PAngleY PAngleZ] in the earth coordinate system; An attitude angle difference acquisition unit, which is used to obtain the motor structure angle MAngle according to the attitude angle difference ΔAngle; A calculated electrical angle value acquisition unit, which is used to obtain the calculated electrical angle value EAngle1 of the motor according to the motor structure angle MAngle; A magnetic pole judgment unit, which is used to judge whether the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1 correspond to the same magnetic pole according to the difference ΔEAngle between the actual electrical angle RealEAngle and the calculated electrical angle value EAngle1; A magnetic pole number acquisition unit, which is used to obtain the actual pole number RealCnt corresponding to the actual electrical angle RealEAngle; The gimbal structure angle acquisition unit is used to acquire the actual gimbal structure angle RealMAngle according to the actual magnetic pole number RealCnt, the actual electrical angle RealEAngle, and the electrical angle ZeoEAngle when the motor is in the structural zero position.
