Three patches for the LASM(B) are lunched to conform to some specific situations. When some particles are not stable at their right positions, i.e. local optimization, patch A is lunched to identify these particles, reinitialize them and reuse the LASM(B) to draw them in their right positions. When there are some nodes which are not well localized (we call them bad nodes), patch B is lunched to seek them out and set different trust values for them. Then we can use the nodes with the higher trust values and delete the bad nodes for the lunar rover's navigation. When there are node variations, i.e., there are sensor nodes adding to or leaving the network, patch C is lunched to deal with these nodes. In this way, the proposed LASM algorithm will be more suitable and robust with different situations.

#### 2.3.1 Patch A for particles at needless point

In some specific situations, some particles may be stable at a needless point. In this point, the total force exerted by its neighbors equals to 0 but at least one force exerted by its neighbor doesn't equal to 0, i.e., the length of one spring r_{ij} doesn't equal to the original length r_{ij0} of the spring. Compared to this point, we denote the point (that each force exerted by its neighbor equals to 0) the right point. A solution is needed to deal with this problem. However, we stress that the number of these needless points is small in the experiment shown in Section 3.

It is not a large problem to find out these particles stabilizing at needless points. For each sensor node, it can obtain the distances between it and its neighbors. It can compare these distances with the lengths of springs to find out whether the sensor node is stable at needless points.

After these sensor nodes (particles) have been found, the next step is to set these nodes out of the needless points.

One simple method is to reinitialize the positions of these particles at random points. After this, we use the LASM(B) algorithm again to run to new positions. The particle is stable at its right point (or the localization algorithm is convergent at its right point as proved in Section 2). Therefore, if the particle runs near the true point, it will be static in the right point finally. Therefore, this simple method can solve this needless point problem.

In addition, another method can solve this problem efficiently.

Because a majority of sensor nodes are stable in their right positions, this information can be used to improve the precision of those particles which are at needless points.

If there are at least 3 neighbor particles (in 2-D system) which are stable at right positions, the least squares algorithm can be used to derive the position of this particle which is at a needless point.

where (

x_{i},

y_{i}) is the position to be solved, (

x_{j},

y_{j}),(

x_{k},

y_{k}),---,(

x_{n},

y_{n}) is the positions of its

n neighbors (

n ≥ 3), and

r_{ij}_{0},

r_{ik}_{0}, ⋯

r_{in}_{0} is the distance between the particle and its neighbors.

This function can be linearized by subtracting the last row:

This equation can be solved using a traditional least squares algorithm.

After the position of this particle is calculated, we consider that this position is also a right position, and also use this position to help its neighbors to calculate their positions using (16).

If there are no particles which can use the second method to reinitialize the positions, the residual particles can use the first simple method to reinitialize.

After these particles which are stable at needless points have been reinitialized, we can reuse the LASM(B) algorithm to obtain the positions of these nodes.

Even after the LASM(B) is reused once, there may also be a smaller number of particles which are not at their right positions. We can reinitialize and reuse the LASM(B) several times to decrease the number of these particles at needless positions. However, it was seen in the experiment that the localization error was very small after the reuse of LASM(B) once. Therefore, LASM(B) is just reused for once in the experiment in Section 3.

The Patch A described above is to reinitialize the positions of those particles at needless points, and then also uses the LASM(B) algorithm. Therefore, the good performance of the LASM(B) algorithm can also be maintained, such as the computational complexity, the communication cost, the convergence and the optimization under the aspect of minimizing error square sum.

#### 2.3.2 Patch B for bad nodes

In order to obtain higher localization accuracy for lunar rover, the bad nodes which can't be well localized need to be found out. A trust value is set for each of these sensor nodes. If the trust value of one node is 1, it means that the estimated position can be well trusted. When using sensor nodes' position information for lunar rover's localization and navigation on the moon, it can just use the information of nodes with higher trusts to the best of our abilities. In this way, the accuracy of lunar rover's localization and navigation can be increased. Here, “not well localized” means that:

**Theorem 1**. In a two dimensional system, if a particle is connected with at least 3 unaligned particles who know their positions, this particle can be localized. (‘Unaligned’ means that these particles are not in a line)

Proof. If two particles are connected, the distance between these two particles can be obtained. When there are three nodes

j,

k, l, which know their positions and the distances (between these nodes and the un-located node

i), triangulation algorithm [

18] can be used as follows:

Therefore, the coordinates (x_{i}, y_{i}) of the particle i can be calculated.

In some specific situations, a particle can also be localized even if there are only two particles connected with it, which is shown in

Figure 3. Particle

a is just connected with particle

b and

c. This particle can be localized at two positions (position

a and

d). However, if this particle were located at position

d, it would have obtained connections with particles

e,

f. In face, it does not have connections with

e,

f. Therefore, this particle can just be localized at position

a.

However, we don't pay much attention on these situations, because we need a fast and simple algorithm to find out these nodes for the lunar rover's localization and navigation on the moon, not a precise algorithm.

Two methods are used to solve this problem. The relatively complex algorithm is used to find out the nodes which can't be localized as follows:

First, 3 particles which are connected with each other are chosen and put in a set. Using these 3 particles, a relative coordinate system can be established.

Secondly, if there are particles which are connected with at least 3 particles in that set, these particles can also be localized. And we also put them into that set. The amount of particles in that set will increase.

In addition, if there are at least 3 anchor nodes in this set, all particles in this set can have absolute coordinates by coordinate transformation.

Finally, the particles which can't be put in the set may not be able to be localized to a great extent (These node may also be localized in some specific situations as described before).

This algorithm is a little complex, and do not take the information of LASM(B) into consideration. Therefore, a new algorithm can be used to find out the nodes which can't be well localized.

The main idea of this algorithm is as follows:

- Step 1
for each particle, if it is at needless point, the trust of this particle is set to be 0.5; if it only has one or two neighbor particles, the trust of this particle is set to be 0. The trusts of other particles are set to be 1.

- Step 2
for each particle, if its trust is not equal to 1, cut off all the springs connected with it. Therefore, it will not be the neighbor particles of others. And then tells its former neighbors to delete itself from the neighbors' neighbor list.

- Step 3
repeat steps 1&2, until no particles need to change their trust.

Even if the trust of the particle is less than 1, it maybe not well localized with certainty. However, if the trust of the particle is 1, it may also not well localized in some specific situations. Here, we just need a fast and simple algorithm; therefore we don't pay more attention to the precision.

All the sensor nodes are divided into 3 parts with different trust values. The sensor nodes with higher trusts will be more likely used in the latter process of lunar rover's localization and navigation.

#### 2.3.3 Patch C for node variation

With the increase of the exploration area and working time on the moon, there are more nodes adding to or leaving from the network. How to deal with these nodes after the network has been localized?

When a new blind node adds in the network, it communicates with its neighbors and then obtains their positions and distances between itself and its neighbors. First, the positions of its neighbors are fixed. Then, the new node calculates its position using the proposed LASM algorithm. After that, small movements are made for the other nodes in the network using LASM. When a new anchor node adds in the network, it communicates its position to its neighbor nodes. These neighbor nodes use the LASM to adjust their positions again.

When a new blind node adds in the network in the LASM process of its neighbor nodes, it first calculates its approximate position using (16). Then it broadcasts its position to its neighbors using LASM to estimate its position. Its neighbor nodes receive its position, and then add it in the calculation of total force.

When a node leaves from the network after the LASM process, if the network is immobile (which means that the nodes in the network don't move once being deployed), the positions of the other nodes need not be changed. Therefore, nothing needs to be done on the positions of the other nodes. If the network is mobile, the other nodes will be relocalized using the proposed LASM algorithm.

When a node leaves from the network suddenly during the LASM process, may its neighbor nodes run into a deadlock because they are waiting for the leaving node's position information? The answer is no. In the LASM process, a time threshold can be set for each sensor node. If it does not receive all the neighbors' position information in the time threshold, it will just use the positions of the remaining neighbor nodes to calculate its velocity, acceleration and position. Therefore, the LASM algorithm can perform well in dynamic networks with nodes adding and leaving rapidly.