Design of Electric Patrol UAVs Based on a Dual Antenna System

China completed the construction of more than 1.15 million kilometers of transmission lines with conventional voltage levels spanning its vast territory in 2014. This large and complicated power grid structure relies mainly on manual operation and maintenance of lines. Unmanned aerial vehicles (UAVs) equipped with high-definition digital video cameras and cameras and GPS positioning systems can conduct autonomous patrols along the grid. However, the presence of electromagnetic fields around high-voltage transmission lines can affect the UAV’s magnetometer, resulting in a wrong heading and thus unsafe flight. In this paper, the traditional method of UAV heading calculation using a magnetometer was analyzed, and a novel method for calculating UAV heading based on dual antennas was proposed. Experimental data showed that the proposed method improves the anti-magnetic interference characteristics of UAVs and increases UAV security and stability for power inspection applications.


Introduction
The increasing interest in the development of unmanned aerial vehicle (UAV) technology has heightened the demand for safe and efficient UAVs for power transmission line inspection.However, the presence of electromagnetic fields around high-voltage overhead transmission lines affects the sensors on UAVs, especially the magnetometer (LS303DMPU9250 InvenSense, Beijing, China).The entire electromagnetic spectrum will disrupt the magnetometer on UAVs.In China, the electromagnetic field from transmission lines is 50 Hz, resulting in errors in the heading-angles of UAVs, and affecting their flight [1,2].As a consequence, existing power-patrol UAVs can only carry out long-distance photography, and it is difficult to achieve precise operation requirements with the UAVs.Therefore, this paper proposes a UAV positioning and direction-finding system based on dual-antenna GPS (CUAV NEO-M8N, Beijing, China).This paper reports in detail on the results obtained by the measurement principle and measurement scheme of this system, and verifies the feasibility of the system through experiments.

Traditional UAV Positioning
The traditional UAV attitude calculation algorithm is mainly divided into the following steps [3].First, the data preprocessing and attitude calculation of the data obtained by the gyroscope are carried out, thus providing a set of data containing the measured attitude angle values.Meanwhile, data preprocessing and attitude calculation are performed with the data obtained by the accelerometer and the magnetometer, yielding a second set of data [3][4][5].Finally, the two groups of data are processed with the Kalman filter to obtain accurate and stable attitude data of the UAV, as shown in Figure 1.There are three main kinds of attitude calculation algorithms that are widely used at present: the quaternion method, Euler angles, and rotation matrix method [6,7].The quaternion method is the most widely used in the field of engineering.Its calculation is relatively small, and this method is also used in the UAV attitude calculation.We can use the quaternion to represent the rotation matrix as: 2(q 1 q 2 − q 0 q 3 ) 2(q 0 q 2 + q 1 q 3 ) 2(q 1 q 2 + q 0 q 3 ) q 0 2 − q 1 2 + q 2 2 − q 3 2 2(q 2 q 3 − q 0 q 1 ) 2(q 1 q 3 − q 0 q 2 ) 2(q 0 q 1 + q 2 q 3 ) where the R is the rotation moment of the geographic coordinate system to the body axis system.q = q 0 + q 1 * i + q 2 * j + q 3 * k is the initialization quaternion for an initial attitude(i, j, k are three imaginary numbers fulfilling the condition i 2 + j 2 + k 2 = 1; q i are scalars), and we can calculate the Euler angle according to the following formula: where ϕ is pitch, θ is yaw, and ψ is heading.The attitude of the UAV is obtained in real time through the three-axis angular velocity of the gyroscope [3,6,8].However, because of gyroscope precision error, the data error of gyroscope output will increase with time, so the UAV cannot directly use these angles.Therefore, we need to combine gyroscope data with other sensor data, using an information fusion algorithm to improve the calculation accuracy of UAV attitude.We usually use the data of the three-axis accelerometer to calculate the attitude of the pitch and the roll angle.
When a UAV is stationary relative to a geographic coordinate system, the output of the three-axis acceleration is a n = [ 0 0 g ] T ; when it leans, the output of the accelerometer in the coordinate system of the body is a b = [ a x a y a z ] T .We can get the conversion relationship between them according to the Strap-down Inertial Navigation System (SINS) matrix C b n as: For uniform rectilinear movement of the UAV we can get the pitch ϕ and the roll θ as: At the same time, the heading angle is determined by the data of the three-axis magnetometer.
The measured values of the three-axis magnetometer are m a = [ m x m y m z ] T in the geographic coordinate system and m b = [ m x m y m z ] T in the coordinate system of the body; the relationship between m a and m b can be described as: Therefore, the horizontal component of the geomagnetic field can be described as: We can get the heading angle ψ as:

Dual Antenna System Theory
According to the formula listed in Section 2, the magnetometer data is needed in the process of calculating the heading angle of the UAV.When a UAV is carrying out power transmission line inspection, the external magnetic field of the transmission lines can affect the normal operation of the magnetometer, and this results in the incorrect calculation of the heading angle of the UAV and the phenomenon of turning or even exploding [8,9].
In order to solve the problem of electromagnetic interference with UAVs in complex magnetic field environments, we proposed a new UAV heading calculation method based on dual antennas.By using a real-time kinematic (RTK) module, installed with two antennas, in order to obtain the heading information by receiving the satellite signals and base station signals to calculate the baseline vector, the heading measurement cannot be influenced by external magnetic field interference, thereby improving the level of anti-magnetic interference.
In the RTK module, the base station is placed in a known point, while the mobile station is placed in the UAV.The base station and the mobile station then communicate through the radio, enabling the observation information to be transmitted to the mobile station from the base station, and the mobile station receives both the observation and the satellite information, in order to calculate the real-time, three-dimensional position-coordinates of the mobile station [10,11].RTK technology reduces the error caused by the signal passing through the ionosphere in the pseudo-distance measurement, and also further improves the measurement accuracy.The principle of the attitude algorithm is to use the difference algorithm to receive two GPS antennas' carrier signals, calculate the baseline vector, and determine the attitude information of the UAV.
The RTK measurement uses the WGS-84 coordinate system (World Geodetic System-1984 Coordinate System), and the UAV attitude calculation uses the relative position between the body coordinate system (BCS) and the local level coordinate system (LLS) [12].Therefore, we need to convert the attitude information output by the RTK mobile station with the following conversion algorithm.or a point P in space, it is assumed that its coordinates under WGS-84 are [X wgs , Y wgs , Z wgs ]. , and its latitude and longitude are [L 0 , B 0 ], so the transformation matrix between the LLS and the WGS-84 is: Because the LLS and the body coordinate system have the same origin of coordinates, the transformation parameter between the two coordinate systems is the Euler angle [8,13].Rolling the LLS in order, we can get the location of P in the body coordinate system: where R(r) y R(p) x R(y) z is the attitude matrix, and their rotation matrix is: Program flow chart of UAV heading angle by double antenna.When the condition is satisfied, the calculation of rotation cosine matrix of the pitch and roll angles will be continued (using heading signal correction gyros drift).If there is no double antenna signal or the signal is not stable, we will continue to use the magnetic compass signal.
According to Formula (10), we can use the difference algorithm to get the attitude parameters of the UAV.The collected heading information will be sent to the UAV flight control system through the serial port [3,14,15].We use heading information from both antennas in the body coordinate system.The flow chart of the algorithm is shown in Figure 2.

Experiments
In order to verify the characteristics of dual antenna electromagnetic interference, we carried out experiments with four groups of experimental conditions and two experimental environments to test the fluctuation of UAV solution heading information.
Test environment 1 was a place where the magnetic field was normal, and the magnetometer data diagram in this environment is shown in Figure 3. Test environment 2 was a place with larger magnetic field interference, and the magnetometer data diagram in this environment is shown in Figure 4.The magnetic field was small, and the UAV was placed in a place where the magnetic field was normal and there was no electromagnetic or magnetic interference around it.This is the graph of the magnetometer data collected at this time.The curve in the graph is the sampling point curve, where the unit of the vertical axis is degree.

Figure 4.
The interference of magnetic field was large, and the UAV was placed in the normal magnetic field environment.A magnet with Gauss on the surface of 0.3 (Tesla) was held.The magnet was close to the UAV, making the environment one of strong magnetic field interference.This is the graph of the magnetometer data collected at this time.The curve in the graph is the sampling point curve, where the unit of the vertical axis is degree.And we can see the sampling data fluctuates greatly.
In the four test conditions we set up, test condition 1 was in test environment 1 and the UAV used a magnetometer for heading correction; test condition 2 was in test environment 1 and the UAV used the dual antenna for heading correction; test condition 3 was in test environment 2 and the UAV used a magnetometer for heading correction; test condition 4 was in test environment 2 and the UAV used the dual antenna for heading correction.
When the rocker of the remote control channel was in the middle, the expected value of the UAV's heading angle was a fixed value.If the white noise or the surrounding environment was affected, the heading angle of UAV using magnetometer or dual antenna would fluctuate.When the magnetometer was disturbed by the external magnetic field, the fluctuation was more obvious.
During the experiment, the rocker position of the channel was kept constant and we obtained the change curve of the UAV's heading angle by testing in four experimental conditions.Figure 5 is the heading angle curve obtained from experimental condition1; Figure 6 is the heading angle curve obtained under test condition 2; Figure 7 is the heading angle curve obtained under test condition 3; Figure 8 is the course angle curve obtained under the test condition 4. It can be seen that under the condition of small magnetic interference, the magnetometer is less disturbed by external disturbances, which proves that the original heading algorithm can make the UAV fly normally when external magnetic disturbance is small.It can be seen that when the magnetic disturbance is small, the angle of the dual antenna to calculate the heading angle is basically the same as that of the magnetometer.It is proved that the dual antenna can replace the magnetometer to calculate the heading of the UAV.It can be seen that when the external magnetic environment interference is large, the heading angle of UAV magnetometer is calculated by external disturbances.The two deviations can be seen as a linear increase.The deviation is so large that it results in the phenomenon of turning and exploding.The experiment proves that the traditional method is not suitable for the operation of the power transmission line inspection with more complex magnetic field environment.

Discussion
It can be seen that in the presence of strong external magnetic field interference, the heading angle of the UAV calculated using the dual-antenna is still floating around the expected angle.This proves that the method proposed in this paper is able to calculate the heading angle by using dual-antennas.When exposed to external environmental interference, the UAV can fly normally without interference from the external magnetic field, so it is more suitable for power transmission line inspection.The results are shown in Table 1.We note that in the presence of strong external magnetic interference, the UAV with dual antennas did not exhibit large-range drift, and the amplitude of the heading angle was basically the same.The results show that the dual antenna calculation method of heading angle can solve the heading angle correctly under the condition of strong external magnetic field.Thus, it is able to be used in the power transmission line inspection application.

Conclusions
In order to cope with the complex magnetic environment of UAV power transmission line patrol, we proposed a dual-antenna-based algorithm for UAV heading calculation and designed and applied the implementation method.Experiments showed that our method can easily improve the anti-magnetic-interference capability of UAVs, so they are more suitable for power transmission inspection.There are still some requirements that need to be realized in practical application: (1) improving the security of dual antenna direction-finding and magnetic compass direction-finding; and (2) when the UAV accelerometer has problems, the dual antenna baseline solution can be used to calculate the roll and pitch angle of UAVs.

Figure 1 .
Figure 1.Schematic diagram of UAV attitude calculation algorithm.Processing two groups of data with Kalman filter in order to get the accurate and stable attitude data of the UAV.

Figure 3 .
Figure3.The magnetic field was small, and the UAV was placed in a place where the magnetic field was normal and there was no electromagnetic or magnetic interference around it.This is the graph of the magnetometer data collected at this time.The curve in the graph is the sampling point curve, where the unit of the vertical axis is degree.

Figure 5 .
Figure 5.The curve of course angle of UAV under test condition 1.The curve in the graph is the sampling point curve, where the unit of the vertical axis is degree.The green line is the expected value of the heading angle, and the red line is the heading angle calculated by the magnetometer.The amplitude of the course is 0.8 degrees.

Figure 6 .
Figure 6.The curve of course angle of UAV under test condition 2. The curve in the graph is the sampling point curve, where the unit of the vertical axis is degree.The green line is the expected value of the heading angle, and the red line is the heading angle calculated by the dual antenna.The amplitude of the course is 0.5 degrees.

Figure 7 .
Figure 7.The curve of UAV's course angle fluctuation under test condition 3. The curve in the graph is the sampling point curve, where the unit of the vertical coordinate is degree.The green line is the expected value of the heading angle, and the red line is the heading angle calculated by the UAV magnetometer, with a fluctuation range of 5.7 degrees.

Figure 8 .
Figure 8.The angle fluctuation curve of the UAV under test condition 4. The curve in the graph is the sampling point curve, where the unit of the vertical coordinate is degree.The green line is the expected value, the red line is the unmanned aerial vehicle dual antenna to calculate the direction angle, the fluctuation amplitude is small, and it is 0.3 degrees.
The coordinates of the origin H of the LLS in the WGS-84 coordinate system are X wgs H , Y wgs H , Z wgs H

Table 1 .
We conducted four experiments in two different experimental conditions to test the dual antenna UAV antimagnetic interference ability.The experimental conditions have been explained in Section 4. The greater the amplitude of fluctuation, the poorer the UAV anti-magnetic-interference ability.