A Novel Angle Computation and Calibration Algorithm of Bio-Inspired Sky-Light Polarization Navigation Sensor

Navigation plays a vital role in our daily life. As traditional and commonly used navigation technologies, Inertial Navigation System (INS) and Global Navigation Satellite System (GNSS) can provide accurate location information, but suffer from the accumulative error of inertial sensors and cannot be used in a satellite denied environment. The remarkable navigation ability of animals shows that the pattern of the polarization sky can be used for navigation. A bio-inspired POLarization Navigation Sensor (POLNS) is constructed to detect the polarization of skylight. Contrary to the previous approach, we utilize all the outputs of POLNS to compute input polarization angle, based on Least Squares, which provides optimal angle estimation. In addition, a new sensor calibration algorithm is presented, in which the installation angle errors and sensor biases are taken into consideration. Derivation and implementation of our calibration algorithm are discussed in detail. To evaluate the performance of our algorithms, simulation and real data test are done to compare our algorithms with several exiting algorithms. Comparison results indicate that our algorithms are superior to the others and are more feasible and effective in practice.


Introduction
It is vital to know the position, velocity and attitude of an agent in many applications. Inertial Navigation System (INS) and Global Navigation Satellite System (GNSS) are conventional navigation technologies and have been widely used in many fields. INS is able to provide navigation information at a high frequency without receiving external signal, but the precision of INS decreases with time due to the accumulation of inertial sensor biases and noise [1,2]. On the contrary, GNSS can provide accurate location and velocity with bounded errors at a low frequency; however, GNSS cannot be used when the GNSS signal is unreachable or disturbed. Furthermore, the high precision INS and GNSS receivers are always bulky and expensive so they are not suitable for certain applications. What we expected is a new system, able to overcome the shortcomings of conventional navigation systems.
The remarkable navigational abilities of many animals have provided an excellent reference for us. It has been proved that the small brains of insect and animal are able to produce exquisitely efficient, robust navigation in complex environments [3,4]. The desert ants Cataglyphis, for example, are social insects (like all ants), but forage by themselves, and are able to find their way home unfailingly, in a straight line, after foraging hundreds of meters away from their nest [5]. It has been shown that Cataglyhpis get their compass direction mainly from the polarization of the blue sky [6]. Some fly insects, such as bees [7], butterfly, and dragonfly [8], are also able to utilize polarized skylight in their navigation activities. Billions of birds migrate between continents twice each year and return to the same breeding sites year after year with voyages of up to 25,000 km [9]. It is suggested that those migratory birds use skylight polarization patterns to derive an absolute directional system, which is used for calibrating all of their other compasses [10]. The polarization skylight is a natural resource of the Earth, which is caused by the scattering of sunlight in the Earth's atmosphere and is partially linearly polarized [11]. Ideas derived from the studies of insect and animal navigation behaviors have shown that the polarization of skylight can be used as a compass in navigational tasks.
According to the mechanism of processing of polarized-light in the insect, the ommatidia in the compound eyes, and the polarization-sensitive neurons (POL-neurons), are the key organs [12,13]. In each ommatidium, there are two sets of polarization-sensitive photoreceptors, which are tuned to orthogonal e-vectors (the directions of polarization). The POL-neurons receive antagonistic input from two polarization-sensitive channels with orthogonal orientations (Figure 1). This is a crossed-analyzed configuration, which enhances the polarized-light contrast sensitivity and reduces the influence of the fluctuations of light intensity. In addition, it is reported that there are three types of cricket POL-neurons which are sensitive to different e-vector directions, i.e., approximately 10 deg, 60 deg, and 130 deg with respect to the body axis [14].
In order to mimic the principle of animals, researchers have done a great deal of work. Lambrinos [11,13] presented an original polarization compass model and method for extracting compass information. Chu [15][16][17] also constructed a POLarization Navigation Sensor (POLNS) and analyzed the sensor error with numeric simulations. A novel algorithm of the direction angle calculation was presented in [18]. In order to measure polarization information with an image array, studies on the division-of-focal-plane polarimeter have been presented in [19][20][21]. Furthermore, Karman [8] gave a review of bio-inspired, polarized skylight-based navigation sensors. The processing of polarized-light information in the insect nervous system. The two channels in an ommatidium are tuned to orthogonal polarization directions. The e-vector response of the photoreceptor (s1,s2) have a logarithmic intensity characteristic [11]. The POL-neuron response represents a difference between s1 and s2. Studies on the POLNS mainly concentrate on the mechanical construction, the angle computation algorithm, and the sensor calibration. As for the mechanical construction of the POLNS, they have similar designs, inspired by nervous systems of insects, and ours is no exception. There are three channels, called POLarization-Opponent (POL-OP) units, in a POLNS. In terms of the angle computation algorithm, recent studies show different approaches. Lambrinos [13] and Chu [15][16][17] only use two of the three POL-OP units for angle computation. A transform has been utilized in [18] for angle calculation, which uses different pairs of the three POL-OP units, along with the different input polarization angles. In those angle computation algorithms, constant or selective, only two of the three POL-OP units are used, the other one is left useless, which is an unwise choice.
With regards to the sensor calibration algorithms, they have barely been reported. Zhao [22] presented an error compensation algorithms, based on LS-SVM (Least Square Support Vector Machine [23,24]). However, the main shortage of this algorithm is that it only does output angle error compensation according to the input polarization angle, which does not take the real error sources (e.g., the installation angle error and voltage bias) into consideration.
In this paper, we focus on the angle computation algorithm and the sensor calibration of a POLNS. We present a Least Squares based calculation algorithm by employing the outputs of all the POL-OP units, which can also be used for arbitrary installation angle assignment and easily expanded to multiple POL-OP unit design. As for the sensor calibration, a new approach is presented which is able to estimate the installation angles and the biases of the voltage output. Numeric simulation and real data test have been done to evaluate the performance of our angle computation and sensor calibration algorithms. Results comparison shows that, both angle computation and calibration algorithms presented in this paper have higher precision and more robustness than those of the existing algorithms.
The remainder of this paper is organized as follows: the sensor system model and the novel angle computation algorithm are detail in Section 2, followed by our calibration algorithm in Section 3.
Numeric simulation and real data test are presented in Sections 4 and 5, respectively. Finally, the conclusions of this paper are given in Section 6.

Sensor Overview
Our sensor consists of the mechanical construction part and the circuit part. As shown in Figure 2b, there are three POL-OP units, with each POL-OP unit consisting of one pair of wire grid polarizers and one pair of photodiodes. The polarization directions of three POL-OP units are arranged in different angles. If they are ideally arranged, as shown in Figure 2c, they are adjusted by 0 degree, 60 degree, and 120 degree to the reference body axis. As for the two polarizers in a POL-OP unit, the polarization direction of one polarizer was adjusted by 90 degree to that of the other one, which mimics the crossed-analyzer configuration in the POL-area of insect eyes [13]. In reality, the actual installation angle may be different from what we want because of the mechanization processing error and the polarizer installation error. To deal with this problem, a novel angle computation algorithm is presented later in this paper.
Regarding the circuit of the sensor, the signal flowchart is shown in Figure 3. The photodiodes, S1087 [25], allows reliable optical measurements in the visible to near infrared range with a wide dynamic range from a low-light level to a high-light level. In order to deal with the wide range of the current coming from the photodiode, log ratio amplifiers (LOG104, [26]) are utilized, which is also a bio-inspired design [13]. Once the current is converted into voltage, a high resolution Analog Digital Converter (ADC, AD7734, [27]) is employed to transfer the analog signal to digital sequences. The digital sequences are preprocessed in an MCU (Micro Control Unit); and the data are sent to a computer through the serial communication interface of the RS485.

Modeling and Angle Calculation
The output current of photodiode is linear to the light level, which can be modeled as [13,18] where K is an amplification factor related to the photodiode, I is the total intensity max min with max min , I I being the maximum and the minimum intensity, d denotes the polarization degree of the input light, φ is the angle between direction of input polarized light and the reference direction of the sensor, and , i j α is the maximum polarization angle of each polarizer, of which the value maximizes ( ) , i j s φ . The output of each log ratio amplifier can be modeled as [13,18]: The maximum polarization angle of each polarizer , i j α is determined by the mechanical setup, thus, it is also called installation angle. If the polarizers are ideally fixed, as shown in Figure 2c, then we have: The output of each POL-OP unit is the function of the input polarization angle φ and polarization degree d . The aim of the sensor is to compute those two parameters by using the outputs of POLNS outputs, which is the progress of angle computation. According to Equation (2), it is easy to know that there are two unknown parameters and three known equations. Theoretically, the two parameters can be computed by arbitrarily using two of the three equations. In reality, this idea has been used by researchers Lambrinos [13] and Zhao [18]. The difference between them is the choice of the two equations. Lamrinos used a constant two equations, while Zhao used two equations selectively according to the input polarization angle. These algorithms are feasible and can provide accurate angle estimation based on the assumption that the installation angles are known precisely and the measurement noise can be ignored. In practice, the assumption is difficult to be realized. Contrary to the previous algorithms, a new angle computation algorithm is presented for the sake of reducing the influence of the installation angle error and measurement noise, and giving the optimal angle estimation.
We present a transform to Equation (2) as follows: where: , 2 , 1 2 10 cos 2 cos 2 10 sin 2 sin 2 The equation group of Equation (4) can be rewritten as: where: ( ) ( ) 11 12 In order to obtain polarization angle φ and polarization degree d , the vector r is computed first.
As shown in Equations (6) and (7), there are three equations and two unknown variables. In the novel approach, we utilize the Least Squares to estimate the vector r . Then r is computed by: Once r is obtained, the φ and d are computed as follows: In the novel approach, a Least Squares based estimation is presented with the aim of increasing the precision and robustness of the result. In practice, all devices used in the sensor are inevitably polluted by biases and noise. With the utilization of Least Squares estimation, the residual error is minimized, thus, the optimal estimation is obtained. Moreover, this algorithm has several obvious advantages: (1) This algorithm is more anti-noise than the existing solutions, because we use all of the POL-OP units' output and give an optimal estimation while the existing solutions adopt two of the units. (2) The algorithm is not restricted to the fixed installation angle (e.g., 0 degree, 60 degree, and 120 degree), and can be used for an arbitrary installation angle. (3) The algorithm is easily extended to multiple-channel design

Sensor Calibration
In regards to the sensor calibration, the error model of the sensor was analyzed first, and then the nonlinear Least Squares based calibration algorithm was deduced, and finally the implementation of the algorithm was realized.

Error Model
In the sensor measurement model given in Equations (1) and (2), the amplification factor K of each photodiode is assumed as identical; the installation angle , i j α is known precisely, and the output voltage has no bias or noise. However, it is an ideal model and not true in reality. The error model of the sensor is described as follows: n is the measurement noise of ADC, which is modeled as white noise. In this paper, , i j ε is called the installation angle error. What should be noticed is that, because we choose the axis direction of the polarizer 1,1 p as the reference direction (as shown in Figure 2c), then the installation angle error related to this polarizer is zero, which is: As for the voltage error i b , it mainly composes of two parts, in which one is the inconsistent amplification factor , i j K and the other comes from device bias The goal of our calibration algorithm is to determine installation angle errors and voltage biases.

Least Squares Based Calibration Algorithm
The polarization angle φ is computed by using Equations (5)-(9), which is a nonlinear function, provided that there are 1 N + measurements, then, 1 N + polarization angles can be computed as follows: where k denotes the th k measurement, and: where , In this paper, the error value, estimated value and true value of a variable or vector are defined as follows: where a is the true value and , a a δ  are the estimated (or measured) value and error value, respectively. As an exception, the error values of k x and δ x are slightly different, which can be obtained from Equations (12) and (13) 1,2 2,1 2,2 3,1 3,2 1 2 3 0, , , , , , , , It is notable that, though the last three elements of k x are variable depending on the input, δ x is constant and the first element of δ x is zero because of Equation (13).
The Taylor expansion of Equation (15) is written as: where J is the Jacobian. This is a vector containing the first partial derivatives of the function components, which is detailed in the appendix. Based on Equations (17) and (20), we obtain: In the process of calibration, the relative input polarization angles are assumed as known, which is feasible in practice by using a precise rotation table. Thus, what we are able to know exactly about the input polarization light is the relative polarization angle, which is: Combining Equations (20) and (22), we obtain: This equation can be rewritten as: 1,2 2,1 2,2 3,1 3,2 1 2 3 0 , , , , , , , , where ( ) 8 2 : 9 k ∈ J R is the subvector of k J , which consists of the last eight elements of k J .
To estimate the vector P is our objective of sensor calibration. A least square method is fit well with this problem, and P can be calculated as follows: Once we get an estimation of the sensor parameter P , we can compensate the measurement as follows: where ( ) δ x P denotes that δ x is the function of P , which can be obtained by comparing Equations (19) and (26).
To evaluate the performance of the calibration results, two indicators are given. One is to compare the estimated polarization angle with the known input polarization angle, which can be computed by using Equation (27). In other word, the vector Z can be used as the measurement of Least Square and also used for evaluating the results. Another variable is employed to represent the angle error: The other indicator used is to compare the measure voltage and estimated voltage as follows: where: In this paper, the results are examined by using a linear combination of both indicators: where 1 2 , w w are weight factors, which can be arbitrarily set, but in this paper, we set that 1 2 0.5 w w = = . Furthermore, the precision of the matrix H depends on k x  . If the initial estimated x  has large error, the matrix H also has large linearization error, and then the result computed by Equation (28) may be not accurate. In order to reduce the linearization error and improve the estimation precision, an iterative least square [28,29] implementation algorithm is employed, which is detailed in the next section.

Implementation of the Calibration
In this section, the implementation process of iterative least square calibration is presented. What we known are the relative input polarization angle k φ Δ and a series of the sensor measurements k i V .
The objective of calibration is to estimate the sensor parameter P as precisely as possible. The implementation steps are shown in Figure 4. e . After iteration, if the indicator is less than the set threshold or the current iterative number is greater than the set maximum one, the loop is stopped and the calibration results are given, otherwise, the iteration loop continues.

Simulation
In order to evaluate the performance and feasibility of our algorithm, a series of numeric simulations have been done before the test on the real data. For the angle computation algorithm, the performances of different algorithms were compared with different sensor error and noise input. Furthermore, to assess the influence of different polarization degrees, another simulation has been done. As for the calibration algorithm, a comparison was also made between the algorithm in this study and the algorithm presented by Zhao.

Angle Output Comparison with Different Algorithms
In order to investigate angle output performance effected by the voltage biases, the installation angle error, and the voltage noise, three different simulation are done with different error combinations, namely the voltage bias error (denoted by "B"), the voltage bias error, and installation angle error (denoted by "B+AE"), and the combination of the three types of error (denoted by "B+AE+N"). In each simulation, the results of three algorithms, namely algorithm presented by Lambranios, algorithm presented by Zhao, and our algorithm, are compared. Assuming that the polarization degree is 0.5, the voltage bias is 5 mV, the installation angle error is 1 degree, and the noise of the voltage output is white noise with the standard variance of 1 mV.
As for different error inputs, the results are shown in Table 1. As can be seen from the table, with the increase of error sources, the accuracies of all the algorithms decrease. Among the three algorithms, the result of our algorithm is much more accurate than those of the others. Particularly, the results with the input error of "B+AE+N" are compared in Figure 5. It is clear that our algorithm outperforms the other two because all of the three POL-OP units were utilized, and an optimal estimation was given based on the Least-Square. This approach is able to restrain the sensor biases and noise effectively and can be easily expanded to multiple POL-OP units. The more POL-OP units are used, the higher accuracy our algorithm will give. The results also show that, in most cases, the algorithms of Zhao are superior to those of Lambranios, however, they have the same results in certain polarization input angles (from 20 degree to 40 degree and from 105 degree to 135 degree, as shown the parts with a yellow background in Figure 5). The results can be easily explained in that Zhao chooses the optimal two POL-OP units of the three while Lambranios choose two of them constantly; when they choose the same two units they have the same results. On the other hand, when they choose different units, Zhao's algorithm shows a better performance. The three algorithms with different polarization degrees are evaluated for the sake of the study on the influence caused by polarization degree. The error source is "B+AE+N" but the polarization degree is different. As shown in Figure 6, the standard deviation of the estimated angle error decreases as the polarization degree increases. The reason is that the amplitude of voltage output has a positive correlation with the polarization degree. For the same error source, the signal to noise ratio also increases as the voltage amplitude increases. Therefore, all the algorithms show a better performance in high polarization degrees. Our algorithm, however, has similar precision, even in low polarization degrees. The simulation results show that our algorithm is more accurate and robust than the others. It is clear that our algorithm shows a better performance than the other two, however, the result still has a sinusoidal trend, which indicates that a calibration is necessary in order to further improve the senor precision.

Calibration Results
In order to test the performance of the iterative Least Squares based calibration algorithm, the algorithm is tested with large initial errors, which is very important in a real calibration process. Taking the installation angle calibration for example, before calibration, an initial value of the angle with bounded error should be given. If our algorithm is able to be convergent for a large initial error, then just an inexact value of the installation angle is needed by using a common protractor. As shown in Table 2, there are eight calibration parameters, the initial installation angle error is four degrees, and the voltage bias are set to 10 mV. Before calibration, the parameters are all assumed as zeros. After the first calibration loop, an estimation of the parameters is obtained which is quite unacceptable, however, an accurate estimation is obtained after five iterations, with the installation angle error being about   To compare the angle estimation precision before calibration and after calibration, the angle estimation with calibrated parameters is recalculated. Firstly, the data that are also used for calibration are applied to compare the calibration performance. The results are shown in Figure 7. Both calibration algorithms have improved the angle computation precision, and have a similar accuracy after calibration. However, when another two groups of numeric data are utilized, which have the same error sources but different polarization degrees, the results of the two calibration methods show differently. As shown in Figure 8, it is obvious that our algorithm has much more precision than Zhao's algorithm at the polarization degrees of 0.4 and 0.8, which enables our algorithm to be more applicable in practice. The reason for this is that Zhao's algorithm only performs curve-fitting for the angle error and compensates for it, which may be useful if the sensor has the same error trait. However, when the error trait changes, the accuracy decreases. On the contrary, in our algorithm, the aim is to find the real error resource and compensate for it, which is independent of the polarization degree and polarization input angle. Thus, our calibration algorithm is superior to Zhao's algorithm.

Experiment Setup
To verify the performance of the novel algorithm of angle computation and sensor calibration in a real system, the algorithms are tested with our bio-inspired polarization navigation sensor. The test system consists of a 24 V Li-Po battery, a precise angle-dividing table, which is able to provide accurate rotating angle discretely with the minimal step of 360/391 degree, a polarization sensor, and a laptop for saving the sensor voltage output. The angle-dividing table rotates horizontally driven by hand with the precision of 0.0001 degree at each step, which is accurate enough for the test. As for the calibration test, to get a standard polarization light source, an integrating sphere is used in [17], however, due to the lack of a sphere, an LCD screen of a tablet PC is utilized to provide the standard polarization light, as shown in Figure 9a. Furthermore, an outdoor test (as shown in Figure 9b) is also done to evaluate the performance of our calibration algorithm.

Results
For calibration, the angle-dividing table is rotated every 10 scales for each step and the table is kept static for about 10 s. The data are recorded at a sample rate of 100 Hz. There are a total of 20 steps with each step being 9.2072 degree. The raw voltage outputs are shown in Figure 10. After recording the data, 10 epochs of each step are randomly selected for calibration. The initial installation angles are obtained from the mechanical CAD design, which are also with the ideal values. The estimated calibration parameters are shown in Table 3. The result shows that the installation angle errors ranged from 0 to 3 degree and the voltage biases are nearly 10 mV. These errors are relatively large so it is very necessary to do the calibration before using the POLNS.  Table 3. Calibration parameter estimation of our real system. The same data are processed with three different angle computation algorithms and two calibration algorithms. The angle computation errors are compared in Figure 11. It is clear to see that the error trait of three angle computation algorithms have the similar trends. The reason is that the input light source has relative high polarization degree, to be exact; it is 0.9 for this calibration. According to the simulation results shown in Figure 6, the three algorithms have fewer differences in the high polarization degree. Even so, our algorithm shows a better performance than the other two. After calibration and error compensation, the results of Zhao's algorithm was more or less the same as ours.
In reality, the polarization degree of skylight is barely able to reach 0.9. The calibrated parameters are used to compensate one experiment done in the outdoor. The results are compared in Figure 12 and the computed polarization degree is shown in Figure 13. The maximum angle error is about 0.5 degree, which is half of the Zhao's algorithm. The result shows that our calibration algorithm is more robust and useful than Zhao's. Furthermore, it can be noticed that both algorithms have a relative large error of numeric simulation, which is because of unstable sky polarization pattern, which may be caused by moving clouds and the movement of the sun during the real data test.

Conclusions
In the work presented here, we have studied two important issues of bio-inspired POLNS: input polarization angle computation and sensor calibration. Regarding the angle computation algorithm, conventional solutions use only two units of the three POL-OP units of the POLNS, in which sensor output information is not fully utilized. Based on Least Squares algorithm and our sensor model, a novel angle computation algorithm is derived, which is more anti-noise than the existing ones, and can be used for an arbitrary mechanical installation angle and is easily extended to multi-unit designs. With regards to sensor calibration, the main error sources of POLNS, installation angle errors and voltage biases, were analyzed first. Then, the calibration algorithm, based on a standard polarization light source and a precise turntable, was deduced. The aim of the calibration algorithm is to estimate the original sensor parameters and biases, which enables the algorithm to perform better than exiting algorithm.
The proposed two algorithms have been applied to several numeric simulations and real data tests. The comparison with existing algorithms shows that our angle computation algorithm has the same level of precision for different polarization degree input, is more accurate and robust than the other algorithms for the same error input, and that our calibration algorithm is more effective and useful in practice. With the results seen herein, simulation and actual test results are consistent with the analysis, which shows the feasibility and superiority of our algorithms.
Then the vector r can be computed by: The following derivatives can also be deduced as: ( )

Conflicts of Interest
The authors declare no conflict of interest.