Weak Calibration of a Visible Light Positioning System Based on a Position-Sensitive Detector: Positioning Error Assessment

Reduced deployment and calibration requirements are key for scalable and cost-effective indoor positioning systems. In this work, we propose a low-complexity, weak calibration procedure for an indoor positioning system based on infrastructure lighting and a positioning-sensitive detector. The proposed calibration relies on genetic algorithms to obtain the relevant system parameters in the real positioning environment without a priori information, and requires a low number of simple measurements. The achievable performance of the proposal was assessed by direct comparison with a formal offline calibration method requiring complex dedicated infrastructure and instruments. The comparative error assessment showed that the maximum accuracy reduction compared to the significantly more costly formal calibration was below 25 mm, and the overall absolute positioning error was smaller than 35 mm with orientation errors of around 0.25°. The performance achieved with the proposed weak calibration procedure is sufficient for many indoor positioning applications and largely reduces the cost and complexity of setting up the positioning system in real environments.


Introduction
The problem of indoor localization has been the subject of intense study and research in recent years. So far, successful proposals have been developed to provide solutions for specific applications, with varying degrees of accuracy and complexity. However, universal implementation of global positioning systems for outdoor areas is still far from being achieved. The ultimate objective is to combine indoor and outdoor positioning systems. The challenge is to be able to provide an end user with a continuous and transparent navigation solution, regardless of whether one has outdoor coverage or is in an indoor environment. Knowing the user's position can be of great added value; it can expand the capabilities of multiple applications, especially for activities in indoor environments. In indoor positioning, where the environment is complex (walls, objects, etc.), no technology prevails as global navigation satellite systems (GNSS) do in outdoor positioning systems. Sometimes the target environment restricts the design to a particular indoor positioning system (IPS) technology, directly related to accuracy, range, or scalability [1][2][3][4][5]. Indoor positioning data shall enable numerous relevant applications, such as pedestrian tracking [6]; location-based services [7,8] in public and commercial centers [9]; assistance services in daily activities (ambient assistant living (AAL)) [10]; location and tracking of users in geriatric and hospital centers [11,12]; location and tracking of emergency intervention agents (e.g., police/firefighters) [13][14][15]; location and guidance of autonomous vehicles in industrial environments and automated car parks [16,17]; tracking of high value goods a checkerboard and from the corners of the different squares to obtain the distortions of the system.
We focused our research on PSD-based VLP, and since for PSDs it is necessary to attach lenses to obtain the AoA, calibration had to be performed as well. In [49] a calibration process based on Zhang's work [48] but adapted for PSDs was presented. In this case, checkerboards were no longer used, since the PSD did not form an image; instead, a template was used with multiple led emitters placed at known points on a surface, similarly to placing them on the corners of checkerboard squares. It was shown that this calibration method obtains quite good results, but it has some drawbacks, many of them inherited from camera calibration systems. First of all, let us remark that it is a long and laborious process. The calibration template has to be placed in multiple positions at different angles, covering most of the PSD's range. Since there must be many LEDs, in our case 16, and to avoid possible interference, each one of them emits the light sequentially, to acquire a single "image" it is necessary to spend approximately 2 min. Another problem can be found when placing and soldering the LED emitters, as this manufacturing process will always produce small errors. Usually, this error is greater than the error made by a printer when printing a checkerboard. For this reason, it will be necessary to take more "images" to reduce this error as much as possible. Another very important aspect is that once the calibration has been carried out, any small maladjustment, for example, in the handling or in the final installation, means that the calibration process will have to be repeated again.
To simplify the process, in this paper we propose a weak calibration method.
The paper is organized as follows: First an overview of previous research underlying this work is provided in Section 2. In Section 3, the proposal of weak calibration using the genetic algorithm is described. Section 4 describes the setup of the experimental evaluation and the computation of system parameters. In addition, the results are compared with those of a formal calibration, and the dependence of the results on the points chosen is studied. Finally, conclusions are summarized in Section 5.

Background
In this section we present some recent research on the VLP topic related to this work, both from our research group and others.
In previous works carried out by our research group, the influence of the multipath effect on IPSs based on optical signals has been analyzed. In [44] a light reflection model was developed to characterize how light will be reflected by different materials. Thanks to this reflection model, an algorithm was developed [43] which, given a certain environment, allows one to obtain the signal that would be received by the receivers of the positioning system. With this algorithm, in [42] it was demonstrated that the AoA measurement technique is more immune to the multipath effect than the PoA technique. AoA-based systems are affected by different electronic component tolerances and drifts. Therefore, an electrical calibration method was developed in [50] to compensate for these effects.
In [51], it is shown how the frequency division multiple access (FDMA) technique is the most suitable for IPSs based on PSDs. FDMA allows one to discriminate between the different emitters of the system with almost no interference, unlike code division multiple access (CDMA), which due to multiple access interference (MAI), causes errors when obtaining the point of impact. In [52] is shown the implementation of an IPS based on PSDs [51] in a microcontroller unit (MCU)-based system-on-chip (SoC) system. In [52] it is demonstrated that it is possible to integrate into an MCU both the hardware and software requirement for signal acquisition and processing, for an IPS detector.
Recent research by other groups is presented below.
In [53], the actual communication characteristics of a VLP system that uses a QADA receiver are studied. The authors calculated the signal-to-noise ratio and bit-error-rates for a range of scenarios, proving that communication will not be a limiting factor when using QADA in VLP systems.
In [54] is presented an autonomous method of collecting data for VLP, and a comprehensive investigation of VLP using a large set of experimental data is presented. RSS data were collected using a method that utilizes consumer grade virtual reality (VR) tracking for accurate ground truth recording. The quality and volume of the data allow for robust study of machine learning (ML)-and channel model-based positioning utilizing visible light.
A sensor utilizing low-range infrared (IR) signals in the line-of-sight (LOS) context, providing high precision AoA estimation, is presented in [46]. The proposed sensor was used as a pragmatic solution to the localization problem that avoids NLOS propagation issues by exploiting the powerful concept of the wireless sensor network (WSN). The evaluation outcomes reached centimeter-level accuracy.
In [55] a three-dimensional VLP algorithm using the Cayley-Menger determinant (CMD) with a cost function was proposed, and it was experimentally tested to track a drone for industrial applications. The proposed algorithm uses optical RSS for estimating the drone's 3D position without prior knowledge of its height.
Ref. [56] proposed an artificial neural network (ANN)-based approach for accurate modeling and positioning with on-site data. Likewise, the proposed approach was proven applicable to accurate modeling of initial time delay distributions of LED chips in VLP systems based on phase differences of arrival (PDOA). To improve the robustness by mitigating the impact of intensity variations, they introduced a selection strategy utilizing both PDOA and RSS measurements.
In [57], a fast and high-accuracy single-LED based VLP system was proposed. Firstly, an unbalanced single-LED VLP algorithm was proposed to increase the positioning accuracy and reduce the computational complexity. Secondly, a fast beacon searching algorithm was proposed to further reduce the processing time for each captured image.
A new optical signal modulation technique suitable for intensity-modulation/directdetection (IM/DD)-based VLP systems was developed in [58]. The comparative simulations reported that the proposed scheme improved the signal-to-noise ratio (SNR) by more than 4.6 dB, reduced the channel error by 3.5 times or more, and reduced the peak-to-average power ratio (PAPR) by more than 6 dB, excluding time division multiple access (TDMA).
According with the introduction and considering the background of the existing research on the topic, the work presented here focuses the research on VLP systems based on PSDs. This work is based on the work shown in [47]. In that work, several proposals were made for LPS based on optical signals from PSDs as a function of the number of emitters within the field of view of the emitter. Experimental tests were performed in a real environment. Total stations (TS) were used to obtain accurate ground truth. The accuracy and precision of the each proposal were evaluated. To obtain these results, a formal geometric calibration had to be performed beforehand, as shown in [49]. This calibration requires taking different images of a very precise template, at different positions and angles. With the information retrieved from several images (usually more than 10), the parameters of the PSD + lens system, such as focal length, optical center, and radial and tangential distortion parameters, can be obtained. It is a long and laborious process. Besides, any small movement of the lens, for example, moving it from the calibration bench to its position on the mobile agent, modifies the parameters, and it is necessary to do the process again.
This paper proposes a weak calibration procedure to obtain some parameters of the PSD + lens system that allow one to obtain the positioning in an accurate way. A comparison between the positioning results obtained with the proposed model and formal calibration is presented. An experimental evaluation in a real environment is provided to show the benefits of the proposed method.
The main contributions of this work are: • The calibration proposal is a quick method of calibration compared to formal calibration. System parameters can be obtained with only six measurements.
• Calibration is performed in the actual environment, so no complex infrastructure is required for receiver calibration. • The absolute positioning error obtained using the proposed calibration is below 35 mm, so the accuracy achieved is higher than what is achievable for most other existing IPS alternatives. • Highly qualified experts are not needed to calibrate the modules and put them into operation almost immediately.

Identification of IPS Parameters Using Genetic Algorithms
To position a mobile agent in a plane, when using AoA in a PSD-based positioning system, it is necessary to receive the signal from at least two emitters. The computation requires one to know the height of the motion plane to obtain the rotation of the mobile agent. It is also possible to obtain the position from the signal of only one emitter if the rotation of the agent is already known by means of external methods or sensors. In [47], the positioning proposals using 1, 2, and 3 or more emitters are shown in detail. This last case allows one to obtain the total pose, i.e., 3D coordinates and three angles that define its orientation.
Focusing in the positioning using one or two emitters, one or more of the following conditions may occur in real environments: • The normal vector of the PSD surface is not parallel to the normal vector of the motion plane. This is usually due to errors in the placement of the sensor holder. An example is shown in Figure 1 showing the relative situation between the motion plane and the sensor plane. This difference in orientation can be defined with the Euler angles. From these angles, we obtain the R matrix of rotation between one plane and the other. • The parameters focal length f and center of projection of the PSD + lens (C x , C y ) are unknown, along with the radial and tangential distortion parameters. These parameters are those that would be obtained with a formal calibration and are essential to be able to position by triangulation with AoA measurements. • The emitter position is not known with sufficient accuracy within the environment (X e , Y e , Z e ). When placing emitters on the ceiling, the required accurate measurement tools are not always available to obtain precise positioning values. Since it is not always possible to know all the parameters of a system with the required precision, our aim is to propose a weak calibration process that allows, with few measurements from the real scenario, obtaining the parameters needed calculate the position of the PSD accurately. It is worth noting that the more system parameters one knows, the fewer there are to estimate, and the better the results can be expected to be.
The steps proposed for the calibration process are listed below. Figure 2 helps with following the process.

•
Choose a reference origin for the coordinate system of the environment.
• Place the mobile agents with the PSDs at different known positions in the environment along the motion plane, maintaining Z = Z r . Each position is defined as (X n r , Y n r , Z n r ), where n is the receiver position number out of a total of N distinct positions. • Obtain, for each position, the incident point on the PSD surface, (x jn , y jn ) from one or more emitters J, where n defines the position of the receiver and j defines the incident point of the jth emitter. • Obtain the system parameters that minimize the reprojection error by means of an optimization and fitting process, such as a genetic algorithm. In this work, the genetic algorithm (GA) [59][60][61] is used because it presents some advantages over other optimization techniques, including the following: • GAs are less likely to converge on local maxima or minima. • They are simple to implement, since the only information needed is the objective function and the corresponding constraints. • GAs can be implemented in distributed or parallel implementations. • Genetic algorithms are appropriate for optimizing non-differentiable functions or functions profuse with local minima, since GAs are global search methods that do not employ gradient information.
Next, we summarize how the genetic algorithm works, as related in [62]. It replaces the current population with offspring to form the next generation.
• The algorithm stops when one of the stopping criteria is met. Figure 3 shows the inputs and outputs of the genetic algorithm. The inputs of the genetic algorithm are the PSD surface incident points (x jn , y jn ) and the corresponding 3D positions of the PSD in the environment with respect to the chosen coordinate origin (X n r , Y n r , Z n r ). The output data of the genetic algorithm are the parameter values: position of the jth emitter in the environment (X j e , Y j e , Z j e ), misalignment angles of the PSD system with respect to the plane of movement (α, β, γ), the intrinsic parameters ( f , C x , C y ), and the lens distortion parameter (k). The variable to be minimized with the genetic algorithms is the average distance error between the measured impact points and the projections of the impact points obtained analytically with the parameters of the system to be optimized.
To obtain the distance error value, we start from the pinhole model, whose expression is shown in (1).
where the rotation matrix R is obtained from the angles α, β, θ. (x jn , y jn ) is the projection of the jth emitter onto the sensor surface of the nth receiver position, calculated with the parameters to be optimized (X j e , Y j e , Z j e ), α, β, γ, f , C x , C y . Therefore, (x jn , y jn ) is the point of impact in the absence of distortion.
Additionally, it is necessary to correct the distortion of the measured impact points (x jn , y jn ). In general there are two types of distortion, radial and tangential distortion. We have considered only the radial distortion, since the tangential distortion will be corrected to some extent by estimating the misalignment of the normal vectors for the sensing plane and the motion plane. It must be taken into account that this weak calibration is computed with a few number of incidence points, so that increasing the number of parameters to be optimized in excess could lead the algorithm to converge to a non-optimal solution. The radial distortion is modeled according to: where r jn is the Euclidean distance between the measured point of impact (x jn , y jn ) and k i=1,...,m are the m parameters that model the lens radial distortion. Distortion is corrected according to (4) and (5), thereby obtaining the coordinates of the corrected impact point (x jn , y jn ).
y jn = y jn − d jn y As already mentioned, the goal is to obtain the values of the parameters that minimize the error value obtained as the sum of the Euclidean distances between the coordinates of the reprojection x jn i , y jn i and the coordinates measured after correction of the distortion x jn , y jn , according to: Depending on the number of unknown parameters, it will be necessary to take more or less points for the calibration process. The points should be taken so as to cover most of the field of view of the receiver. If the distortion is large, and the distortion parameters are not known, the number of points needed for calibration will be high.
In general, there will be an approximate knowledge of the value of the output parameters of the genetic algorithm, which allows one to restrict the range of values it can take, and therefore, to ensure that an optimal solution with values close to the real values of the parameters will be obtained. For example, it is possible to produce an approximation of the 3D coordinates of the emitters, measuring them with a certain amount of error; the focal length, obtained from the lens datasheet; or for example, to consider that the plane of the ceiling (emitters) and the plane of the ground (receiver) are going to be coplanar with errors of only a few degrees.

Results
This section shows the results obtained when the proposed calibration process is applied. The results and the comparison with the formal calibration considering that the sensor receives the signal from two emitters are shown.

Experimental Setup
The setup is described in detail in [47]. Figure 4 shows a picture of the test environment. As a summary, the main features are listed below: • The emitters were located on the ceiling. There were four emitters, depending on the tests to be performed, the signals from two different emitters were processed. The identifier and the modulation frequency of each emitter are shown in Table 1.

•
The receiver was placed at different points on the floor. • Two total stations were used to obtain, with sub-millimeter precision, the ground-truth positioning of the receiver and its rotation.

System Parameters Computation
To perform the calibration, the receiver was placed in a total of six positions in the coverage area of the two emitters. In this case, in each position the signal impact points of emitters 2 and 4 were obtained. The receiver positions used to obtain the parameters are shown in Figure 6. The points were chosen to try to cover as much of the area as possible (in the corners) and by placing some points near the center. A total of six points was chosen as a trade-off between using minimal points to calibrate (faster calibration process) and obtaining an acceptable solution. The number of parameters to obtain was 13 (six coordinates of the two emitters, plus the three Euler angles, plus the three intrinsic parameters and the distortion parameter). Using six receiver positions, we got 12 values of (x i ) and 12 (y i ) (using two emitters there are two times more impact points than receiver positions), so we used 24 equations to obtain 13 parameters. To know the receiver positions used in the calibration, the ground truth data obtained by the total stations were used. To emulate a real measurement in a real environment where total stations are not available, a Gaussian random error with a standard deviation of 5 mm (value obtained experimentally after several measurements by usual measuring instruments compared to the total station) was added to these positions.
It was also mandated that the receiver always moved in the same plane. To calibrate, it is necessary to know the rotation of the receiver at each point, and when measuring in a real environment there can always be small errors when positioning the receiver. For this reason, in the calibration process we fixed the rotation, with a value of −90 • , when, in fact, the angles measured by the TS vary from −88 • to −92 • (which means that we had errors of ±2 • in the measurements that the calibration method must tolerate).
To consider that possibly the PSD is not coplanar with the plane of movement (Figure 1), the calibration process had to obtain the Euler angles α, β, and γ to correct those possible orientation errors, which were fixed in all positions. The range of values that these angles can take was limited to ±2 • , since we estimated that this would be the maximum error that we would have between the two planes.
The calibration procedure provides the coordinates of the emitters. A range of possible values has been set for the emitter coordinates with respect to those measured with the total station of ±2 cm. This value was chosen because after performing some manual measurements and comparing them with the real values, the maximum error obtained when measuring the emitter coordinates manually was ±2 cm. This value is higher than the one established in the receiver coordinates, as manual measurement of the ceiling increases the errors. The calibration process was set up so that the z coordinates of the emitters were the same.
Finally, the calibration returned the parameters of the system PSD + lens, such as focal length f , optical center C x and C y , and radial distortion parameter k.
In summary, the input and output values of the calibration method for this specific case were: • The inputs: The range of values that the Euler angles could take was limited to ±2 • . • The outputs: -Coordinates of the two emitters.

-
The Euler angles of the sensor rotation with respect to the plane. -Parameters of the system PSD + lens, f , C x , and C y ; and radial distortion parameter k.
To clarify the coordinates of the emitters, in despite of being an output of the genetic algorithm, it was necessary to introduce their approximate coordinates measured with usual measuring instruments beforehand, hence the error ±2 cm.
In this case, the function ga of Matlab that finds the minimum of a function using the genetic algorithm [63,64] was used to obtain the values of the system parameters.
The values of the outputs obtained from the genetic algorithm, although not shown because they are results of an abstract model, were those used to obtain the positioning of the receiver.

Comparison with Formal Calibration
Once the parameters were obtained from the genetic algorithm, with the incidence points from the two emitters, the positions of the sensors were calculated. We proceeded in a similar way to [47] in order to compare our method with formal calibration.
When receiving signals from two emitters, it is possible to know the angles and heights along the plane of the emitters and the plane of movement of the receiver. If these heights are obtained externally with high accuracy, or as in this case, we know them because we have performed the calibration, the positioning results can be improved with respect to cases where the height is calculated in the positioning process. Therefore, both cases will be analyzed: when the height is calculated and when the height is known.
Besides, it should be noted that in this section we focus on the accuracy of the position measurement, i.e., only taking into account systematic errors. For this purpose, a high integration time has been used in order to reduce random errors as much as possible. The integration time was configured at 15 s, as it was experimentally demonstrated to provide sufficient absorption of random variations. The study of the accuracy due to random errors was performed in [47]. Since errors due to miscalibration affect only to the measurement accuracy, there is no point in analyzing the precision in this work. Figure 7 shows the calculated positions and the true positions along with the cumulative distribution function (CDF) of the positioning error, measured as the Euclidean distance between the actual point and the calculated point.  It can be seen how the errors increase slightly as the receiver moves away from the emitter positions. This effect may be due to the calibration process, which only considers one distortion parameter: the further the receiver moves away from the emitters, the less distortion is well-corrected.
As we used four emitters ( Figure 5), there were different alternatives to choosing two pairs of emitters. In this work, besides this first case considering one emitter in the center and one in the corner, the same procedure was performed with a different configuration-two emitters placed in the corners. With these two cases we cover practically all the possibilities, since due to the symmetry of the setup, the results of other possible configurations would be similar.  Table 2 shows the mean, standard deviation, and maximum values of the positioning errors of both case studies. Table 3 shows the same values for a formal calibration obtained by following the procedure given in [47]. It can be seen that the position errors in both cases are low and not very different from those obtained by formal calibration procedure. Mean errors are about 6-13 mm higher when using the genetic algorithms calibration procedure.
The accuracy measurement results for the rotation angle are shown similarly to in [47]. To obtain the values, the receiver was located under emitter 2 and was rotated by a total of 34 degrees.
The mean, standard deviation, and maximum error in the determination of the rotation angles are detailed in Table 4. Figure 9 shows the calculated rotation angles and the true rotation angles along with the cumulative distribution function (CDF) of the rotation angle error. As can be seen, the error in the measurement of the rotation was below 0.5 • in 80% of cases, with an average value of 0.241 • . Errors are also shown for formal calibration was performed. It can be seen that when using the weak calibration, the errors increased slightly; even so the average error was under 0.25 • .
Up to this point, the results shown have been those obtained after a single run. Since a random error was introduced in the receiver position, the results are particular to that particular execution. To avoid this situation, the results shown are for 100 runs. Table 5 shows the average and SD values for the 100 runs with the average positioning error of the 44 receiver positions for the two combinations of emitters, for calculated or known height. Similarly, in Table 6  It can be seen how the results shown are higher than those shown in the Table 2, because the calibration was performed with lower error values (random errors). Even so, the average errors were below 33 mm when the height was calculated and below 16 mm when the height was known. It can be seen that even when emulating a very bad receiver position measurement, case 3, the errors were below 45 mm and below 24 mm for calculated and known height, respectively.

Dependence of the Results on the Points Chosen
The choices of positions for receivers will impact the final results of a calibration. It can be seen that our results are good, with an average error of less than 45 mm in the worst case, using only six receiver positions. It should be noted that equally or more importantly than the number of points used is the positions of those points. In general, the following recommendations should be followed to obtain optimal results: • Choose the points distributed over the coverage area of the emitters. • Do not choose points very close to the boundary of coverage for any of the emitters, since at those points the distortion of both the lens and the PSD itself makes those measurements have greater error than the rest.
To test the influence of the choice of the points, several combinations of six emitters have been analyzed, while always following the discovered criteria. The results were analyzed for case 1 without knowing the height, and the results were practically the same, with differences of less than 10% compared to those obtained in the Tables 5 and 6.
Another factor that can influence the calibration result is the number of points chosen. As a general rule, the more points chosen, provided they are chosen appropriately, the better the results. A test was carried out in which nine points were chosen, evenly distributed in three rows and three columns out of the 44 available. In this test, case 1 was analyzed a total of 100 times, obtaining the values shown in Table 7. The mean and SD values of the mean errors of the total of the 100 emulations performed are shown.  Tables 5 and 6 with the results of Table 7, it can be observed that as the number of points used in the calibration increased, the results improved. Specifically, there was a 5 mm improvement in the mean error.
The choice of the number of points to perform the calibration is a trade-off: the more points used, the better results can be expected to be, but the time to acquire the signals will also increase. Additionally, note that depending on the system configuration, there will be a point at which increasing the number of points in the calibration does not appreciably improve the results.
In this work, we have mostly shown the results when using six points, as we considered that it is a good trade-off solution since similar results to the formal calibration were obtained using a fraction of the time and resources.

Conclusions
A weak calibration method has been developed to improve the position and orientation accuracy of an indoor positioning system based on a PSD performing AoA measurements from modulated infrastructure lighting. The proposed calibration relies on genetic algorithms to estimate the calibration constants without a priori knowledge of the system parameters and requires only six measurement points within the positioning environment.
The positioning errors using the proposed calibration process are not significantly degraded (below 2 cm) when compared to those obtained from a far more complex and costly formal calibration. The main specific contributions and features of the proposed weak calibration are:

•
The parameters required for correcting the lens distortion with sufficient accuracy can be obtained using only observations on six different positions. This prevents the need for a long and complex formal calibration process that is normally carried out in a measurement bench, thereby increasing the risk of misalignments during deployment.
Conversely, the simplified model is unable to account for large lens distortions when the emitters are significantly far away from the sensor. • Small misalignments in the orientation of the PSD with respect to the plane of motion are automatically accounted for. • The proposed procedure is robust against inaccuracies in the ground-truth data, yielding relatively low global positioning errors despite small but non-negligible errors in the reference positions. • The calibration procedure enables positioning with only approximated information about the position of the emitters.
The evaluation of the positioning system's performance using the proposed weak calibration took place by comparison with the results obtained for the same system following an established calibration procedure. The degradation of accuracy was reasonably minor and largely compensated for by the reduction of calibration complexity and cost. The performance is sufficient for a wide range of indoor positioning applications whose overall cost and scalability should be enhanced by the simplified calibration method proposed herein.