1 Introduction
Light emitting diodes (LEDs), known for their illumination efficiency, ecofriendliness, and durability (lifetime) (ledsurvey), are semiconductors that can be simply modulated and used in communication systems (Pau201744). Visible light communication (VLC) using white LEDs is also increasingly popular since they can operate as lighting and communications systems simultaneously (vlcsurvey; biagiextra; mangoldextra; zhangextra). Such communication is also carried out in the licensefree spectrum and produces no electromagnetic interference. Besides, VLC can be adopted in particularly sensitive areas (lampeextra), such as airplanes and hospitals. Not surprisingly, LEDbased VLCs have been proposed for sensing networks (vlcsensing), illumination (vlcillumination), intelligent transportation systems (vlcits), broadcasting (vlcbroadcasting), and many other applications.
A trend in recent years is to ensure indoor location systems including selfsufficient robot management (robotlocalization; Prorok20113241), position identification (positionrevognition), and locationbased services (locationservices; jisis177302; jisis166404). For instance, there are several localization and positioning systems proposed in the literature, such as those based on GPS (indoorgps), RFID (indoorrfid), infrared (indoorinfrared), ultrasound (indoorultrasound), WLAN (indoorwlan), Bluetooth (indoorbluetooth) and other approaches (indoorsurvey). However, GPS may not be fitforpurpose in indoor situations due to multipath fading (e.g., caused by objects and surfaces) and power attenuation. Indoor positioning systems based on RFID, ultrasound, WLAN, infrared, and Bluetooth also have several constraints, such as electromagnetic interference, requiring the installation of new infrastructures (jowua178303), low certainty, relatively slow responses, and low security. Multipath propagation issues also affect these systems; thus, it is particularly challenging to ascertain the direction or the distance of the transmitter from the obtained signal. Hence, the development of innovative strategies based on existing networks is of high importance.
One particular solution is to design indoor positioning systems based on VLC (vlcsurvey; Yi2015436), using the light released by LEDs (xuextra). LEDbased positioning approaches are usually economical, easytouse, and can be integrated into indoor localization systems. Existing VLCbased indoor positioning approaches are briefly summarized as follow:

Scene Analysis and Proximity
(fingerprinting): Fingerprinting can be applied to the VLC, i.e., the gathering of necessary information, followed by the second measurement before a realtime comparison. This technique is simple and does not require complicated processing. However, it requires a large amount of relevant information to be collected. If such information is not available, then it would lead to inaccurate estimates. This approach has been applied in visiblelight beacons indoor positioning
vlclocfingerprint, where a correlationbased technique is employed to decompose light signals and to obtain fingerprints. Subsequently, the authors used a localization framework to improve the precision. A comparison is carried out with other localization systems and the findings suggested that the authors’ proposed (fingerprintingbased) solution does not always allow achieve the best performance. 
Time Difference of Arrival (TDOA): Each LED uses a specific frequency, and by applying appropriate bandpass filters at the receiver, it is possible to detect each of them. The TDOA method is based on the same principle of the Time of Arrival (TOA) approach (Wang20133302). In the latter, the time required for a signal to arrive from a transmitter to a receiver is measured, and its distance is then calculated. Unlike TOA (that computes the propagation delay between the receiver and each transmitter), TDOA exploits the difference in propagation time between them to estimate the distance between the transmitters (whose coordinates are already known). In this case, it is necessary that only the transmitters have to be synchronized and not the receivers. A TDOA approach was proposed in vlcloctdoa1 to estimate the target position by using LED ceiling lamps. The authors explained that their system can potentially be used for future indoor positioning in environments with ceiling composed of LEDs light. In a later work, vlcloctdoa2 improved the approach presented in vlcloctdoa1 incorporating measurement uncertainty generated by Additive White Gaussian Noise to achieve better accuracies. While TDOA method may be an appropriate solution in some contexts, it is not an optimal choice for economic LED positioning. Other approaches based on Phase Difference of Arrival (PDOA) (locpdoa) can also be used for VLC positioning, but they also suffer from the same limitations.

Angle of Arrival (AOA): AOA is defined as the angle between the propagation path of a wave (with its incidence) and a direction of reference, which is identified as orientation. This approach has been applied in vlclocaoa; littleextra, where the authors in both works introduced new efficient and lowcomplexity solutions, by using VLC, for the localization of devices in indoor environments. Both findings suggested that a localization with a precision of the order of a meter could be achieved.

Image positioning: These techniques usually employ image sensors to capture images of LEDs (Huynh2016). Then, the position of the image sensor is estimated considering the correlation between the 3D coordinates of LEDs (that are known) and the 2D coordinates of LEDs in the obtained image(s) (vlclocimage1; vlclocimage2).

Received Signal Strength (RSS): The distance is estimated from the information on the pulses received from the various transmitters (Jung201363). A method based on RSS measures was proposed by vlclocrssbiagi. In this method, each LED has its carrier to reduce interference between the LEDs, while the receiver determines the distance by measuring the RSS of the LED light and, finally, estimates the position. In vlclocrss1, the authors also presented an indoor positioning method that employs a single LED array and many tilted optical receivers. Threedimensional positioning is achieved by managing the RSS. Another indoor localization system, by utilizing VLC, for mobile robots was proposed by vlclocrss2. In this case, the positioning is obtained by employing a multifrequency method with the RSS to estimate the distance between a robot and each LED. Findings appear to be promising. Thus, RSSbased approaches can be a viable support for indoor positioning and localization based on VLC.
In this paper, an innovative fuzzybased localization system by using VLC is presented. Specifically, the proposed approach extends the concept of trilateration without the need to solve several equations required for determining the location of a receiver. A fuzzybased solution is chosen, since it has been demonstrated in the literature to be a viable approach for indoor localization (vlclocimage2; Jung201363; vlclocrssbiagi). Furthermore, the application of Fuzzy Logic Controllers (FLCs) facilitates the development of control procedures with multicriteria. Fuzzy logic is also capable of performing realtime choices, while traditional control systems often rely on an exact description of the controlled environment that is not usually available. Considering that fuzzy logic methods can efficiently manage the linguistic rules, they can be attractive for a diverse range of applications such as indoor localization. At the time of this research, there is no solution in the literature where a VLCbased indoor localization system is supported using fuzzy logic controllers. This is the focus of this paper.
In the proposed VLCbased indoor localization system, the environment map is discretized in a reference grid; subsequently, a fuzzybased approach is applied for anchor weighting and, finally, these weights are summed. We adopt the Particle Swarm Optimization (PSO) to achieve the best parameters and values of the fuzzybased system. In particular, PSO is used to optimize the membership functions of the Fuzzy Logic Controller, by adjusting their range. PSO, an evolutionary computation method
(pso), is recognized as a valid heuristic technique for optimization problems in multidimensional and continuous research spaces. It has also been shown that the PSO technique can be used to achieve highquality solutions while minimizing the computational load
(psofuzzy1; psofuzzy2; psofuzzy3; psofuzzy4; psofuzzypau), unlike stochastic methods such as the genetic algorithms. Although PSO has been used in FLCs optimization, we are not aware of any existing work using PSO in a VLCbased indoor localization system.
2 The Proposed Solution
The proposed system is defined by the architecture represented in Figure 1, and consists of two phases, namely: offline training and online localization, where a fuzzy inference system is employed. In the proposed system, triangular membership functions are chosen for the parameters in the fuzzy inference system. Let be the general variable. Every membership function can be described by a general triangularshaped mathematical description as follow:
(1) 
where is a lower limit, is upper limit and a value, with (Figure 2). The operation of both stages, depicted in Figure 1, is described in the following subsections.
2.1 Offline Stage
The main aim of the offline stage is to determine the parameters of the RSSIdistance equation, of which a simplified version, taking into account irradiance angles of the light sources and the incident angles, is the following (rssieq; rssirefref):
(2) 
where the is estimated in power ratio while is the distance (in meters) between the receiver node and the beacon. Obviously, as in all RSSIbased approaches, even the one proposed in this paper assumes that the communication is in LOS (Line of Sight). It is required to obtain the values of and parameters. To this end, the least squares technique is taken into account in this paper. The map of the environment is arranged into square cells with a side equal to . A specific value is assigned to every single cell, and its initialization value is . In the proposed solution, for each cell (,), the range (,) between the center of the cell and the anchor , whose positions are known, is estimated.
Besides, the goal of the offline stage is to ascertain a (pre)weighting parameter, closely related to modeling and estimating of accuracy, faulty localization, and reliability of each anchor employed in the map of the environment. In fact, this cumulative reliability index is obtained as the output of a Fuzzy Logic Controller (FLC). On the contrary, the input parameters are and , which are organized in 3 fuzzy sets with triangular membership functions. They represent the various levels of correlation between each parameter and its theoretical value. It is necessary to note that this typical value is determined by measuring the median of each earned value of and . The membership functions of and are pictured in Figure 3, where the membership is outlined by normalized values []. Furthermore, considering the equation 1, the different values of the variables are shown in Table 1. The output value of the FLC 1, reported in Table 2, is determined by 9 fuzzy rules and represents the model reliability index, fluctuating from to . For instance, if is Medium and is High then the output value is .
Input Variable  Linguistic term  a  m  b 
Z%  Low  0  0  50 
Medium  0  50  100  
High  50  100  100  
K  Low  0  0  0.5 
Medium  0  0.5  1  
High  0.5  1  1 
K  
Low  Medium  High  
Z%  Low  0.03  0.06  0.15 
Medium  0.25  0.45  0.75  
High  0.65  0.85  1 
2.2 Online Stage
In the proposed system, when it is necessary to locate an undiscovered node placed at the center of a generic cell in the environment map, the value related to each cell denotes an evaluation of the error that may affect the localization mechanism. The main aim is to obtain an aggregate value for each cell and, in the end, select the cell with the smallest value. To this end, the overall map of errors is realized by subsequent steps, calculated for each anchor node and for every cell:

gathering and filtering: in this first step, the RSSI values obtained by the beacon are computed. It is necessary to note that in the proposed solution just the values less than the 25th percentile (absolute value) are considered due to multiple reflections and multipaths. In fact, the lower values of signals could be received due to larger paths and, as a consequence, they are not important because could lead to a wrong estimation of the true distance. Besides, the threshold of the 25th percentile has been chosen as a heuristic solution because it can represent a worthwhile tradeoff between the number of values to be filtered and the total number of takeovers. As a result, in a general indoor environment, this prefiltering step enhances the precision of the received signal.

estimating of distance: in the second step, the distance between the unknown node and the beacon () is estimated ().

development of error map: in the third step, for each cell, the value is associated with it to develop an error map coupled to the anchor (Figure 4). It is useful to remark that is the Euclidean distance between the center of the cell and the anchor .

weighting: the final step consists in weighting. In fact, the fuzzy reliability index, called , is computed to scale the map. is the output value of the FLC 2, as shown in Figure 1, while its input parameters are the reliability index (measured in the previous phase) and a proximity index determined as follows:
(3) where the value obtained by the anchor node is confronted with the biggest value acquired by the unknown node. The input parameters of the FLC 2 are subdivided into 3 fuzzy sets (with triangular membership functions) and are shown in Figure 5, where the membership is realized by normalized values []. Furthermore, even in this case, considering the equation 1, the different values of the variables are presented in Table 3. Finally, the output of the FLC 2, reported in Table 4, is determined by 9 fuzzy rules and represents the model total reliability index, ranging from to . For instance, if Anchor node reliability is High and Anchor node normalized RSSI is Low then the output value () is .
Now, it is possible to outline the the equation of the map, that is the following:
(4) Regarding the cells, the indexes that decrease at the minimum the error are:
(5) An example of the function is depicted in Figure 6. Finally, the coordinates of the position are provided as follows:
(6) where , i.e. the side of the cell, is a project parameter because it is chosen in the implementation phase.

Linguistic term  a  m  b  


Low  0  0  0.5  
Medium  0  0.5  1  
High  0.5  1  1  

Low  0  0  0.5  
Medium  0  0.5  1  
High  0.5  1  1 
Anchor node normalized RSSI  
Low  Medium  High  

Low  0.001  0.3  0.7  
Medium  0.01  0.4  0.9  
High  0.3  0.6  1 
3 FLC optimization through PSO
Particle Swarm Optimization technique reproduces the actions of crowds of animals to generate the best (or near best) solutions for a function with a specific goal in a constant search domain. PSO consists in a populationbased method where a swarm of particles goes in the research domain. The positions of this swarm of particles designate the applicant solutions of the considered problem. The performance of each particle is strictly related to its position. Its value is determined by a cost function associated with the examined optimization issue. Usually, the opening condition of every single particle is randomly produced. Subsequently, through several iterations, the progress of the particles in the search domain is affected by the present best position, named personal best position. Moreover, it depends further on the present best position of the whole particles, denominated global best position. As a starting point, it is necessary to consider an individual swarm with a size equals to K. Furthermore, this swarm is fully connected in a Ndimensional research domain. It is possible to determine and refresh the position and velocity of every single particle as follows:
(7) 
(8) 
It is necessary to note that and , while and
are the position and velocity vectors of the
kth particle at the tth time step respectively. Moreover, is the individual best position of the kth particle at the tth time step, is the global best position in the entire swarm of particles at the tth time step; and are causal numbers organized in a uniform way in the range . Finally, the last parameters to introduce are w, i.e. the inertia weight, and and , that are the cognitive coefficients. It is useful to highlight that w is employed to achieve a scale of the research domain and performs an essential function in PSO convergence performance. There are various methods of estimating this parameter. However, in most of them, and also in this paper, it can be adjusted to a constant value to decrease the computational load of the algorithm.The velocity of every single particle, as reported in the eq. 7, is adjusted taking into account the inertial component, i.e. its current velocity, the social component, and the cognitive component. All these parameters are strictly related to the personal best and global best position. The Algorithm 1 represents the pseudocode of the Particle Swarm Optimization Algorithm introduced in this work. As it is possible to note, in the initial phase the swarm is analyzed and elaborated, initializing the position and velocity of every single particle randomly. Subsequently, the evaluation of the cost function for each particle is carried out. This procedure is performed to achieve the global best position in the swarm. In the next step of the algorithm, the position and velocity of all the particles of the swarm are updated continuously taking into account not only the equations 7 and 8 but also the cost function, which is evaluated from time to time. A direct consequence of this mechanism is the upgrade of both the personal and the global best position. In the end, the cycle is terminated if the finish rule is fulfilled. The output of the algorithm, i.e. the solution, consists of the global best position at the last iteration.
3.1 Particle Swarm Optimization Algorithm
The architecture of the FLC 1 is depicted in Figure 3. As it is possible to note the inputs of the controller are and , while the output is represented by the model reliability index. On the contrary, in the FLC 2, depicted in Figure 5, the controller inputs are the Anchor node reliability and the Anchor node normalized RSSI, while the output is represented by . In both cases, the number of the membership functions is 3 (i.e. Low, Medium, High) for both inputs and outputs. Consequently, as depicted in Tables 2 and 4, the amount of the fuzzy inference rules is 9. As mentioned above, triangular membership functions are taken into account in the approach introduced in this paper, and the goal is to optimize them through the Particle Swarm Optimization. The membership functions can be expressed as in Figure 7. In this paper, the optimization must be simple and should not involve a large computational load. For this reason, it is defined that the parameters , and , for both inputs and outputs, are fixed. As a consequence, the PSO algorithm has to optimize 18 membership functions parameters. The arrangement of a general particle, for both inputs and outputs, is defined as follows:
(9) 
Examining the Figure 7, it is necessary to specify that in the PSO algorithm introduced in this paper the 6 parameters considered for the optimization of both inputs and outputs need to satisfy not only the following rules but also in the itemized order:
(10) 
In the operation of the PSO algorithm, all the constraints, shown in eq. 10, must be checked in each repetition. Nevertheless, in this paper, the PSO is supported by a proportional method with the aim to decrease the computational cost in such a way to enhance the convergence speed. It is valuable to examine the nth position of the kth particle at the tth iteration to understand the proposed PSO algorithm. The next limitation must be met:
(11) 
where the limitations and have previously been refreshed considering the sequence presented in eq. 10. Furthermore, it is helpful to remark that, if necessary, just one of them can be changed.
The key phases of the PSO algorithm presented in this work are the following:

if the interval does not contain the the position , then the latter is determined proportionally as follows:
if , then(12) else if , then
(13) 
the velocity is refreshed based on the equation 7. It is useful to highlight that, in the context analyzed in this work, the velocity nth of the kth particle at the (t+1)th iteration is the following:
(14) where and are determined ad follows:
(15) (16) 
the position is refreshed based on the equation 8. If the interval interval does not contain the position , at first, the minimum and the maximum values of the velocity are estimated based on the equation 15 and 16, and, subsequently, the position is estimated proportionally as follows:
if , then
(17) else if , then
(18)
3.2 Particle Swarm Optimization Performance
The performance of the suggested Particle Swarm Optimization method is addressed in this section. For the sake of simplicity, only the performance of the PSO related to the FLC 2 is shown. The inputs of the FLC 2 (Figure 1) are the Anchor node reliability and the Anchor node normalized RSSI, while the output is the model total reliability index. This value has been considered as the fitness function. As a consequence, the Particle Swarm Optimization algorithm has been implemented to obtain its maximum value. The Particle Swarm Optimization performance has been analyzed taking into account swarms with different sizes, i.e. . Figure 8 presents the model total reliability index reached by Particle Swarm Optimization method presented in this paper. The values, obtained through simulations carried out with Matlab, have been averaged over executions for iterations. It is beneficial to perceive that, in each simulation, the algorithm has been initialized randomly, the cognitive coefficients have been established to , the value of the inertia weight has been , and the state of iterations has been considered as the the end check. The achieved results show that the performance of the proposed algorithm is enhanced by enlarging the swarm concerning size. In fact, the simulation by using , and achieves the convergence, i.e. the maximum value, after about iterations. However, it is useful to perceive that the PSO algorithm developed with holds a greater speed, regarding the achievement of the convergence (i.e. iterations), compared to smaller sized swarms. In fact, examines in the best way the research domain by treating further particles in every single iteration.
4 Performance Evaluation
A testbed scenario, composed of different LED lamps and an optical receiver, was developed to validate the proposed fuzzybased solution optimized through the PSO algorithm. The lamps used in the testbed had 18 white LEDs to provide illumination of 60 lux. The LED (NBLR3W) has a viewing angle of 30 degrees, and the standard light power is 5.0 cd. The LED lamps used in the testbed scenario were managed by an 8bit microcontroller (ATmega128). The receiver used a lowcost photodiode (SFH213) to estimate the intensity of the light source. The radiant sensitive area of the photodiode is while the half angle is degree. The measures were obtained by persisting seconds in each position, both in offline and online stages (Figure 1), in an environment whose area is . In other words, between and anchor nodes (LED lamps) were used. In each experimental scenario, different and known positions were chosen. Moreover, the performance of the proposed fuzzybased solution was then compared with those of MinMax, Maximum Likelihood and Trilateration.
Several measurements were conducted both to validate the method presented in this paper, i.e. indoor localization through VLC, and, principally, to examine the various solutions of the Particle Swarm Optimization by diversifying the swarm size regarding the number of the particles. As mentioned before, the goal of the PSO method is to optimize both FLCs regarding their membership functions, modifying their range. It is essential to examine the membership functions presented in Figures 3 and 5 to determine the run time of the PSO. These membership functions were statically assigned for both FLCs (Section 2). Using PSO, the results achieved using particles and iterations are shown in Figure 9. In this case, the range of the membership functions was considerably varied compared to those depicted in Figures 3 and 5. Nevertheless, in almost all cases, PSO offers better performance. For simplicity, we presented the range of the membership functions achieved with particles and iterations since these values yielded the best performance.
4.1 Findings
Statistical metrics and the the Cumulative Distribution Function (CDF)
(rssirefref; cdf) of localization error were taken into account when evaluating the performance. The CDF () of a localization error , wheredenotes a probability density function, is defined as follows:
(19) 
In fact, considering the CDF of localization error, it is feasible to determine the localization error at an assigned confidence level (for instance , , ). The performance of three popular methods (i.e. MinMax, Maximum Likelihood, and Trilateration) were also evaluated. We remark the performance on load and computational complexity is not included in this paper since the setting does not influence the algorithmic complexity (computing).
Algorithm  AE  ME  SD 

MinMax  1.94  1.91  1.21 
Maximum Likelihood  2.03  1.97  1.24 
Trilateration  2.28  2.05  1.31 
Fuzzy without PSO  1.88  1.78  0.99 
FuzzyPSO: 5 particles  1.97  2.02  1.23 
FuzzyPSO: 10 particles  1.71  1.65  1.01 
FuzzyPSO: 20 particles  1.44  1.33  0.85 
FuzzyPSO: 40 particles  0.95  0.67  0.57 
FuzzyPSO: 50 particles  0.75  0.43  0.35 
For every record of the obtained data at a target position, the algorithms were applied to determine the position and to compare this value with its real value for error evaluation. The achieved performance of the localization approaches is shown in Table 5
. The proposed fuzzy solution (with and without the PSO) was able to achieve better performance, in comparison to the other three algorithms, in terms of Average Error (AE), Median Error (ME) and Standard Deviation (SD). In detail, the excellent outcomes are obtained by employing the Particle Swarm Optimization considering a swarm with more than
particles. This is because of the use of the triangular membership functions determined by the PSO with particles. We also determined that any more than particles will offer only modest improvement, particularly if more than particles are used.Figure 10 shows the cumulative probability function of the estimation error in the four algorithms. Analyzing the results depicted in Figure 10, it is clear that the proposed fuzzy solution outperformed MinMax, Maximum Likelihood, and Trilateration algorithms. For instance, the estimation error of the fuzzyPSO with particles was less than those of MinMax, Maximum Likelihood, and Trilateration, at both and confidence levels. In fact, the estimation of Error/Meter could be at most equal to meters. This value (i.e. the maximum for fuzzyPSO with particles) is satisfactory in a environment. On the contrary, with particles in the PSO, the worst performance, compared to the use of a greater number of particles, were obtained. However, in all other cases, even without PSO, the performance were always better than those achieved with MinMax, Maximum Likelihood, and Trilateration. It is necessary to highlight that the average error fluctuated based on the number of beacons, as depicted in Figure 11. In fact, there is a clear error reduction when the number of anchors increased from to , and when there is a large beacon density, the improvement is almost negligible. Our findings echoed those in the literature (i.e. an improvement in precision with a major density) (accuracy1; accuracy2).
5 Conclusions
In this paper, a novel solution for the indoor localization, based on the combined use of Fuzzy Logic and Visible Light Communications, was introduced. We demonstrated via a real testbed scenario that the proposed system can achieve optimal FLCs parameters due to the optimization of membership functions. In fact, their range can be adjusted to produce optimal localization reliability. In our approach, we also applied PSO technique.
Future research includes expanding the scope of the evaluation, such as the number of algorithms to be compared against and a broader set of environmental configurations.
Compliance with ethical standards
Conflict of interest All authors declare that they have no conflict of interest.
Ethical standard This article does not contain any studies with human participants or animals performed by any of the authors.
Comments
There are no comments yet.