INTRODUCTION
The underground mine accidents are frequently occurring incidents. These are endangering the life of the staff safety and the economic losses of enterprises seriously. Safe production of mine is paid more and more attention. They have important practical significance that how to improve the safety and realize rapid and efficient management of the mine to avoid the occurrence of accidents and enhance safe management of coal enterprise further. And the coal mine locomotive is an important implement of underground production and transport; realizing the reasonable scheduling of mine locomotive has an important role to reduce the loss of life and property.
At present, the underground positioning technologies are as follows as Han et al. (2013) proposed a weighted centroid localization algorithm based on RSSI for underground coal mine. This algorithm firstly accessed to the path of decline index dynamically and then calculated its own location by weighted centroid algorithm. Meng et al. (2013) proposed a positioning technology of underground moving target based on WiFi and Web GIS. It uses trilateration algorithm to calculate relative coordinate of the target. Chi et al. (2012) introduced a laserbased positioning system. The laser light is reflected back to locomotive using time difference to calculate the distance and achieving positioning. Gao et al. (2012) proposed a locomotive position system in coal mine which is based on the piezoelectric accelerometer, through integrating over the collected acceleration value of the electric locomotive and solving out the speed and position. Fang et al. (2010) introduced a selfpositioning shearer operating at a manless working face. It analyzed an inertial navigation system intended to guide the movement of a shearer and used Kalman filtering algorithm and error compensation model to improve positioning accuracy.
These above mentioned several positioning techniques are able to achieve locomotive location of underground mine, the one which is based on the RSSI is a hot research at the present stage. This technology simply a cost effective and do not need any other hardware except itself (Wan et al., 2012; Narzullaev et al., 2011). Using this feature, nodes can be fully installed in the mine, so as to improve the accuracy of algorithm. Through the above analysis, RSSI is used to achieve locomotive location in this study. The nearest node from the locomotive was find first as reference node and get the receiving signal strength and path loss coefficient values at 1 m in realtime. Because the locomotive runs on the track and the track after lying on the tunnels will not change. So, a coordinate system was established include whole coal mine and determine the equation as a known condition. In this way, the location of locomotive can be determined with 2 distances between locomotive and beacon nodes. Finally, the weighted least squares method is used to estimate coordinates of locomotive.
MATERIALS AND METHODS
Positioning technology of RSSI: RSSI is a positioning technology based on distance, so the distance from unknown node to beacon nodes must be measured before positioning. Positioning technology based on distance also includes: TOA (Time of Arrival), TDOA (Time Difference of Arrival) and AOA (Angle of Arrival) (Zhang et al., 2011; Zhao et al., 2014; Malajner et al., 2012). Compared with these types of positioning technology, the RSSI is relatively simple in data acquisition and only needs to measure the strength of the signal. According to a propagation characteristic of wireless signalpropagation loss, the strength of signal can be measured. Along with the increase of propagation distance signal is attenuated. The typical wireless signal propagation model is shown as Eq. 1 (Blumrosen et al., 2013).
where, PL(d) is the path loss after signal transmit distance d, (PL (d_{0}) is a known reference power value at a reference distance d_{0} from the transmitter, X_{σ} is a Gaussian distribution random variable whose mean value is 0 and standard deviation is σ (generally 410), n is path attenuation factor and always takes 25.
Transmission distance d of the signal can be calculated by Eq. 1.
_{}
where, d_{0} is 1 m in general, so the received signal strength in 1 m is shown as follow:
Similarly, the received signal strength in distance d is:
By Eq. 24, the distance between unknown nodes and beacon nodes can be calculated:
Equation 5 showed that positioning error is effected by RSSI, A and n. Where, A and n are the value of experience, so they must be determine before ranging. The RSSI value which is measured in actual environment has a large error, so we have to amend the RSSI value. After obtain high accuracy distances, the next step is to calculate the coordinates of the unknown node. In plane coordinate system we must need more than 3 distances to calculate the unknown coordinates and in the three dimensional coordinate system need more than 4 distances to calculate. For the convenience of calculation, in this study calculation is completed in a plane coordinate system. The positioning algorithm commonly used trilateration algorithm (Xiong et al., 2010), weighted centroid localization algorithm (Li and Zhang, 2013), the weighted least squares method (Lin et al., 2013) and so on.
Communication model of underground mine railway: When locomotive is operated in underground mine, it is a regular exercise and move along with railways which have been laid. If the equations of railways in the coordinate system are able to determine, it has a great help to compute the position of the locomotive. From the literature (Wei et al., 2014), it is known that length of mine tunnels is generally hundreds of meters or even thousands of meters, the height is 2~4 m and the width is 4~5 m. The branch roads of tunnels are not much and mostly take on straight. So, the track is taken as composition which is composed by several straight lines. The central line of the track is taken as locomotive running track and it is shown in Fig. 1.
Due to the narrow and intricate mine roadway wrong, Fig. 1 represents only several roadway of the mine at a same plane. In the coordinate system, the linear equation can be know, as long as two points of the track are determined. It can be simply expressed as Eq. 6.
_{}

Fig. 1:  Model of the track 

Fig. 2:  Wireless communication model 
In mine tunnel beacon node cannot be lay out anywhere. So, these nodes are arranged on both sides of the track and the nodes at the same side are separated by a distance, as it is shown in Fig. 2.
Figure 2 shows the beacon nodes. When the locomotive runs to this position, it can communicate with the beacon nodes on both sides of the track.
Improved positioning algorithm
Correction of RSSI value: Because the RSSI is affected by the environment and RSSI value will exhibit large fluctuations, when RSSI ranging is used. If these RSSI is used to calculate the distances, it will have larger error compared with the actual distances. So, these RSSI values have to be modified. The RSSI correction models which are commonly used include: Statistical mean model, correction model based on the distance, Gaussian model, etc. (Tao et al., 2012; Zhang et al., 2009). Zhang et al. (2009), took an experiment for correcting RSSI values to compare the function of the three models on an open lawn. The results show that the ranging error is minimum when the Gauss model is used to correct the RSSI value. In this study, the Gauss model is used.
The volatility of RSSI is greatly reduced, when the Gauss model is used to correct the RSSI value. The principle is that when the unknown node receives m RSSI values in the same position from the same beacon node, the RSSI values which are in high probability area are selected. Then take the mean of the selected RSSI values. Eq. 4 and 1 show that RSSI value obeys Gaussian distribution whose mean value is 0 and standard deviation is σ. Its probability density function is shown as Eq. 7:
Where:
The table shows that the probability of RSSI value is 0.6826 in the interval of (μσ μ+σ). This interval is called high probability area and the RSSI value which is existent in this interval is called high probability value. Then take the mean of the high probability values.
where, μ is the number of the high probability RSSI values. Equation 5 is simplified into Eq. 9 after correcting RSSI value:
The Gauss model filters most of the instability RSSI value at actual measurement. But the accuracy of the method will reduce when the number of the RSSI value is small. In order to increase the accuracy, high probability area can be expanded.
Determinate the parameters of A and n: From Eq. 9 it can be seen that the values of the A and n will also affect the positioning accuracy and with the change of the environment, its value will be changed also. Mine environment is bad and the environment of different tunnel is not the same. If the values of A and n without changing, positioning accuracy cannot be satisfied the requirement. So the values of A and n must be determined in realtime. As can be seen from Fig. 2, the environment of locomotive in this position has little difference compared with the environment of beacon nodes which are joining in positioning. So, the values of A and n can be determined from Eq. 5 which RSSI is measured between beacon nodes and the distances are known. In order to make the data more accurate, reference node is selected which is nearest to locomotive. It replaces locomotive and communicates with other beacon nodes. Suppose, the coordinate of reference node is A1 (x_{1}, y_{1}) and the coordinates of other beacon nodes are Ai (x_{i}, y_{i}), i = 2, 3,...,N. It is shown in Fig. 3.

Fig. 3:  Communication model of reference node 
The Eq. 10 is got by Eq. 5:
_{}
where, d_{i, l }are the distances and RSSI_{i, l} are the values of RSSI between beacon nodes A_{i} and A_{1}. More than 2 equations can be got when N≥3. So Eq. 10 can be written Eq. 11:
Where:
The leastsquare solution of Eq. 11 is:
where, Q is the inverse matrix of covariance matrix σ of Gauss noise.
Improved weighted least square method: In a plane suppose the coordinate of locomotive is A(x, y) and the coordinates of beacon nodes A_{i} are (x_{i}, y_{i}), i = 1, 2,...,N. Where, N is the number of beacon nodes and N≥2. There are N equations, when all beacon nodes can communicate with the unknown node, that is:
_{}
where,,
v_{i} is measurement error. Equation 13 is squared
on both sides:
Because the relationship between x and y has been determined before positioning, Eq. 14 do not need linearization and only need to substitute Eq. 6 into Eq. 14.
In Eq. 15, there only have one unknown x and simplify the Eq. 15 the Eq. 16 can be obtained:
Where:
The leastsquare solution of Eq. 11 is:
where, W is the inverse matrix of covariance matrix v of Gauss noise. θ_{2} is substitute into Eq. 6, that is:
So, the coordinate of the locomotive is:
Implementation process of underground mine locomotive positioning algorithm: Through the above analysis, the process of underground mine locomotive positioning algorithm is divided into the following steps:
Step 1: 
After receiving a location command from the host computer, the locomotive uses wireless AP to broadcast positioning information. The beacon nodes which receive location information reply to the linear equation of the track 
Step 2: 
Judging whether the track linear equation of each beacon node that locates to is the same. If they are different, it wait for a moment time and resume step 1; if the same, it execute the next step 
Step 3: 
Locomotive request RSSI value with the number of M and the beacon nodes which receive signal reply the value of RSSI. Then the received RSSI values are modified by Gauss model and the modified RSSI values were ranked. The beacon node of maximum RSSI value is selected as the reference node 
Step 4: 
Each beacon node radios RSSI value before location and the values of A and N are calculated by Eq. 14. Then the beacon nodes wait for the information of reference node. When it receive the information of reference node, judged whether it is the reference node. If not, continue to wait; if it is, it send the values of A and n to the locomotive 
Step 5: 
When the locomotive receives the values of A and n, the coordinate of locomotive is calculated and sent to the host computer 

Fig. 4: 
Flow chart of the positioning algorithm 
Figure 4 is the detailed flow chart of the positioning algorithm.
RESULT AND DISCUSSION
Using MATLAB simulation platform for experiment and selecting a plane of 5x100 m as the environment for locomotive. Beacon nodes were arranged on both sides of the track, as shown in Fig. 2. The same side of the beacon nodes space is 20 m. In order to evaluate the performance of this algorithm, it was compared with literature (Han et al., 2013; Xiong et al., 2010; Li and Zhang, 2013) algorithm in the same environment. The results are compared with the positioning error, calculating error from Eq. 20:
_{}
where, error is absolute error of positioning algorithm, x^{0} and y^{0} are the true coordinate. The result of simulation is shown in Fig. 5.

Fig. 5: 
Comparison of different positioning algorithms 
Table 1: 
Comparison of positioning error 

Figure 5 is the comparison of the positioning error of each algorithm simulated 50 times. It can be seen from Fig. 5 that the positioning error of this study is small and the error fluctuated at 1 m. The positioning errors of literature (Han et al., 2013; Xiong et al., 2010; Li and Zhang, 2013) are larger than this study and also have larger fluctuation. The 50 values which are obtained from each algorithm in Fig. 5 are averaged, as they shown in Table 1. Table 1, the algorithm of this study has minimum average error and the maximum positioning error is less than 1.7 m. The average positioning errors of literature (Han et al., 2013; Xiong et al., 2010; Li and Zhang, 2013) have large error and the maximum positioning error is more than 2 m.
In order to verify the effect of communication radius to algorithm, changing the size of communication distance between nodes and making experiment and simulation to the above several positioning algorithms. Changing communication radius and the distances between nodes are the same. In the experiment, 8 points were taken within the distance 540 m on same the side of track. In order to make the error more stable, each algorithm ran 100 times and calculate the average error, simulation result were shown in Fig. 6. It can be found from Fig. 6 that with the increasing of communication radius, positioning errors of each algorithm also increase.

Fig. 6: 
Comparison of average error of different positioning algorithms 
Among the above several kinds of positioning algorithms, the algorithm of this paper had minimum positioning error. When the communication radius was 40 m, the positioning error was less than 2 m while the others positioning algorithm of error is larger than 2 m.
There is only one unknown x in Eq. 14. If v_{i} was ignored, the coordinate of locomotive can be calculated as long as there were 2 equations. If there are more than 3 equations, let them in pairs and compute the values of x. Then the values were got mean. Finally, x value was substituted into Eq. 6 and the coordinate of locomotive was got.
The position coordinates of this method to calculate the position coordinates to calculate whether than the weighted least squares method more accurate, this study shows the results through the MATLAB simulation platform, as shown in Fig. 7. Whether the coordinate is more accurate than that was got by the algorithm of this study. So, the experiment was taken by the MATLAB simulation platform and the results were shown in Fig. 7.
According to Fig. 7, it can be concluded that the error calculated by the improved weighted least square method is less than the other two methods and the fluctuation is stable relatively. For the pervious method (for the average of x), which was mentioned above, although the calculation is relatively simple, the position error is large. Because it is ignore the measurement error may occur in some special situation, such as: The “x” has no value, etc. Therefore, it reduces the validity of date.
It also increases the positioning accuracy that gets the values of A and n in realtime. Through the simulation, we compared get the values of A and n in realtime and constant. In experiment we assumed that the coordinate of locomotive was (0, 6) and the locomotive was running along with the straight line y = x+6 equation. The 7 point were selected to calculate the coordinate of locomotive. The experimental data is shown in Table 2.

Fig. 7: 
Comparison of positioning error with different method to solve 
Table 2: 
Comparison of positioning error with different method to get the values of A and n 

According to Table 2, it can be get that the positioning error of got the values of A and n in realtime is better than constant A and n in general. And the average error is small. So the algorithm can reflect the received signal strength and the path loss coefficient of locomotive’s location correctly.
CONCLUSION
This study proposed an underground mine locomotive positioning algorithm which is based on RSSI. In RSSI positioning technology received signal strength at 1m A and the path loss coefficient n will change with the change of environment. In this paper, a reference node was selected to calculate the values of A and n and it increases the positioning accuracy. Because the locomotive runs in a special environment that is the mine tunnel, the track which is run by locomotive is assumed as a model which is composed of several straight line. The equations of the locomotive track are determined in coordinate system to increase the known condition. If the locomotive locates in the junction of two lines, the positioning error is large. How to increase the positioning accuracy in the junction of linear will be the focus of next study.