Embodiments of this invention relate to a method and system for determining a propagation delay of communications.
In a wireless network, nodes communicate with each other. For example, a first node may send information to a second node. In this example, the first node is a source node or transmitter and the second node is destination node or a receiver. However, the first node may also include the capability for receiving and/or the destination node may include the capability for transmitting.
A propagation delay of communications sent between the first and second nodes can be measured using timers located within the respective nodes. However, a clock signal generated by one node that drives the node's timer may include an offset and/or may not be exactly matched in frequency to a clock signal generated by the other node to drive the other node's timer. Therefore, one or both of the timers may measure incorrect times, and errors may thus be introduced into the measure of the propagation delay.
It is an object of embodiments of the invention to at least mitigate one or more of the problems of the prior art.
Embodiments of the invention will now be described by way of example only, with reference to the accompanying figures, in which:
Embodiments of the invention provide a method and apparatus for accurately determining a propagation delay between wirelessly communicating nodes. In embodiments of the invention, a mechanism for reducing or eliminating the effect of clock frequency error or clock frequency offset in the two nodes is provided, such that any error in measuring the propagation delay of communications sent between the two nodes can be reduced or eliminated.
Embodiments of the present invention are particularly useful in determining a communication delay between two nodes when one or both of the nodes are mobile nodes. Embodiments of the present invention will be explained with reference to a pair of nodes, one of which is a mobile node and one of which is a fixed node.
The nodes 102 and 104 may represent some or all of the nodes in the network 100 that can transmit communications to other nodes and receive communications from other nodes. The position of the mobile node 104 may change over time, and a propagation delay of communications sent between the mobile node 104 and the fixed node 102 cannot be predetermined or known in advance.
Embodiments of the invention involve independent measurement of time periods and communication of information concerning at least one of those time periods between the nodes such that one of the nodes can accurately determine the propagation delay between the nodes.
Firstly, the fixed node 102 sends a Request communication 202 to the mobile node 104. The fixed node 102 then begins to time a duration ttA between sending the Request communication 202 and receiving an Acknowledgement communication 204 from the mobile node 104. In embodiments of the invention, this is accomplished by the fixed node 102 recording a value of a local timer or resetting and starting the local timer upon completion of transmitting the Request communication 202. Communications 202, 204, 206 may comprise one or more packets, although in embodiments of the invention the communications 202, 204, 206 comprise a single packet.
When the mobile node 104 has received the Request communication 202, it sends the Acknowledgement communication 204 to the fixed node 102. According to the 802.15.4 specification, an acknowledgement communication should be sent 192 μs after receipt of an original communication being detected. Therefore, the Acknowledgement communication 204 is sent (that is, transmission of the communication is started) approximately 192 μs after receipt (end of reception) of the Request communication 202. This response time period may be achieved by detecting the receipt of the Request communication 202 on a clock edge and starting transmission of the Acknowledgement communication 204 on another clock edge. However, the response time period may in practice be a time other than 192 μs. Therefore, the mobile node 104 sends a Response Time Result (RTR) communication 206 to the fixed node 102. The RTR communication 206 contains information indicating a value of trB measured by the mobile node 104 which indicates a period trB between receipt (end of reception) of the Request communication 202 by the mobile node 104 and completion of transmission of the Acknowledgement communication 204 by the mobile node 104. Therefore, the fixed node 102 obtains information indicating the actual turnaround or response time trB at the mobile node 104. On receiving the RTR communication 206 the fixed node 102 can calculate a propagation delay tpd as will be explained. In embodiments of the invention tpd is the time taken for a communication from one of the nodes to propagate through the transmission medium (for example, air) to the other node.
As noted above, the fixed node 102 measures a time ttA between the times t1 and t4 (completion of transmission of Request 202 and receipt of Acknowledgement 204) for example by starting and stopping an internal timer. The fixed node 102 also obtains information indicating the turnaround time trB between t2 and t3 from the RTR communication 206. Therefore, for an ideal case where the clock signals in both nodes 102, 104 are identical at a frequency fc, the propagation delay tpd of Request and Acknowledgment communications 202, 204 can be determined as follows. From
t
tA
=t
tpd
+t
rB
+t
tpd (1)
However, the clock signals within each of the nodes 102,104 may include a frequency error or offset. For example, the error in the clock frequency of the fixed node 102 is fA, and the error in the clock frequency of the mobile node 104 is fB, where fA and fB are fractions of the ideal clock frequency fC. Therefore, the time ttA as measured by the fixed node 102 is measured as ttA+ttA.fA, and the turnaround time trB as measured by the mobile node 104 is trB+trB.fB. The errors lead to the fixed node 102 calculating an approximate propagation delay tpdA as follows:
Thus, an error epdA is included within the measurement of tpdA by the fixed node 102, where:
Substituting Equation 1 into 4 gives:
Even if the errors in the clock frequencies are small, the error introduced into the measurement of tpdA may be significant if the turnaround time trB is much larger than the ideal propagation delay tpd. For a communication system where trB is 544 μs and the nodes are separated by 30 metres or less, for example, then trB will be much larger than tpd.
The communications in
If the local clock reference signals in each of the nodes 102, 104 are ideal, then the propagation delay is:
However, due to frequency errors in the local oscillators of each node 102, 104 an error epdB is present in the propagation delay calculated by the fixed node 102 when the measurement is initiated by the mobile node sending the Request communication 410. The error is given by:
In embodiments of the present invention, the fixed node 102 calculates a mean propagation delay tpdm using the information obtained from RTR and TTR communications 406, 414. The mean propagation delay tpdm is calculated by determining the mean value of the first propagation delay tpd of Request and Acknowledgment communications 402, 404 and the second propagation delay of Request and Acknowledgement communications 410, 412 tpd. Using this information as well as local timer measurements, then the mean propagation delay error epd is given by:
Since the response times trA, trB of each node 102, 104 are likely to be approximately equal; the resultant contribution of the response times to the mean propagation delay error cancels and is thus negligible.
As an example, the following figures are used:
The measurement of tpdA by the fixed node 102 gives an error of:
Since epdA=21.764 ns and tpd=100 ns, epdA is a 21.764% error on tpd.
Similarly, the error epdB can be calculated as epdB=−21.604 ns which is a −21.604% error on tpd.
Using the mean of the calculated values tpdA and tpdB gives an error of (from equation 8):
Since epd=80 ps, this is a 0.8% error on tpd. Thus, the mean epd of the calculated values tpdA and tpdB gives a result for the propagation delay tpd that is more accurate than the propagation delay value calculated a node 102 using only total delay and turnaround time each measured by one node respectively.
Embodiments of the invention may further include determining a “delta” value representing a time period between completion of receiving a communication and detection of receipt of the communication by a node. The determination of the delta value may be used in the above-described methods to further improve an accuracy of propagation delay measurement.
The above described embodiments of the invention assume that receipt of a communication by a node is detected at the exact moment that receipt of the communication is complete. However, the receipt of the communication may be detected later than this moment. For example, the internal clock signal of a node may be used to drive receiver circuitry within the node. Thus, receipt of a communication may only be detected on a rising and/or falling edge of the clock signal. The delay between completion of receipt of a communication and detection of receipt of communication by a node is referred to as “delta”.
The timings shown in
t
mA
=t
tA
+t
ΔA
+t
ΔB (14)
In the communications shown in
The correlator 808 provides an output 810 that indicates the fraction of the clock cycle. The apparatus 800 may also provide the output 806 of the receiver portion 804 to other parts of the apparatus (not shown) as indicated by arrow 812.
A chip sequence generator 930 generates a chip sequence 932 according to a chip sequence phase input 934 to the correlator 900. The chip sequence 932 matches the chip sequence of a received communication. For example, where an 802.15.4 communications standard is used, the chip sequence input 934 is used to control the chip sequence generator 930 such that the chip sequence 932 comprises a 32-bit sequence that matches the 32-bit sequence currently being provided to the correlator 900. That is, the chip sequence 932 matches the bits of the input signal 902 and approximately matches the phase of the input signal 902. The chip sequence 932 is provided to the second input of the XOR logic unit 920 and a delay unit 935. The output of the delay unit 935 is provided to the second input of the XOR logic unit 918 and another delay unit 936. The output of the delay unit 936 is provided to the second input of the XOR logic unit 916 and another delay unit 938. The output of the delay unit 938 is provided to the second input of the XOR logic unit 914 and another delay unit 540. The output of the delay unit 940 is provided to the second input of the XOR logic unit 912. Thus, therefore, the time difference between the input signal as seen by the XOR logic units and the chip sequence as seen by the XOR logic units is +2τ, +τ, 0, −τ and −2τ for the XOR logic units 912, 914, 916, 918 and 920 respectively. That is, for example, the received signal reaches the XOR logic unit 920 −2τ later than the chip sequence signal 932. The delay units 935, 936, 938 and 940 are controlled by the clock signal 911. In embodiments of the invention, the delays τ and 2τ are chosen to be fractions of a clock signal period.
The outputs of the XOR logic units 912, 914, 916, 918 and 920 are provided to up/down counters 942, 944, 946, 948 and 950 respectively. The up/down counters increase or decrease their respective outputs on each pulse from the clock signal 911, according to whether the input from the corresponding XOR logic unit is high or low. For example, in embodiments of the invention, an up/down counter increases its output on a clock pulse when the input is high, and decreases its output if the input is low.
The outputs of the up/down counters 942, 944, 946, 948 and 950 are provided to a peak detector 960. The peak detector 960 determines the timing of the input signal from the outputs of the up/down counters as described in more detail below. An output 962 of the peak detector 960 indicates the timing and is provided to a register 964 that stores the indication or the timing. The output of the register 966 comprises the output of the correlator 900.
The up/down counters can be reset using a reset signal input 968. The reset signal 968 is also used to clock the output 962 of the peak detector 960 into the register 964.
The operation of the correlator will now be described. The phase of the chip sequence 932 is matched approximately to the phase of the input signal 902. For example, the apparatus 800 shown in
Where an 802.15.4 based communications standard such as Zigbee is used for wireless communications, data contained within a communication is grouped into sets of four bits. A set of four data bits is used to select one of sixteen unique 32-bit sequences defined by the 802.15.4 standard, and the selected 32-bit sequence is transmitted eight times faster than the bit rate of the data bits using an offset quadrature phase shift keying (OQPSK) modulation technique. Thus, the four bit code is transmitted using a spread-spectrum technique. A receiver may identify the 32-bit sequence and thus identify the four data bits being transmitted. A receiver can determine the positions of boundaries between 32-bit sequences by, for example, identifying the start of frame delimiter (SFD) as above, which provides a reference point in time for identifying separate 32-bit sequences.
Therefore, the two signals provided to each of the XOR logic units 912, 914, 916, 918 and 920 are substantially identical, except for a phase delay between the two inputs to each XOR logic unit. For example, if the phase of the input signal 902 and chip sequence signal 934 are exactly aligned in phase, then there is no phase difference between the two signals provided to the XOR logic unit 916, although there is, for example, a +τ delay between the signals provided to the XOR logic unit 914. Similarly, for example, if there is a +τ delay between the phases of the input signal 902 and the chip sequence signal 934, then there is no phase difference between the two signals provided to the XOR logic unit 914, although there is, for example, a +τ delay between the signals provided to the XOR logic unit 912, and a −τ delay between the signals provided to the XOR logic unit 916. The time difference between the signals may comprise a value other than an integer multiple of τ.
If the signals provided to an XOR logic unit are exactly aligned in phase, then the output of the XOR logic unit will always be logic 0 (low). However, a phase difference between the signals provided to an XOR logic unit, even if less than the delay value τ, causes the output of the XOR logic unit to occasionally be logic 1 (high). A greater phase difference causes the output of the XOR logic unit to be high more often and/or for longer periods. Therefore, a greater phase difference causes, over a period of time (the correlation period), an associated up/down counter to count to a higher number.
At the start of the correlation period, a reset signal is sent to the correlator using the reset signal input 968. This causes the up/down counters 942, 944, 946, 948 and 950 to be reset to a predetermined value, for example zero. At the end of the correlation period, which comprises a plurality of clock cycles of the clock signal 911 and may also comprise a plurality of bits of the input signal 902, another reset signal is sent to the correlator, and this causes the peak detector 960 to calculate a peak phase difference value using the inputs from the up/down counters 942, 944, 946, 948 and 950 as indicated in more detail below, and for this value to be stored in the register 964. This also causes the outputs of the up/down counters to be reset to the predetermined value again.
An example of the possible relative values of the outputs of the up/down counters before they are reset are shown in the graph 1000 of
An example of curve fitting, as performed by the peak detector 960, is described below, although other curve fitting/interpolation techniques may additionally or alternatively be used. The lowest three points (i.e. the lowest value and the values either side of the lowest value, where appropriate) are considered for simplicity, and are fitted to the following quadratic equation:
y=Ax
2
+Bx+C (15)
For the curve shown in
Y
−1
=A−B+C (16)
Y0=C (17)
Y
+1
=A+B+C (18)
Solving Equations 16-18 yields the coefficients of Equation 15:
Equation 15 can be differentiated to determine the slope of the curve:
The minimum of the curve occurs where the slope is zero, i.e.:
Using the values of A and B from Equations 21 and 22, x at the minimum can be determined as follows:
The value of x obtained from Equation 23 above can be used to determine the time difference between the input signal 902 and the chip sequence 932 (for example, the time difference is xτ). In embodiments of the invention, this time difference is also delta, the time difference between receipt of the communication and detection of the communication, as the clock signal used to control the chip sequence generator 930 is also the clock signal used to detect incoming communications.
In embodiments of the invention, both the fixed node 102 and the mobile node 104 include apparatus (such as, for example, the apparatus shown in
A chip sequence generator 1130 generates a chip sequence 1132 according to a chip sequence phase input 1134 to the correlator 1100. The chip sequence 1132 matches a received communication. For example, where an 802.15.4 communications standard is used, the chip sequence phase input 1134 is used to control the chip sequence generator 1130 such that the chip sequence 1132 comprises a 32-bit sequence that matches the 32-bit sequence provided to the correlator 1100 in the input signal 1102. The chip sequence 1132 is provided to the second input of the multiplier 1120 and a delay unit 1135. The output of the delay unit 1135 is provided to the second input of the multiplier 1118 and another delay unit 1136. The output of the delay unit 1136 is provided to the second input of the multiplier 1116 and another delay unit 1138. The output of the delay unit 1138 is provided to the second input of the multiplier 1111 and another delay unit 1140. The output of the delay unit 1140 is provided to the second input of the multiplier 1112. Thus, therefore, the time difference between the received signal as seen by the multipliers and the chip sequence as seen by the multipliers is +2τ, +τ, 0, −τ and −2τ for the multipliers 1112, 1111, 1116, 1118 and 1120 respectively. That is, for example, the received signal reaches the multiplier 1120 −2τ later than the chip sequence signal 1132. The delay units 1135, 1136, 1138 and 1140 are controlled by the clock signal 1111.
The outputs of the multipliers 1112, 1111, 1116, 1118 and 1120 are provided to integrators 1142, 1144, 1146, 1148 and 1150 respectively. The integrators integrate the outputs of the respective multipliers over time. For example, in embodiments of the invention, the bit stream input 1102 comprises a series of bits at voltages +V and −V. Similarly, the chip sequence signal 1132 comprises a series of bits at voltages +V and −V. Thus, the output of each multiplier comprises a positive or negative voltage depending on the inputs to the multiplier.
The outputs of the integrators 1142, 1144, 1146, 1148 and 1150 are provided to a peak detector 1160. The peak detector 1160 determines the timing of a received communication using the outputs of the integrators described in more detail below. An output 1162 of the peak detector 1160 indicates the timing and is provided to a register 1164 that stores the indication or the timing. The output of the register 1166 comprises the output of the correlator 1100.
The integrators 1142, 1144, 1146, 1148 and 1150 can be reset using a reset signal input 1168. The reset signal 1168 is also used to clock the output 1162 of the peak detector 1160 into the register 1164.
The operation of the correlator 1100 is similar to that of the correlator 900 shown in
The usefulness of embodiments of the invention includes determining a distance between two nodes. For example, the propagation delay tpd may be used to determine a distance that the communication has traveled and, therefore, how far apart the nodes are. The distance to the node may be used in determining a position of the node.
For example, where tpd is 100 ns, the distance d may be calculated by:
d=ct
Pd=30 m (24)
where c is a speed of light in air of 299,792,458 ms−1.
The measurement of distance between two nodes may be used to determine the position of one of the nodes relative to the other node. For example, it may be required to know whether a node is within a certain distance from the other node, for example whether the nodes are in the same room. In such a scenario, a measurement of the distance between two nodes may be used to determine whether one of the nodes is far enough away from the other node to be outside of a room in which the receiver is located. Alternatively, for example, a node in a fixed position at one end of an elongate room or space may be used to determine the approximate location of the other node along the length of the room or space. The measurement of distance between the nodes provides a sphere around one of the nodes of the possible positions of the other node and vice versa. If the other node cannot be located in many of the positions (for example, because these positions are located outside of the room or space) then the number of possible positions of the other node may be reduced significantly, and thus the other node may be located or at least information relating to its location has been determined.
In other embodiments, each one of a plurality of nodes may determine the distance between itself and a mobile node, i.e. a node whose location needs to be determined, or the mobile node may determine the plurality of distances between itself and each of the other nodes. The plurality of distances can then be used to determine the location of the mobile node, for example using trilateration as will be appreciated by the skilled person.
The presence of multiple fixed nodes 1204, 1206, 1208 allows the position of the mobile node 1202 to be determined, using, for example, trilateration.
The location of the first fixed node 1302 is chosen as the origin for a coordinate system for determining the position of the mobile node point 1300, although any other point may be chosen as the origin. The coordinate system is also chosen such that the second fixed node 1304 is located along the x-axis, although the coordinate system can be chosen so that the second fixed node 1304 is not located on the x-axis (for example, the second receiver is located on another axis, or another receiver is located on the x- or y-axis). If the position of the mobile node 1300 is at (x, y) and the location in the coordinate system of the second and third fixed nodes 1304 and 1306 is (a, 0) and (i, j) respectively, then using Pythagoras' theorem gives the following equations:
R12=x2+y2 (25)
R22=(a−x)2+y2 (26)
R32=(i−x)2+(j−y)2 (27)
Subtracting (25) from (26) gives:
R12−R22=2ax−a2 (28)
Rearranging (28) gives:
Substituting (29) into (27) will give the value for y. Thus, the position (x, y) of the mobile node 1300 can be determined, although other methods of determining the position (x, y) may be used.
In practise, the distances R1, R2 and/or R3 may be inaccurate (i.e. they may contain errors). Therefore, Equations 24 to 26 above may not have a solution. Instead, techniques may be used to determine (x, y) in the presence of errors. For example, optimisation techniques may be employed to determine an estimation of (x, y).
For example, the distance from the mobile node 1202 to a number of fixed nodes 1204, 1206, 1208 may be determined, the number of fixed nodes 1204, 1206, 1208 being greater than the number required for trilateration. A least squares method may then be used to minimise the squared error between the calculated (x, y) and the fixed nodes. For example, e1 is a distance (an error) between (x, y) and the nearest point on a circle of radius R1 centred on a first fixed node. Similarly, e2, e3 and e4 are error distances associated with second, third and fourth fixed nodes respectively. The estimate of (x, y) is chosen such that the sum of the squares of e1, e2, e3 and e4 is a minimum. Other techniques for choosing an estimate for (x, y) may be used, for example which are more robust against data outliers.
The determination of the position of the mobile node 1202 can be determined by any of the nodes in the network. For example, a coordinator may collect indications from one or more fixed nodes and/or the mobile node of the distances between the fixed nodes and the mobile node. The coordinator may then use the indication(s) to determine the position of the mobile node 1202.
Embodiments of the invention as described above refer to fixed nodes in a network. However, in other embodiments of the invention one or more fixed nodes may instead be moveable nodes whose position may change over time. Embodiments of the invention may be used, for example, to determine the position of a moveable node before the distance between the moveable node and the mobile node is determined. Additionally or alternatively, the mobile node may be in a fixed position.
Embodiments of the invention may use the network to convey both position information, such as the location of a mobile node, and other information, such as information transmitted by the mobile node. For example, in a medical application, a mobile node may be used to determine the position of a patient and data associated with the patient if the patient is carrying the mobile node or if the mobile node is fixed to the patient.
It will be appreciated that embodiments of the present invention can be realised in the form of hardware, software or a combination of hardware and software. Any such software may be stored in the form of volatile or non-volatile storage such as, for example, a storage device like a ROM, whether erasable or rewritable or not, or in the form of memory such as, for example, RAM, memory chips, device or integrated circuits or on an optically or magnetically readable medium such as, for example, a CD, DVD, magnetic disk or magnetic tape. It will be appreciated that the storage devices and storage media are embodiments of machine-readable storage that are suitable for storing a program or programs that, when executed, implement embodiments of the present invention. Accordingly, embodiments provide a program comprising code for implementing a system or method as claimed in any preceding claim and a machine readable storage storing such a program. Still further, embodiments of the present invention may be conveyed electronically via any medium such as a communication signal carried over a wired or wireless connection and embodiments suitably encompass the same.
All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and/or all of the steps of any method or process so disclosed, may be combined in any combination, except combinations where at least some of such features and/or steps are mutually exclusive.
Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise. Thus, unless expressly stated otherwise, each feature disclosed is one example only of a generic series of equivalent or similar features.
The invention is not restricted to the details of any foregoing embodiments. The invention extends to any novel one, or any novel combination, of the features disclosed in this specification (including any accompanying claims, abstract and drawings), or to any novel one, or any novel combination, of the steps of any method or process so disclosed. The claims should not be construed to cover merely the foregoing embodiments, but also any embodiments which fall within the scope of the claims.