<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rsewiki.electro.dtu.dk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=S123950</id>
	<title>Rsewiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://rsewiki.electro.dtu.dk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=S123950"/>
	<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Special:Contributions/S123950"/>
	<updated>2026-04-27T04:53:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=3090</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=3090"/>
		<updated>2017-07-20T12:17:07Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Results to date */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
This page gives an overview of a three dimensional localization system developed. The system can be used in every scenario where it is wanted to obtain some sort of position or velocity information about something, whether it is for ground-truth information, control feedback, surveillance or the like. A few examples of such places could be:&lt;br /&gt;
&lt;br /&gt;
* Robotic control position and velocity feedback, for autonomous usage&lt;br /&gt;
* Ground-truth to test other approaches&lt;br /&gt;
* Inventory tagging&lt;br /&gt;
* Personnel location information&lt;br /&gt;
* Intelligent transportation in regards to eg. smarter vehicles&lt;br /&gt;
&lt;br /&gt;
The position and velocity estimates are available wherever they are needed, whether that is onboard the host as data extraction from the tag itself or at a specific anchor for data logging purposes. &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore the system features extremely rapid deployment, as the anchors will be able to find their own position in a matter of seconds from first power. This means that the system can be set-up and ready to be used in a matter of minutes, without loss of accuracy.&lt;br /&gt;
&lt;br /&gt;
The developed system, is intended to be used as closed-environment system, meaning that it is intended to not require anything of the host carrying the tag. This means that the system is extremely versatile and can be used almost anywhere, as the host is not required to run any timing specific software. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 As the Kalman filter is still not fully implemented, and thus not tested, this section still needs some information about the Kalman filter.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=3089</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=3089"/>
		<updated>2017-07-20T12:16:32Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Results to date */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
This page gives an overview of a three dimensional localization system developed. The system can be used in every scenario where it is wanted to obtain some sort of position or velocity information about something, whether it is for ground-truth information, control feedback, surveillance or the like. A few examples of such places could be:&lt;br /&gt;
&lt;br /&gt;
* Robotic control position and velocity feedback, for autonomous usage&lt;br /&gt;
* Ground-truth to test other approaches&lt;br /&gt;
* Inventory tagging&lt;br /&gt;
* Personnel location information&lt;br /&gt;
* Intelligent transportation in regards to eg. smarter vehicles&lt;br /&gt;
&lt;br /&gt;
The position and velocity estimates are available wherever they are needed, whether that is onboard the host as data extraction from the tag itself or at a specific anchor for data logging purposes. &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore the system features extremely rapid deployment, as the anchors will be able to find their own position in a matter of seconds from first power. This means that the system can be set-up and ready to be used in a matter of minutes, without loss of accuracy.&lt;br /&gt;
&lt;br /&gt;
The developed system, is intended to be used as closed-environment system, meaning that it is intended to not require anything of the host carrying the tag. This means that the system is extremely versatile and can be used almost anywhere, as the host is not required to run any timing specific software. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 As the Kalman filter is still not fully implemented, and thus not tested, this section still needs some information about the Kalman filter.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=3088</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=3088"/>
		<updated>2017-07-20T12:16:12Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
This page gives an overview of a three dimensional localization system developed. The system can be used in every scenario where it is wanted to obtain some sort of position or velocity information about something, whether it is for ground-truth information, control feedback, surveillance or the like. A few examples of such places could be:&lt;br /&gt;
&lt;br /&gt;
* Robotic control position and velocity feedback, for autonomous usage&lt;br /&gt;
* Ground-truth to test other approaches&lt;br /&gt;
* Inventory tagging&lt;br /&gt;
* Personnel location information&lt;br /&gt;
* Intelligent transportation in regards to eg. smarter vehicles&lt;br /&gt;
&lt;br /&gt;
The position and velocity estimates are available wherever they are needed, whether that is onboard the host as data extraction from the tag itself or at a specific anchor for data logging purposes. &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore the system features extremely rapid deployment, as the anchors will be able to find their own position in a matter of seconds from first power. This means that the system can be set-up and ready to be used in a matter of minutes, without loss of accuracy.&lt;br /&gt;
&lt;br /&gt;
The developed system, is intended to be used as closed-environment system, meaning that it is intended to not require anything of the host carrying the tag. This means that the system is extremely versatile and can be used almost anywhere, as the host is not required to run any timing specific software. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 As the Kalman filter is still not fully implemented, and thus not tested, this section still needs some information about the Kalman filter.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Arm_compiler_environment&amp;diff=2572</id>
		<title>Arm compiler environment</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Arm_compiler_environment&amp;diff=2572"/>
		<updated>2016-08-19T13:27:48Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:ST-Link-V2.png|thumb|right|ST-Link/V2 Programmer]]&lt;br /&gt;
&lt;br /&gt;
The arm compiler environment for the ST microcontrollers used in the [[3D localization]] project contains a number of software packages, which ones are needed depends on the users demands to debugging.&lt;br /&gt;
It consists of an arm compiler including accessory binaries, openOCD for SWD usage (programming &amp;amp; debugging through GDB) and DFU-util for programming through USB.&lt;br /&gt;
&lt;br /&gt;
==Compiler setup - Linux==&lt;br /&gt;
&lt;br /&gt;
The following steps were performed on Linux Mint (Procedure is the same for Linux Ubuntu, but please adjust them accordingly for other distributions):&lt;br /&gt;
&lt;br /&gt;
since the toolchain executables are 32-bits apps, when running on 64-bits machines, be sure you install the following 32-bits libraries (for different versions check the toolchain README for the actual list):&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get -y install lib32z1 lib32ncurses5 lib32bz2-1.0&lt;br /&gt;
on Mint 17.3 / Ubuntu 15.04 the following libraries are required:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get -y install lib32ncurses5&lt;br /&gt;
on Ubuntu 12 LTSx64 all 32-bits libraries were packed in ia32-libs, so you can also use, but be prepared to get a lot of useless libraries:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get -y install ia32-libs&lt;br /&gt;
download the latest Linux install tarball file from [https://launchpad.net/gcc-arm-embedded/+download Launchpad] (currently gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2, more than 60 MB)&lt;br /&gt;
&lt;br /&gt;
Note: DO NOT install the ARM GCC package that comes with your distribution, especially if it is newer than the one provided by Launchpad, since generally it is not supported, and debugging sessions might fail.&lt;br /&gt;
&lt;br /&gt;
locate the file (usually in the $HOME/Downloads/  folder)&lt;br /&gt;
decide on a location to install the toolchain; the recommended folder is /usr/local/ or /opt/&lt;br /&gt;
unpack the archive in the destination folder&lt;br /&gt;
&lt;br /&gt;
 $ cd /opt&lt;br /&gt;
 $ sudo tar xjf ~/Downloads/gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2&lt;br /&gt;
the result should be a folder like /opt/gcc-arm-none-eabi-5_3-2016q1&lt;br /&gt;
test if the compiler is functional; use the actual install path:&lt;br /&gt;
&lt;br /&gt;
 $ /opt/gcc-arm-none-eabi-5_3-2016q1/bin/arm-none-eabi-gcc --version&lt;br /&gt;
 arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.3 20160330 (release) [ARM/embedded-5-branch revision 234589]&lt;br /&gt;
&lt;br /&gt;
In order to let the system know where to find the compiler binaries, there are three options:&lt;br /&gt;
&lt;br /&gt;
# Add the extracted folder to your environment variables ($PATH for linux) &#039;&#039;&#039;(Not recommended for linux)&#039;&#039;&#039;&lt;br /&gt;
#; This can be done on linux by adding the following to &#039;&#039;&#039;&amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt;&#039;&#039;&#039;: &amp;lt;code&amp;gt;export PATH=$PATH:/opt/gcc-arm-none-eabi-5_3-2016q1/bin/&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add a symbolic link of all the binaries for the compiler to your &#039;&#039;&#039;&amp;lt;code&amp;gt;/usr/bin/&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
#; This can be done by issuing the following command with root privileges (&#039;&#039;&#039;NOTE&#039;&#039;&#039; You have to add all the binary files in the bin folder): &amp;lt;code&amp;gt;ln -s /opt/gcc-arm-none-eabi-5_3-2016q1/bin/&amp;lt;binary name&amp;gt; /usr/bin/&amp;lt;/code&amp;gt;&lt;br /&gt;
# The third and last option is to alter the Makefile of the project to contain the absolute path to the compiler binaries &#039;&#039;&#039;(Also NOT recommended)&#039;&#039;&#039;&lt;br /&gt;
#; This can be done by changing the line in the Makefile containing the path to compiler binary folder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you’ll ever need to remove the toolchain, just remove the /opt/gcc-arm-none-eabi-5_3-2016q1, there are no other components stored in system folders.&lt;br /&gt;
&lt;br /&gt;
==OpenOCD setup==&lt;br /&gt;
&lt;br /&gt;
In order to program the devices through SWD, a hardware programmer and some software are needed.&lt;br /&gt;
&lt;br /&gt;
====ST-Link/V2====&lt;br /&gt;
&lt;br /&gt;
The hardware used is ST&#039;s own ST-Link/V2 programmer, that can be acquired either in a proprietary version from ST, or in a cheap China version from eg. [http://www.ebay.de ebay] (I have only personally tested the cheap China version, which works to perfection).&lt;br /&gt;
&lt;br /&gt;
====Installing OpenOCD====&lt;br /&gt;
&lt;br /&gt;
The GNU/Linux versions of GNU ARM Eclipse OpenOCD are packed as TGZ archives. Go to the [https://github.com/gnuarmeclipse/openocd/releases GitHub Releases] page and download the latest version named like:&lt;br /&gt;
&lt;br /&gt;
 [https://github.com/gnuarmeclipse/openocd/releases/download/gae-0.9.0-20150519/gnuarmeclipse-openocd-debian64-0.9.0-201505190955.tgz gnuarmeclipse-openocd-debian64-0.9.0-201505190955.tgz]&lt;br /&gt;
 [https://github.com/gnuarmeclipse/openocd/releases/download/gae-0.9.0-20150519/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz]&lt;br /&gt;
&lt;br /&gt;
As the name implies, these are Debian tar.gz archives, but can be executed on most recent GNU/Linux distributions (they were tested on Debian, Ubuntu, Manjaro, SuSE and Fedora). Select the -debian64- file for 64-bit machines and the -debian32- file for 32-bit machines.&lt;br /&gt;
&lt;br /&gt;
In case you use an older distribution and encounter difficulties to run GNU ARM Eclipse OpenOCD, you can also try to build it from sources on your machine. As a last resort, if your distribution includes an OpenOCD package, you can install it using the specific tools.&lt;br /&gt;
&lt;br /&gt;
To install this package, unpack the archive and copy it to where you install binaries, eg. &#039;&#039;&#039;/opt/gnuarmeclipse/openocd/${version}&#039;&#039;&#039; or &#039;&#039;&#039;/usr/local/gnuarmeclipse/openocd/${version}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 sudo mkdir -p /opt/gnuarmeclipse&lt;br /&gt;
 cd /opt/gnuarmeclipse&lt;br /&gt;
 sudo tar xvf ~/Downloads/gnuarmeclipse-openocd-debian64-0.9.0-201505190955.tgz&lt;br /&gt;
Note: although perfectly possible to install it in any location, it is recommended to use either of the two above locations&lt;br /&gt;
&lt;br /&gt;
To check if OpenOCD starts and is recent, use:&lt;br /&gt;
&lt;br /&gt;
 $ /opt/gnuarmeclipse/openocd/0.9.0-201505190955/bin/openocd --version   GNU ARM Eclipse 64-bits Open On-Chip Debugger ....&lt;br /&gt;
&lt;br /&gt;
If you’ll ever need to remove OpenOCD, just remove the /opt/gnuarmeclipse, there are no other components stored in system folders (And the UDEV rule).&lt;br /&gt;
&lt;br /&gt;
====UDEV Rules====&lt;br /&gt;
&lt;br /&gt;
For the JTAG probes implemented as USB devices (actually most of them), the last installation step on GNU/Linux is to configure the UDEV subsystem. OpenOCD provides an UDEV rules file defining all the supported IDs; to install it, just copy the file to &#039;&#039;&#039;/etc/udev/rules.d&#039;&#039;&#039; and eventually notify the daemon:&lt;br /&gt;
&lt;br /&gt;
 $ sudo cp /opt/gnuarmeclipse/openocd/0.9.0-201505190955/contrib/99-openocd.rules /etc/udev/rules.d/&lt;br /&gt;
 $ sudo udevadm control --reload-rules&lt;br /&gt;
Note: If you previously installed the J-Link binaries, the USB IDs were already added to UDEV. The above OpenOCD rules file also defines the J-Link ID. Apparently UDEV does not complain; if you encounter problems, just comment out the definition in the OpenOCD file.&lt;br /&gt;
&lt;br /&gt;
==DFU-Util setup==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OBS: Only the anchors (with their Cortex-M0 processor), and the newest versions of the tags (with their Cortex-M4 processor), supports programming through USB (DFU protocol).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The host-side tool used for programming the devices through USB, is called DFU-Util. &amp;lt;br /&amp;gt;&lt;br /&gt;
Either install DFU-Util from the apt-get repository as&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install dfu-util&lt;br /&gt;
&lt;br /&gt;
Or download and extract the tool as described below &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool can be downloaded at [http://dfu-util.sourceforge.net/releases/ http://dfu-util.sourceforge.net/releases/], and is ready to be used out of the box. &lt;br /&gt;
&lt;br /&gt;
Extract the tool where you usually install programs (for linux this is usually /opt/ or /usr/local/), and choose one of the following three:&lt;br /&gt;
&lt;br /&gt;
# Add the extracted folder to your environment variables ($PATH for linux) &#039;&#039;&#039;(Not recommended for linux)&#039;&#039;&#039;&lt;br /&gt;
#; This can be done on linux by adding the following to &#039;&#039;&#039;&amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt;&#039;&#039;&#039;: &amp;lt;code&amp;gt;export PATH=$PATH:/path/to/DFU-Util/binary_folder/&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add a symbolic link of the DFU-Util binaries to your &#039;&#039;&#039;&amp;lt;code&amp;gt;/usr/bin/&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
#; This can be done by issuing the following command with root privileges: &amp;lt;code&amp;gt;ln -s /path/to/DFU-Util/binary /usr/bin/&amp;lt;/code&amp;gt;&lt;br /&gt;
# The third and last option is to alter the Makefile of the project to contain the absolute path to the DFU-Util binaries &#039;&#039;&#039;(Also NOT recommended)&#039;&#039;&#039;&lt;br /&gt;
#; This can be done by changing the line in the Makefile containing the path to DFU-Util&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DFU-util also comes in a Python version, which is included in the Scripts folder for convenience.&lt;br /&gt;
&lt;br /&gt;
More info about the DFU-Util can be found at [http://dfu-util.sourceforge.net/ http://dfu-util.sourceforge.net/].&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Arm_compiler_environment&amp;diff=2571</id>
		<title>Arm compiler environment</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Arm_compiler_environment&amp;diff=2571"/>
		<updated>2016-08-19T13:26:38Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* DFU-Util setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:ST-Link-V2.png|thumb|right|ST-Link/V2 Programmer]]&lt;br /&gt;
&lt;br /&gt;
The arm compiler environment for the ST microcontrollers used in the [[3D localization]] project contains a number of software packages, which ones are needed depends on the users demands to debugging.&lt;br /&gt;
It consists of an arm compiler including accessory binaries, openOCD for SWD usage (programming &amp;amp; debugging through GDB) and DFU-util for programming through USB.&lt;br /&gt;
&lt;br /&gt;
==Compiler setup - Linux==&lt;br /&gt;
&lt;br /&gt;
The following steps were performed on Linux Mint (Procedure is the same for Linux Ubuntu, but please adjust them accordingly for other distributions):&lt;br /&gt;
&lt;br /&gt;
since the toolchain executables are 32-bits apps, when running on 64-bits machines, be sure you install the following 32-bits libraries (for different versions check the toolchain README for the actual list):&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get -y install lib32z1 lib32ncurses5 lib32bz2-1.0&lt;br /&gt;
on Mint 17.3 / Ubuntu 15.04 the following libraries are required:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get -y install lib32ncurses5&lt;br /&gt;
on Ubuntu 12 LTSx64 all 32-bits libraries were packed in ia32-libs, so you can also use, but be prepared to get a lot of useless libraries:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get -y install ia32-libs&lt;br /&gt;
download the latest Linux install tarball file from [https://launchpad.net/gcc-arm-embedded/+download Launchpad] (currently gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2, more than 60 MB)&lt;br /&gt;
&lt;br /&gt;
Note: DO NOT install the ARM GCC package that comes with your distribution, especially if it is newer than the one provided by Launchpad, since generally it is not supported, and debugging sessions might fail.&lt;br /&gt;
&lt;br /&gt;
locate the file (usually in the $HOME/Downloads/  folder)&lt;br /&gt;
decide on a location to install the toolchain; the recommended folder is /usr/local/ or /opt/&lt;br /&gt;
unpack the archive in the destination folder&lt;br /&gt;
&lt;br /&gt;
 $ cd /opt&lt;br /&gt;
 $ sudo tar xjf ~/Downloads/gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2&lt;br /&gt;
the result should be a folder like /opt/gcc-arm-none-eabi-5_3-2016q1&lt;br /&gt;
test if the compiler is functional; use the actual install path:&lt;br /&gt;
&lt;br /&gt;
 $ /opt/gcc-arm-none-eabi-5_3-2016q1/bin/arm-none-eabi-gcc --version&lt;br /&gt;
 arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.3 20160330 (release) [ARM/embedded-5-branch revision 234589]&lt;br /&gt;
&lt;br /&gt;
In order to let the system know where to find the compiler binaries, there are three options:&lt;br /&gt;
&lt;br /&gt;
# Add the extracted folder to your environment variables ($PATH for linux) &#039;&#039;&#039;(Not recommended for linux)&#039;&#039;&#039;&lt;br /&gt;
#; This can be done on linux by adding the following to &#039;&#039;&#039;&amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt;&#039;&#039;&#039;: &amp;lt;code&amp;gt;export PATH=$PATH:/opt/gcc-arm-none-eabi-5_3-2016q1/bin/&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add a symbolic link of all the binaries for the compiler to your &#039;&#039;&#039;&amp;lt;code&amp;gt;/usr/bin/&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
#; This can be done by issuing the following command with root privileges (&#039;&#039;&#039;NOTE&#039;&#039;&#039; You have to add all the binary files in the bin folder): &amp;lt;code&amp;gt;ln -s /opt/gcc-arm-none-eabi-5_3-2016q1/bin/&amp;lt;binary name&amp;gt; /usr/bin/&amp;lt;/code&amp;gt;&lt;br /&gt;
# The third and last option is to alter the Makefile of the project to contain the absolute path to the compiler binaries &#039;&#039;&#039;(Also NOT recommended)&#039;&#039;&#039;&lt;br /&gt;
#; This can be done by changing the line in the Makefile containing the path to compiler binary folder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you’ll ever need to remove the toolchain, just remove the /opt/gcc-arm-none-eabi-5_3-2016q1, there are no other components stored in system folders.&lt;br /&gt;
&lt;br /&gt;
==OpenOCD setup==&lt;br /&gt;
&lt;br /&gt;
In order to program the devices through SWD, a hardware programmer and some software are needed.&lt;br /&gt;
&lt;br /&gt;
====ST-Link/V2====&lt;br /&gt;
&lt;br /&gt;
The hardware used is ST&#039;s own ST-Link/V2 programmer, that can be acquired either in a proprietary version from ST, or in a cheap China version from eg. [http://www.ebay.de ebay] (I have only personally tested the cheap China version, which works to perfection).&lt;br /&gt;
&lt;br /&gt;
====Installing OpenOCD====&lt;br /&gt;
&lt;br /&gt;
The GNU/Linux versions of GNU ARM Eclipse OpenOCD are packed as TGZ archives. Go to the [https://github.com/gnuarmeclipse/openocd/releases GitHub Releases] page and download the latest version named like:&lt;br /&gt;
&lt;br /&gt;
 [https://github.com/gnuarmeclipse/openocd/releases/download/gae-0.9.0-20150519/gnuarmeclipse-openocd-debian64-0.9.0-201505190955.tgz gnuarmeclipse-openocd-debian64-0.9.0-201505190955.tgz]&lt;br /&gt;
 [https://github.com/gnuarmeclipse/openocd/releases/download/gae-0.9.0-20150519/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz]&lt;br /&gt;
&lt;br /&gt;
As the name implies, these are Debian tar.gz archives, but can be executed on most recent GNU/Linux distributions (they were tested on Debian, Ubuntu, Manjaro, SuSE and Fedora). Select the -debian64- file for 64-bit machines and the -debian32- file for 32-bit machines.&lt;br /&gt;
&lt;br /&gt;
In case you use an older distribution and encounter difficulties to run GNU ARM Eclipse OpenOCD, you can also try to build it from sources on your machine. As a last resort, if your distribution includes an OpenOCD package, you can install it using the specific tools.&lt;br /&gt;
&lt;br /&gt;
To install this package, unpack the archive and copy it to where you install binaries, eg. &#039;&#039;&#039;/opt/gnuarmeclipse/openocd/${version}&#039;&#039;&#039; or &#039;&#039;&#039;/usr/local/gnuarmeclipse/openocd/${version}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 sudo mkdir -p /opt/gnuarmeclipse&lt;br /&gt;
 cd /opt/gnuarmeclipse&lt;br /&gt;
 sudo tar xvf ~/Downloads/gnuarmeclipse-openocd-debian64-0.9.0-201505190955.tgz&lt;br /&gt;
Note: although perfectly possible to install it in any location, it is recommended to use either of the two above locations&lt;br /&gt;
&lt;br /&gt;
To check if OpenOCD starts and is recent, use:&lt;br /&gt;
&lt;br /&gt;
 $ /opt/gnuarmeclipse/openocd/0.9.0-201505190955/bin/openocd --version   GNU ARM Eclipse 64-bits Open On-Chip Debugger ....&lt;br /&gt;
&lt;br /&gt;
If you’ll ever need to remove OpenOCD, just remove the /opt/gnuarmeclipse, there are no other components stored in system folders (And the UDEV rule).&lt;br /&gt;
&lt;br /&gt;
====UDEV Rules====&lt;br /&gt;
&lt;br /&gt;
For the JTAG probes implemented as USB devices (actually most of them), the last installation step on GNU/Linux is to configure the UDEV subsystem. OpenOCD provides an UDEV rules file defining all the supported IDs; to install it, just copy the file to &#039;&#039;&#039;/etc/udev/rules.d&#039;&#039;&#039; and eventually notify the daemon:&lt;br /&gt;
&lt;br /&gt;
 $ sudo cp /opt/gnuarmeclipse/openocd/0.9.0-201505190955/contrib/99-openocd.rules /etc/udev/rules.d/&lt;br /&gt;
 $ sudo udevadm control --reload-rules&lt;br /&gt;
Note: If you previously installed the J-Link binaries, the USB IDs were already added to UDEV. The above OpenOCD rules file also defines the J-Link ID. Apparently UDEV does not complain; if you encounter problems, just comment out the definition in the OpenOCD file.&lt;br /&gt;
&lt;br /&gt;
==DFU-Util setup==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OBS: Only the anchors (with their Cortex-M0 processor), and the newest versions of the tags (with their Cortex-M4 processor), supports programming through USB (DFU protocol).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Either install DFU-Util from the apt-get repository as&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$ sudo apt-get install dfu-util&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The host-side tool used for programming the devices through USB, is called DFU-Util. &amp;lt;br /&amp;gt;&lt;br /&gt;
The tool can be downloaded at [http://dfu-util.sourceforge.net/releases/ http://dfu-util.sourceforge.net/releases/], and is ready to be used out of the box. &lt;br /&gt;
&lt;br /&gt;
Extract the tool where you usually install programs (for linux this is usually /opt/ or /usr/local/), and choose one of the following three:&lt;br /&gt;
&lt;br /&gt;
# Add the extracted folder to your environment variables ($PATH for linux) &#039;&#039;&#039;(Not recommended for linux)&#039;&#039;&#039;&lt;br /&gt;
#; This can be done on linux by adding the following to &#039;&#039;&#039;&amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt;&#039;&#039;&#039;: &amp;lt;code&amp;gt;export PATH=$PATH:/path/to/DFU-Util/binary_folder/&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add a symbolic link of the DFU-Util binaries to your &#039;&#039;&#039;&amp;lt;code&amp;gt;/usr/bin/&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
#; This can be done by issuing the following command with root privileges: &amp;lt;code&amp;gt;ln -s /path/to/DFU-Util/binary /usr/bin/&amp;lt;/code&amp;gt;&lt;br /&gt;
# The third and last option is to alter the Makefile of the project to contain the absolute path to the DFU-Util binaries &#039;&#039;&#039;(Also NOT recommended)&#039;&#039;&#039;&lt;br /&gt;
#; This can be done by changing the line in the Makefile containing the path to DFU-Util&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DFU-util also comes in a Python version, which is included in the Scripts folder for convenience.&lt;br /&gt;
&lt;br /&gt;
More info about the DFU-Util can be found at [http://dfu-util.sourceforge.net/ http://dfu-util.sourceforge.net/].&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2544</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2544"/>
		<updated>2016-06-20T18:32:05Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Further work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
This page gives an overview of a three dimensional localization system developed. The system can be used in every scenario where it is wanted to obtain some sort of position or velocity information about something, whether it is for ground-truth information, control feedback, surveillance or the like. A few examples of such places could be:&lt;br /&gt;
&lt;br /&gt;
* Robotic control position and velocity feedback, for autonomous usage&lt;br /&gt;
* Ground-truth to test other approaches&lt;br /&gt;
* Inventory tagging&lt;br /&gt;
* Personnel location information&lt;br /&gt;
* Intelligent transportation in regards to eg. smarter vehicles&lt;br /&gt;
&lt;br /&gt;
The position and velocity estimates are available wherever they are needed, whether that is onboard the host as data extraction from the tag itself or at a specific anchor for data logging purposes. &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore the system features extremely rapid deployment, as the anchors will be able to find their own position in a matter of seconds from first power. This means that the system can be set-up and ready to be used in a matter of minutes, without loss of accuracy.&lt;br /&gt;
&lt;br /&gt;
The developed system, is intended to be used as closed-environment system, meaning that it is intended to not require anything of the host carrying the tag. This means that the system is extremely versatile and can be used almost anywhere, as the host is not required to run any timing specific software. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 As the Kalman filter is still not fully implemented, and thus not tested, this section still needs some information about the Kalman filter. This information will be added during the 3 weeks period of June, 2016.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2543</id>
		<title>Localization Hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2543"/>
		<updated>2016-06-13T12:01:15Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Known errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Tag anchor.jpg|thumb|right|500px|A tag and an anchor]]&lt;br /&gt;
&lt;br /&gt;
This page describes the hardware design of the [[3D localization]] system.&lt;br /&gt;
&lt;br /&gt;
The anchors and tags are made up of some main components as described in the table below. The main difference is that the anchors have 180&amp;amp;#176; of the antenna shielded in order to allow mounting on walls and ceilings without changing the antenna properties from reflections, other than that the tags contains a high precision IMU for sensor fusion in order to improve the velocity estimates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;50%&amp;quot;&lt;br /&gt;
|+ Main hardware elements of anchors and tags&lt;br /&gt;
|-&lt;br /&gt;
! Anchors&lt;br /&gt;
! Tag&lt;br /&gt;
|-&lt;br /&gt;
| a cortex-m0 processor from ST (STM32f072)    &lt;br /&gt;
| a cortex-m3 processor from ST (STM32f103)    &lt;br /&gt;
|-&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
|-&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
|-&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
| a high precision IMU (MPU-9250)&lt;br /&gt;
|-&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Connectivity===&lt;br /&gt;
&lt;br /&gt;
The system contains a number of potential ways to extract information. It is possible to connect to the &#039;&#039;&#039;anchors&#039;&#039;&#039; through a UART serial port, a virtual serial port on the USB port, or SWD via eg. openOCD (GDB). In the same way the &#039;&#039;&#039;tags&#039;&#039;&#039; can be reached through the UART port, a virtual serial port through the USB port, SWD or I2C. The next generation of the tags are supposed to SPI extracted from the uC as well for improved connectivity to eg. a robot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Anchors===&lt;br /&gt;
[[File:Anchor layout.png|450px|thumb|right|Anchor layout]]&lt;br /&gt;
The anchor schematic can be seen at [[Media:Anchor_sch.jpg|Anchor schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The anchors can be programmed through either the USB (DFU), or the SWD link that has been broken out to &#039;&#039;J3&#039;&#039;. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging. See [[Arm compiler environment#OpenOCD Setup]] For more info on how to use SWD.&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The anchor hardware is &#039;&#039;still&#039;&#039; error free, meaning that there is yet to be found errors in the newest electronic design.&lt;br /&gt;
The only thing on the list of changes to come in the next revision is a better power control, courtesy of a switch-mode regulator and the ability to utilize the ultra-low power sleep mode of the DW1000 devices. This means that the DWM1000 modules would have to be powered directly from the battery, through its own 3.3v &#039;&#039;always-on&#039;&#039; regulator, with &#039;&#039;EXTON&#039;&#039; connected to the shutdown of the switch-mode. This would allow the anchors to be powered on and off wirelessly, while still maintaining an ultra low power consumption in &#039;&#039;standby mode&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Furthermore it would be a very good idea to combine the bootloader jumper with the user switch, to get rid of both the hardware jumper and the bootloader switch software check.&lt;br /&gt;
&lt;br /&gt;
===The Tags===&lt;br /&gt;
[[File:Tag_layout.png|450px|thumb|right|Tag layout]]&lt;br /&gt;
&lt;br /&gt;
The tag schematic can be seen at [[Media:Tag_sch.jpg|Tag schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags can only be programmed through the SWD link that has been broken out to the &#039;&#039;U6&#039;&#039; connector. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging. See [[Arm compiler environment#OpenOCD Setup]] For more info on how to use SWD. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags furthermore contain a high precision IMU (MPU9250), to allow for sensor fusion with the result of a better velocity estimate. For more info in the sensor fusion see [[3D localization#Sensor fusion]]&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The tags contains at least two known hardware errors, one is the missing load sharing in the charger design (see the anchors for the proper design), and the other known issue, is the &#039;&#039;&#039;regout&#039;&#039;&#039; pin being connected to 3.3v instead of bypassed to ground through 100 nF capacitor. As with the anchors, the next hardware revision of the tags should implement a proper power scheme, through a switch-mode regulator. The next revision will probably loose the battery charger entirely, as the system should be powered through the device you want to track (robot), and as such does not need a battery.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
All the PCB design is done in a software suite called DipTrace, which can be downloaded for free at [http://diptrace.com/ www.diptrace.com]. The software is currently only available in a Windows and Mac OS X version, but runs perfectly through [https://en.wikipedia.org/wiki/Wine_(software) Wine]. DipTrace offers a free student license, allowing a larger design along with some extra features. This student license can be requested by writing an email to the contact address listed at their [http://diptrace.com/buy/academic/ academic] site.&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2533</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2533"/>
		<updated>2016-06-02T16:42:46Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
This page gives an overview of a three dimensional localization system developed. The system can be used in every scenario where it is wanted to obtain some sort of position or velocity information about something, whether it is for ground-truth information, control feedback, surveillance or the like. A few examples of such places could be:&lt;br /&gt;
&lt;br /&gt;
* Robotic control position and velocity feedback, for autonomous usage&lt;br /&gt;
* Ground-truth to test other approaches&lt;br /&gt;
* Inventory tagging&lt;br /&gt;
* Personnel location information&lt;br /&gt;
* Intelligent transportation in regards to eg. smarter vehicles&lt;br /&gt;
&lt;br /&gt;
The position and velocity estimates are available wherever they are needed, whether that is onboard the host as data extraction from the tag itself or at a specific anchor for data logging purposes. &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore the system features extremely rapid deployment, as the anchors will be able to find their own position in a matter of seconds from first power. This means that the system can be set-up and ready to be used in a matter of minutes, without loss of accuracy.&lt;br /&gt;
&lt;br /&gt;
The developed system, is intended to be used as closed-environment system, meaning that it is intended to not require anything of the host carrying the tag. This means that the system is extremely versatile and can be used almost anywhere, as the host is not required to run any timing specific software. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 As the Kalman filter is still not fully implemented, and thus not tested, this section still needs some information about the Kalman filter. This information will be added during the 3 weeks period of June, 2016.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2532</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2532"/>
		<updated>2016-06-02T11:37:04Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Extended Kalman filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
The developed three dimensional localization system, is intended to be used as closed-environment system, meaning that it is intended to not require anything of the host carrying the tag. This means that the system is extremely versatile and can be used almost anywhere, as the host is not required to run any timing specific software. The system can be used in every scenario where it is wanted to obtain some sort of position or velocity information about something, whether it is for ground-truth information, control feedback, surveillance or the like. A few examples of such places could be:&lt;br /&gt;
&lt;br /&gt;
* Robotic control position and velocity feedback, for autonomous usage&lt;br /&gt;
* Ground-truth to test other approaches&lt;br /&gt;
* Inventory tagging&lt;br /&gt;
* Personnel location information&lt;br /&gt;
* Intelligent transportation in regards to eg. smarter vehicles&lt;br /&gt;
&lt;br /&gt;
The position and velocity estimates are available wherever they are needed, whether that is onboard the host as data extraction from the tag itself or at a specific anchor for data logging purposes. &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore the system features extremely rapid deployment, as the anchors will be able to find their own position in a matter of seconds from first power. This means that the system can be set-up and ready to be used in a matter of minutes, without loss of accuracy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 As the Kalman filter is still not fully implemented, and thus not tested, this section still needs some information about the Kalman filter. This information will be added during the 3 weeks period of June, 2016.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2531</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2531"/>
		<updated>2016-06-02T11:30:46Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
The developed three dimensional localization system, is intended to be used as closed-environment system, meaning that it is intended to not require anything of the host carrying the tag. This means that the system is extremely versatile and can be used almost anywhere, as the host is not required to run any timing specific software. The system can be used in every scenario where it is wanted to obtain some sort of position or velocity information about something, whether it is for ground-truth information, control feedback, surveillance or the like. A few examples of such places could be:&lt;br /&gt;
&lt;br /&gt;
* Robotic control position and velocity feedback, for autonomous usage&lt;br /&gt;
* Ground-truth to test other approaches&lt;br /&gt;
* Inventory tagging&lt;br /&gt;
* Personnel location information&lt;br /&gt;
* Intelligent transportation in regards to eg. smarter vehicles&lt;br /&gt;
&lt;br /&gt;
The position and velocity estimates are available wherever they are needed, whether that is onboard the host as data extraction from the tag itself or at a specific anchor for data logging purposes. &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore the system features extremely rapid deployment, as the anchors will be able to find their own position in a matter of seconds from first power. This means that the system can be set-up and ready to be used in a matter of minutes, without loss of accuracy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2530</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2530"/>
		<updated>2016-06-02T11:29:19Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
The developed three dimensional localization system, is intended to be used as closed-environment system, meaning that it is intended to not require anything of the host carrying the tag. This means that the system is extremely versatile and can be used almost anywhere, as the host is not required to run any timing specific software. The system can be used in every scenario where it is wanted to obtain some sort of position or velocity information about something, whether it is for ground-truth information, control feedback, surveillance or the like. A few examples of such places could be:&lt;br /&gt;
&lt;br /&gt;
* Robotic control position and velocity feedback, for autonomous usage&lt;br /&gt;
* Ground-truth to test other approaches&lt;br /&gt;
* Inventory tagging&lt;br /&gt;
* Personnel location information&lt;br /&gt;
* Intelligent transportation in regards to eg. smarter vehicles&lt;br /&gt;
&lt;br /&gt;
The position and velocity estimates are available wherever they are needed, whether that is onboard the host as data extraction from the tag itself or at a specific anchor for data logging purposes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2529</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2529"/>
		<updated>2016-06-02T11:27:34Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
The developed three dimensional localization system, is intended to be used as closed-environment system, meaning that it is intended to not require anything of the host carrying the tag. This means that the system is extremely versatile and can be used almost anywhere, as the host is not required to run any timing specific software. The system can be used in every scenario where it is wanted to obtain some sort of position or velocity information about something, whether it is for ground-truth information, control feedback, surveillance or the like. A few examples of such places could be:&lt;br /&gt;
&lt;br /&gt;
* Robotic control position and velocity feedback, for autonomous usage&lt;br /&gt;
* Ground-truth to test other approaches&lt;br /&gt;
* Inventory tagging&lt;br /&gt;
* Personnel location information&lt;br /&gt;
* Intelligent transportation in regards to eg. smarter vehicles&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2528</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2528"/>
		<updated>2016-06-02T11:09:00Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least four anchors and one tag. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2527</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2527"/>
		<updated>2016-06-02T10:18:31Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Received signal strength bias */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes]&#039;&#039;&#039;, where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2526</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2526"/>
		<updated>2016-06-02T10:17:03Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Nonlinear least squares optimization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository. Furthermore a paper on a non-iterative nonlinear least squares matrix solution to the multilateration problem can be found in &#039;&#039;Related papers/An Efficient Least-Squares Trilateration Algorithm for Mobile Robot Localization.pdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in [http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes], where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2525</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2525"/>
		<updated>2016-06-02T10:14:15Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Received signal strength bias */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in [http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes], where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate. The measurements for this conclusion can be found in &#039;&#039;Matlab/bias&#039;&#039; in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2524</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2524"/>
		<updated>2016-06-02T09:59:47Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Further work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in [http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes], where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with a physical interrupt pin.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2523</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2523"/>
		<updated>2016-06-02T09:59:21Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Further work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in [http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes], where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
* Output API&lt;br /&gt;
*; A proper API on how the host devices can acquire data from the tags, through I2C, USB, UART og SPI. Also allowing a data driven scheme with an interrupt.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2522</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2522"/>
		<updated>2016-06-02T09:57:37Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Further work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in [http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes], where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
*; The current implementation can only handle one tag in the system at a time. This limitation is due to the implemented &#039;&#039;infrastructure based asset tracking scheme&#039;&#039; seen in [[3D localization#Ranging]]. &lt;br /&gt;
* Relative positioning&lt;br /&gt;
*; It would be interesting to implement a way for tags to calculate relative positions, in order to allow robotic formations in an easy manner.&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
*; Allow all of the devices to range to all other devices.&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
*; Implement a proper Kalman filter to fuse info from ranges, IMU and pressure data into a best-case state estimate.&lt;br /&gt;
* Message push-through option&lt;br /&gt;
*; A structured way of utilizing the large data bandwidth of the system, in order to allow devices to exchange communication that is not ranging or position related.&lt;br /&gt;
* Logging&lt;br /&gt;
*; An easy and structured way to log data and set where to output which data at runtime (Debug, Error, Warning, Info). The implementation should furthermore have a log-level that can be set.&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2521</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2521"/>
		<updated>2016-06-02T09:49:35Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Results to date */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in [http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes], where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 Results will be added during the next three weeks (June, 2016). Previous results can be found in the &#039;&#039;Related papers/Previous DTU projects&#039;&#039; folder in the Github repository.&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2520</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2520"/>
		<updated>2016-06-02T09:47:08Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Sensor fusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 Sensor fusion has still to be implemented in the project. The IMU on the tag is currently not used.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in [http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes], where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2519</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2519"/>
		<updated>2016-06-02T08:24:39Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Received signal strength bias */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
The system seems to contain a ranging bias as a function of the received signal strength. The phenomena is discussed in [http://www.decawave.com/support/download/file/nojs/453 APS011: Sources of error in TWR schemes], where a proposed bias correction curve is given as well. Numerous measurements has been taken during this localization project, in order to see whether the antenna shielding of the anchors, changes the required correction curve. It has yet to be proved with absolute certainty, that the provided curve is in fact the best curve or the job, but for now it seems like the provided curve is accurate.&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2518</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2518"/>
		<updated>2016-06-01T17:20:08Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Software download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
The softwares known bugs and issues can be found at [[3d Localization - Software issues]].&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2517</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2517"/>
		<updated>2016-06-01T17:19:06Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2516</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2516"/>
		<updated>2016-06-01T17:18:14Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
[[File:trilat.png|300px|thumb|right|Trilateration example.]]&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2515</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2515"/>
		<updated>2016-06-01T17:17:13Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
[[File:trilat.png|300px]]&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2514</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2514"/>
		<updated>2016-06-01T17:17:04Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
[[File:trilat.png|300px]]&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Trilat.png&amp;diff=2513</id>
		<title>File:Trilat.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Trilat.png&amp;diff=2513"/>
		<updated>2016-06-01T17:16:44Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2512</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2512"/>
		<updated>2016-06-01T17:12:47Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions. The position will be calculated locally on the tag, and can as such be used to eg. control a robot carrying the tag.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2511</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2511"/>
		<updated>2016-06-01T17:11:46Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The system can be used by placing the anchors at fixed known positions in the room,  preferably in different heights, after which the system will measure the distance from each anchor to the tag. These distances can then be combined with the known position of the associated anchor, in order to estimate the absolute position of the tag in three dimensions.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2510</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2510"/>
		<updated>2016-06-01T14:05:18Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone https://repos.gbar.dtu.dk/git/jcan/3d_wb_loc.git&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2509</id>
		<title>Localization Hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2509"/>
		<updated>2016-06-01T12:19:18Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Tag anchor.jpg|thumb|right|500px|A tag and an anchor]]&lt;br /&gt;
&lt;br /&gt;
This page describes the hardware design of the [[3D localization]] system.&lt;br /&gt;
&lt;br /&gt;
The anchors and tags are made up of some main components as described in the table below. The main difference is that the anchors have 180&amp;amp;#176; of the antenna shielded in order to allow mounting on walls and ceilings without changing the antenna properties from reflections, other than that the tags contains a high precision IMU for sensor fusion in order to improve the velocity estimates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;50%&amp;quot;&lt;br /&gt;
|+ Main hardware elements of anchors and tags&lt;br /&gt;
|-&lt;br /&gt;
! Anchors&lt;br /&gt;
! Tag&lt;br /&gt;
|-&lt;br /&gt;
| a cortex-m0 processor from ST (STM32f072)    &lt;br /&gt;
| a cortex-m3 processor from ST (STM32f103)    &lt;br /&gt;
|-&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
|-&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
|-&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
| a high precision IMU (MPU-9250)&lt;br /&gt;
|-&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Connectivity===&lt;br /&gt;
&lt;br /&gt;
The system contains a number of potential ways to extract information. It is possible to connect to the &#039;&#039;&#039;anchors&#039;&#039;&#039; through a UART serial port, a virtual serial port on the USB port, or SWD via eg. openOCD (GDB). In the same way the &#039;&#039;&#039;tags&#039;&#039;&#039; can be reached through the UART port, a virtual serial port through the USB port, SWD or I2C. The next generation of the tags are supposed to SPI extracted from the uC as well for improved connectivity to eg. a robot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Anchors===&lt;br /&gt;
[[File:Anchor layout.png|450px|thumb|right|Anchor layout]]&lt;br /&gt;
The anchor schematic can be seen at [[Media:Anchor_sch.jpg|Anchor schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The anchors can be programmed through either the USB (DFU), or the SWD link that has been broken out to &#039;&#039;J3&#039;&#039;. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging. See [[Arm compiler environment#OpenOCD Setup]] For more info on how to use SWD.&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The anchor hardware is &#039;&#039;still&#039;&#039; error free, meaning that there is yet to be found errors in the newest electronic design.&lt;br /&gt;
The only thing on the list of changes to come in the next revision is a better power control, courtesy of a switch-mode regulator and the ability to utilize the ultra-low power sleep mode of the DW1000 devices. This means that the DWM1000 modules would have to be powered directly from the battery, through its own 3.3v &#039;&#039;always-on&#039;&#039; regulator, with &#039;&#039;EXTON&#039;&#039; connected to the shutdown of the switch-mode. This would allow the anchors to be powered on and off wirelessly, while still maintaining an ultra low power consumption in &#039;&#039;standby mode&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===The Tags===&lt;br /&gt;
[[File:Tag_layout.png|450px|thumb|right|Tag layout]]&lt;br /&gt;
&lt;br /&gt;
The tag schematic can be seen at [[Media:Tag_sch.jpg|Tag schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags can only be programmed through the SWD link that has been broken out to the &#039;&#039;U6&#039;&#039; connector. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging. See [[Arm compiler environment#OpenOCD Setup]] For more info on how to use SWD. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags furthermore contain a high precision IMU (MPU9250), to allow for sensor fusion with the result of a better velocity estimate. For more info in the sensor fusion see [[3D localization#Sensor fusion]]&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The tags contains at least two known hardware errors, one is the missing load sharing in the charger design (see the anchors for the proper design), and the other known issue, is the &#039;&#039;&#039;regout&#039;&#039;&#039; pin being connected to 3.3v instead of bypassed to ground through 100 nF capacitor. As with the anchors, the next hardware revision of the tags should implement a proper power scheme, through a switch-mode regulator. The next revision will probably loose the battery charger entirely, as the system should be powered through the device you want to track (robot), and as such does not need a battery.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
All the PCB design is done in a software suite called DipTrace, which can be downloaded for free at [http://diptrace.com/ www.diptrace.com]. The software is currently only available in a Windows and Mac OS X version, but runs perfectly through [https://en.wikipedia.org/wiki/Wine_(software) Wine]. DipTrace offers a free student license, allowing a larger design along with some extra features. This student license can be requested by writing an email to the contact address listed at their [http://diptrace.com/buy/academic/ academic] site.&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2508</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2508"/>
		<updated>2016-06-01T12:18:04Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2507</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2507"/>
		<updated>2016-06-01T12:17:21Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:File:System close.jpg|thumb|right|600px|Full system with 6 anchors and 3 tags.]]&lt;br /&gt;
&lt;br /&gt;
 TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:System_distributed.jpg&amp;diff=2506</id>
		<title>File:System distributed.jpg</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:System_distributed.jpg&amp;diff=2506"/>
		<updated>2016-06-01T12:16:29Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:System_close.jpg&amp;diff=2505</id>
		<title>File:System close.jpg</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:System_close.jpg&amp;diff=2505"/>
		<updated>2016-06-01T12:15:33Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Tag_anchor.jpg&amp;diff=2504</id>
		<title>File:Tag anchor.jpg</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Tag_anchor.jpg&amp;diff=2504"/>
		<updated>2016-06-01T12:14:43Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2503</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2503"/>
		<updated>2016-06-01T09:45:00Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Positioning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term (where r is the distance between the tag and the i&#039;th anchor)&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=File:Position-minimize.png&amp;diff=2502</id>
		<title>File:Position-minimize.png</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=File:Position-minimize.png&amp;diff=2502"/>
		<updated>2016-06-01T09:44:04Z</updated>

		<summary type="html">&lt;p&gt;S123950: S123950 uploaded a new version of &amp;amp;quot;File:Position-minimize.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2501</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2501"/>
		<updated>2016-06-01T07:28:45Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Extended Kalman filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2500</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2500"/>
		<updated>2016-06-01T07:28:37Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Extended Kalman filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
 * TODO: Elaborate on the use of Kalman&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2499</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2499"/>
		<updated>2016-05-31T17:07:27Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Nonlinear least squares optimization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system, can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2498</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2498"/>
		<updated>2016-05-31T17:07:06Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Nonlinear least squares optimization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates. &amp;lt;br /&amp;gt;&lt;br /&gt;
A nonlinear least squares implementation done in Matlab for the system can be found in the &#039;&#039;Matlab&#039;&#039; folder in the github repository.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2497</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2497"/>
		<updated>2016-05-31T14:12:53Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Further reading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
More resources on the subject can be found at:&lt;br /&gt;
* [http://www.decawave.com/support http://www.decawave.com/support] (Requires free signup to download)&lt;br /&gt;
* [https://groups.google.com/forum/#!forum/decawave_group https://groups.google.com/forum/#!forum/decawave_group] (Requires membership, everyone can obtain free membership)&lt;br /&gt;
* The &#039;&#039;Related papers&#039;&#039; folder in github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2496</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2496"/>
		<updated>2016-05-31T14:06:49Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Network topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
 TODO: Add a link to decawaves resources page, talk about the google-groups group and mention the &amp;quot;Relevant papers&amp;quot; folder in Github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2495</id>
		<title>3D localization</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=3D_localization&amp;diff=2495"/>
		<updated>2016-05-31T13:52:17Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* Extended Kalman filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; TODO: Short intro to the system, the need for such system, possible applications and a short overview.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
The localization system at hand consists of at least 4 &#039;&#039;&#039;anchors&#039;&#039;&#039; and a &#039;&#039;&#039;tag&#039;&#039;&#039;. &amp;lt;br /&amp;gt;&lt;br /&gt;
The hardware design considerations, descriptions and overviews can be found at the [[Localization Hardware]] page. &amp;lt;br /&amp;gt;&lt;br /&gt;
Each device communicates and ranges with each other through an UWB ([https://en.wikipedia.org/wiki/Ultra-wideband Ultra-wideband]) radio.&lt;br /&gt;
&lt;br /&gt;
==Software download==&lt;br /&gt;
&lt;br /&gt;
The source code for the system is available here.&lt;br /&gt;
NB! the software source can not be compiled without the proper tool-chain (see [[Arm compiler environment]] for instructions on how to set this up)&lt;br /&gt;
&lt;br /&gt;
A Github repository for the project is available at&lt;br /&gt;
&lt;br /&gt;
 TODO: Add github here!&lt;br /&gt;
&lt;br /&gt;
On a Linux computer this can be cloned as:&lt;br /&gt;
 git clone Something!&lt;br /&gt;
&lt;br /&gt;
==Install software tools==&lt;br /&gt;
&lt;br /&gt;
In order to modify the software, some tools are required.&lt;br /&gt;
&lt;br /&gt;
* [[Arm compiler environment]] and tool-chain - Linux&lt;br /&gt;
* [[Localization Hardware]]&lt;br /&gt;
&lt;br /&gt;
==Network topology==&lt;br /&gt;
&lt;br /&gt;
[[File:Network flow.png|350px|thumb|right|Network notification flowchart for anchor and tag]]&lt;br /&gt;
&lt;br /&gt;
The system is able to automatically register when new devices are joining the network, and as such automatically hand out network addresses to all new devices. This is done by having the tag issue a broadcast message once a second, in order to allow any new non-registered devices to answer back, letting the tag know there is an additional device available. The broadcast message is what&#039;s called a Blink message, which is actually just a very short message containing no info.&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write some more about this, and possibilities of auto-positioning for rapid-deployment&lt;br /&gt;
&lt;br /&gt;
==Ranging==&lt;br /&gt;
&lt;br /&gt;
[[File:DS-TWR.png|400px|thumb|right|Double-sided two way ranging scheme. Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
In order to estimate the distance between an anchor and a tag, the system uses [https://en.wikipedia.org/wiki/Time_of_flight Time of Flight (TOF)]. There exists a number of ways to estimate a distance from exchanging packages with timestamps, all with different pros and cons, which has been discussed elaborately in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039;. In this project, it has been chosen to implement and use the double-sided two way ranging scheme as shown in the figure to the right. This method has the advantage that it is the best method for handling any clock skew between the two devices, this means that it will have a smaller impact on the range estimate, if the clock in one device is running slightly faster than the clock of the other device. &amp;lt;br /&amp;gt;&lt;br /&gt;
The average time of flight between the two devices can be calculated as&lt;br /&gt;
&lt;br /&gt;
:[[File:DS-TWR-calc.png]]&lt;br /&gt;
&lt;br /&gt;
From this the distance can be calculated by multiplying the propagation time with the [https://en.wikipedia.org/wiki/Speed_of_light speed of light]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DS-TWR ranging scheme mentioned above can then be extended through the use of broadcast messages, in order to minimize the required number of data exchanges between devices. One such way could be through the infrastructure based asset tracking scheme as implemented in this project. In this ranging scheme the tag sends a Poll message as a broadcast, which is received by a number of anchors (three in the following case) in the infrastructure. Each anchor then replies in successive responses with packets RespA, RespB &amp;amp; RespC after which the tag, sends the Final message as a broadcast again, received by all three anchors. This allows the tag to be located after sending only 2 messages and receiving 3 (including another 3 if the distances are needed on the tag). &lt;br /&gt;
&lt;br /&gt;
This scheme is illustrated in the figure below.&lt;br /&gt;
This represents a substantial saving in message traffic, thereby saving battery power and air-time, while increasing potential update rate.&lt;br /&gt;
&lt;br /&gt;
[[File:Infrastructure-based-asset-tracking.png|800px|Infrastructure based asset tracking scheme based on  asymmetric double-sided two way ranging (DS-TWR). Image taken from DW1000 User manual.]]&lt;br /&gt;
&lt;br /&gt;
 * TODO: Write a bit about peer-to-peer ranging schemes for lower update rate, but where every device knows the distance to every other device.&lt;br /&gt;
&lt;br /&gt;
==Positioning==&lt;br /&gt;
The 3d position of the tag can be estimated, through [https://en.wikipedia.org/wiki/Multilateration multilateration] by using ranges to at least four different anchors. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Because there is noise in the distance estimations performed by the system, the multilateration has the issue of becoming an optimization problem. This is because there is no exact solution to the multilateration problem at hand, but there will exist a solution that minimizes the sum of the errors in the euclidean distances. Mathematically speaking that is a position solution (x,y,z) that will minimize the term&lt;br /&gt;
&lt;br /&gt;
[[File:Position-minimize.png]]&lt;br /&gt;
&lt;br /&gt;
Furthermore the complexity of the optimization tends to increase with more anchors being added into the system.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to solve the optimization problem described above, some of which will be discussed here.&lt;br /&gt;
&lt;br /&gt;
====Nonlinear least squares optimization====&lt;br /&gt;
The direct way of solving the multilateration problem, would be through a least squares approximation. This is an iterative way of solving the problem in a purely non-statistical way, which means that it does not take into account what the previous solution was, and as such allows the tag to move an infinite distance between two consecutive samples. Another downside of the least squares method for solving the optimization problem, is that it is slightly harder to extend the system to provide more details, like velocity estimates.&lt;br /&gt;
&lt;br /&gt;
====Particle filter====&lt;br /&gt;
Another way of solving the optimization problem, is by utilizing a statistical particle filter, also known as a sequential Monte Carlo filter. The base idea of a particle filter, is that a number of &amp;quot;particles&amp;quot;, containing a direction and a speed, is spawned in a distributed manner and is then perturbed, with the goal of having the particles converge towards the same point, with a unified direction and speed. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter is a statistical filter, meaning that it takes into account the previous solutions found. &amp;lt;br /&amp;gt;&lt;br /&gt;
The particle filter has &#039;&#039;&#039;not&#039;&#039;&#039; been implemented or tested for this project, but a sample implementation, in Python, of such filter for this specific use case can be found at [https://github.com/bitcraze/lps-ros https://github.com/bitcraze/lps-ros].&lt;br /&gt;
&lt;br /&gt;
====Extended Kalman filter====&lt;br /&gt;
The last method of solving the optimization problem discussed here, will be the Extended Kalman filter. This way is, like the particle filter, a statistical filter capable of estimating a number of details about the system such as position, velocity and even accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
===Sensor fusion===&lt;br /&gt;
&lt;br /&gt;
 TODO.&lt;br /&gt;
&lt;br /&gt;
==Limitations==&lt;br /&gt;
The system does come with a few limitations, which will be discussed below.&lt;br /&gt;
&lt;br /&gt;
===Line of sight (LOS)===&lt;br /&gt;
The most important limitation is that it is very sensitive to line of sight (LOS). This means that the tag trying to localize itself, should always have pure line of sight to at least 4 anchors, which is why it is recommended to run the system with 6 or more anchors, as this would give the system redundancy. It is possible to get a clue about whether the most recent range measurement was taken in a line of sight situation or not, by looking at the quality of the measurement. This quality is a combination of the received power level and the first path power level, and is discussed further in the &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/744 DW1000 User manual]&#039;&#039;&#039; on page 45.&lt;br /&gt;
&lt;br /&gt;
===Calibration===&lt;br /&gt;
Because the system is based on time of flight measurements of radio waves, even a small change in the time stamps of the system will result in huge variations in distance (1 ns results in a change of 299 mm). This means that proper calibration of the system is crucial in order to obtain any usable performance. The main calibration property of the system is the antenna delay constants, a constant describing the delay from antenna through PCB. A detailed explanation of the antenna delay and how to calibrate it properly can be found in  &#039;&#039;&#039;[http://www.decawave.com/support/download/file/nojs/552 APS014: Antennna Delay Calibration]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Range===&lt;br /&gt;
The range of the system varies tremendously, as a function of channel, header length, data rate, transmission power etc. A longer communication range usually means a lower data rate and a less accurate distance estimate of the system. With the configuration currently chosen for the system, the range is about 25 m, as the system is configured for the best distance approximation as possible. The relatively short range is however not a problem in this case, as the system is intended to be used indoors, where a room is seldom larger than 25 meters end-to-end.&lt;br /&gt;
&lt;br /&gt;
===Received signal strength bias===&lt;br /&gt;
&lt;br /&gt;
 TODO: Write about the bias!&lt;br /&gt;
&lt;br /&gt;
==Results to date==&lt;br /&gt;
&lt;br /&gt;
 BIG TODO&lt;br /&gt;
&lt;br /&gt;
==Further work==&lt;br /&gt;
&lt;br /&gt;
* Multiple tags&lt;br /&gt;
* Relative positioning&lt;br /&gt;
* Peer-to-peer mesh ranging scheme&lt;br /&gt;
* Sensor fusion in EKF or preferably UKF&lt;br /&gt;
* Message push-through option&lt;br /&gt;
* Logging&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
&lt;br /&gt;
 TODO: Add a link to decawaves resources page, talk about the google-groups group and mention the &amp;quot;Relevant papers&amp;quot; folder in Github&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2494</id>
		<title>Localization Hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2494"/>
		<updated>2016-05-31T13:39:59Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the hardware design of the [[3D localization]] system.&lt;br /&gt;
&lt;br /&gt;
The anchors and tags are made up of some main components as described in the table below. The main difference is that the anchors have 180&amp;amp;#176; of the antenna shielded in order to allow mounting on walls and ceilings without changing the antenna properties from reflections, other than that the tags contains a high precision IMU for sensor fusion in order to improve the velocity estimates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;50%&amp;quot;&lt;br /&gt;
|+ Main hardware elements of anchors and tags&lt;br /&gt;
|-&lt;br /&gt;
! Anchors&lt;br /&gt;
! Tag&lt;br /&gt;
|-&lt;br /&gt;
| a cortex-m0 processor from ST (STM32f072)    &lt;br /&gt;
| a cortex-m3 processor from ST (STM32f103)    &lt;br /&gt;
|-&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
|-&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
|-&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
| a high precision IMU (MPU-9250)&lt;br /&gt;
|-&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Connectivity===&lt;br /&gt;
&lt;br /&gt;
The system contains a number of potential ways to extract information. It is possible to connect to the &#039;&#039;&#039;anchors&#039;&#039;&#039; through a UART serial port, a virtual serial port on the USB port, or SWD via eg. openOCD (GDB). In the same way the &#039;&#039;&#039;tags&#039;&#039;&#039; can be reached through the UART port, a virtual serial port through the USB port, SWD or I2C. The next generation of the tags are supposed to SPI extracted from the uC as well for improved connectivity to eg. a robot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Anchors===&lt;br /&gt;
[[File:Anchor layout.png|450px|thumb|right|Anchor layout]]&lt;br /&gt;
The anchor schematic can be seen at [[Media:Anchor_sch.jpg|Anchor schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The anchors can be programmed through either the USB (DFU), or the SWD link that has been broken out to &#039;&#039;J3&#039;&#039;. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging. See [[Arm compiler environment#OpenOCD Setup]] For more info on how to use SWD.&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The anchor hardware is &#039;&#039;still&#039;&#039; error free, meaning that there is yet to be found errors in the newest electronic design.&lt;br /&gt;
The only thing on the list of changes to come in the next revision is a better power control, courtesy of a switch-mode regulator and the ability to utilize the ultra-low power sleep mode of the DW1000 devices. This means that the DWM1000 modules would have to be powered directly from the battery, through its own 3.3v &#039;&#039;always-on&#039;&#039; regulator, with &#039;&#039;EXTON&#039;&#039; connected to the shutdown of the switch-mode. This would allow the anchors to be powered on and off wirelessly, while still maintaining an ultra low power consumption in &#039;&#039;standby mode&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===The Tags===&lt;br /&gt;
[[File:Tag_layout.png|450px|thumb|right|Tag layout]]&lt;br /&gt;
&lt;br /&gt;
The tag schematic can be seen at [[Media:Tag_sch.jpg|Tag schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags can only be programmed through the SWD link that has been broken out to the &#039;&#039;U6&#039;&#039; connector. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging. See [[Arm compiler environment#OpenOCD Setup]] For more info on how to use SWD. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags furthermore contain a high precision IMU (MPU9250), to allow for sensor fusion with the result of a better velocity estimate. For more info in the sensor fusion see [[3D localization#Sensor fusion]]&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The tags contains at least two known hardware errors, one is the missing load sharing in the charger design (see the anchors for the proper design), and the other known issue, is the &#039;&#039;&#039;regout&#039;&#039;&#039; pin being connected to 3.3v instead of bypassed to ground through 100 nF capacitor. As with the anchors, the next hardware revision of the tags should implement a proper power scheme, through a switch-mode regulator. The next revision will probably loose the battery charger entirely, as the system should be powered through the device you want to track (robot), and as such does not need a battery.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
All the PCB design is done in a software suite called DipTrace, which can be downloaded for free at [http://diptrace.com/ www.diptrace.com]. The software is currently only available in a Windows and Mac OS X version, but runs perfectly through [https://en.wikipedia.org/wiki/Wine_(software) Wine]. DipTrace offers a free student license, allowing a larger design along with some extra features. This student license can be requested by writing an email to the contact address listed at their [http://diptrace.com/buy/academic/ academic] site.&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2493</id>
		<title>Localization Hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2493"/>
		<updated>2016-05-31T13:37:49Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the hardware design of the [[3D localization]] system.&lt;br /&gt;
&lt;br /&gt;
The anchors and tags are made up of some main components as described in the table below. The main difference is that the anchors have 180&amp;amp;#176; of the antenna shielded in order to allow mounting on walls and ceilings without changing the antenna properties from reflections, other than that the tags contains a high precision IMU for sensor fusion in order to improve the velocity estimates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;50%&amp;quot;&lt;br /&gt;
|+ Main hardware elements of anchors and tags&lt;br /&gt;
|-&lt;br /&gt;
! Anchors&lt;br /&gt;
! Tag&lt;br /&gt;
|-&lt;br /&gt;
| a cortex-m0 processor from ST (STM32f072)    &lt;br /&gt;
| a cortex-m3 processor from ST (STM32f103)    &lt;br /&gt;
|-&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
|-&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
|-&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
| a high precision IMU (MPU-9250)&lt;br /&gt;
|-&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Connectivity===&lt;br /&gt;
&lt;br /&gt;
The system contains a number of potential ways to extract information. It is possible to connect to the &#039;&#039;&#039;anchors&#039;&#039;&#039; through a UART serial port, a virtual serial port on the USB port, or SWD via eg. openOCD (GDB). In the same way the &#039;&#039;&#039;tags&#039;&#039;&#039; can be reached through the UART port, a virtual serial port through the USB port, SWD or I2C. The next generation of the tags are supposed to SPI extracted from the uC as well for improved connectivity to eg. a robot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Anchors===&lt;br /&gt;
[[File:Anchor layout.png|450px|thumb|right|Anchor layout]]&lt;br /&gt;
The anchor schematic can be seen at [[Media:Anchor_sch.jpg|Anchor schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The anchors can be programmed through either the USB (DFU), or the SWD link that has been broken out to &#039;&#039;J3&#039;&#039;. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging.&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The anchor hardware is &#039;&#039;still&#039;&#039; error free, meaning that there is yet to be found errors in the newest electronic design.&lt;br /&gt;
The only thing on the list of changes to come in the next revision is a better power control, courtesy of a switch-mode regulator and the ability to utilize the ultra-low power sleep mode of the DW1000 devices. This means that the DWM1000 modules would have to be powered directly from the battery, through its own 3.3v &#039;&#039;always-on&#039;&#039; regulator, with &#039;&#039;EXTON&#039;&#039; connected to the shutdown of the switch-mode. This would allow the anchors to be powered on and off wirelessly, while still maintaining an ultra low power consumption in &#039;&#039;standby mode&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===The Tags===&lt;br /&gt;
[[File:Tag_layout.png|450px|thumb|right|Tag layout]]&lt;br /&gt;
&lt;br /&gt;
The tag schematic can be seen at [[Media:Tag_sch.jpg|Tag schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags can only be programmed through the SWD link that has been broken out to the &#039;&#039;U6&#039;&#039; connector. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags furthermore contain a high precision IMU (MPU9250), to allow for sensor fusion with the result of a better velocity estimate. For more info in the sensor fusion see [[3D localization#Sensor fusion]]&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The tags contains at least two known hardware errors, one is the missing load sharing in the charger design (see the anchors for the proper design), and the other known issue, is the &#039;&#039;&#039;regout&#039;&#039;&#039; pin being connected to 3.3v instead of bypassed to ground through 100 nF capacitor. As with the anchors, the next hardware revision of the tags should implement a proper power scheme, through a switch-mode regulator. The next revision will probably loose the battery charger entirely, as the system should be powered through the device you want to track (robot), and as such does not need a battery.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
All the PCB design is done in a software suite called DipTrace, which can be downloaded for free at [http://diptrace.com/ www.diptrace.com]. The software is currently only available in a Windows and Mac OS X version, but runs perfectly through [https://en.wikipedia.org/wiki/Wine_(software) Wine]. DipTrace offers a free student license, allowing a larger design along with some extra features. This student license can be requested by writing an email to the contact address listed at their [http://diptrace.com/buy/academic/ academic] site.&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2492</id>
		<title>Localization Hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2492"/>
		<updated>2016-05-31T13:37:23Z</updated>

		<summary type="html">&lt;p&gt;S123950: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the hardware design of the [[3D localization]] system.&lt;br /&gt;
&lt;br /&gt;
The anchors and tags are made up of some main components as described in the table below. The main difference is that the anchors have 180&amp;amp;#176; of the antenna shielded in order to allow mounting on walls and ceilings without changing the antenna properties from reflections, other than that the tags contains a high precision IMU for sensor fusion in order to improve the velocity estimates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;50%&amp;quot;&lt;br /&gt;
|+ Main hardware elements of anchors and tags&lt;br /&gt;
|-&lt;br /&gt;
! Anchors&lt;br /&gt;
! Tag&lt;br /&gt;
|-&lt;br /&gt;
| a cortex-m0 processor from ST (STM32f072)    &lt;br /&gt;
| a cortex-m3 processor from ST (STM32f103)    &lt;br /&gt;
|-&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
|-&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
|-&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
| a high precision IMU (MPU-9250)&lt;br /&gt;
|-&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Connectivity===&lt;br /&gt;
&lt;br /&gt;
The system contains a number of potential ways to extract information. It is possible to connect to the &#039;&#039;&#039;anchors&#039;&#039;&#039; through a UART serial port, a virtual serial port on the USB port, or SWD via eg. openOCD (GDB). In the same way the &#039;&#039;&#039;tags&#039;&#039;&#039; can be reached through the UART port, a virtual serial port through the USB port, SWD or I2C. The next generation of the tags are supposed to SPI extracted from the uC as well for improved connectivity to eg. a robot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Anchors===&lt;br /&gt;
[[File:Anchor layout.png|450px|thumb|right|Anchor layout]]&lt;br /&gt;
The anchor schematic can be seen at [[Media:Anchor_sch.jpg|Anchor schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The anchors can be programmed through either the USB (DFU), or the SWD link that has been broken out to &#039;&#039;J3&#039;&#039;. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging.&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The anchor hardware is &#039;&#039;still&#039;&#039; error free, meaning that there is yet to be found errors in the newest electronic design.&lt;br /&gt;
The only thing on the list of changes to come in the next revision is a better power control, courtesy of a switch-mode regulator and the ability to utilize the ultra-low power sleep mode of the DW1000 devices. This means that the DWM1000 modules would have to be powered directly from the battery, through its own 3.3v &#039;&#039;always-on&#039;&#039; regulator, with &#039;&#039;EXTON&#039;&#039; connected to the shutdown of the switch-mode. This would allow the anchors to be powered on and off wirelessly, while still maintaining an ultra low power consumption in &#039;&#039;standby mode&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===The Tags===&lt;br /&gt;
[[File:Tag_layout.png|450px|thumb|right|Tag layout]]&lt;br /&gt;
&lt;br /&gt;
The tag schematic can be seen at [[Media:Tag_sch.jpg|Tag schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags can only be programmed through the SWD link that has been broken out to the &#039;&#039;U6&#039;&#039; connector. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags furthermore contain a high precision IMU (MPU9250), to allow for sensor fusion with the result of a better velocity estimate. For more info in the sensor fusion see [[3D Localization#Sensor fusion]]&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The tags contains at least two known hardware errors, one is the missing load sharing in the charger design (see the anchors for the proper design), and the other known issue, is the &#039;&#039;&#039;regout&#039;&#039;&#039; pin being connected to 3.3v instead of bypassed to ground through 100 nF capacitor. As with the anchors, the next hardware revision of the tags should implement a proper power scheme, through a switch-mode regulator. The next revision will probably loose the battery charger entirely, as the system should be powered through the device you want to track (robot), and as such does not need a battery.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
All the PCB design is done in a software suite called DipTrace, which can be downloaded for free at [http://diptrace.com/ www.diptrace.com]. The software is currently only available in a Windows and Mac OS X version, but runs perfectly through [https://en.wikipedia.org/wiki/Wine_(software) Wine]. DipTrace offers a free student license, allowing a larger design along with some extra features. This student license can be requested by writing an email to the contact address listed at their [http://diptrace.com/buy/academic/ academic] site.&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
	<entry>
		<id>https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2491</id>
		<title>Localization Hardware</title>
		<link rel="alternate" type="text/html" href="https://rsewiki.electro.dtu.dk/index.php?title=Localization_Hardware&amp;diff=2491"/>
		<updated>2016-05-31T13:36:03Z</updated>

		<summary type="html">&lt;p&gt;S123950: /* The Tags */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the hardware design of the [[3D localization]] system.&lt;br /&gt;
&lt;br /&gt;
The anchors and tags are made up of some main components as described in the table below. The main difference is that the anchors have 180&amp;amp;#176; of the antenna shielded in order to allow mounting on walls and ceilings without changing the antenna properties from reflections, other than that the tags contains a high precision IMU for sensor fusion in order to improve the velocity estimates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;50%&amp;quot;&lt;br /&gt;
|+ Main hardware elements of anchors and tags&lt;br /&gt;
|-&lt;br /&gt;
! Anchors&lt;br /&gt;
! Tag&lt;br /&gt;
|-&lt;br /&gt;
| a cortex-m0 processor from ST (STM32f072)    &lt;br /&gt;
| a cortex-m3 processor from ST (STM32f103)    &lt;br /&gt;
|-&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
| an UWB device (DWM1000)&lt;br /&gt;
|-&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
| a pressure sensor (LPS25H)&lt;br /&gt;
|-&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
| a high precision IMU (MPU-9250)&lt;br /&gt;
|-&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
| a 3.3v low noise LDO regulator (MIC5209)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| a single-cell LIPO charger (MCP73831)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Connectivity===&lt;br /&gt;
&lt;br /&gt;
The system contains a number of potential ways to extract information. It is possible to connect to the &#039;&#039;&#039;anchors&#039;&#039;&#039; through a UART serial port, a virtual serial port on the USB port, or SWD via eg. openOCD (GDB). In the same way the &#039;&#039;&#039;tags&#039;&#039;&#039; can be reached through the UART port, a virtual serial port through the USB port, SWD or I2C. The next generation of the tags are supposed to SPI extracted from the uC as well for improved connectivity to eg. a robot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Anchors===&lt;br /&gt;
[[File:Anchor layout.png|450px|thumb|right|Anchor layout]]&lt;br /&gt;
The anchor schematic can be seen at [[Media:Anchor_sch.jpg|Anchor schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The anchors can be programmed through either the USB (DFU), or the SWD link that has been broken out to &#039;&#039;J3&#039;&#039;. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging.&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The anchor hardware is &#039;&#039;still&#039;&#039; error free, meaning that there is yet to be found errors in the newest electronic design.&lt;br /&gt;
The only thing on the list of changes to come in the next revision is a better power control, courtesy of a switch-mode regulator and the ability to utilize the ultra-low power sleep mode of the DW1000 devices. This means that the DWM1000 modules would have to be powered directly from the battery, through its own 3.3v &#039;&#039;always-on&#039;&#039; regulator, with &#039;&#039;EXTON&#039;&#039; connected to the shutdown of the switch-mode. This would allow the anchors to be powered on and off wirelessly, while still maintaining an ultra low power consumption in &#039;&#039;standby mode&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===The Tags===&lt;br /&gt;
[[File:Tag_layout.png|450px|thumb|right|Tag layout]]&lt;br /&gt;
&lt;br /&gt;
The tag schematic can be seen at [[Media:Tag_sch.jpg|Tag schematic]] &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tags can only be programmed through the SWD link that has been broken out to the &#039;&#039;U6&#039;&#039; connector. The SWD protocol is an alternative to the full [https://en.wikipedia.org/wiki/JTAG JTAG], that only used 2 data wires for programming and debugging.&lt;br /&gt;
&lt;br /&gt;
====Known errors====&lt;br /&gt;
The tags contains at least two known hardware errors, one is the missing load sharing in the charger design (see the anchors for the proper design), and the other known issue, is the &#039;&#039;&#039;regout&#039;&#039;&#039; pin being connected to 3.3v instead of bypassed to ground through 100 nF capacitor. As with the anchors, the next hardware revision of the tags should implement a proper power scheme, through a switch-mode regulator. The next revision will probably loose the battery charger entirely, as the system should be powered through the device you want to track (robot), and as such does not need a battery.&lt;br /&gt;
&lt;br /&gt;
 TODO: Add some more content here about the tags, mention ST-Link/V2 and IMU for sensor fusion&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
All the PCB design is done in a software suite called DipTrace, which can be downloaded for free at [http://diptrace.com/ www.diptrace.com]. The software is currently only available in a Windows and Mac OS X version, but runs perfectly through [https://en.wikipedia.org/wiki/Wine_(software) Wine]. DipTrace offers a free student license, allowing a larger design along with some extra features. This student license can be requested by writing an email to the contact address listed at their [http://diptrace.com/buy/academic/ academic] site.&lt;/div&gt;</summary>
		<author><name>S123950</name></author>
	</entry>
</feed>