<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2866652313268705224</id><updated>2026-08-05T03:17:30.949+10:00</updated><category term="Life"/><category term="Heli-Project"/><category term="Me :)"/><title type='text'>**Usman**</title><subtitle type='html'>_______________________________________&#xa;&#xa;|Life, Vision Research,and me|</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-4318247386900179236</id><published>2016-09-03T18:39:00.001+10:00</published><updated>2016-09-03T18:39:24.337+10:00</updated><title type='text'>FINDING OPTIMAL ROTATION AND TRANSLATION BETWEEN CORRESPONDING 3D POINTS</title><content type='html'>&lt;div style=&quot;background-color: white; border: 0px; color: #2b2b2b; font-family: Lato, sans-serif; font-size: 16px; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Finding the&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;optimal/best&lt;/span&gt;&amp;nbsp;rotation and translation between two sets of&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;corresponding&lt;/span&gt;&amp;nbsp;3D point data, so that they are aligned/registered, is a common problem I come across. An&amp;nbsp; illustration of the problem is shown below for the simplest case of 3 corresponding points (the minimum required points to solve).&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhFVYdrUg6g4iJ-dHipZO9LGKUl2Pi8-kGRREYVFyvhj5O2vo_T1Th5947Rr_JmFTc1OgUK1UpmwNjRKmEYBwLfwM-6kaU60jeeG4FYFahyENxwvUDOarCWThEgWBZ1JlPBeqIEZ3QJPU/s1600/optimal_rotation_translation.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;146&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhFVYdrUg6g4iJ-dHipZO9LGKUl2Pi8-kGRREYVFyvhj5O2vo_T1Th5947Rr_JmFTc1OgUK1UpmwNjRKmEYBwLfwM-6kaU60jeeG4FYFahyENxwvUDOarCWThEgWBZ1JlPBeqIEZ3QJPU/s320/optimal_rotation_translation.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
The corresponding points have the same colour,&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;R&lt;/span&gt;&amp;nbsp;is the rotation and&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;t&lt;/span&gt;&amp;nbsp;is the translation. We want to find the best rotation and translation that will align the points in dataset A to dataset B. Here, ‘optimal’ or ‘best’ is in terms of least square errors. This transformation is sometimes called the Euclidean or&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Rigid_transformation&quot; style=&quot;border: 0px; color: #24890d; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Rigid transform&lt;/a&gt;, because it preserves the shape and size. This is in contrast to an affine transform, which includes scaling and shearing.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
This problem arises especially in tasks like 3D point cloud data registration, where the data is obtained from hardware like a 3D laser scanner or the popular Kinect device. The solution I’ll be presenting is from the paper&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;‘A Method for Registration of 3-D Shapes’, by Besl and McKay, 1992.&lt;/span&gt;&lt;/div&gt;
&lt;h1 style=&quot;border: 0px; clear: both; font-family: Lato, sans-serif; font-size: 26px; line-height: 1.3846153846; margin: 36px 0px 12px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Solution overview&lt;/h1&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
We’re solving for&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;R,t&lt;/span&gt;&amp;nbsp;in the equation:&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
B =&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;R&lt;/span&gt;*A +&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;t&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Where R,t are the transforms applied to dataset A to align it with dataset B, as best as possible.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Finding the optimal rigid transformation matrix can be broken down into the following steps:&lt;/div&gt;
&lt;ol style=&quot;border: 0px; font-family: Lato, sans-serif; list-style-image: initial; list-style-position: initial; margin: 0px 0px 24px 20px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Find the centroids of both dataset&lt;/li&gt;
&lt;li style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Bring both dataset to the origin then find the optimal rotation, (matrix&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;R&lt;/span&gt;)&lt;/li&gt;
&lt;li style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Find the translation&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;t&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 style=&quot;border: 0px; clear: both; font-family: Lato, sans-serif; font-size: 26px; line-height: 1.3846153846; margin: 36px 0px 12px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Finding the centroids&lt;/h1&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
This bit is easy, the centroids are just the average point and can be calculated as follows:&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;P = \left[\begin{array}{c} x\\ y\\ z \end{array}\right] &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=P+%3D+%5Cleft%5B%5Cbegin%7Barray%7D%7Bc%7D+x%5C%5C+y%5C%5C+z+%5Cend%7Barray%7D%5Cright%5D+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;P = \left[\begin{array}{c} x\\ y\\ z \end{array}\right] &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;centroid_A = \frac{1}{N} \displaystyle\sum\limits_{i=1}^N P_A^i &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=centroid_A+%3D+%5Cfrac%7B1%7D%7BN%7D+%5Cdisplaystyle%5Csum%5Climits_%7Bi%3D1%7D%5EN+P_A%5Ei+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;centroid_A = \frac{1}{N} \displaystyle\sum\limits_{i=1}^N P_A^i &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;centroid_B = \frac{1}{N} \displaystyle\sum\limits_{i=1}^N P_B^i &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=centroid_B+%3D+%5Cfrac%7B1%7D%7BN%7D+%5Cdisplaystyle%5Csum%5Climits_%7Bi%3D1%7D%5EN+P_B%5Ei+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;centroid_B = \frac{1}{N} \displaystyle\sum\limits_{i=1}^N P_B^i &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here,&amp;nbsp;&lt;img alt=&quot;P_A &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=P_A+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;P_A &quot; /&gt;&amp;nbsp;and&amp;nbsp;&lt;img alt=&quot;P_B&quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=P_B&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;P_B&quot; /&gt;&amp;nbsp;are points in dataset A and B respectively. We will use these values in the next step.&lt;/div&gt;
&lt;h1 style=&quot;border: 0px; clear: both; font-family: Lato, sans-serif; font-size: 26px; line-height: 1.3846153846; margin: 36px 0px 12px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Finding the optimal rotation&lt;/h1&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
There are a few ways of finding optimal rotations between points. The easiest way I found is using&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Singular_value_decomposition&quot; style=&quot;border: 0px; color: #24890d; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Singular Value Decomposition (SVD)&lt;/a&gt;, because it’s a function that is widely available in many programming languages (Matlab, Octave, C using LAPACK, C++ using OpenCV …). SVD is like this powerful magical wand in linear algebra for solving all sorts of numerical problems, but tragically wasn’t taught when I was at uni. I won’t go into details on how it works but rather how to use it. You only need to know that the SVD will decompose/factorise a matrix (call it&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;E)&lt;/span&gt;, into 3 other matrices, such that:&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;[U,S,V] = SVD(E) &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=%5BU,S,V%5D+%3D+SVD(E)+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;[U,S,V] = SVD(E) &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;E = USV^T &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=E+%3D+USV%5ET+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;E = USV^T &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
If E is a square matrix then U, S and V are the same size as well. We’re only interested in square matrices for this problem so I won’t go into detail about rectangular ones.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
To find the optimal rotation we first re-centre both dataset so that both centroids are at the origin, like shown below.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0vsnvPxUEJwkSFGCxoq67aU8LTMVRpV81_Yb53P2mskRozIIfj_i9-Bp3FTYLFCL_ULs7RUs1vznJVmBwmZBNImUo_yiF54NOeyOQMthMimgkTPF1_Y9ON5ljR85EXnwqW254xd0tRMU/s1600/optimal_rotation_translation_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0vsnvPxUEJwkSFGCxoq67aU8LTMVRpV81_Yb53P2mskRozIIfj_i9-Bp3FTYLFCL_ULs7RUs1vznJVmBwmZBNImUo_yiF54NOeyOQMthMimgkTPF1_Y9ON5ljR85EXnwqW254xd0tRMU/s1600/optimal_rotation_translation_3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This removes the translation component, leaving on the rotation to deal with. The next step involves accumulating a matrix, called&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;H&lt;/span&gt;, and using SVD to find the rotation as follows:&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;H = \displaystyle\sum\limits_{i=1}^N (P_A^i - centroid_A)(P_B^i - centroid_B)^T &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=H+%3D+%5Cdisplaystyle%5Csum%5Climits_%7Bi%3D1%7D%5EN+(P_A%5Ei+-+centroid_A)(P_B%5Ei+-+centroid_B)%5ET+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;H = \displaystyle\sum\limits_{i=1}^N (P_A^i - centroid_A)(P_B^i - centroid_B)^T &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;[U,S,V] = SVD(H) &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=%5BU,S,V%5D+%3D+SVD(H)+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;[U,S,V] = SVD(H) &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;R = VU^T &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=R+%3D+VU%5ET+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;R = VU^T &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
H is the familiar covariance matrix.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
At this point you may be thinking, “what the, that easy?!”, and indeed you would be right. One thing to be careful is that you calculate&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;H&lt;/span&gt;correctly. It should end up being a 3×3 matrix, not a 1×1 matrix. Pay close attention to the transpose symbol. It’s doing a multiplication between 2 matrices where the dimensions effectively are, 3×1 and 1×3, respectively. The ordering of the multiplication is also important, doing it the other way will find a rotation from B to A instead.&lt;/div&gt;
&lt;h1 style=&quot;border: 0px; clear: both; font-family: Lato, sans-serif; font-size: 26px; line-height: 1.3846153846; margin: 36px 0px 12px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Special reflection case&lt;/h1&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
There’s a special case when finding the rotation matrix that you have to take care of. Sometimes the SVD will return a ‘reflection’ matrix, which is numerically correct but is actually nonsense in real life. This is addressed by checking the determinant of V (from SVD above) and seeing if it’s negative (-1). If it is then the 3rd column of V is multiplied by -1.&lt;/div&gt;
&lt;pre class=&quot;wp-code-highlight prettyprint prettyprinted&quot; style=&quot;-webkit-hyphens: none; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; font-family: monospace, serif; font-size: 12px; line-height: 16px; margin-bottom: 6px; margin-top: 6px; max-width: 100%; outline: 0px; overflow: auto; padding: 2px 7px; vertical-align: baseline; white-space: pre-wrap; width: 464.515625px; word-wrap: normal;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #000088; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; determinant&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;lt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #006666; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    multiply &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #006666; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;3rd&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; column of V &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #000088; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;by&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #006666; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    recompute R
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #000088; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #000088; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
An alternative check that is possibly more robust was suggested by Nick Lambert&lt;/div&gt;
&lt;pre class=&quot;wp-code-highlight prettyprint prettyprinted&quot; style=&quot;-webkit-hyphens: none; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; font-family: monospace, serif; font-size: 12px; line-height: 16px; margin-bottom: 6px; margin-top: 6px; max-width: 100%; outline: 0px; overflow: auto; padding: 2px 7px; vertical-align: baseline; white-space: pre-wrap; width: 464.515625px; word-wrap: normal;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #000088; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; determinant&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;lt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #006666; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    multiply &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #006666; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;3rd&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; column of R &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #000088; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;by&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #006666; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #000088; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #000088; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
where R is the rotation matrix.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
A big thank you goes to Klass Jan Russcher and Nick Lambert for these solutions.&lt;/div&gt;
&lt;h1 style=&quot;border: 0px; clear: both; font-family: Lato, sans-serif; font-size: 26px; line-height: 1.3846153846; margin: 36px 0px 12px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Finding t&lt;/h1&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
The translation is&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;t = -R \times centroid_A + centroid_B &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=t+%3D+-R+%5Ctimes+centroid_A+%2B+centroid_B+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;t = -R \times centroid_A + centroid_B &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
The centroids are 3×1 column vectors.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
How did I get this? If you remember back, to transform A to B we first had to centre A to its origin. This is where the -centroid_A comes from, though I put the minus sign at the front. We then rotate A, hence R. Then finally translate it to dataset B’s origin, the + centroid_B bit.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
And we’re done!&lt;/div&gt;
&lt;h1 style=&quot;border: 0px; clear: both; font-family: Lato, sans-serif; font-size: 26px; line-height: 1.3846153846; margin: 36px 0px 12px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Note on usage&lt;/h1&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
The solution presented can be used on any size dataset as long as there are at least 3 points. When there are more than 3 points a least square solution is obtained, such that the following error is minimised:&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;err = \displaystyle\sum\limits_{i=1}^N \left|\left|RP_A^i + t -P_B^i \right|\right|^2 &quot; class=&quot;latex&quot; src=&quot;https://s0.wp.com/latex.php?latex=err+%3D+%5Cdisplaystyle%5Csum%5Climits_%7Bi%3D1%7D%5EN+%5Cleft%7C%5Cleft%7CRP_A%5Ei+%2B+t+-P_B%5Ei+%5Cright%7C%5Cright%7C%5E2+&amp;amp;bg=ffffff&amp;amp;fg=000000&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;err = \displaystyle\sum\limits_{i=1}^N \left|\left|RP_A^i + t -P_B^i \right|\right|^2 &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-family: Lato, sans-serif; margin-bottom: 24px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
Here, the operator ||&amp;nbsp; || is the Euclidean distance between two vectors, a scalar value.&amp;nbsp;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;er&lt;/span&gt;r is just the square distance error between the points in the two dataset.&lt;/div&gt;
&lt;div&gt;
source(Great tutorial from :::http://nghiaho.com/?page_id=671)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/4318247386900179236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2016/09/finding-optimal-rotation-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/4318247386900179236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/4318247386900179236'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2016/09/finding-optimal-rotation-and.html' title='FINDING OPTIMAL ROTATION AND TRANSLATION BETWEEN CORRESPONDING 3D POINTS'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhFVYdrUg6g4iJ-dHipZO9LGKUl2Pi8-kGRREYVFyvhj5O2vo_T1Th5947Rr_JmFTc1OgUK1UpmwNjRKmEYBwLfwM-6kaU60jeeG4FYFahyENxwvUDOarCWThEgWBZ1JlPBeqIEZ3QJPU/s72-c/optimal_rotation_translation.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-3633419889675252466</id><published>2015-04-12T03:01:00.002+10:00</published><updated>2015-04-12T03:01:44.280+10:00</updated><title type='text'>Carina 2 &quot;Self Driving Car&quot; </title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;I have been following AV 
related projects and one of them is from Brazil &quot;Carina 2 Self driving&quot;.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;Demo in News:&lt;br /&gt;
(Self driving Toyota Carina and Volvo with smart-auto-cruise )&amp;nbsp;&amp;nbsp; &lt;a href=&quot;https://mail.i2r.a-star.edu.sg/OWA/redir.aspx?C=cUwc-SqWRUmCIqE5ItHpmHtRlTD1R9IIX9zpG3hFo50JO9Dgf7DxsRdLOfFH6SoSEdg_ekrfk5s.&amp;amp;URL=https%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dudk9NdQoVFE&quot; target=&quot;_blank&quot;&gt;https://www.youtube.com/watch?v=udk9NdQoVFE&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;The Toyota Carina is using the map based localization using high-end GPS+wheel encoder+IMU+velodyne for localization (with precise map they do monte-carlo localization. The map is 2D occupancy of elevations). They have drive-by-wire (actuators for steering control, brake, gas). The obstacle detection is mainly done using velodyne 3D data (I presume elevation thresholding for free-space detection). &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;The Volvo car uses the camera plus radar for smart auto-cruise feature. Keeping in lane (using vision camera) and avoiding obstacle using radar information for automatic steering and gas/brake control&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;br /&gt;
Localization Technology: Map based localization using Velodyne+GPS+encoder+IMU &lt;br /&gt;
Object Detection: Velodyne and also Camera for free-space detection (code link below)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some resources:&lt;br /&gt;
a- They have open source code for road-detection using neural network (free space)&lt;br /&gt;
video:https://www.youtube.com/watch?v=FEePJBn3Yos&lt;br /&gt;
code: &lt;a href=&quot;https://mail.i2r.a-star.edu.sg/OWA/redir.aspx?C=cUwc-SqWRUmCIqE5ItHpmHtRlTD1R9IIX9zpG3hFo50JO9Dgf7DxsRdLOfFH6SoSEdg_ekrfk5s.&amp;amp;URL=http%3a%2f%2fwww.lrm.icmc.usp.br%2fweb%2findex.php%3fn%3dSite.ProjRoadANN&quot; target=&quot;_blank&quot;&gt;http://www.lrm.icmc.usp.br/web/index.php?n=Site.ProjRoadANN&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
b- Multiple vehicle simulation network&lt;br /&gt;
Video: &lt;a href=&quot;https://mail.i2r.a-star.edu.sg/OWA/redir.aspx?C=cUwc-SqWRUmCIqE5ItHpmHtRlTD1R9IIX9zpG3hFo50JO9Dgf7DxsRdLOfFH6SoSEdg_ekrfk5s.&amp;amp;URL=https%3a%2f%2fwww.youtube.com%2fwatch%3fv%3d0Hg2ntnhhEM&quot; target=&quot;_blank&quot;&gt;https://www.youtube.com/watch?v=0Hg2ntnhhEM&lt;/a&gt;&lt;br /&gt;
Description: &lt;a href=&quot;https://mail.i2r.a-star.edu.sg/OWA/redir.aspx?C=cUwc-SqWRUmCIqE5ItHpmHtRlTD1R9IIX9zpG3hFo50JO9Dgf7DxsRdLOfFH6SoSEdg_ekrfk5s.&amp;amp;URL=http%3a%2f%2fwww.lrm.icmc.usp.br%2fweb%2findex.php%3fn%3dSite.ProjSimul&quot; target=&quot;_blank&quot;&gt;http://www.lrm.icmc.usp.br/web/index.php?n=Site.ProjSimul&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/3633419889675252466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2015/04/carina-2-self-driving-car.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/3633419889675252466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/3633419889675252466'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2015/04/carina-2-self-driving-car.html' title='Carina 2 &quot;Self Driving Car&quot; '/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-5416433139634129075</id><published>2015-04-12T02:55:00.000+10:00</published><updated>2015-04-12T02:55:05.089+10:00</updated><title type='text'>Insight into Mercedes Autonomous Vehicle &quot;On a memorial Bertha Benz route&quot;</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;Recently published [1] article details the Mercedes Autonomous Vehicle. The keypoints from&amp;nbsp;&lt;/span&gt;localisation/perception perspective are highlighted here:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;b&gt;
1- Localization&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;Using stereo/backward monocular camera plus high-end IMU/GPS/wheel-encoder to make offline maps.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;During the online&amp;nbsp;localisation the&amp;nbsp;initial position was determined by GPS/IMU however vision based two-localization techniques are integrated for precise centimeter localisation&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp;&amp;nbsp; a- Image feature to image feature based localisation&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp;&amp;nbsp; b- Lane and curb detection from stereo data and then matching with the LANE/CURB based map (Advance form of RNDF (Route Network Defination File) as nice concept of&amp;nbsp;lanelet was introduced&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;http://www.mrt.kit.edu/software/libLanelet/libLanelet.html)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;
2- Pedestrian detection&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Stereo camera&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp;&amp;nbsp; a- From Stereo ROI is extracted and then trained classifier (HOG+mixture of expert-SVMachines) is used to classify.&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp;&amp;nbsp; b- Tracking is performed using EKF&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;
3- Vehicle detection&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;Stereo &amp;amp; (Radar is used separetly and the results are not fused with vision)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp; a- From Stereo ROI approach similiar to 2a for distance &amp;lt; 40meter. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp; b- For 200m they used monocular classifier (viola jones adaboost)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;
4- Traffic Light&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Monocular camera because of wide FOV&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp; a- Train a neural network for classification on the record data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp; b- Did NN matching on real-stream of video&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;
5- Planning&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp; a- Optimization of the cost function which depends upon velocity, jerk, yaw and collision.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp;&amp;nbsp; b- They used SQP approach for minimisation&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;
6- Controller&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp;&amp;nbsp; a- Lateral controller is similiar to lane keeping controller using Feed forward &amp;amp; backward proportional controller &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp;&amp;nbsp; b- Longitudnal using model predictive control &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;
7- Offline planning&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp;a- Used the map generated earlier for localization and used free OpenStreetMap editor for defining the planned route.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
In short the main sensors used were camera+radar+GPS for localisation/perception.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
[1] Making Bertha See,&amp;nbsp; ICCV workshop 2013&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://mail.i2r.a-star.edu.sg/OWA/redir.aspx?C=8s0JfInOCEifgxw1n3QmzHd_8d17OdIIgQHgWyiCUrdV4EYD1E9moBs8oml1MwftTlrMlQZFJRs.&amp;amp;URL=http%3a%2f%2fwww.cv-foundation.org%2fopenaccess%2fcontent_iccv_workshops_2013%2fW07%2fpapers%2fFranke_Making_Bertha_See_2013_ICCV_paper.pdf&quot; style=&quot;font-size: 10pt;&quot; target=&quot;_blank&quot;&gt;http://www.cv-foundation.org/openaccess/content_iccv_workshops_2013/W07/papers/Franke_Making_Bertha_See_2013_ICCV_paper.pdf&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/5416433139634129075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2015/04/insight-into-mercedes-autonomous.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/5416433139634129075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/5416433139634129075'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2015/04/insight-into-mercedes-autonomous.html' title='Insight into Mercedes Autonomous Vehicle &quot;On a memorial Bertha Benz route&quot;'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-6849702400758640042</id><published>2015-03-09T02:38:00.001+11:00</published><updated>2015-03-09T02:51:36.387+11:00</updated><title type='text'>Simple Idea to Control a car Remotely (using actuators)</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/_x5IziyOcAg/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;http://www.youtube.com/embed/_x5IziyOcAg?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
Guys from LabView&amp;nbsp; &quot;Waterloolabs&quot; have built a control systems using a few motors, potentiometers, a 
Compact RIO embedded controller, and LabVIEW.&lt;br /&gt;
&lt;br /&gt;
They then set up wi-fi 
communication so that they can drive the car from an iPhone as well as from a 
modified Power Wheels truck.&lt;br /&gt;
&lt;br /&gt;
For detailed plans, parts lists and code 
available for download, check out their website &lt;a class=&quot;yt-uix-redirect-link&quot; dir=&quot;ltr&quot; href=&quot;http://www.waterloolabs.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;http://www.WaterlooLabs.com&quot;&gt;http://www.WaterlooLabs.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
(Project done in back 2009) </content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/6849702400758640042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2015/03/remotely-control-car-fitting-actuators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6849702400758640042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6849702400758640042'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2015/03/remotely-control-car-fitting-actuators.html' title='Simple Idea to Control a car Remotely (using actuators)'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/_x5IziyOcAg/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-6036971446178030538</id><published>2015-02-28T17:24:00.001+11:00</published><updated>2015-02-28T17:24:05.221+11:00</updated><title type='text'>Low-cost 3D Lidar </title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Low-cost Lidar for Autonomous vehicle technology is a big boost for real-time 3D perception. The video mentions the cost of two 3D Lidar (8 Layers) with Tegra K1 processor to be US $2500.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Range: 300 meter&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Advantage: No rotating part&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Sensor Manufacturer: http://www.quanergy.com&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe width=&quot;320&quot; height=&quot;266&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/PYOeJUtQsEs/0.jpg&quot; src=&quot;http://www.youtube.com/embed/PYOeJUtQsEs?feature=player_embedded&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/6036971446178030538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2015/02/low-cost-3d-lidar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6036971446178030538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6036971446178030538'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2015/02/low-cost-3d-lidar.html' title='Low-cost 3D Lidar '/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/PYOeJUtQsEs/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-5494026969135288934</id><published>2015-02-28T16:20:00.000+11:00</published><updated>2015-02-28T16:27:53.191+11:00</updated><title type='text'>Google New Lidar Sensor (with Multiple camera)</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/PHaPjrkapg0/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;http://www.youtube.com/embed/PHaPjrkapg0?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;Regarding the latest development at google Autonomous Vehicle. From the video, it seems they are using their own Lidar sensor rather than &lt;a href=&quot;http://velodynelidar.com/lidar/hdlproducts/vlp16.aspx&quot;&gt;velodyne Puck 16&lt;/a&gt;. The interesting thing with rotating lidar is the presence of multiple cameras(seems either they are using depth-color known as RGB-D approach to solve various task like localization, pedestrian/vehicle/obstacle detection etc).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;a href=&quot;http://www.newyorker.com/magazine/2013/11/25/auto-correct?currentPage=all&quot;&gt;Specs from the New Yorker article&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;At the tech meeting, Levandowski showed the team a video of Google’s newest laser, slated to be installed within the year. It had more than twice the range of previous models—eleven hundred feet instead of two hundred and sixty—and thirty times the resolution. At three hundred feet, it could spot a metal plate less than two inches thick. The laser would be about the size of a coffee mug, he told me, and cost around ten thousand dollars—seventy thousand less than the current model.&lt;/span&gt;&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;Some Useful links:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Google_driverless_car&quot;&gt;Google Self-driving car&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;a href=&quot;http://velodynelidar.com/lidar/hdlproducts/vlp16.aspx&quot;&gt;Velodyne Lidar&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;a href=&quot;http://spectrum.ieee.org/robotics/artificial-intelligence/the-unknown-startup-that-built-googles-first-selfdriving-car&quot;&gt;History about Google AV&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/5494026969135288934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2015/02/google-new-lidar-sensor-with-multiple.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/5494026969135288934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/5494026969135288934'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2015/02/google-new-lidar-sensor-with-multiple.html' title='Google New Lidar Sensor (with Multiple camera)'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/PHaPjrkapg0/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-7613820038799589322</id><published>2014-05-02T17:12:00.000+10:00</published><updated>2015-02-24T02:45:10.479+11:00</updated><title type='text'>Drive by Wire Technology</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.dalydesign.co.uk/dd-images/featured-clients/illustration/drive-by-wire.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
Drive-by-wire is a catch-all term that can refer to a number of 
electronic systems that take the place of old mechanical controls.&lt;br /&gt;
&lt;br /&gt;
Instead of using cables, hydraulic pressure, and other things that 
provide the driver with direct, physical control over the speed or 
direction of a vehicle, drive-by-wire technology uses electronic 
controls to activate the brakes, control the steering, and operate other
 systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The three main drive-by-wire technologies are referred to as:&amp;nbsp; &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Brake-By-Wire&lt;/li&gt;
&lt;li&gt;Electronic Throttle Control&lt;/li&gt;
&lt;li&gt;Steer-By-Wire&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Drive by wire is a vehicle that is not controlled by a direct mechanical means by the driver. 
The throttle is controlled by an electrical servo controller by a 
computer based on input from the throttle pedal.  There is no direct 
mechanical linkage from the throttle pedal to the throttle valve in the 
throttle body &lt;br /&gt;
&lt;br /&gt;
The steering is controlled by a servo controlled by the car&#39;s computer 
based on input from the steering wheel.  There is no direct mechanical 
connection from the steering wheel to the steering box. &amp;nbsp;
The brakes are controlled by servos in the braking system controlled by 
the car&#39;s computer based on input from the brake pedal.  There is no 
direct mechanical linkage between the brake pedal and the braking 
system.          </content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/7613820038799589322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2014/05/drive-by-wire-technology.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/7613820038799589322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/7613820038799589322'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2014/05/drive-by-wire-technology.html' title='Drive by Wire Technology'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-2465902131502444613</id><published>2013-08-30T09:51:00.001+10:00</published><updated>2015-03-09T02:53:14.312+11:00</updated><title type='text'>PID position Controller for Arducopter with VICON Measurements!</title><content type='html'>&lt;br /&gt;
&lt;h1 style=&quot;background-color: white; border: 0px; color: #0a010a; font-family: Arial, &#39;Helvetica Neue&#39;, Helvetica, sans-serif; font-size: 1.53846em; font-weight: normal; letter-spacing: -1px; margin: 10px 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;border: 0px; color: #666066; font-size: 16px; letter-spacing: normal; line-height: 16px; margin-bottom: 0.5em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
We have developed a PID position controller that can communicate with arducopter via 3DR radio. The position controller runs on the ground computer and transmits the commands to hexacopter at 50HZ via mavlink protocol. The mavlink packet used during our test flights is &quot;set_roll_pitch_yaw_thrust_send&quot;. We have tested the hovering flight for the developed controller.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #666066; font-size: 16px; letter-spacing: normal; line-height: 16px; margin-bottom: 0.5em; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #666066; font-size: 16px; letter-spacing: normal; line-height: 16px; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;iframe width=&quot;320&quot; height=&quot;266&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/oXaA3nRmutk/0.jpg&quot; src=&quot;http://www.youtube.com/embed/oXaA3nRmutk?feature=player_embedded&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #666066; font-size: 16px; letter-spacing: normal; line-height: 16px; min-height: 1em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/h1&gt;
&lt;div&gt;
The source code for ground control is available here :&amp;nbsp;&lt;a href=&quot;https://docs.google.com/file/d/0B8gYxW2umHiVdUVqb0RVU0xCQ2M/edit?usp=sharing&quot;&gt;Code of PID_controller&lt;/a&gt;&lt;br /&gt;
Please note that: I have used the standard code for arducopter communication via ROS available here:&lt;br /&gt;
&lt;a href=&quot;https://code.google.com/p/roscopter/&quot;&gt;https://code.google.com/p/roscopter/&lt;/a&gt;. Please copy the PID controller code into the roscopter&#39;s nodes directory. For running please type: python&amp;nbsp;position_controller_for_vicon_measurements.py (bydefault it will check for USB0 for 3RD radio modem at 57600).&lt;br /&gt;
&lt;br /&gt;
The aim is to provide the basic understanding of the controller (its a hierarchical controller i.e. the position controller uses the stabilization controller of the arducopter) --*please note that the arducopter code is also required to be changed to&amp;nbsp;accommodate&amp;nbsp;the mavlink listening&amp;nbsp;+ update of roll/pitch/yaw commands in the stablization mode.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #666066; font-family: Arial, &#39;Helvetica Neue&#39;, Helvetica, sans-serif; font-size: 16px; line-height: 16px;&quot;&gt;Thanks&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/2465902131502444613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2013/08/pid-position-controller-for-arducopter.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/2465902131502444613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/2465902131502444613'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2013/08/pid-position-controller-for-arducopter.html' title='PID position Controller for Arducopter with VICON Measurements!'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/oXaA3nRmutk/default.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-1115715997607789719</id><published>2013-07-08T02:46:00.000+10:00</published><updated>2013-07-08T02:46:11.102+10:00</updated><title type='text'>Location on Maps (Lat/Lon, UTM)</title><content type='html'>&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: white; font-family: arial; height: 100%px; width: 100%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;texttitle&quot; style=&quot;color: #990000; font-family: &#39;Times New Roman&#39;, Times, serif; font-size: 20px; word-spacing: 0.1em;&quot;&gt;&lt;blockquote&gt;
&lt;h1&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Location, Distance, and Direction on Maps&lt;/span&gt;&lt;/h1&gt;
&lt;/blockquote&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-size: 11px;&quot;&gt;&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;texttitle&quot; style=&quot;color: #990000; font-family: &#39;Times New Roman&#39;, Times, serif; font-size: 20px; word-spacing: 0.1em;&quot;&gt;&lt;blockquote&gt;
&lt;div align=&quot;left&quot; class=&quot;text&quot; style=&quot;color: #333333; font-size: 18px; word-spacing: 0.1em;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;b&gt;&lt;span&gt;Location on Maps&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;Most&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/m.html#map&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;maps&lt;/a&gt;&lt;/b&gt;&amp;nbsp;allow us to specify the location of points on the Earth&#39;s surface using a coordinate system. For a two-dimensional map, this coordinate system can use simple geometric relationships between the perpendicular axes on a grid system to define spatial location.&amp;nbsp;&lt;b&gt;Figure 2b-1&lt;/b&gt;illustrates how the location of a point can be defined on a coordinate system.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;300&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/coordinate_system.jpg&quot; width=&quot;488&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Times New Roman, Times, serif;&quot;&gt;Figure 2b-1&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&amp;nbsp;A grid coordinate system defines the location of points from the distance traveled along two perpendicular axes from some stated origin. In the example above, the two axes are labeled X and Y. The origin is located in the lower left hand corner. Unit distance traveled along each axis from the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/o.html#origin&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;origin&lt;/a&gt;&lt;/b&gt;&amp;nbsp;is shown. In this coordinate system, the value associated with the X-axis is given first, following by the value assigned from the Y-axis. The location represented by the star has the coordinates 7 (X-axis), 4 (Y-axis).&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;Two types of coordinate systems are currently in general use in geography: the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/g.html#geographical_coordinate_system&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;geographical coordinate system&lt;/a&gt;&lt;/b&gt;&amp;nbsp;and the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/r.html#rectangular_coordinate_system&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;rectangular&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(also called&lt;b&gt;Cartesian&lt;/b&gt;)&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/r.html#rectangular_coordinate_system&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;coordinate system&lt;/a&gt;&lt;/b&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;&lt;b&gt;Geographical&lt;/b&gt;&amp;nbsp;&lt;b&gt;Coordinate&lt;/b&gt;&amp;nbsp;&lt;b&gt;System&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;The&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/g.html#geographical_coordinate_system&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;geographical coordinate system&lt;/a&gt;&lt;/b&gt;&amp;nbsp;measures location from only two values, despite the fact that the locations are described for a three-dimensional surface. The two values used to define location are both measured relative to the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/p.html#polar_axis&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;polar axis&lt;/a&gt;&lt;/b&gt;&amp;nbsp;of the Earth. The two measures used in the geographic coordinate system are called&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/l.html#latitude&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;latitude&lt;/a&gt;&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/l.html#longitude&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;longitude&lt;/a&gt;&lt;/b&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;312&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/globe5.jpg&quot; width=&quot;547&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Figure 2b-2&lt;/span&gt;:&lt;/b&gt;&amp;nbsp;Lines of latitude or&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/p.html#parallel&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;parallels&lt;/a&gt;&lt;/b&gt;&amp;nbsp;are drawn parallel to the equator (shown in&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;red&lt;/span&gt;&lt;/b&gt;) as circles that span the Earth&#39;s surface. These parallels are measure in degrees (°). There are 90 angular degrees of latitude from the equator to each of the poles. The equator has an assigned value of 0°. Measurements of latitude are also defined as being either north or south of equator to distinguish the hemisphere of their location. Lines of&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/l.html#longitude&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;longitude&lt;/a&gt;&lt;/b&gt;&amp;nbsp;or&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/m.html#meridian&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;meridians&lt;/a&gt;&lt;/b&gt;&amp;nbsp;are circular arcs that meet at the poles. There are 180° of longitude either side of a starting meridian which is known the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/p.html#prime_meridian&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Prime Meridian&lt;/a&gt;&lt;/b&gt;. The Prime Meridian has a designated value of 0°. Measurements of longitude are also defined as being either west or east of the Prime Meridian.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/l.html#latitude&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Latitude&lt;/a&gt;&lt;/b&gt;&amp;nbsp;measures the north-south position of locations on the Earth&#39;s surface relative to a point found at the center of the Earth (&lt;b&gt;Figure 2b-2&lt;/b&gt;). This central point is also located on the Earth&#39;s rotational or&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/p.html#polar_axis&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;polar axis&lt;/a&gt;&lt;/b&gt;. The equator is the starting point for the measurement of latitude. The equator has a value of zero degrees. A line of latitude or&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/p.html#parallel&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;parallel&lt;/a&gt;&lt;/b&gt;&amp;nbsp;of 30° North has an angle that is 30° north of the plane represented by the equator (&lt;b&gt;Figure 2b-3&lt;/b&gt;). The maximum value that latitude can attain is either 90° North or South. These lines of latitude run parallel to the rotational axis of the Earth.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;350&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/globe6.jpg&quot; width=&quot;532&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Figure 2b-3&lt;/span&gt;:&lt;/b&gt;&amp;nbsp;Measurement of&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/l.html#latitude&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;latitude&lt;/a&gt;&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/l.html#longitude&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;longitude&lt;/a&gt;&lt;/b&gt;&amp;nbsp;relative to the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/e.html#equator&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;equator&lt;/a&gt;&lt;/b&gt;&amp;nbsp;and the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/p.html#prime_meridian&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Prime Meridian&lt;/a&gt;&lt;/b&gt;&amp;nbsp;and the Earth&#39;s rotational or polar axis.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/l.html#longitude&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Longitude&lt;/a&gt;&lt;/b&gt;&amp;nbsp;measures the west-east position of locations on the Earth&#39;s surface relative to a circular arc called the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/p.html#prime_meridian&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Prime Meridian&lt;/a&gt;&amp;nbsp;&lt;/b&gt;(&lt;b&gt;Figure 2b-2&lt;/b&gt;). The position of the Prime Meridian was determined by international agreement to be in-line with the location of the former astronomical observatory at Greenwich, England. Because the Earth&#39;s circumference is similar to circle, it was decided to measure longitude in degrees. The number of degrees found in a circle is 360. The Prime Meridian has a value of zero degrees. A line of longitude or&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/m.html#meridian&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;meridian&lt;/a&gt;&lt;/b&gt;&amp;nbsp;of 45° West has an angle that is 45° west of the plane represented by the Prime Meridian (&lt;b&gt;Figure 2b-3&lt;/b&gt;). The maximum value that a&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/m.html#meridian&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;meridian&lt;/a&gt;&lt;/b&gt;&amp;nbsp;of longitude can have is 180° which is the distance halfway around a circle. This meridian is called the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/i.html#international_date_line&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;International Date Line&lt;/a&gt;&lt;/b&gt;. Designations of west and east are used to distinguish where a location is found relative to the Prime Meridian. For example, all of the locations in North America have a longitude that is designated west.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;&lt;b&gt;Universal&lt;/b&gt;&amp;nbsp;&lt;b&gt;Transverse&lt;/b&gt;&amp;nbsp;&lt;b&gt;Mercator&lt;/b&gt;&amp;nbsp;&lt;b&gt;System&amp;nbsp;&lt;/b&gt;(UTM)&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;Another commonly used method to describe location on the Earth is the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/u.html#universal_transverse_mercator&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Universal Transverse Mercator&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(&lt;b&gt;UTM&lt;/b&gt;)&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/u.html#universal_transverse_mercator&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;grid system&lt;/a&gt;&lt;/b&gt;. This&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/r.html#rectangular_coordinate_system&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;rectangular&lt;/a&gt;&lt;/b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/r.html#rectangular_coordinate_system&quot; style=&quot;color: #000099; font-weight: bold; text-decoration: initial;&quot;&gt;&lt;b&gt;coordinate system&lt;/b&gt;&lt;/a&gt;&amp;nbsp;is metric, incorporating the meter as its basic unit of measurement.&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;also uses the Transverse Mercator projection system to model the Earth&#39;s spherical surface onto a two-dimensional plane. The&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;system divides the world&#39;s surface into 60 - six degree longitude wide zones that run north-south (&lt;b&gt;Figure 2b-5&lt;/b&gt;). These zones start at the International Date Line and are successively numbered in an eastward direction (&lt;b&gt;Figure 2b-5&lt;/b&gt;). Each zone stretches from 84° North to 80° South (&lt;b&gt;Figure 2b-4&lt;/b&gt;). In the center of each of these zones is a central meridian. Location is measured in these zones from a&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/f.html#false_origin&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;false origin&lt;/a&gt;&amp;nbsp;&lt;/b&gt;which is determined relative to the intersection of the equator and the central meridian for each zone. For locations in the Northern Hemisphere, the false origin is 500,000 meters west of the central meridian on the equator. Coordinate measurements of location in the Northern Hemisphere using the&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;system are made relative to this point in meters in&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/e.html#easting&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;eastings&lt;/a&gt;&lt;/b&gt;(longitudinal distance) and&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/n.html#northing&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;northings&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(latitudinal distance). The point defined by the intersection of 50° North and 9° West would have a&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;coordinate of Zone&amp;nbsp;&lt;b&gt;29&lt;/b&gt;, 500000 meters east (E), 5538630 meters north (N) (see&amp;nbsp;&lt;b&gt;Figures 2b-4&amp;nbsp;&lt;/b&gt;and&lt;b&gt;&amp;nbsp;2b-5&lt;/b&gt;). In the Southern Hemisphere, the origin is 10,000,000 meters south and 500,000 meters west of the equator and central meridian, respectively. The location found at 50° South and 9° West would have a&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;coordinate of Zone&amp;nbsp;&lt;b&gt;29&lt;/b&gt;, 500000 meters E, 4461369 meters N (remember that northing in the Southern Hemisphere is measured from 10,000,000 meters south of the equator - see&amp;nbsp;&lt;b&gt;Figures 2b-4&amp;nbsp;&lt;/b&gt;and&lt;b&gt;&amp;nbsp;2b-5&lt;/b&gt;).&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;340&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/utmzone.jpg&quot; width=&quot;602&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Figure 2b-4&lt;/span&gt;:&lt;/b&gt;&amp;nbsp;The following illustration describes the characteristics of the&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;zone &quot;&lt;b&gt;29&lt;/b&gt;&quot; found between 12 to 6° West longitude. Note that the zone has been split into two halves. The half on the left represents the area found in the Northern Hemisphere. The Southern Hemisphere is located on the right. The blue line represents the central meridian for this zone. Locations measurements for this zone are calculated relative to a false origin. In the Northern Hemisphere, this origin is located 500,000 meters west of the equator. The Southern Hemisphere&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;measurements are determined relative to a origin located at 10,000,000 meters south and 500,000 meters west of the equator and central meridian, respectively.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;The UTM system has been modified to make measurements less confusing. In this modification, the six degree wide zones are divided into smaller pieces or quadrilaterals that are eight degrees of latitude tall. Each of these rows is labeled, starting at 80° South, with the letters C to X consecutively with I and O being omitted (&lt;b&gt;Figure 2b-5&lt;/b&gt;). The last row X differs from the other rows and extends from 72 to 84° North latitude (twelve degrees tall). Each of the quadrilaterals or grid zones are identified by their number/letter designation. In total, 1200 quadrilaterals are defined in the&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;system.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;The quadrilateral system allows us to further define location using the&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;system. For the location 50° North and 9° West, the&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;coordinate can now be expressed as Grid Zone&amp;nbsp;&lt;b&gt;29U&lt;/b&gt;, 500000 meters E, 5538630 meters N.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;450&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/utm.jpg&quot; width=&quot;507&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Figure 2b-5&lt;/span&gt;:&lt;/b&gt;&amp;nbsp;The&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;system also uses a grid system to break the Earth up into 1200 quadrilaterals. To keep the illustration manageable, most of these zones have been excluded. Designation of each quadrilaterals is accomplished with a number-letter system. Along the horizontal bottom, the six degree longitude wide zones are numbered, starting at 180° West longitude, from 1 to 60. The twenty vertical rows are assigned letters C to X with I and O excluded. The letter, C, begins at 80° South latitude. Note that the rows are 8 degrees of latitude wide, except for the last row X which is 12 degrees wide. According to the reference system, the bright green quadrilateral has the grid reference&amp;nbsp;&lt;b&gt;29V&lt;/b&gt;&amp;nbsp;(note that in this system west-east coordinate is given first, followed by the south-north coordinate). This grid zone is found between 56 and 64° North latitude and 6 and 12° West longitude.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;Each&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;quadrilateral is further subdivided into a number of 100,000 by 100,000 meter zones. These subdivisions are coded by a system of letter combinations where the same two-letter combination is not repeated within 18 degrees of latitude and longitude. Within each of the 100,000 meter squares one can specify location to one-meter accuracy using a 5 digit eastings and northings reference system.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;The&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;grid system is displayed on all&amp;nbsp;&lt;b&gt;United States Geological Survey&lt;/b&gt;&amp;nbsp;(&lt;b&gt;USGS&lt;/b&gt;) and&amp;nbsp;&lt;b&gt;National Topographic Series&amp;nbsp;&lt;/b&gt;(&lt;b&gt;NTS&lt;/b&gt;) of Canada maps. On USGS 7.5-minute quadrangle maps (1:24,000 scale), 15-minute quadrangle maps (1:50,000, 1:62,500, and standard-edition 1:63,360 scales), and Canadian 1:50,000 maps the&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;grid lines are drawn at intervals of 1,000 meters, and are shown either with blue ticks at the edge of the map or by full blue grid lines. On USGS maps at 1:100,000 and 1:250,000 scale and Canadian 1:250,000 scale maps a full&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;grid is shown at intervals of 10,000 meters.&amp;nbsp;&lt;b&gt;Figure 2b-6&amp;nbsp;&lt;/b&gt;describes how the&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;grid system can be used to determine location on a 1:50,000&amp;nbsp;&lt;b&gt;National Topographic Series of Canada&lt;/b&gt;&amp;nbsp;map.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;350&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/utmmapsmallsize.jpg&quot; width=&quot;535&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Figure 2b-6&lt;/span&gt;:&lt;/b&gt;&amp;nbsp;The top left hand corner the &quot;&lt;b&gt;Tofino&lt;/b&gt;&quot; 1:50,000&amp;nbsp;&lt;b&gt;National Topographic Series of Canada&lt;/b&gt;&amp;nbsp;map is shown above. The blue lines and associated numbers on the map margin are used to determine location by way of the&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;grid system. Abbreviated&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;1,000-meter values or&amp;nbsp;&lt;b&gt;principle digits&lt;/b&gt;&amp;nbsp;are shown by numbers on the map margin that vary from 0 to 100 (100 is actually given the value 00). In each of the corners of the map, two of the principle digits are expressed in their full&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;coordinate form. On the image we can see 283000 m E. and 5458000 m N. The&amp;nbsp;&lt;b&gt;red dot&lt;/b&gt;&amp;nbsp;is found in the center of the grid defined by principle numbers 85 to 86 easting and 57 to 58 northing. A more complete&amp;nbsp;&lt;b&gt;UTM&lt;/b&gt;&amp;nbsp;grid reference for this location would be 285500 m E. and 5457500 m N. Information found on the map margin also tells us (not shown) that the area displayed is in Grid Zone&amp;nbsp;&lt;b&gt;10U&lt;/b&gt;&amp;nbsp;and the 100,000 m squares&amp;nbsp;&lt;b&gt;BK&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;CK&lt;/b&gt;&amp;nbsp;are located on this map.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;&lt;b&gt;Distance on Maps&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;In&amp;nbsp;&lt;b&gt;section&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;http://www.physicalgeography.net/fundamentals/2a.html&quot; style=&quot;color: #000099; font-weight: bold; text-decoration: initial;&quot;&gt;&lt;b&gt;2a&lt;/b&gt;&lt;/a&gt;, w e have learned that depicting the Earth&#39;s three-dimensional surface on a two-dimensional map creates a number of distortions that involve distance, area, and direction. It is possible to create maps that are somewhat equidistance. However, even these types of maps have some form of distance distortion. Equidistance maps can only control distortion along either lines of&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/l.html#latitude&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;latitude&lt;/a&gt;&lt;/b&gt;&amp;nbsp;or lines of&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/l.html#longitude&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;longitude&lt;/a&gt;&lt;/b&gt;. Distance is often correct on equidistance maps only in the direction of latitude.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;On a map that has a large scale, 1:125,000 or larger, distance distortion is usually insignificant. An example of a large-scale map is a standard topographic map. On these maps measuring straight line distance is simple. Distance is first measured on the map using a ruler. This measurement is then converted into a real world distance using the map&#39;s scale. For example, if we measured a distance of 10 centimeters on a map that had a scale of 1:10,000, we would multiply 10 (distance) by 10,000 (scale). Thus, the actual distance in the real world would be 100,000 centimeters.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;Measuring distance along map features that are not straight is a little more difficult. One technique that can be employed for this task is to use a number of straight-line segments. The accuracy of this method is dependent on the number of straight-line segments used (&lt;b&gt;Figure 2b-7&lt;/b&gt;). Another method for measuring curvilinear map distances is to use a mechanical device called an&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/o.html#opisometer&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;opisometer&lt;/a&gt;&lt;/b&gt;. This device uses a small rotating wheel that records the distance traveled. The recorded distance is measured by this device either in centimeters or inches.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;256&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/distance.jpg&quot; width=&quot;550&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;strong&gt;Figure 2b-7&lt;/strong&gt;&lt;/span&gt;&lt;b&gt;:&lt;/b&gt;&amp;nbsp;Measurement of distance on a map feature using straight-line segments.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;&lt;b&gt;Direction on Maps&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;Like distance, direction is difficult to measure on maps because of the distortion produced by projection systems. However, this distortion is quite small on maps with scales larger than 1:125,000. Direction is usually measured relative to the location of&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/n.html#north_pole&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;North&lt;/a&gt;&lt;/b&gt;&amp;nbsp;or&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/s.html#south_pole&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;South Pole&lt;/a&gt;&lt;/b&gt;. Directions determined from these locations are said to be relative to&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/t.html#true_north&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;True North&lt;/a&gt;&lt;/b&gt;&amp;nbsp;or&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/t.html#true_south&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;True South&lt;/a&gt;&lt;/b&gt;. The magnetic poles can also be used to measure direction. However, these points on the Earth are located in spatially different spots from the geographic North and South Pole. The&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/n.html#north_magnetic_pole&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;North Magnetic Pole&lt;/a&gt;&lt;/b&gt;is located at 78.3° North, 104.0° West near Ellef Ringnes Island, Canada. In the Southern Hemisphere, the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/s.html#south_magnetic_pole&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;South Magnetic Pole&lt;/a&gt;&lt;/b&gt;&amp;nbsp;is located in Commonwealth Day, Antarctica and has a geographical location of 65° South, 139° East. The magnetic poles are also not fixed overtime and shift their spatial position overtime.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;Topographic maps normally have a declination diagram drawn on them (&lt;b&gt;Figure 2b-8&lt;/b&gt;). On Northern Hemisphere maps, declination diagrams describe the angular difference between Magnetic North and True North. On the map, the angle of True North is parallel to the depicted lines of longitude. Declination diagrams also show the direction of&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/g.html#grid_north&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Grid North&lt;/a&gt;&lt;/b&gt;. Grid North is an angle that is parallel to the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/e.html#easting&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;easting&lt;/a&gt;&lt;/b&gt;&amp;nbsp;lines found on the&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/u.html#universal_transverse_mercator&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Universal Transverse Mercator&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(&lt;b&gt;UTM&lt;/b&gt;)&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/u.html#universal_transverse_mercator&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;grid system&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(&lt;b&gt;Figure 2b-8&lt;/b&gt;).&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;350&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/azimuth.jpg&quot; width=&quot;359&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Figure 2b-8&lt;/span&gt;:&lt;/b&gt;&amp;nbsp;This declination diagram describes the angular difference between Grid, True, and Magnetic North. This illustration also shows how angles are measured relative grid, true, and magnetic azimuth.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;In the field, the direction of features is often determined by a magnetic compass which measures angles relative to Magnetic North. Using the declination diagram found on a map, individuals can convert their field measures of magnetic direction into directions that are relative to either Grid or True North. Compass directions can be described by using either the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/a.html#azimuth&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;azimuth&lt;/a&gt;&lt;/b&gt;&amp;nbsp;system or the&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/b.html#bearing&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;bearing&lt;/a&gt;&lt;/b&gt;&amp;nbsp;system. The azimuth system calculates direction in degrees of a full circle. A full circle has 360 degrees (&lt;b&gt;Figure 2b-9&lt;/b&gt;). In the azimuth system, north has a direction of either the 0 or 360°. East and west have an azimuth of 90° and 270°, respectively. Due south has an azimuth of 180°.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;350&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/angles_azimuth.jpg&quot; width=&quot;339&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Figure 2b-9&lt;/span&gt;:&lt;/b&gt;&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/a.html#azimuth&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Azimuth&lt;/a&gt;&lt;/b&gt;&amp;nbsp;system for measuring direction is based on the 360 degrees found in a full circle. The illustration shows the angles associated with the major cardinal points of the compass. Note that angles are determined clockwise from north.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;The bearing system divides direction into four quadrants of 90 degrees. In this system, north and south are the dominant directions. Measurements are determined in degrees from one of these directions. The measurement of two angles based on this system are described in&lt;b&gt;Figure 2b-10&lt;/b&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span&gt;&lt;img height=&quot;350&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/angles_bearing.jpg&quot; width=&quot;338&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Figure 2b-10&lt;/span&gt;:&lt;/b&gt;&amp;nbsp;The&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/b.html#bearing&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;bearing&lt;/a&gt;&lt;/b&gt;&amp;nbsp;system uses four quadrants of 90 degrees to measure direction. The illustration shows two direction measurements. These measurements are made relative to either north or south. North and south are given the measurement 0 degrees. East and west have a value of 90 degrees. The first measurement (&lt;b&gt;green&lt;/b&gt;) is found in the north - east quadrant. As a result, its measurement is north 75 degrees to the east or N75°E. The first measurement (&lt;b&gt;orange&lt;/b&gt;) is found in the south - west quadrant. Its measurement is south 15 degrees to the west or S15°W.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;&lt;b&gt;Global Positioning Systems&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span&gt;Determination of location in field conditions was once a difficult task. In most cases, it required the use of a topographic map and landscape features to estimate location. However, technology has now made this task very simple.&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/g.html#global_positioning_system&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Global Positioning Systems&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(&lt;b&gt;GPS&lt;/b&gt;) can calculate one&#39;s location to an accuracy of about 30-meters (&lt;b&gt;Figure 2b-11&lt;/b&gt;). These systems consist of two parts: a GPS receiver and a network of many satellites. Radio transmissions from the satellites are broadcasted continually. The GPS receiver picks up these broadcasts and through triangulation calculates the altitude and spatial position of the receiving unit. A minimum of three satellite is required for triangulation.&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;&lt;img height=&quot;320&quot; src=&quot;http://www.physicalgeography.net/fundamentals/images/gps_system.jpg&quot; width=&quot;363&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table style=&quot;width: 75%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;color: #333333; font-family: arial; font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman, Times, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Figure 2b-11&lt;/span&gt;:&lt;/b&gt;&amp;nbsp;Handheld&amp;nbsp;&lt;b&gt;&lt;a href=&quot;http://www.physicalgeography.net/physgeoglos/g.html#global_positioning_system&quot; style=&quot;color: #000099; text-decoration: initial;&quot;&gt;Global Positioning Systems&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(&lt;b&gt;GPS&lt;/b&gt;). GPS receivers can determine latitude, longitude, and elevation anywhere on or above the Earth&#39;s surface from signals transmitted by a number of satellites. These units can also be used to determine direction, distance traveled, and determine routes of travel in field situations.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
source:&amp;nbsp;&lt;a href=&quot;http://www.physicalgeography.net/fundamentals/2b.html&quot; style=&quot;word-spacing: 0.1em;&quot;&gt;http://www.physicalgeography.net/fundamentals/2b.html&lt;/a&gt;&lt;span style=&quot;word-spacing: 0.1em;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/1115715997607789719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2013/07/location-on-maps-latlon-utm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/1115715997607789719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/1115715997607789719'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2013/07/location-on-maps-latlon-utm.html' title='Location on Maps (Lat/Lon, UTM)'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-8034689878354089386</id><published>2013-04-18T01:05:00.000+10:00</published><updated>2013-04-18T01:11:21.505+10:00</updated><title type='text'>Quadrotor with IMU</title><content type='html'>&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: black; font-family: Arial Rounded MT Bold; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&lt;/span&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Arial Black;&quot;&gt;Quadrotor&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 15pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Arial Rounded MT Bold;&quot;&gt;A quadrotor, also called a quadrotor helicopter or quadrocopter, is an aircraft that is lifted and propelled by four rotors. Following shows the schematic of reaction torques on each motor of a quadrotor aircraft, due to spinning rotors.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #333333;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://cog.yonsei.ac.kr/quad/img13.jpg&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 15pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Arial Rounded MT Bold;&quot;&gt;In quadrotor system, each rotor produces both a thrust and torque about its center of rotation, as well as a drag force opposite to the vehicle&#39;s direction of flight. If all rotors are spinning at the same angular velocity, with rotors one and three rotating clockwise and rotors two and four counterclockwise, the net aerodynamic torque, and hence the angular acceleration about the yaw axis is exactly zero, which implies that the yaw stabilizing rotor of conventional helicopters is not needed. Yaw is induced by mismatching the balance in aerodynamic torques. Angular accelerations about the pitch and roll axes can be caused separately without impacting the yaw axis. Each pair of blades rotating in the same direction controls one axis, either roll or pitch, and increasing thrust for one rotor while decreasing thrust for the other will maintain the torque balance needed for yaw stability and induce a net torque about the roll or pitch axes. This way, fixed rotor blades can be made to maneuver the quad rotor vehicle in all dimensions. Translational acceleration is achieved by maintaining a non-zero pitch or roll angle. Based on these flight control method, following control block diagram can be used.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #333333;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;228&quot; src=&quot;http://cog.yonsei.ac.kr/quad/img14.jpg&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/8034689878354089386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/quadrotor-with-imu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/8034689878354089386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/8034689878354089386'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/quadrotor-with-imu.html' title='Quadrotor with IMU'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-6205297902504079958</id><published>2013-04-16T19:41:00.000+10:00</published><updated>2013-04-16T19:41:01.697+10:00</updated><title type='text'>MLE (negative log likelihood)</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: white; border-bottom-color: rgb(238, 238, 238); border-bottom-style: double; border-bottom-width: 4px; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 10px; line-height: 22px; padding-bottom: 7px;&quot;&gt;
&lt;h1 style=&quot;font-size: 2.6em; line-height: 1.1em; margin: 0px; padding: 0px;&quot;&gt;
Why Minimize Negative Log&amp;nbsp;Likelihood?&lt;/h1&gt;
&lt;div class=&quot;date&quot; id=&quot;single-date&quot; style=&quot;color: #757575; font-family: &#39;Trebuchet MS&#39;, &#39;Lucida Grande&#39;, &#39;Lucida Sans&#39;, Verdana, Arial, sans-serif; font-size: 1.6em; padding-top: 10px; text-transform: uppercase;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 1em;&quot;&gt;One of the wonders of machine learning is the diversity of divergent traditions from which it originates, from classical statistics (both frequentist and Bayesian) to information and control theories, plus a significant dose of pragmatism from computer science. For those interested in the historical relationship between statistics and machine learning, see Breiman’s&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 1em;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.stat.osu.edu/~bli/dmsl/papers/Breiman.pdf&quot; style=&quot;color: #772124; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 1em; font-weight: bold; text-decoration: none;&quot;&gt;Two Cultures&lt;/a&gt;&lt;span style=&quot;color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 1em;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;entry clear&quot; style=&quot;background-color: white; color: #333333; font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 1.3em; line-height: 22px; word-wrap: break-word;&quot;&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
This diversity is reflected in the&amp;nbsp;&lt;em&gt;surprising complexity in answering simple-sounding questions&lt;/em&gt;, which often speaks to the heart of trading using computational machine learning models—ranging from estimating HMM models via MLE (&lt;em&gt;e.g.&lt;/em&gt;&amp;nbsp;vol / correlation regime models) to non-convex optimization via non-standard likelihood or loss functions (&lt;em&gt;e.g.&lt;/em&gt;&amp;nbsp;portfolio optimization via&lt;a href=&quot;http://finance.yendor.com/etfviz/2007/0928/Omega-intro.pdf&quot; style=&quot;color: #772124; font-weight: bold; text-decoration: none;&quot;&gt;omega&lt;/a&gt;):&lt;/div&gt;
&lt;blockquote style=&quot;background-color: #e7e6e2; background-image: url(http://s1.wp.com/wp-content/themes/pub/vigilance/images/blockquote.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; color: #141310; font-size: 14px; font-style: italic; margin: 20px 0px; padding: 20px 20px 10px 45px;&quot;&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
Why is minimizing the negative log likelihood equivalent to maximum likelihood estimation (MLE)?&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span id=&quot;more-5505&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
Or, equivalently, in Bayesian-speak:&lt;/div&gt;
&lt;blockquote style=&quot;background-color: #e7e6e2; background-image: url(http://s1.wp.com/wp-content/themes/pub/vigilance/images/blockquote.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; color: #141310; font-size: 14px; font-style: italic; margin: 20px 0px; padding: 20px 20px 10px 45px;&quot;&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
Why is minimizing the negative log likelihood equivalent to maximum a posteriori probability (MAP), given a uniform prior?&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
Answering this question provides insight into the foundations of machine learning, as well as connection with several branches of mathematics.&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
Classic statistics opens the answer, beginning with the definition of a likelihood function:&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img alt=&quot;\mathcal{L}(\theta\,|\,x_1,\ldots,x_n) = f(x_1,x_2,\ldots,x_n|\theta) = \prod\limits_{i=1}^n f(x_i|\theta) &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=%5Cmathcal%7BL%7D%28%5Ctheta%5C%2C%7C%5C%2Cx_1%2C%5Cldots%2Cx_n%29+%3D+f%28x_1%2Cx_2%2C%5Cldots%2Cx_n%7C%5Ctheta%29+%3D+%5Cprod%5Climits_%7Bi%3D1%7D%5En+f%28x_i%7C%5Ctheta%29+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;\mathcal{L}(\theta\,|\,x_1,\ldots,x_n) = f(x_1,x_2,\ldots,x_n|\theta) = \prod\limits_{i=1}^n f(x_i|\theta) &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
Applying the natural log function in this context is handy, for several reasons. First, numerical analysis reminds us that logs reduce potential for underflow, due to very small likelihoods. Second, calculus reminds us logs permit the addition trick: converting a product of factors into a summation of factors (as seen before in&amp;nbsp;&lt;a href=&quot;http://quantivity.wordpress.com/2011/02/21/why-log-returns/&quot; style=&quot;color: #772124; font-weight: bold; text-decoration: none;&quot;&gt;Why Log Returns?&lt;/a&gt;). Finally, calculus again reminds us that the natural log function is a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Monotone_transformation&quot; style=&quot;color: #772124; font-weight: bold; text-decoration: none;&quot;&gt;monotone transformation&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
Thus, the extrema of&amp;nbsp;&lt;img alt=&quot;\mathcal{L} &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=%5Cmathcal%7BL%7D+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;\mathcal{L} &quot; /&gt;&amp;nbsp;are equivalent to the extrema of&amp;nbsp;&lt;img alt=&quot;\log \mathcal{L} &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=%5Clog+%5Cmathcal%7BL%7D+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;\log \mathcal{L} &quot; /&gt;:&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img alt=&quot;\log \mathcal{L}(\theta\,|\,x_1,\ldots,x_n) = \sum\limits_{i=1}^n \log f(x_i|\theta) &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=%5Clog+%5Cmathcal%7BL%7D%28%5Ctheta%5C%2C%7C%5C%2Cx_1%2C%5Cldots%2Cx_n%29+%3D+%5Csum%5Climits_%7Bi%3D1%7D%5En+%5Clog+f%28x_i%7C%5Ctheta%29+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;\log \mathcal{L}(\theta\,|\,x_1,\ldots,x_n) = \sum\limits_{i=1}^n \log f(x_i|\theta) &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
From which the maximum likelihood estimator&amp;nbsp;&lt;img alt=&quot;\hat{\theta}_{\textnormal{MLE}} &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=%5Chat%7B%5Ctheta%7D_%7B%5Ctextnormal%7BMLE%7D%7D+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;\hat{\theta}_{\textnormal{MLE}} &quot; /&gt;&amp;nbsp;is defined as:&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img alt=&quot;\hat{\theta}_{\textnormal{MLE}} = \underset{\theta}{\arg\max} \sum\limits_{i=1}^n \log f(x_i|\theta) &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=%5Chat%7B%5Ctheta%7D_%7B%5Ctextnormal%7BMLE%7D%7D+%3D+%5Cunderset%7B%5Ctheta%7D%7B%5Carg%5Cmax%7D+%5Csum%5Climits_%7Bi%3D1%7D%5En+%5Clog+f%28x_i%7C%5Ctheta%29+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;\hat{\theta}_{\textnormal{MLE}} = \underset{\theta}{\arg\max} \sum\limits_{i=1}^n \log f(x_i|\theta) &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
As an aside, Bayesians will remind us we can generalized into a MAP estimator, given uniform prior&amp;nbsp;&lt;img alt=&quot;g(\theta) &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=g%28%5Ctheta%29+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;g(\theta) &quot; /&gt;:&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img alt=&quot;\underset{\theta}{\arg\max} \sum\limits_{i=1}^n \log f(x_i|\theta)  = \underset{\theta}{\arg\max} \log(f|\theta) = \underset{\theta}{\arg\max} \log(f|\theta) g(\theta) = \hat{\theta}_{\textnormal{MAP}} &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=%5Cunderset%7B%5Ctheta%7D%7B%5Carg%5Cmax%7D+%5Csum%5Climits_%7Bi%3D1%7D%5En+%5Clog+f%28x_i%7C%5Ctheta%29++%3D+%5Cunderset%7B%5Ctheta%7D%7B%5Carg%5Cmax%7D+%5Clog%28f%7C%5Ctheta%29+%3D+%5Cunderset%7B%5Ctheta%7D%7B%5Carg%5Cmax%7D+%5Clog%28f%7C%5Ctheta%29+g%28%5Ctheta%29+%3D+%5Chat%7B%5Ctheta%7D_%7B%5Ctextnormal%7BMAP%7D%7D+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;\underset{\theta}{\arg\max} \sum\limits_{i=1}^n \log f(x_i|\theta)  = \underset{\theta}{\arg\max} \log(f|\theta) = \underset{\theta}{\arg\max} \log(f|\theta) g(\theta) = \hat{\theta}_{\textnormal{MAP}} &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
From which optimization and real analysis reminds us of the following equivalence, for all&amp;nbsp;&lt;img alt=&quot;x&quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=x&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;x&quot; /&gt;:&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img alt=&quot;\underset{x}{\arg\max} (x)  = \underset{x}{\arg\min} (-x) &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=%5Cunderset%7Bx%7D%7B%5Carg%5Cmax%7D+%28x%29++%3D+%5Cunderset%7Bx%7D%7B%5Carg%5Cmin%7D+%28-x%29+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;\underset{x}{\arg\max} (x)  = \underset{x}{\arg\min} (-x) &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
Thus, the following are equivalent:&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img alt=&quot;\underset{\theta}{\arg\max} \sum\limits_{i=1}^n \log f(x_i|\theta) = \underset{\theta}{\arg\min} - \sum\limits_{i=1}^n \log f(x_i|\theta) = \hat{\theta}_{\textnormal{MLE}} &quot; class=&quot;latex&quot; src=&quot;http://s0.wp.com/latex.php?latex=%5Cunderset%7B%5Ctheta%7D%7B%5Carg%5Cmax%7D+%5Csum%5Climits_%7Bi%3D1%7D%5En+%5Clog+f%28x_i%7C%5Ctheta%29+%3D+%5Cunderset%7B%5Ctheta%7D%7B%5Carg%5Cmin%7D+-+%5Csum%5Climits_%7Bi%3D1%7D%5En+%5Clog+f%28x_i%7C%5Ctheta%29+%3D+%5Chat%7B%5Ctheta%7D_%7B%5Ctextnormal%7BMLE%7D%7D+&amp;amp;bg=ffffff&amp;amp;fg=333333&amp;amp;s=0&quot; style=&quot;border: none; height: auto; max-width: 100%; vertical-align: middle;&quot; title=&quot;\underset{\theta}{\arg\max} \sum\limits_{i=1}^n \log f(x_i|\theta) = \underset{\theta}{\arg\min} - \sum\limits_{i=1}^n \log f(x_i|\theta) = \hat{\theta}_{\textnormal{MLE}} &quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 1em; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/6205297902504079958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/mle-negative-log-likelihood.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6205297902504079958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6205297902504079958'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/mle-negative-log-likelihood.html' title='MLE (negative log likelihood)'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-387423789699220622</id><published>2013-04-14T20:56:00.002+10:00</published><updated>2013-04-14T20:56:35.264+10:00</updated><title type='text'>Pan Tilt mount, Their Terminology</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pan &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; == &amp;gt; Yaw angle&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b&gt;Tilt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ==&amp;gt; &amp;nbsp; Pitch&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bank &amp;nbsp; &amp;nbsp; &amp;nbsp; ==&amp;gt; &amp;nbsp;Stable Roll&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRkNtYEGwLPJmhQ0EceMIOeKAWjYUNHJ3KnJMAQixk03Z163ohVTSUBB55HacFsJH3Kr8fJKQ5QzbhVEtnTMZ12pgWzyUtVKOmTdUBgc9iEYy_axsJqrCLJvxbDijmu2SpndXd89uhoq8/s1600/pan+titl+camera.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRkNtYEGwLPJmhQ0EceMIOeKAWjYUNHJ3KnJMAQixk03Z163ohVTSUBB55HacFsJH3Kr8fJKQ5QzbhVEtnTMZ12pgWzyUtVKOmTdUBgc9iEYy_axsJqrCLJvxbDijmu2SpndXd89uhoq8/s1600/pan+titl+camera.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjPb-se585VYk0VpLRKT8TW9gk-gSuFnI0qnbFQ7omtBTnGMav8d3CDupv7fRH4U1ys-UQw_lqUwpn9dkPd06364vbVdH-p6NZIudKs_g4oiu_SXn2S59U74HFH3Q6-9tPgC6MBkOCohc/s1600/PanTilt-1L.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjPb-se585VYk0VpLRKT8TW9gk-gSuFnI0qnbFQ7omtBTnGMav8d3CDupv7fRH4U1ys-UQw_lqUwpn9dkPd06364vbVdH-p6NZIudKs_g4oiu_SXn2S59U74HFH3Q6-9tPgC6MBkOCohc/s320/PanTilt-1L.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/387423789699220622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/pan-tilt-mount-their-terminology.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/387423789699220622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/387423789699220622'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/pan-tilt-mount-their-terminology.html' title='Pan Tilt mount, Their Terminology'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRkNtYEGwLPJmhQ0EceMIOeKAWjYUNHJ3KnJMAQixk03Z163ohVTSUBB55HacFsJH3Kr8fJKQ5QzbhVEtnTMZ12pgWzyUtVKOmTdUBgc9iEYy_axsJqrCLJvxbDijmu2SpndXd89uhoq8/s72-c/pan+titl+camera.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-8103625374657781479</id><published>2013-04-14T17:59:00.000+10:00</published><updated>2013-04-14T18:00:11.969+10:00</updated><title type='text'>Complimentary AHRS approach (DCM algorithm) </title><content type='html'>(Source:&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/dcm_tutorial.html&quot;&gt;http://www.starlino.com/dcm_tutorial.html&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Introduction&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This article is a continuation of my&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/imu_guide.html&quot; style=&quot;color: #0099ff;&quot;&gt;IMU Guide&lt;/a&gt;, covering additional orientation kinematics topics. I will go through some theory first and then I will present a practical example with code build around an Arduino and a 6DOF IMU sensor (acc_gyro_6dof). The scope of this experiment is to create an algorithm for fusing gyroscope and accelerometer data in order to create an estimation of the device orientation in space. Such an algorithm was already presented in part 3 of my “IMU Guide” and a practical Arduino experiment with code was presented in the “&lt;a href=&quot;http://www.starlino.com/imu_kalman_arduino.html&quot; style=&quot;color: #0099ff;&quot;&gt;Using a 5DOF IMU&lt;/a&gt;” article and was nicknamed “Simplified Kalman Filter”, providing a simple alternative to the well known Kalman Filter algorithm. In this article we’ll use another approach utilizing the DCM (Direction Cosine Matrix). For the reader that is unfamiliar with MEMS sensors it is recommended to read Part 1 and 2 of the IMU Guide article. Also for following the experiments presented in this text it is recommended to acquire an Arduino board and an&amp;nbsp;&lt;a href=&quot;http://www.gadgetgangster.com/367&quot; style=&quot;color: #0099ff;&quot;&gt;acc_gyro_6dof&lt;/a&gt;&amp;nbsp;sensor.&lt;/div&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Prerequisites&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
No really advanced math is necessary. Find a good book on matrix operations, that’s all you might need above school math course. If you would like to refresh your knowledge below are some quick articles:&lt;br /&gt;
Cartesian Coordinate System –&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cartesian_coordinate_system&quot; style=&quot;color: #0099ff;&quot;&gt;http://en.wikipedia.org/wiki/Cartesian_coordinate_system&lt;/a&gt;&lt;br /&gt;
Rotation –&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Rotation_%28mathematics%29&quot; style=&quot;color: #0099ff;&quot;&gt;http://en.wikipedia.org/wiki/Rotation_%28mathematics%29&lt;/a&gt;&lt;br /&gt;
Vector scalar product –&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Dot_product&quot; style=&quot;color: #0099ff;&quot;&gt;http://en.wikipedia.org/wiki/Dot_product&lt;/a&gt;&lt;br /&gt;
Vector cross product –&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cross_product&quot; style=&quot;color: #0099ff;&quot;&gt;http://en.wikipedia.org/wiki/Cross_product&lt;/a&gt;&lt;br /&gt;
Matrix Multiplication –&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Matrix_multiplication&quot; style=&quot;color: #0099ff;&quot;&gt;http://en.wikipedia.org/wiki/Matrix_multiplication&lt;/a&gt;&lt;br /&gt;
Block Matrix –&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Block_matrix&quot; style=&quot;color: #0099ff;&quot;&gt;http://en.wikipedia.org/wiki/Block_matrix&lt;/a&gt;&lt;br /&gt;
Transpose Matrix –&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Transpose&quot; style=&quot;color: #0099ff;&quot;&gt;http://en.wikipedia.org/wiki/Transpose&lt;/a&gt;&lt;br /&gt;
Triple Product –&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Triple_product&quot; style=&quot;color: #0099ff;&quot;&gt;http://en.wikipedia.org/wiki/Triple_product&lt;/a&gt;&lt;/div&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Notations&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Vectors are marked in&amp;nbsp;&lt;b&gt;bold text&amp;nbsp;&lt;/b&gt;-&lt;b&gt;&amp;nbsp;&lt;/b&gt;so for example “&lt;b&gt;v&lt;/b&gt;”&lt;b&gt;&amp;nbsp;&lt;/b&gt;is a vector and “v” is a scalar (if you can’t distinguish the two there’s problem with the text formatting wherever you’re reading this).&lt;/div&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Part 1. The DCM Matrix&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Generally speaking orientation kinematics deals with calculating the relative orientation of a body relative to a global coordinate system. It is useful to attach a coordinate system to our body frame and call it Oxyz, and another one to our global frame and call it OXYZ. Both the global and the body frames have the same fixed origin O (see&amp;nbsp;&lt;i&gt;Fig. 1&lt;/i&gt;). Let’s also define&amp;nbsp;&lt;b&gt;i, j, k&lt;/b&gt;&amp;nbsp;to be unity vectors co-directional with the body frame’s x, y, and z axes – in other words they are versors of Oxyz and let&amp;nbsp;&lt;b&gt;I, J, K&amp;nbsp;&lt;/b&gt;be the versors of global frame OXYZ.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0024.jpg&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image002[4]&quot; border=&quot;0&quot; height=&quot;249&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0024_thumb.jpg&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image002[4]&quot; width=&quot;279&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;i&gt;Figure 1&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Thus, by definition, expressed&amp;nbsp;&lt;b&gt;in terms of global coordinates&lt;/b&gt;&amp;nbsp;vectors&amp;nbsp;&lt;b&gt;I, J, K&lt;/b&gt;&amp;nbsp;can be written as:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= {1,0,0}&lt;b&gt;&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&lt;/b&gt;,&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;={0,1,0}&lt;b&gt;&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&lt;/b&gt;&amp;nbsp;,&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= {0,0,1}&lt;b&gt;&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;i&gt;Note: we use {…}&lt;sup&gt;&amp;nbsp;T&amp;nbsp;&lt;/sup&gt;notation to denote a column vector, in other words a column vector is a translated row vector. The orientation of vectors (row/column) will become relevant once we start multiplying them by a matrix later on in this text.&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
And similarly,&amp;nbsp;&lt;b&gt;in terms of body coordinates&amp;nbsp;&lt;/b&gt;vectors&lt;b&gt;&amp;nbsp;i, j, k&amp;nbsp;&lt;/b&gt;can be written as:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;i&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;= {1,0,0}&lt;b&gt;&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&lt;/b&gt;,&amp;nbsp;&lt;b&gt;j&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;={0,1,0}&lt;b&gt;&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&lt;/b&gt;&amp;nbsp;,&amp;nbsp;&lt;b&gt;k&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;= {0,0,1}&lt;b&gt;&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now let’s see if we can write vectors&amp;nbsp;&lt;b&gt;i, j, k&amp;nbsp;&lt;/b&gt;in terms of global coordinates. Let’s take vector&amp;nbsp;&lt;b&gt;i&amp;nbsp;&lt;/b&gt;as an example and write its global coordinates:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;i&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= {i&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;, i&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;G&amp;nbsp;&lt;/sup&gt;, i&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;}&lt;b&gt;&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Again, by example let’s analyze the X coordinate i&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;, it’s calculated as the length of projection of the&amp;nbsp;&lt;b&gt;i&amp;nbsp;&lt;/b&gt;vector onto the global X axis.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
i&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&amp;nbsp;&lt;/sup&gt;= |&lt;b&gt;i&lt;/b&gt;| cos(X,&lt;b&gt;i&lt;/b&gt;) = cos(&lt;b&gt;I&lt;/b&gt;,&lt;b&gt;i&lt;/b&gt;)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Where |&lt;b&gt;i&lt;/b&gt;| is the norm (length) of the&amp;nbsp;&lt;b&gt;i&lt;/b&gt;&amp;nbsp;unity vector and cos(&lt;b&gt;I&lt;/b&gt;,&lt;b&gt;i&lt;/b&gt;) is the cosine of the angle formed by the vectors&amp;nbsp;&lt;b&gt;I&lt;/b&gt;and&amp;nbsp;&lt;b&gt;i&lt;/b&gt;. Using the fact that |&lt;b&gt;I&lt;/b&gt;| = 1 and |&lt;b&gt;i&lt;/b&gt;| = 1 (they are unit vectors by definition). We can write:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
i&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&amp;nbsp;&lt;/sup&gt;= cos(&lt;b&gt;I&lt;/b&gt;,&lt;b&gt;i&lt;/b&gt;) = |&lt;b&gt;I&lt;/b&gt;||&lt;b&gt;i&lt;/b&gt;| cos(&lt;b&gt;I&lt;/b&gt;,&lt;b&gt;i&lt;/b&gt;) =&amp;nbsp;&lt;b&gt;I.i&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Where&amp;nbsp;&lt;b&gt;I.i&lt;/b&gt;. is the scalar (dot) product of vectors&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;i&lt;/b&gt;. For the purpose of calculating scalar product&amp;nbsp;&lt;b&gt;I.i&amp;nbsp;&lt;/b&gt;it doesn’t matter in which coordinate system these vectors are measured as long as they are both expressed in the same system, since a rotation does not modify the angle between vectors so:&amp;nbsp;&lt;b&gt;I.i = I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;.i&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&lt;b&gt;.i&lt;/b&gt;&lt;sup&gt;G&amp;nbsp;&lt;/sup&gt;= cos(&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;.i&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;) = cos(&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&lt;b&gt;.i&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;) , so for simplicity we’ll skip the superscript in scalar products&amp;nbsp;&lt;b&gt;I.i , J.j , K.k&amp;nbsp;&lt;/b&gt;and in cosines&lt;b&gt;&amp;nbsp;&lt;/b&gt;cos(&lt;b&gt;I&lt;/b&gt;,&lt;b&gt;i&lt;/b&gt;), cos(&lt;b&gt;J&lt;/b&gt;,&lt;b&gt;j&lt;/b&gt;), cos(&lt;b&gt;K&lt;/b&gt;,&lt;b&gt;k&lt;/b&gt;).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Similarly we can show that:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
i&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;J.i&lt;/b&gt;&lt;sup&gt;&amp;nbsp;&lt;/sup&gt;, i&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;=&lt;b&gt;K.i&amp;nbsp;&lt;/b&gt;, so now we can write vector&amp;nbsp;&lt;b&gt;i&lt;/b&gt;&amp;nbsp;in terms of global coordinate system as:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;i&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;= {&lt;b&gt;&amp;nbsp;I.i, J.i, K.i&lt;/b&gt;}&lt;sup&gt;T&lt;/sup&gt;&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Furthermore, similarly it can be shown that&amp;nbsp;&lt;b&gt;j&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;= {&lt;b&gt;&amp;nbsp;I.j, J.j, K.j&lt;/b&gt;}&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&lt;b&gt;&amp;nbsp;, k&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;= {&lt;b&gt;&amp;nbsp;I.k, J.k, K.k&lt;/b&gt;}&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We now have a complete set of global coordinates for our body’s versors&amp;nbsp;&lt;b&gt;i, j, k&amp;nbsp;&lt;/b&gt;and we can organize these values in a convenient matrix form:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0044.gif&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image004[4]&quot; border=&quot;0&quot; height=&quot;74&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0044_thumb.gif&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image004[4]&quot; width=&quot;620&quot; /&gt;&lt;/a&gt;&lt;i&gt;&amp;nbsp;(Eq. 1.1)&lt;/i&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This matrix is called Direction Cosine Matrix for now obvious reasons – it consists of cosines of angles of all possible combinations of body and global versors.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The task of expressing the global frame versors&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;,&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;,&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;in body frame coordinates is symmetrical in nature and can be achieved by simply swapping the notations&amp;nbsp;&lt;b&gt;I, J, K&amp;nbsp;&lt;/b&gt;with&amp;nbsp;&lt;b&gt;i, j, k,&amp;nbsp;&lt;/b&gt;the results being:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;= {&lt;b&gt;&amp;nbsp;I.i, I.j, I.k&lt;/b&gt;}&lt;sup&gt;T&lt;/sup&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;,&lt;b&gt;&amp;nbsp;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;= {&lt;b&gt;&amp;nbsp;J.i, J.j, J.k&lt;/b&gt;}&lt;sup&gt;T&lt;/sup&gt;&lt;b&gt;&amp;nbsp;, K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;= {&lt;b&gt;&amp;nbsp;K.i, K.j, K.k&lt;/b&gt;}&lt;sup&gt;T&lt;/sup&gt;&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
and organized in a matrix form:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0064.gif&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image006[4]&quot; border=&quot;0&quot; height=&quot;74&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0064_thumb.gif&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image006[4]&quot; width=&quot;620&quot; /&gt;&lt;/a&gt;&lt;i&gt;&amp;nbsp;(Eq. 1.2)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
It is now easy to notice that DCM&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;= (DCM&lt;sup&gt;G&lt;/sup&gt;)&lt;sup&gt;T&amp;nbsp;&lt;/sup&gt;or DCM&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= (DCM&lt;sup&gt;B&lt;/sup&gt;)&lt;sup&gt;T&amp;nbsp;&lt;/sup&gt;, in other words the two matrices are translates of each other, we’ll use this important property later on.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Also notice that DCM&lt;sup&gt;B&lt;/sup&gt;. DCM&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= (DCM&lt;sup&gt;G&lt;/sup&gt;)&lt;sup&gt;T&lt;/sup&gt;&amp;nbsp;.DCM&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= DCM&lt;sup&gt;B&lt;/sup&gt;. (DCM&lt;sup&gt;B&lt;/sup&gt;)&lt;sup&gt;T&lt;/sup&gt;&amp;nbsp;= I&lt;sub&gt;3&lt;/sub&gt;&amp;nbsp;, where I&lt;sub&gt;3&lt;/sub&gt;&amp;nbsp;is the 3×3 identity matrix. In other words the DCM matrices are orthogonal.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This can be proven by simply expanding the matrix multiplication in block matrix form:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0084.gif&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image008[4]&quot; border=&quot;0&quot; height=&quot;145&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0084_thumb.gif&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image008[4]&quot; width=&quot;624&quot; /&gt;&lt;/a&gt;&lt;i&gt;&amp;nbsp;(Eq. 1.3)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
To prove this we use such properties as for example:&amp;nbsp;&lt;b&gt;i&lt;/b&gt;&lt;sup&gt;GT&lt;/sup&gt;.&lt;b&gt;&amp;nbsp;i&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= |&lt;b&gt;&amp;nbsp;i&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;||&lt;b&gt;&amp;nbsp;i&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;|cos(0) = 1 and&amp;nbsp;&lt;b&gt;i&lt;/b&gt;&lt;sup&gt;GT&lt;/sup&gt;.&lt;b&gt;&amp;nbsp;j&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= 0 because (&lt;b&gt;i&amp;nbsp;&lt;/b&gt;and&lt;b&gt;j&lt;/b&gt;&amp;nbsp;are orthogonal) and so forth.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The DCM matrix (also often called the rotation matrix) has a great importance in orientation kinematics since it defines the rotation of one frame relative to another. It can also be used to determine the global coordinates of an arbitrary vector if we know its coordinates in the body frame (and vice versa).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Let’s consider such a vector with body coordinates:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;= {&lt;b&gt;&amp;nbsp;&lt;/b&gt;r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;, r&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;, r&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;}&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&amp;nbsp;and let’s try to determine its coordinates in the global frame, by using a known rotation matrix DCM&lt;sup&gt;G&lt;/sup&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We start by doing following notation:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= { r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;, r&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;, r&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;}&amp;nbsp;&lt;sup&gt;T&lt;/sup&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now let’s tackle the first coordinate r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= |&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;| cos(&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;,&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;) , because r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;is the projection of&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;onto X axis that is co-directional with&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Next let’s note that by definition a rotation is such a transformation that does not change the scale of a vector and does not change the angle between two vectors that are subject to the same rotation, so if we express some vectors in a different rotated coordinate system the norm and angle between vectors will not change:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
|&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;| = |&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;| , |&lt;b&gt;&amp;nbsp;I&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;| = |&lt;b&gt;&amp;nbsp;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;| = 1 and cos(&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;,&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;) = cos(&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;,&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;), so we can use this property to write&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= |&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;| cos(&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;,&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;) = |&lt;b&gt;&amp;nbsp;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;||&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;| cos(&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;,&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;) =&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;.&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;. {&lt;b&gt;&amp;nbsp;&lt;/b&gt;r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;, r&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;, r&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;}&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&amp;nbsp;, by using one the two definition of the scalar product.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now recall that&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;= {&lt;b&gt;&amp;nbsp;I.i, I.j, I.k&lt;/b&gt;}&lt;sup&gt;T&lt;/sup&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;and by using the other definition of scalar product:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;.&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;= {&lt;b&gt;&amp;nbsp;I.i, I.j, I.k&lt;/b&gt;}&lt;sup&gt;T&lt;/sup&gt;&lt;b&gt;&amp;nbsp;.&amp;nbsp;&lt;/b&gt;{&lt;b&gt;&amp;nbsp;&lt;/b&gt;r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;, r&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;, r&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;}&lt;sup&gt;&amp;nbsp;T&lt;/sup&gt;&amp;nbsp;= r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;I.i&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;&lt;/b&gt;r&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;I.j&amp;nbsp;&lt;/b&gt;+ r&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;I.k&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In same fashion it can be shown that:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
r&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;J.i&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;&lt;/b&gt;r&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;J.j&amp;nbsp;&lt;/b&gt;+ r&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;J.k&amp;nbsp;&lt;/b&gt;r&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= r&lt;sub&gt;x&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;K.i&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;&lt;/b&gt;r&lt;sub&gt;y&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;K.j&amp;nbsp;&lt;/b&gt;+ r&lt;sub&gt;z&lt;/sub&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;K.k&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Finally let’s write this in a more compact matrix form:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0104.gif&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image010[4]&quot; border=&quot;0&quot; height=&quot;80&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0104_thumb.gif&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image010[4]&quot; width=&quot;386&quot; /&gt;&lt;/a&gt;&lt;i&gt;&amp;nbsp;(Eq. 1.4)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Thus the DCM matrix can be used to covert an arbitrary vector&amp;nbsp;&lt;b&gt;r&lt;sup&gt;B&lt;/sup&gt;&lt;/b&gt;&amp;nbsp;expressed in one coordinate system B, to a rotated coordinate system G.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We can use similar logic to prove the reverse process:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0124.gif&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image012[4]&quot; border=&quot;0&quot; height=&quot;26&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0124_thumb.gif&quot; style=&quot;background-image: none; border: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image012[4]&quot; width=&quot;125&quot; /&gt;&lt;/a&gt;&lt;i&gt;&amp;nbsp;(Eq. 1.5)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Or we can arrive at the same conclusion by multiplying both parts in&amp;nbsp;&lt;i&gt;(Eq. 1.4)&amp;nbsp;&lt;/i&gt;by DCM&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;which equals to DCM&lt;sup&gt;GT&lt;/sup&gt;, and using the property that DCM&lt;sup&gt;GT&lt;/sup&gt;.DCM&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= I&lt;sub&gt;3&lt;/sub&gt;&amp;nbsp;, see (&lt;i&gt;Eq. 1.3)&lt;/i&gt;:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
DCM&lt;sup&gt;B&lt;/sup&gt;&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= DCM&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;DCM&lt;sup&gt;G&lt;/sup&gt;&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;= DCM&lt;sup&gt;GT&lt;/sup&gt;&amp;nbsp;DCM&lt;sup&gt;G&lt;/sup&gt;&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;= I&lt;sub&gt;3&lt;/sub&gt;&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&lt;sup&gt;B&amp;nbsp;&lt;/sup&gt;=&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;/div&gt;
&lt;h4 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px;&quot;&gt;
&amp;nbsp;&lt;/h4&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Part 2. Angular Velocity&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So far we have a way to characterize the orientation of one frame relative to another rotated frame, it is the DCM matrix and it allows us to easily convert the global and body coordinates back and forth using&amp;nbsp;&lt;i&gt;(Eq. 1.4)&amp;nbsp;&lt;/i&gt;and&amp;nbsp;&lt;i&gt;(Eq. 1.5).&amp;nbsp;&lt;/i&gt;In this section we’ll analyze the rotation as a function of time that will help us establish the rules of updating the DCM matrix based on a characteristic called angular velocity. Let’s consider an arbitrary rotating vector&amp;nbsp;&lt;b&gt;r&lt;/b&gt;and define it’s coordinates at time t to be&amp;nbsp;&lt;b&gt;r&lt;/b&gt;(t). Now let’s consider a small time interval dt and make the following notations:&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;(t) ,&amp;nbsp;&lt;b&gt;r’&lt;/b&gt;=&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;(t+dt) and d&lt;b&gt;r = r&lt;/b&gt;’ –&amp;nbsp;&lt;b&gt;r&lt;/b&gt;:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0144.jpg&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image014[4]&quot; border=&quot;0&quot; height=&quot;205&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0144_thumb.jpg&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image014[4]&quot; width=&quot;199&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;i&gt;Figure 2&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Let’s say that during a very small time interval dt → 0 the vector&amp;nbsp;&lt;b&gt;r&amp;nbsp;&lt;/b&gt;has&lt;b&gt;&amp;nbsp;&lt;/b&gt;rotated about an axis co-directional with a unity vector&amp;nbsp;&lt;b&gt;u&lt;/b&gt;&lt;sub&gt;&amp;nbsp;&lt;/sub&gt;by an angle dθ and ended up in the position&amp;nbsp;&lt;b&gt;r’&lt;/b&gt;. Since&amp;nbsp;&lt;b&gt;u&amp;nbsp;&lt;/b&gt;is our axis of rotation it is perpendicular to the plane in which the rotation took place (the plane formed by&lt;b&gt;&amp;nbsp;r&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;r&lt;/b&gt;’) so&amp;nbsp;&lt;b&gt;u&amp;nbsp;&lt;/b&gt;is orthogonal to both&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;r&lt;/b&gt;’. There are two unity vectors that are orthogonal to the plane formed by&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;r’&lt;/b&gt;, they are shown on the picture as&lt;b&gt;u&amp;nbsp;&lt;/b&gt;and&amp;nbsp;&lt;b&gt;u’&lt;/b&gt;&amp;nbsp;since we’re still defining things we’ll choose the one that is co-directional with the cross product&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;r’&lt;/b&gt;, following the rule of&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Right-hand_rule&quot; style=&quot;color: #0099ff;&quot;&gt;right-handed coordinate system&lt;/a&gt;. Thus because&amp;nbsp;&lt;b&gt;u&amp;nbsp;&lt;/b&gt;is a unity vector |&lt;b&gt;u&lt;/b&gt;| = 1 and is co-directional with&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;r’&amp;nbsp;&lt;/b&gt;we can deduct it as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;u&lt;/b&gt;&amp;nbsp;=&lt;b&gt;&amp;nbsp;&lt;/b&gt;(&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;r&lt;/b&gt;’) / |&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;r&lt;/b&gt;’| =&lt;b&gt;&amp;nbsp;&lt;/b&gt;(&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;r&lt;/b&gt;’) / (|&lt;b&gt;r&lt;/b&gt;||&lt;b&gt;&amp;nbsp;r&lt;/b&gt;’|sin(dθ)) = (&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&lt;b&gt;&amp;nbsp;r&lt;/b&gt;’) / (|&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;&amp;nbsp;sin(dθ))&amp;nbsp;&lt;i&gt;(Eq. 2.1)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Since a rotation does not alter the length of a vector we used the property that|&lt;b&gt;&amp;nbsp;r&lt;/b&gt;’| = |&lt;b&gt;r&lt;/b&gt;|.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The linear velocity of the vector&amp;nbsp;&lt;b&gt;r&amp;nbsp;&lt;/b&gt;can&lt;b&gt;&amp;nbsp;&lt;/b&gt;be defined as the vector:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;v =&amp;nbsp;&lt;/b&gt;d&lt;b&gt;r&amp;nbsp;&lt;/b&gt;/ dt = (&lt;b&gt;&amp;nbsp;r&lt;/b&gt;’ –&amp;nbsp;&lt;b&gt;r&lt;/b&gt;) / dt&amp;nbsp;&lt;i&gt;(Eq. 2.2)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Please note that since our dt approaches 0 so does dθ → 0, hence the angle between vectors&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;and d&lt;b&gt;r&amp;nbsp;&lt;/b&gt;(let’s call it α)&lt;b&gt;&amp;nbsp;&lt;/b&gt;can be found from the isosceles triangle contoured by&amp;nbsp;&lt;b&gt;r&amp;nbsp;&lt;/b&gt;,&amp;nbsp;&lt;b&gt;r’&amp;nbsp;&lt;/b&gt;and&lt;b&gt;&amp;nbsp;&lt;/b&gt;d&lt;b&gt;r:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
α = (π – dθ) / 2 and because dθ → 0 , then α → π/2&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
What this tells us is that&amp;nbsp;&lt;b&gt;r&amp;nbsp;&lt;/b&gt;is perpendicular to&lt;b&gt;&amp;nbsp;&lt;/b&gt;d&lt;b&gt;r&lt;/b&gt;&amp;nbsp;when dt → 0 and hence&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;is perpendicular to&amp;nbsp;&lt;b&gt;v&lt;/b&gt;&amp;nbsp;since&amp;nbsp;&lt;b&gt;v&lt;/b&gt;&amp;nbsp;and d&lt;b&gt;r&lt;/b&gt;are co-directional from&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;i&gt;(Eq. 2.2):&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;i&gt;v&lt;/i&gt;&lt;/b&gt;&amp;nbsp;⊥ r&amp;nbsp;&lt;i&gt;(Eq. 2.21)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We are now ready to define the angular velocity vector. Ideally such a vector should define the rate of change of the angle θ and the axis of the rotation, so we define it as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;w&amp;nbsp;&lt;/b&gt;= (dθ/dt )&amp;nbsp;&lt;b&gt;u&amp;nbsp;&lt;/b&gt;&lt;i&gt;(Eq. 2.3)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Indeed the norm of the&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&amp;nbsp;is |&lt;b&gt;w&lt;/b&gt;| = dθ/dt and the direction of&amp;nbsp;&lt;b&gt;w&amp;nbsp;&lt;/b&gt;coincides with the axis of rotation&amp;nbsp;&lt;b&gt;u&lt;/b&gt;. Let’s expand&lt;i&gt;(Eq. 2.3)&amp;nbsp;&lt;/i&gt;and try to establish a relationship with the linear velocity&amp;nbsp;&lt;b&gt;v:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Using&amp;nbsp;&lt;i&gt;(Eq. 2.3)&amp;nbsp;&lt;/i&gt;and&lt;i&gt;&amp;nbsp;(Eq. 2.1)&lt;/i&gt;:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;w&amp;nbsp;&lt;/b&gt;= (dθ/dt )&amp;nbsp;&lt;b&gt;u&amp;nbsp;&lt;/b&gt;= (dθ/dt ) (&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&lt;b&gt;&amp;nbsp;r&lt;/b&gt;’) / (|&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;&amp;nbsp;sin(dθ))&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now note that when dt → 0, so does dθ → 0 and hence for small dθ, sin(dθ) ≈ dθ , we end up with:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;w&amp;nbsp;&lt;/b&gt;= (&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&lt;b&gt;&amp;nbsp;r&lt;/b&gt;’) / (|&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;&amp;nbsp;dt)&amp;nbsp;&lt;i&gt;(Eq. 2.4)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now because&amp;nbsp;&lt;b&gt;r&lt;/b&gt;’ =&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;+ d&lt;b&gt;r&lt;/b&gt;&amp;nbsp;, d&lt;b&gt;r&lt;/b&gt;/dt =&amp;nbsp;&lt;b&gt;v , r&amp;nbsp;&lt;/b&gt;x&amp;nbsp;&lt;b&gt;r = 0&amp;nbsp;&lt;/b&gt;and using the distributive property of cross product over addition:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;w&amp;nbsp;&lt;/b&gt;= (&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x (&lt;b&gt;r&lt;/b&gt;&amp;nbsp;+ d&lt;b&gt;r)&lt;/b&gt;) / (|&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;&amp;nbsp;dt) = (&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;+&amp;nbsp;&lt;b&gt;r&amp;nbsp;&lt;/b&gt;x d&lt;b&gt;r)&lt;/b&gt;) / (|&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;&amp;nbsp;dt) =&amp;nbsp;&lt;b&gt;r&amp;nbsp;&lt;/b&gt;x (d&lt;b&gt;r&lt;/b&gt;/dt) / |&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
And finally:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;w&amp;nbsp;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;v&amp;nbsp;&lt;/b&gt;/ |&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;­&amp;nbsp;&lt;i&gt;(Eq. 2.5)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This equation establishes a way to calculate angular velocity from a known linear velocity&amp;nbsp;&lt;b&gt;v&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We can easily prove the reverse equation that lets us deduct linear velocity from angular velocity:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;v&amp;nbsp;&lt;/b&gt;=&lt;b&gt;&amp;nbsp;w&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&amp;nbsp;&lt;/b&gt;­&amp;nbsp;&lt;i&gt;(Eq. 2.6)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This can be proven simply by expanding&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&amp;nbsp;from&amp;nbsp;&lt;i&gt;(Eq. 2.5)&amp;nbsp;&lt;/i&gt;and using vector&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Triple_product&quot; style=&quot;color: #0099ff;&quot;&gt;triple product&lt;/a&gt;&amp;nbsp;rule (&lt;b&gt;a&amp;nbsp;&lt;/b&gt;x&amp;nbsp;&lt;b&gt;b&lt;/b&gt;) x&amp;nbsp;&lt;b&gt;c&lt;/b&gt;&amp;nbsp;= (&lt;b&gt;a&lt;/b&gt;.&lt;b&gt;c&lt;/b&gt;)&lt;b&gt;b&lt;/b&gt;– (&lt;b&gt;b&lt;/b&gt;.&lt;b&gt;c&lt;/b&gt;)&lt;b&gt;a&lt;/b&gt;. Also we’ll use the fact that&amp;nbsp;&lt;b&gt;v&amp;nbsp;&lt;/b&gt;and&lt;b&gt;&amp;nbsp;r&amp;nbsp;&lt;/b&gt;are perpendicular&amp;nbsp;&lt;i&gt;(Eq. 2.21)&lt;/i&gt;&amp;nbsp;and thus&amp;nbsp;&lt;b&gt;v&lt;/b&gt;.&lt;b&gt;r&amp;nbsp;&lt;/b&gt;= 0&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;w&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&amp;nbsp;&lt;/b&gt;=&lt;b&gt;&amp;nbsp;&lt;/b&gt;(&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;v&amp;nbsp;&lt;/b&gt;/ |&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;­) x&amp;nbsp;&lt;b&gt;r&amp;nbsp;&lt;/b&gt;= (&lt;b&gt;r&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;v)&amp;nbsp;&lt;/b&gt;x&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&amp;nbsp;/ |&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;­ = ((&lt;b&gt;r&lt;/b&gt;.&lt;b&gt;r&lt;/b&gt;)&amp;nbsp;&lt;b&gt;v&lt;/b&gt;&amp;nbsp;+ (&lt;b&gt;v&lt;/b&gt;.&lt;b&gt;r&lt;/b&gt;)&lt;b&gt;r&lt;/b&gt;) / |&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;­ = ( |&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&lt;/sup&gt;­&amp;nbsp;&lt;b&gt;v&lt;/b&gt;&amp;nbsp;+ 0) |&lt;b&gt;r&lt;/b&gt;|&lt;sup&gt;2&amp;nbsp;&lt;/sup&gt;=&amp;nbsp;&lt;b&gt;v&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So we just proved that&amp;nbsp;&lt;i&gt;(Eq. 2.6)&lt;/i&gt;&amp;nbsp;is true. Just to check&amp;nbsp;&lt;i&gt;(Eq. 2.6)&amp;nbsp;&lt;/i&gt;intuitively – from&amp;nbsp;&lt;i&gt;Figure 2&amp;nbsp;&lt;/i&gt;indeed&amp;nbsp;&lt;b&gt;v&amp;nbsp;&lt;/b&gt;has the direction of&amp;nbsp;&lt;b&gt;w&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&amp;nbsp;&lt;/b&gt;using the right hand rule and indeed&amp;nbsp;&lt;b&gt;&lt;i&gt;v&lt;/i&gt;&lt;/b&gt;&amp;nbsp;⊥&amp;nbsp;&lt;b&gt;r&amp;nbsp;&lt;/b&gt;and&amp;nbsp;&lt;b&gt;&lt;i&gt;v&lt;/i&gt;&lt;/b&gt;&amp;nbsp;⊥&amp;nbsp;&lt;b&gt;w&amp;nbsp;&lt;/b&gt;because it is in the same plane with&lt;b&gt;&amp;nbsp;r&lt;/b&gt;and&amp;nbsp;&lt;b&gt;r’&lt;/b&gt;.&lt;/div&gt;
&lt;h4 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px;&quot;&gt;
&amp;nbsp;&lt;/h4&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Part 3. Gyroscopes and angular velocity vector&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
A 3-axis MEMS gyroscope is a device that senses rotation about 3 axes attached to the device itself (body frame). If we adopt the device’s coordinate system (body’s frame), and analyze some vectors attached to the earth (global frame), for example vector&amp;nbsp;&lt;b&gt;K&amp;nbsp;&lt;/b&gt;pointing to the zenith or vector&amp;nbsp;&lt;b&gt;I&amp;nbsp;&lt;/b&gt;pointing North – then it would appear to an observer inside the device that these vector rotate about the device center. Let w&lt;sub&gt;x&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;y&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;z&amp;nbsp;&lt;/sub&gt;be the outputs of a gyroscope expressed in rad/s – the measured rotation about axes x, y , z respectively. Converting from the raw output of the gyroscope to physical values is discussed for example here:&lt;a href=&quot;http://www.starlino.com/imu_guide.html&quot; style=&quot;color: #0099ff;&quot;&gt;http://www.starlino.com/imu_guide.html&lt;/a&gt;&amp;nbsp;. If we query the gyroscope at regular, small time intervals&amp;nbsp;&lt;b&gt;dt,&amp;nbsp;&lt;/b&gt;then what gyroscope output tells us is that during this time interval the earth rotated about gyroscope’s&amp;nbsp;&lt;i&gt;x&lt;/i&gt;&amp;nbsp;axis by an angle of dθ&lt;sub&gt;x&lt;/sub&gt;&amp;nbsp;= w&lt;sub&gt;x&lt;/sub&gt;dt, about&amp;nbsp;&lt;i&gt;y&lt;/i&gt;&amp;nbsp;axis by an angle of dθ&lt;sub&gt;y&lt;/sub&gt;&amp;nbsp;= w&lt;sub&gt;y&lt;/sub&gt;dt and about&amp;nbsp;&lt;i&gt;z&lt;/i&gt;&amp;nbsp;axis by an angle of dθ&lt;sub&gt;z&lt;/sub&gt;&amp;nbsp;= w&lt;sub&gt;z&lt;/sub&gt;dt. These rotations can be characterized by the angular velocity vectors:&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;x&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/sub&gt;= w&lt;sub&gt;x&lt;/sub&gt;&lt;b&gt;&amp;nbsp;i&amp;nbsp;&lt;/b&gt;= {w&lt;sub&gt;x&amp;nbsp;&lt;/sub&gt;, 0&lt;sub&gt;&amp;nbsp;&lt;/sub&gt;, 0&lt;sub&gt;&amp;nbsp;&lt;/sub&gt;}&lt;sup&gt;T&amp;nbsp;&lt;/sup&gt;,&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;y&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/sub&gt;= w&lt;sub&gt;y&lt;/sub&gt;&lt;b&gt;&amp;nbsp;j&amp;nbsp;&lt;/b&gt;= { 0&lt;sub&gt;&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;y&amp;nbsp;&lt;/sub&gt;, 0&lt;sub&gt;&amp;nbsp;&lt;/sub&gt;}&lt;sup&gt;T&lt;/sup&gt;,&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;z&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/sub&gt;= w&lt;sub&gt;z&lt;/sub&gt;&lt;b&gt;&amp;nbsp;k&amp;nbsp;&lt;/b&gt;= { 0&lt;sub&gt;&amp;nbsp;&lt;/sub&gt;, 0, w&lt;sub&gt;z&amp;nbsp;&lt;/sub&gt;}&lt;sup&gt;T&lt;/sup&gt;&amp;nbsp;, where&amp;nbsp;&lt;b&gt;i,j,k&amp;nbsp;&lt;/b&gt;are versors of the local coordinate frame (they are co-directional with body’s axes x,y,z respectively). Each of these three rotations will cause a linear displacement which can be expressed by using&amp;nbsp;&lt;i&gt;(Eq. 2.6)&lt;/i&gt;:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
d&lt;b&gt;r&lt;/b&gt;&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;= dt&amp;nbsp;&lt;b&gt;v&lt;/b&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;= dt (&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;x&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&lt;/b&gt;) ; d&lt;b&gt;r&lt;/b&gt;&lt;sub&gt;2&lt;/sub&gt;&amp;nbsp;= dt&amp;nbsp;&lt;b&gt;v&lt;/b&gt;&lt;sub&gt;2&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;= dt (&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;y&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&lt;/b&gt;) ; d&lt;b&gt;r&lt;/b&gt;&lt;sub&gt;3&lt;/sub&gt;&amp;nbsp;= dt&amp;nbsp;&lt;b&gt;v&lt;/b&gt;&lt;sub&gt;3&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;= dt (&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;z&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&lt;/b&gt;)&amp;nbsp;&lt;i&gt;.&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The combined effect of these three displacements will be:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
d&lt;b&gt;r&amp;nbsp;&lt;/b&gt;= d&lt;b&gt;r&lt;/b&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;+ d&lt;b&gt;r&lt;/b&gt;&lt;sub&gt;2&amp;nbsp;&lt;/sub&gt;+ d&lt;b&gt;r&lt;/b&gt;&lt;sub&gt;3&amp;nbsp;&lt;/sub&gt;= dt (&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;x&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&amp;nbsp;&lt;/b&gt;+&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;y&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;w&lt;/b&gt;&lt;sub&gt;z&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&lt;/b&gt;) = dt (&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;x&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;+&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;y&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;w&lt;/b&gt;&lt;sub&gt;z&lt;/sub&gt;) x&lt;b&gt;&amp;nbsp;r&amp;nbsp;&lt;/b&gt;(cross product is distributive over addition)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Thus the equivalent linear velocity resulting from these 3 transformations can be expressed as:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;v&lt;/b&gt;&amp;nbsp;= d&lt;b&gt;r/&lt;/b&gt;dt = (&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;x&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;+&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;y&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;w&lt;/b&gt;&lt;sub&gt;z&lt;/sub&gt;) x&lt;b&gt;&amp;nbsp;r&amp;nbsp;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;w&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;r&amp;nbsp;&lt;/b&gt;, where we introduce&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;x&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;+&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;y&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;w&lt;/b&gt;&lt;sub&gt;z&lt;/sub&gt;&amp;nbsp;= {w&lt;sub&gt;x&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;y&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;z&amp;nbsp;&lt;/sub&gt;}&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Which looks exactly like&amp;nbsp;&lt;i&gt;(Eq. 2.6)&amp;nbsp;&lt;/i&gt;and suggests that&lt;i&gt;&amp;nbsp;&lt;/i&gt;the combination of three&amp;nbsp;&lt;b&gt;small&lt;/b&gt;&amp;nbsp;rotations about axes x,y,z characterized by angular rotation vectors&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;x&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;,&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;y&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;,&lt;b&gt;&amp;nbsp;w&lt;/b&gt;&lt;sub&gt;z&lt;/sub&gt;&amp;nbsp;is equivalent to one&amp;nbsp;&lt;b&gt;small&lt;/b&gt;&amp;nbsp;rotation characterized by angular rotation vector&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;x&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;+&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;y&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;w&lt;/b&gt;&lt;sub&gt;z&lt;/sub&gt;&amp;nbsp;= {w&lt;sub&gt;x&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;y&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;z&amp;nbsp;&lt;/sub&gt;}. Please note that we’re stressing out that these are&lt;b&gt;small&lt;/b&gt;&amp;nbsp;rotations, since in general when you combine large rotations the order in which rotations are performed become important and you cannot simply sum them up. Our main assumption that let us go from a linear displacement to a rotation by using&amp;nbsp;&lt;i&gt;(Eq. 2.6)&amp;nbsp;&lt;/i&gt;was that dt is really small, and thus the rotations dθ&lt;i&gt;&lt;sub&gt;&amp;nbsp;&lt;/sub&gt;&lt;/i&gt;and linear displacement dr are small as well. In practice this means that the larger the dt interval between gyro queries the larger will be our accumulated error, we’ll deal with this error later on. Now, since w&lt;sub&gt;x&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;y&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;z&amp;nbsp;&lt;/sub&gt;are the output of the gyroscope, then we arrive at the conclusion that in fact a 3 axis gyroscope measures the instantaneous angular velocity of the world rotating about the device’s center.&lt;/div&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Part 4. DCM complimentary filter algorithm using 6DOF or 9DOF IMU sensors&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In the context of this text a 6DOF device is an IMU device consisting of a 3 axis gyroscope and a 3 axis accelerometer. A 9DOF device is an IMU device of a 3 axis gyroscope, a 3 axis accelerometer and a 3 axis magnetometer. Let’s attach a global right-handed coordinate system to the Earth’s frame such that the&amp;nbsp;&lt;b&gt;I&amp;nbsp;&lt;/b&gt;versor points North,&amp;nbsp;&lt;b&gt;K&amp;nbsp;&lt;/b&gt;versor points to the Zenith and thus, with these two versors fixed, the&amp;nbsp;&lt;b&gt;J&amp;nbsp;&lt;/b&gt;versor&lt;b&gt;&amp;nbsp;&lt;/b&gt;will be constrained to point&lt;b&gt;&amp;nbsp;&lt;/b&gt;West.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0164.jpg&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image016[4]&quot; border=&quot;0&quot; height=&quot;331&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0164_thumb.jpg&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image016[4]&quot; width=&quot;359&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;i&gt;Figure 3&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Also let’s consider the body coordinate system to be attached to our IMU device (acc_gyro used as an example),&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0184.jpg&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image018[4]&quot; border=&quot;0&quot; height=&quot;175&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0184_thumb.jpg&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image018[4]&quot; width=&quot;257&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;i&gt;Figure 4&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We already established the fact that gyroscopes can measure the angular velocity vector. Let’s see how accelerometer and magnetometer measurements will fall into our model.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Accelerometers are devices that can sense gravitation. Gravitation vector is pointing towards the center of the earth and is opposite to the vector pointing to Zenith&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;. If the 3 axis accelerometer output is&amp;nbsp;&lt;b&gt;A&amp;nbsp;&lt;/b&gt;= {A&lt;sub&gt;x&amp;nbsp;&lt;/sub&gt;, Ay , A&lt;sub&gt;z&lt;/sub&gt;&amp;nbsp;} and we assume that there are no external accelerations or we have corrected them then we can estimate that&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;= -&lt;b&gt;A&lt;/b&gt;. (See this IMU Guide for more clarifications&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/imu_guide.html&quot; style=&quot;color: #0099ff;&quot;&gt;http://www.starlino.com/imu_guide.html&lt;/a&gt;).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Magnetometers are devices that are really similar to accelerometers, except that instead of gravitation they can sense the Earth’s magnetic North. Just like accelerometers they are not perfect and often need corrections and initial calibration. If the corrected 3-axis magnetometer output is&amp;nbsp;&lt;b&gt;M&amp;nbsp;&lt;/b&gt;= {M&lt;sub&gt;x&amp;nbsp;&lt;/sub&gt;, My , M&lt;sub&gt;z&lt;/sub&gt;&amp;nbsp;}, then according to our model&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;is pointing North , thus&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;M&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Knowing&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;allows us calculate&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Thus an accelerometer and a magnetometer alone can give us the DCM matrix , expressed either as DCM&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;or DCM&lt;sup&gt;G&lt;/sup&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
DCM&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= DCM&lt;sup&gt;BT&lt;/sup&gt;&amp;nbsp;= [&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;,&lt;b&gt;&amp;nbsp;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;,&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;]&lt;sup&gt;T&lt;/sup&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The DCM matrix can be used to convert any vector from body’s(devices) coordinate system to the global coordinate system. Thus for example if we know that the nose of the plane has some fixed coordinates expressed in body’s coordinate system as&amp;nbsp;&lt;b&gt;r&lt;sup&gt;B&lt;/sup&gt;&lt;/b&gt;&amp;nbsp;= {1,0,0}, the we can find where the device is heading in other words the coordinates of the nose in global coordinate systems using&amp;nbsp;&lt;i&gt;(Eq. 1.4)&lt;/i&gt;:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;G&lt;/sup&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;= DCM&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;&lt;b&gt;r&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So far you’re asking yourself if an accelerometer and a magnetometer gives us the DCM matrix at any point in time, why do we need the gyroscope ? The gyroscope is actually a more precise device than the accelerometer and magnetomer are , it is used to “fine-tune” the DCM matrix returned by the accelerometer and magnetometer.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Gyroscopes have no sense of absolute orientation of the device , i.e. they don’t know where north is and where zenith is (things that we can find out using the accelerometer and magnetometer), instead if we know the orientation of the device at time t, expressed as a DCM matrix DCM(t) , we can find a more precise orientation DCM(t+dt) using the gyroscope , then the one estimated directly from the accelerometer and magnetometer direct readings which are subject to a lot of noise in form of external (non-gravitational) inertial forces (i.e. acceleration) or magnetically forces that are not caused by the earth’s magnetic field.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
These facts call for an algorithm that would combine the readings from all three devices (accelerometer, magnetometer and gyroscope) in order to create our best guess or estimate regarding the device orientation in space (or space’s orientation in device’s coordinate systems), the two orientations are related since they are simply expressed using two DCM matrices that are transpose of one another (DCM&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;= DCM&lt;sup&gt;BT&amp;nbsp;&lt;/sup&gt;).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We’ll now go ahead and introduce such an algorithm.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We’ll work with the DCM matrix that consists of the versors of the global (earth’s) coordinate system aligned on each row:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0204.gif&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image020[4]&quot; border=&quot;0&quot; height=&quot;149&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0204_thumb.gif&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image020[4]&quot; width=&quot;624&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
If we read the rows of DCM&lt;sup&gt;G&lt;/sup&gt;&amp;nbsp;we get the vectors&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;,&lt;b&gt;&amp;nbsp;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;,&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;. We’ll work mostly with vectors&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;(that can be directly estimated by accelerometer) and vector&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&amp;nbsp;&lt;/sup&gt;(that can be directly estimated by the magnetometer). The vector&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&amp;nbsp;&lt;/sup&gt;is simply calculated as&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;, since it’s orthogonal to the other two vectors (remember versors are unity vectors with same direction as coordinate axes).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Let’s say we know the zenith vector expressed in body frame coordinates at time t&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;and we note it as&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0.&amp;nbsp;&lt;/sub&gt;Also let’s say we measured our gyro output and we have determined that our angular velocity is&amp;nbsp;&lt;b&gt;w =&amp;nbsp;&lt;/b&gt;{w&lt;sub&gt;x&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;y&amp;nbsp;&lt;/sub&gt;, w&lt;sub&gt;z&amp;nbsp;&lt;/sub&gt;}. Using our gyro we want to know the position of our zenith vector after a small period of time dt has passed we’ll note it as&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1G&amp;nbsp;&lt;/sub&gt;. And we find it using&amp;nbsp;&lt;i&gt;(Eq. 2.6)&lt;/i&gt;:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1G&lt;/sub&gt;&amp;nbsp;≈&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;+ dt&lt;b&gt;&amp;nbsp;v&amp;nbsp;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;+ dt (&lt;b&gt;w&lt;sub&gt;g&lt;/sub&gt;&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;) =&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;+ ( d&lt;b&gt;θ&lt;sub&gt;g&lt;/sub&gt;&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Where we noted d&lt;b&gt;θ&lt;sub&gt;g&lt;/sub&gt;&amp;nbsp;&lt;/b&gt;= dt&amp;nbsp;&lt;b&gt;w&lt;sub&gt;g&lt;/sub&gt;&lt;/b&gt;. Because&amp;nbsp;&lt;b&gt;w&lt;sub&gt;g&lt;/sub&gt;&amp;nbsp;&lt;/b&gt;is angular velocity as measured by the gyroscope. We’ll call d&lt;b&gt;θ&lt;sub&gt;g&lt;/sub&gt;&lt;/b&gt;angular displacement. In other words it tells us by what&amp;nbsp;&lt;b&gt;small&lt;/b&gt;&amp;nbsp;angle (given for all 3 axis in form of a vector) has the orientation of a vector&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;changed during this&amp;nbsp;&lt;b&gt;small&lt;/b&gt;&amp;nbsp;period of time dt.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Obviously, another way to estimate&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;is by making another reading from accelerometer so we can get a reading that we note as&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1A&amp;nbsp;&lt;/sub&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In practice the values&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1G&lt;/sub&gt;&amp;nbsp;will be different from from&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1A.&amp;nbsp;&lt;/sub&gt;One was estimated using our gyroscope and the other was estimated using our accelerometer.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now it turns out we can go the reverse way and estimate the angular velocity&amp;nbsp;&lt;b&gt;w&lt;/b&gt;&lt;sub&gt;a&lt;/sub&gt;&amp;nbsp;or angular displacement d&lt;b&gt;θ&lt;sub&gt;a ­&lt;/sub&gt;&lt;/b&gt;=&lt;b&gt;&lt;/b&gt;dt&amp;nbsp;&lt;b&gt;w&lt;sub&gt;a&lt;/sub&gt;&lt;/b&gt;&amp;nbsp;, from the new accelerometer reading&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1A­&amp;nbsp;&lt;/sub&gt;, we’ll use&amp;nbsp;&lt;i&gt;(Eq. 2.5):&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;w&lt;/b&gt;­&lt;sub&gt;a&lt;/sub&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;v&lt;sub&gt;a&lt;/sub&gt;&amp;nbsp;&lt;/b&gt;/ |&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;|&lt;sup&gt;2&lt;/sup&gt;­&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now&amp;nbsp;&lt;b&gt;v&lt;/b&gt;&lt;sub&gt;a&amp;nbsp;&lt;/sub&gt;= (&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1A­&amp;nbsp;&lt;/sub&gt;-&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;) / dt , and is basically the linear velocity of the vector&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;. And |&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;|&lt;sup&gt;2&lt;/sup&gt;­­ = 1 , since&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;is a unity vector. So we can calculate:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
d&lt;b&gt;θ&lt;sub&gt;a ­&lt;/sub&gt;&lt;/b&gt;=&lt;b&gt;&amp;nbsp;&lt;/b&gt;dt&amp;nbsp;&lt;b&gt;w&lt;sub&gt;a&amp;nbsp;&lt;/sub&gt;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;x (&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1A­&amp;nbsp;&lt;/sub&gt;-&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The idea of calculating a new estimate&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1 ­&lt;/sub&gt;&amp;nbsp;that combines both&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1A&lt;/sub&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1G&lt;/sub&gt;&amp;nbsp;is to first estimate d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;as a weighted average of&lt;b&gt;&amp;nbsp;&lt;/b&gt;d&lt;b&gt;θ&lt;sub&gt;a&lt;/sub&gt;&amp;nbsp;&lt;/b&gt;and d&lt;b&gt;θ&lt;sub&gt;g&lt;/sub&gt;&lt;/b&gt;&amp;nbsp;:&lt;br /&gt;
&lt;b&gt;&lt;sub&gt;&lt;br /&gt;&lt;/sub&gt;&lt;/b&gt;d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;= (s&lt;sub&gt;a&lt;/sub&gt;&amp;nbsp;d&lt;b&gt;θ&lt;sub&gt;a&lt;/sub&gt;&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;&lt;/b&gt;s&lt;sub&gt;g&lt;/sub&gt;&amp;nbsp;d&lt;b&gt;θ&lt;sub&gt;g&lt;/sub&gt;&lt;/b&gt;) / (s&lt;sub&gt;a&lt;/sub&gt;&amp;nbsp;+ s&lt;sub&gt;g­&lt;/sub&gt;), we’ll discuss about the weights later on , but shortly they are determined and tuned experimentally in order to achieve a desired response rate and noise rejection.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
And then&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1 ­&amp;nbsp;&lt;/sub&gt;is calculated similar to how we calculated&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1G&lt;/sub&gt;:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;≈&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;+ ( d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Why we went all the way to calculate d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;and did not apply the weighted average formula directly to&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1A&lt;/sub&gt;&amp;nbsp;and&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1G&amp;nbsp;&lt;/sub&gt;? Because d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;can be used to calculate the other elements of our DCM matrix in the same way:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;≈&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;+ ( d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;≈&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;+ ( d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The idea is that all three versors&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;,&lt;b&gt;&amp;nbsp;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;,&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&amp;nbsp;are attached to each other and will follow the same angular displacement d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;during our small interval dt. So in a nutshell this is the algorithm that allows us to calculate the DCM&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;matrix at time t&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;from our previous estimated DCM&lt;sub&gt;0&amp;nbsp;&lt;/sub&gt;matrix at time t­­&lt;sub&gt;0&lt;/sub&gt;. It is applied recursively at regular small time intervals dt and gives us an updated DCM matrix at any point in time. The matrix will not drift too much because it is fixed to the absolute position dictated by the accelerometer and will not be too noisy from external accelerations because we also use the gyroscope data to update it.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So far we didn’t mention a word about our magnetometer. One reasons being that it is not available on all IMU units (6DOF) and we can go away without using it, but our resulting orientation will then have a drifting heading (i.e. it will not show if we’re heading north, south, west or east), or we can introduce a virtual magnetometer that is always pointing North, to introduce stability in our model. This situation is demonstrated in the accompanying source code that used a 6DOF IMU.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now we’ll show how to integrate magnetometer readings into our algorithm. As it turns out it is really simple since magnetometer is really similar to accelerometer (they even use similar calibration algorithms), the only difference being that instead of estimating the Zenith vector&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;&amp;nbsp;&lt;/sub&gt;vector it estimates the vector pointing North&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;. Following the same logic as we did for our accelerometer we can determine the angular displacement according to the updated magnetometer reading as being:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
d&lt;b&gt;θ&lt;sub&gt;m ­&lt;/sub&gt;&lt;/b&gt;=&lt;b&gt;&amp;nbsp;&lt;/b&gt;dt&amp;nbsp;&lt;b&gt;w&lt;sub&gt;m&amp;nbsp;&lt;/sub&gt;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;x (&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1M­&amp;nbsp;&lt;/sub&gt;-&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now let’s incorporate it into our weighted average:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;= (s&lt;sub&gt;a&lt;/sub&gt;&amp;nbsp;d&lt;b&gt;θ&lt;sub&gt;a&lt;/sub&gt;&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;&lt;/b&gt;s&lt;sub&gt;g&lt;/sub&gt;&amp;nbsp;d&lt;b&gt;θ&lt;sub&gt;g&amp;nbsp;&lt;/sub&gt;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;&lt;/b&gt;s&lt;sub&gt;m&lt;/sub&gt;&amp;nbsp;d&lt;b&gt;θ&lt;sub&gt;m&lt;/sub&gt;&lt;/b&gt;) / (s&lt;sub&gt;a&lt;/sub&gt;&amp;nbsp;+ s&lt;sub&gt;g&lt;/sub&gt;&amp;nbsp;+&lt;sub&gt;­&amp;nbsp;&lt;/sub&gt;s&lt;sub&gt;m&lt;/sub&gt;)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
From here we go the same path to calculate the updated DCM&lt;sub&gt;1­&lt;/sub&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;≈&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;+ ( d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;) ,&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;≈&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;+ ( d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;) and&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;≈&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;&amp;nbsp;+ ( d&lt;b&gt;θ&amp;nbsp;&lt;/b&gt;x&lt;b&gt;&amp;nbsp;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;),&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In practice we’ll calculate&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;=&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;x&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1,&lt;/sub&gt;&amp;nbsp;after correcting&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;and&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;to be perpendicular unity vectors again , note that all our logic is approximated and dependent on dt being small, the larger the dt the larger the error we’ll accumulate.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So if vectors&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;,&lt;b&gt;&amp;nbsp;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&lt;/sub&gt;,&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;0&amp;nbsp;&lt;/sub&gt;form a valid DCM matrix , in other words they are orthogonal to each other and are unity vectors, then we can’t say the same about&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;,&lt;b&gt;&amp;nbsp;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;,&lt;b&gt;&amp;nbsp;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;, the formulas used for calculating them does not guarantee the orthogonality or length of the vector to be preserved , however we will not get a big error if dt is small, all we need to do is to correct them after each iteration.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
First let’s see how we can ensure that two vectors are orthogonal again. Let’s consider two unity vectors&amp;nbsp;&lt;b&gt;a&amp;nbsp;&lt;/b&gt;and&amp;nbsp;&lt;b&gt;b&lt;/b&gt;that are “almost orthogonal” in other words the angle between these two vectors is close to 90°, but not exactly 90°. We’re looking to find a vector&amp;nbsp;&lt;b&gt;b’&lt;/b&gt;&amp;nbsp;that is orthogonal to&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;and that is in the same plane formed by the vectors&amp;nbsp;&lt;b&gt;a&lt;/b&gt;and&amp;nbsp;&lt;b&gt;b.&amp;nbsp;&lt;/b&gt;Such a vector is easy to find as shown in Figure 5. First we find vector&amp;nbsp;&lt;b&gt;c = a x b&amp;nbsp;&lt;/b&gt;that by the rules of cross product is orthogonal to both&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;b&amp;nbsp;&lt;/b&gt;and thus is perpendicular to the plane formed by&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;b&lt;/b&gt;. Next the vector&lt;b&gt;b’ = c x a&amp;nbsp;&lt;/b&gt;is calculated as the cross product of&amp;nbsp;&lt;b&gt;c&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;a.&amp;nbsp;&lt;/b&gt;From the definition of cross product&amp;nbsp;&lt;b&gt;b’&amp;nbsp;&lt;/b&gt;is orthogonal to&amp;nbsp;&lt;b&gt;a&lt;/b&gt;and because it is also orthogonal to&amp;nbsp;&lt;b&gt;c&lt;/b&gt;&amp;nbsp;– it end up in the plane orthogonal to&amp;nbsp;&lt;b&gt;c&lt;/b&gt;&amp;nbsp;, which is the plane formed by&amp;nbsp;&lt;b&gt;a&amp;nbsp;&lt;/b&gt;and&lt;b&gt;b.&amp;nbsp;&lt;/b&gt;Thus&amp;nbsp;&lt;b&gt;b’&lt;/b&gt;&amp;nbsp;is the corrected vector we’re seeking that is orthogonal to&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;and belongs to the plane formed by&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;and&lt;b&gt;b&lt;/b&gt;.&lt;br /&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0224.jpg&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image022[4]&quot; border=&quot;0&quot; height=&quot;272&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0224_thumb.jpg&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image022[4]&quot; width=&quot;307&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;i&gt;Figure 5&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We can extend the equation using&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Triple_product&quot; style=&quot;color: #0099ff;&quot;&gt;the triple product rule&lt;/a&gt;&amp;nbsp;and the fact that&amp;nbsp;&lt;b&gt;a.a&lt;/b&gt;&amp;nbsp;= |&lt;b&gt;a&lt;/b&gt;| = 1:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;b’&lt;/b&gt;&amp;nbsp;=&amp;nbsp;&lt;b&gt;c&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;= (&lt;b&gt;a&lt;/b&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;b&lt;/b&gt;) x&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;= -&lt;b&gt;a&lt;/b&gt;&amp;nbsp;(&lt;b&gt;a&lt;/b&gt;.&lt;b&gt;b&lt;/b&gt;) + b(&lt;b&gt;a&lt;/b&gt;.&lt;b&gt;a&lt;/b&gt;) =&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;–&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;(&lt;b&gt;a.b&lt;/b&gt;) =&amp;nbsp;&lt;b&gt;b&amp;nbsp;&lt;/b&gt;+&lt;b&gt;&amp;nbsp;d ,&amp;nbsp;&lt;/b&gt;where&amp;nbsp;&lt;b&gt;d&amp;nbsp;&lt;/b&gt;=&lt;b&gt;&amp;nbsp;– a (a.b)&amp;nbsp;&lt;/b&gt;(Scenario 1,&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;is fixed&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;is corrected)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
You can reflect a little bit on the results … So we obtain corrected vector&amp;nbsp;&lt;b&gt;b’&amp;nbsp;&lt;/b&gt;from vector&amp;nbsp;&lt;b&gt;b&amp;nbsp;&lt;/b&gt;by adding a “correction” vector&lt;b&gt;&amp;nbsp;d&amp;nbsp;&lt;/b&gt;=&lt;b&gt;&amp;nbsp;– a (a.b).&amp;nbsp;&lt;/b&gt;Notice that&amp;nbsp;&lt;b&gt;d&lt;/b&gt;&amp;nbsp;is parallel to&amp;nbsp;&lt;b&gt;a&lt;/b&gt;. Its direction is dependent upon the angle between&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;b&lt;/b&gt;, for example in Figure 5&amp;nbsp;&lt;b&gt;a&lt;/b&gt;.&lt;b&gt;b&lt;/b&gt;&amp;nbsp;= cos (&lt;b&gt;a&lt;/b&gt;,&lt;b&gt;b&lt;/b&gt;) &amp;gt; 0 , because angle between&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;is less than&lt;b&gt;&amp;nbsp;&lt;/b&gt;90°thus&lt;b&gt;d&amp;nbsp;&lt;/b&gt;has opposite direction from&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;and a magnitutde of cos(&lt;b&gt;a&lt;/b&gt;,&lt;b&gt;b&lt;/b&gt;)&lt;b&gt;&amp;nbsp;&lt;/b&gt;=&lt;b&gt;&amp;nbsp;&lt;/b&gt;sin(&lt;b&gt;b,b’&lt;/b&gt;).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In the scenario above we considered that vector&amp;nbsp;&lt;b&gt;a&amp;nbsp;&lt;/b&gt;is fixed and we found a corrected vector&amp;nbsp;&lt;b&gt;b’&lt;/b&gt;&amp;nbsp;that is orthogonal to&amp;nbsp;&lt;b&gt;a&lt;/b&gt;. We can consider the symmetric problem – we fix&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;and find the corrected vector&amp;nbsp;&lt;b&gt;a’:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;a’&amp;nbsp;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;–&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;(&lt;b&gt;b&lt;/b&gt;.&lt;b&gt;a&lt;/b&gt;) =&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;–&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;(&lt;b&gt;a&lt;/b&gt;.&lt;b&gt;b&lt;/b&gt;) =&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;+&amp;nbsp;&lt;b&gt;e&lt;/b&gt;, where&amp;nbsp;&lt;b&gt;e&amp;nbsp;&lt;/b&gt;=&lt;b&gt;&amp;nbsp;&lt;/b&gt;-&lt;b&gt;&amp;nbsp;b&amp;nbsp;&lt;/b&gt;(&lt;b&gt;a.b&lt;/b&gt;) (Scenario 2,&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;is fixed&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;is corrected)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Finally in the third scenario we want both vectors to move towards their corrected state, we consider them both “equally wrong”, so intuitively we apply half correction to both vectors from scenario 1 and 2:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;a’&amp;nbsp;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;–&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;(&lt;b&gt;a&lt;/b&gt;.&lt;b&gt;b&lt;/b&gt;) / 2 (Scenario 3, both&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;are corrected)&lt;br /&gt;
&lt;b&gt;b’&amp;nbsp;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;–&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;(&lt;b&gt;a&lt;/b&gt;.&lt;b&gt;b&lt;/b&gt;) / 2&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0244.jpg&quot; style=&quot;color: #0099ff;&quot;&gt;&lt;img alt=&quot;clip_image024[4]&quot; border=&quot;0&quot; height=&quot;272&quot; src=&quot;http://www.starlino.com/wp-content/uploads/2011/11/clip_image0244_thumb.jpg&quot; style=&quot;background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;clip_image024[4]&quot; width=&quot;307&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;i&gt;Figure 6&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This is an relatively easy formula to calculate on a microprocessor since we can pre-compute Err = (&lt;b&gt;a&lt;/b&gt;.&lt;b&gt;b&lt;/b&gt;)/2 and then use it to correct both vectors:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;a’&amp;nbsp;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&amp;nbsp;– Err *&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;b’&amp;nbsp;&lt;/b&gt;=&amp;nbsp;&lt;b&gt;b&lt;/b&gt;&amp;nbsp;– Err *&amp;nbsp;&lt;b&gt;a&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Please note that we’re not proving that&amp;nbsp;&lt;b&gt;a’&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;b’&amp;nbsp;&lt;/b&gt;are orthogonal in Scenario 3, but we presented the intuitive reasoning why the angle between&amp;nbsp;&lt;b&gt;a’&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b&gt;b’&lt;/b&gt;&amp;nbsp;will get closer to 90°if we apply the above corrective transformations.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now going back to our updated DCM matrix that consists of three vectors&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;,&lt;b&gt;&amp;nbsp;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;,&lt;b&gt;&amp;nbsp;&lt;/b&gt;we apply the following corrective actions before reintroducing the DCM matrix into the next loop:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Err = (&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;.&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;) / 2&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’&amp;nbsp;&lt;/sup&gt;=&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;– Err *&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’&amp;nbsp;&lt;/sup&gt;=&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;– Err *&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&amp;nbsp;&lt;/sub&gt;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’’&amp;nbsp;&lt;/sup&gt;= Normalize[&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’&lt;/sup&gt;]&lt;br /&gt;
&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’’&amp;nbsp;&lt;/sup&gt;= Normalize[&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’&lt;/sup&gt;]&lt;br /&gt;
&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’’&amp;nbsp;&lt;/sup&gt;=&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’’&lt;/sup&gt;&amp;nbsp;x&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’’&lt;/sup&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Where Normalize[&lt;b&gt;a&lt;/b&gt;] =&amp;nbsp;&lt;b&gt;a&amp;nbsp;&lt;/b&gt;/ |&lt;b&gt;a&lt;/b&gt;| , is the formula calculating the unit vector co-directional with&amp;nbsp;&lt;b&gt;a&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So finally our corrected DCM&lt;sub&gt;1&lt;/sub&gt;&amp;nbsp;matrix can be recomposed from vectors&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’’&lt;/sup&gt;,&amp;nbsp;&lt;b&gt;J&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’’&lt;/sup&gt;,&amp;nbsp;&lt;b&gt;K&lt;/b&gt;&lt;sup&gt;B&lt;/sup&gt;&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;’’&amp;nbsp;&lt;/sup&gt;that have been ortho-normalized (each vector constitutes a row of the updated and corrected DCM matrix).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We repeat the loop to find DCM&lt;sub&gt;2 ,&lt;/sub&gt;&amp;nbsp;DCM&lt;sub&gt;3 ,&lt;/sub&gt;&amp;nbsp;or in general DCM&lt;sub&gt;&amp;nbsp;n&amp;nbsp;&lt;/sub&gt;, at any time interval n.&lt;/div&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
References&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
1.&amp;nbsp;&lt;a href=&quot;http://www.amazon.com/gp/product/1441917497/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;amp;tag=librarian06-20&amp;amp;linkCode=as2&amp;amp;camp=217145&amp;amp;creative=399353&amp;amp;creativeASIN=1441917497&quot; style=&quot;color: #0099ff;&quot;&gt;Theory of Applied Robotics: Kinematics, Dynamics, and Control (Reza N. Jazar)&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
2.&amp;nbsp;&lt;a href=&quot;http://www.amazon.com/gp/product/0321287134/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;amp;tag=librarian06-20&amp;amp;linkCode=as2&amp;amp;camp=217145&amp;amp;creative=399349&amp;amp;creativeASIN=0321287134&quot; style=&quot;color: #0099ff;&quot;&gt;Linear Algebra and Its Applications (David C. Lay)&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
3.&amp;nbsp;&lt;a href=&quot;http://www.amazon.com/gp/product/0470528338/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;amp;tag=librarian06-20&amp;amp;linkCode=as2&amp;amp;camp=217145&amp;amp;creative=399353&amp;amp;creativeASIN=0470528338&quot; style=&quot;color: #0099ff;&quot;&gt;Fundamentals of Matrix Computations (David S. Watkins)&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
4.&amp;nbsp;&lt;a href=&quot;http://gentlenav.googlecode.com/files/DCMDraft2.pdf&quot; style=&quot;color: #0099ff;&quot;&gt;Direction Cosine Matrix IMU: Theory (W Premerlani)&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/8103625374657781479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/source-httpwww.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/8103625374657781479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/8103625374657781479'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/source-httpwww.html' title='Complimentary AHRS approach (DCM algorithm) '/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-6837593500157219007</id><published>2013-04-14T17:58:00.001+10:00</published><updated>2013-04-14T17:58:02.035+10:00</updated><title type='text'>IMU Guide</title><content type='html'>(source is:&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/imu_guide.html&quot;&gt;http://www.starlino.com/imu_guide.html&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Part 1. Accelerometer&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
To understand this unit we&#39;ll start with the accelerometer. When thinking about accelerometers it is often useful to image a box in shape of a cube with a ball inside it. You may imagine something else like a cookie or a donut , but I&#39;ll imagine a ball:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;img alt=&quot;accelerometer model&quot; height=&quot;310&quot; src=&quot;http://www.starlino.com/wp-content/uploads/data/imu_guide/04.png&quot; style=&quot;border: none;&quot; width=&quot;450&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
If we take this box in a place with no gravitation fields or for that matter with no other fields that might affect the ball&#39;s position – the ball will simply float in the middle of the box. You can imagine the box is in outer-space far-far away from any cosmic bodies, or if such a place is hard to find imagine at least a space craft orbiting around the planet where everything is in weightless state . From the picture above you can see that we assign to each axis a pair of walls (we removed the wall Y+ so we can look inside the box). Imagine that each wall is pressure sensitive. If we move suddenly the box to the left (we accelerate it with acceleration 1g = 9.8m/s^2), the ball will hit the wall X-. We then measure the pressure force that the ball applies to the wall and output a value of -1g on the X axis.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;img alt=&quot;accelerometer model&quot; height=&quot;280&quot; src=&quot;http://www.starlino.com/wp-content/uploads/data/imu_guide/05.png&quot; style=&quot;border: none;&quot; width=&quot;450&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Please note that the accelerometer will actually detect a force that is directed in the opposite direction from the acceleration vector. This force is often called&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Fictitious_force&quot; style=&quot;color: #0099ff;&quot;&gt;Inertial Force or Fictitious Force&amp;nbsp;&lt;/a&gt;. One thing you should learn from this is that an accelerometer measures acceleration indirectly through a force that is applied to one of it&#39;s walls (according to our model, it might be a spring or something else in real life accelerometers). This force can be caused by the acceleration , but as we&#39;ll see in the next example it is not always caused by acceleration.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
If we take our model and put it on Earth the ball will fall on the Z- wall and will apply a force of 1g on the bottom wall, as shown in the picture below:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;img alt=&quot;accelerometer model&quot; height=&quot;300&quot; src=&quot;http://www.starlino.com/wp-content/uploads/data/imu_guide/06.png&quot; style=&quot;border: none;&quot; width=&quot;450&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In this case the box isn&#39;t moving but we still get a reading of -1g on the Z axis. The pressure that the ball has applied on the wall was caused by a gravitation force. In theory it could be a different type of force – for example, if you imagine that our ball is metallic, placing a magnet next to the box could move the ball so it hits another wall. This was said just to prove that in essence accelerometer measures force not acceleration. It just happens that acceleration causes an inertial force that is captured by the force detection mechanism of the accelerometer.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
While this model is not exactly how a MEMS sensor is constructed it is often useful in solving accelerometer related problems. There are actually similar sensors that have metallic balls inside, they are called tilt switches, however they are more primitive and usually they can only tell if the device is inclined within some range or not, not the extent of inclination.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So far we have analyzed the accelerometer output on a single axis and this is all you&#39;ll get with a single axis accelerometers. The real value of triaxial accelerometers comes from the fact that they can detect inertial forces on all three axes. Let&#39;s go back to our box model, and let&#39;s rotate the box 45 degrees to the right. The ball will touch 2 walls now: Z- and X- as shown in the picture below:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;img alt=&quot;accelerometer model&quot; height=&quot;390&quot; src=&quot;http://www.starlino.com/wp-content/uploads/data/imu_guide/07.png&quot; style=&quot;border: none;&quot; width=&quot;450&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The values of 0.71 are not arbitrary, they are actually an approximation for SQRT(1/2). This will become more clear as we introduce our next model for the accelerometer.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In the previous model we have fixed the gravitation force and rotated our imaginary box. In last 2 examples we have analyzed the output in 2 different box positions, while the force vector remained constant. While this was useful in understanding how the accelerometer interacts with outside forces, it is more practical to perform calculations if we fix the coordinate system to the axes of the accelerometer and imagine that the force vector rotates around us.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;img alt=&quot;accelerometer model&quot; height=&quot;370&quot; src=&quot;http://www.starlino.com/wp-content/uploads/data/imu_guide/01.png&quot; style=&quot;border: none;&quot; width=&quot;450&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Please have a look at the model above, I preserved the colors of the axes so you can make a mental transition from the previous model to the new one. Just imagine that each axis in the new model is perpendicular to the respective faces of the box in the previous model. The vector R is the force vector that the accelerometer is measuring (it could be either the gravitation force or the inertial force from the examples above or a combination of both). Rx, Ry, Rz are projection of the R vector on the X,Y,Z axes. Please notice the following relation:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
R^2 = Rx^2 + Ry^2 + Rz^2&amp;nbsp;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(Eq. 1)&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
which is basically the equivalent of the&amp;nbsp;&lt;a href=&quot;http://demonstrations.wolfram.com/PythagoreanTheorem3D/&quot; style=&quot;color: #0099ff;&quot;&gt;Pythagorean theorem in 3D&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Remember that a little bit earlier I told you that the values of SQRT(1/2) ~ 0.71 are not random. If you plug them in the formula above, after recalling that our gravitation force was 1 g we can verify that:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
1^2 = (-SQRT(1/2) )^2 + 0 ^2 + (-SQRT(1/2))^2&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
simply by substituting R=1, Rx = -SQRT(1/2), Ry = 0 , Rz = -SQRT(1/2) in&amp;nbsp;&lt;strong&gt;Eq.1&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
After a long preamble of theory we&#39;re getting closer to real life accelerometers. The values Rx, Ry, Rz are actually linearly related to the values that your real-life accelerometer will output and that you can use for performing various calculations.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Before we get there let&#39;s talk a little about the way accelerometers will deliver this information to us. Most accelerometers will fall in two categories: digital and analog. Digital accelerometers will give you information using a serial protocol like I2C , SPI or USART, while analog accelerometers will output a voltage level within a predefined range that you have to convert to a digital value using an ADC (analog to digital converter) module. I will not go into much detail about how ADC works, partly because it is such an extensive topic and partly because it is different from one platform to another. Some microcontroller will have a built-in ADC modules some of them will need external components in order to perform the ADC conversions. No matter what type of ADC module you use you&#39;ll end up with a value in a certain range. For example a 10-bit ADC module will output a value in the range of 0..1023, note that 1023 = 2^10 -1. A 12-bit ADC module will output a value in the range of 0..4095, note that 4095 = 2^12-1.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Let&#39;s move on by considering a simple example, suppose our 10bit ADC module gave us the following values for the three accelerometer channels (axes):&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
AdcRx = 586&lt;br /&gt;AdcRy = 630&lt;br /&gt;AdcRz = 561&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Each ADC module will have a reference voltage, let&#39;s assume in our example it is 3.3V. To convert a 10bit adc value to voltage we use the following formula:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
VoltsRx = AdcRx * Vref / 1023&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
A quick note here: that for 8bit ADC the last divider would be 255 = 2 ^ 8 -1 , and for 12bit ADC last divider would be 4095 = 2^12 -1.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Applying this formula to all 3 channels we get:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
VoltsRx = 586 * 3.3V / 1023 =~ 1.89V (we round all results to 2 decimal points)&lt;br /&gt;VoltsRy = 630 * 3.3V / 1023 =~ 2.03V&lt;br /&gt;VoltsRz = 561 * 3.3V / 1023 =~ 1.81V&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Each accelerometer has a zero-g voltage level, you can find it in specs, this is the voltage that corresponds to 0g. To get a signed voltage value we need to calculate the shift from this level. Let&#39;s say our 0g voltage level is VzeroG = 1.65V. We calculate the voltage shifts from zero-g voltage as follows::&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
DeltaVoltsRx = 1.89V – 1.65V = 0.24V&lt;br /&gt;DeltaVoltsRy = 2.03V – 1.65V = 0.38V&lt;br /&gt;DeltaVoltsRz = 1.81V – 1.65V = 0.16V&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We now have our accelerometer readings in Volts , it&#39;s still not in g (9.8 m/s^2), to do the final conversion we apply the accelerometer sensitivity, usually expressed in mV/g. Lets say our Sensitivity = 478.5mV/g = 0.4785V/g. Sensitivity values can be found in accelerometer specifications. To get the final force values expressed in g we use the following formula:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rx = DeltaVoltsRx / Sensitivity&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rx = 0.24V / 0.4785V/g =~ 0.5g&lt;br /&gt;Ry = 0.38V / 0.4785V/g =~ 0.79g&lt;br /&gt;Rz = 0.16V / 0.4785V/g =~ 0.33g&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We could of course combine all steps in one formula, but I went through all the steps to make it clear how you go from ADC readings to a force vector component expressed in g.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rx = (AdcRx * Vref / 1023 – VzeroG) / Sensitivity&amp;nbsp;&lt;strong&gt;(Eq.2&lt;/strong&gt;)&lt;br /&gt;Ry = (AdcRy * Vref / 1023 – VzeroG) / Sensitivity&lt;br /&gt;Rz = (AdcRz * Vref / 1023 – VzeroG) / Sensitivity&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We now have all 3 components that define our inertial force vector, if the device is not subject to other forces other than gravitation, we can assume this is the direction of our gravitation force vector. If you want to calculate inclination of device relative to the ground you can calculate the angle between this vector and Z axis. If you are also interested in per-axis direction of inclination you can split this result into 2 components: inclination on the X and Y axis that can be calculated as the angle between gravitation vector and X / Y axes. Calculating these angles is more simple than you might think, now that we have calculated the values for Rx,Ry and Rz. Let&#39;s go back to our last accelerometer model and do some additional notations:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;img alt=&quot;&quot; height=&quot;370&quot; src=&quot;http://www.starlino.com/wp-content/uploads/data/imu_guide/02.png&quot; style=&quot;border: none;&quot; width=&quot;450&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The angles that we are interested in are the angles between X,Y,Z axes and the force vector R. We&#39;ll define these angles as Axr, Ayr, Azr. You can notice from the right-angle triangle formed by R and Rx that:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
cos(Axr) = Rx / R , and similarly :&lt;br /&gt;cos(Ayr) = Ry / R&lt;br /&gt;cos(Azr) = Rz / R&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We can deduct from&amp;nbsp;&lt;strong&gt;Eq.1&lt;/strong&gt;&amp;nbsp;that R = SQRT( Rx^2 + Ry^2 + Rz^2).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We can find now our angles by using arccos() function (the inverse cos() function ):&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Axr = arccos(Rx/R)&lt;br /&gt;Ayr = arccos(Ry/R)&lt;br /&gt;Azr = arccos(Rz/R)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We&#39;ve gone a long way to explain the accelerometer model, just to come up to these formulas. Depending on your applications you might want to use any intermediate formulas that we have derived. We&#39;ll also introduce the gyroscope model soon, and we&#39;ll see how accelerometer and gyroscope data can be combined to provide even more accurate inclination estimations.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
But before we do that let&#39;s do some more useful notations:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
cosX = cos(Axr) = Rx / R&lt;br /&gt;cosY = cos(Ayr) = Ry / R&lt;br /&gt;cosZ = cos(Azr) = Rz / R&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This triplet is often called&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Direction_cosine&quot; style=&quot;color: #0099ff;&quot; target=&quot;_blank&quot;&gt;Direction Cosine&lt;/a&gt;&amp;nbsp;, and it basically represents the unit vector (vector with length 1) that has same direction as our R vector. You can easily verify that:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
SQRT(cosX^2 + cosY^2 + cosZ^2) = 1&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This is a nice property since it absolve us from monitoring the modulus(length) of R vector. Often times if we&#39;re just interested in direction of our inertial vector, it makes sense to normalize it&#39;s modulus in order to simplify other calculations.&lt;/div&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Part 2. Gyroscope&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We&#39;re not going to introduce any equivalent box model for the gyroscope like we did for accelerometer, instead we&#39;re going to jump straight to the second accelerometer model and we&#39;ll show what does the gyroscope measure according to this model.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;img alt=&quot;&quot; height=&quot;380&quot; src=&quot;http://www.starlino.com/wp-content/uploads/data/imu_guide/03.png&quot; style=&quot;border: none;&quot; width=&quot;450&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Each gyroscope channel measures the rotation around one of the axes. For instance a 2-axes gyroscope will measure the rotation around (or some may say &quot;about&quot;) the X and Y axes. To express this rotation in numbers let&#39;s do some notations. First let&#39;s define:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rxz – is the projection of the inertial force vector R on the XZ plane&lt;br /&gt;Ryz – is the projection of the inertial force vector R on the YZ plane&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
From the right-angle triangle formed by Rxz and Rz, using Pythagorean theorem we get:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rxz^2 = Rx^2 + Rz^2 , and similarly:&lt;br /&gt;Ryz^2 = Ry^2 + Rz^2&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
also note that:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
R^2 = Rxz^2 + Ry^2 , this can be derived from&lt;strong&gt;&amp;nbsp;Eq.1&lt;/strong&gt;&amp;nbsp;and above equations, or it can be derived from right-angle triangle formed by R and Ryz&lt;br /&gt;R^2 = Ryz^2 + Rx^2&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We&#39;re not going to use these formulas in this article but it is useful to note the relation between all the values in our model.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Instead we&#39;re going to define the angle between the Z axis and Rxz, Ryz vectors as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Axz – is the angle between the Rxz (projection of R on XZ plane) and Z axis&lt;br /&gt;Ayz – is the angle between the Ryz (projection of R on YZ plane) and Z axis&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now we&#39;re getting closer to what the gyroscope measures. Gyroscope measures the rate of changes of the angles defined above. In other words it will output a value that is linearly related to the rate of change of these angles. To explain this let&#39;s assume that we have measured the rotation angle around axis Y (that would be Axz angle) at time t0, and we define it as Axz0, next we measured this angle at a later time t1 and it was Axz1. The rate of change will be calculated as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RateAxz = (Axz1 – Axz0) / (t1 – t0).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
If we express Axz in degrees, and time in seconds , then this value will be expressed in deg/s . This is what a gyroscope measures.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In practice a gyroscope(unless it is a special digital gyroscope) will rarely give you a value expressed in deg/s. Same as for accelerometer you&#39;ll get an ADC value that you&#39;ll need to convert to deg/s using a formula similar to&lt;strong&gt;Eq. 2&lt;/strong&gt;&amp;nbsp;that we have defined for accelerometer. Let&#39;s introduce the ADC to deg/s conversion formula for gyroscope (we assume we&#39;re using a 10bit ADC module , for 8bit ADC replace 1023 with 255, for 12bit ADC replace 1023 with 4095).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RateAxz = (AdcGyroXZ * Vref / 1023 – VzeroRate) / Sensitivity&amp;nbsp;&lt;strong&gt;Eq.3&lt;/strong&gt;&lt;br /&gt;RateAyz = (AdcGyroYZ * Vref / 1023 – VzeroRate) / Sensitivity&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
AdcGyroXZ, AdcGyroYZ – are obtained from our adc module and they represent the channels that measure the rotation of projection of R vector in XZ respectively in YZ planes, which is the equivalent to saying rotation was done around Y and X axes respectively.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Vref – is the ADC reference voltage we&#39;ll use 3.3V in the example below&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
VzeroRate – is the zero-rate voltage, in other words the voltage that the gyroscope outputs when it is not subject to any rotation, for the&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/store/acc-gyro&quot; style=&quot;color: #0099ff;&quot; target=&quot;_blank&quot;&gt;Acc_Gyro&lt;/a&gt;&amp;nbsp;board it is for example 1.23V (you can find this values in the specs – but don&#39;t trust the specs most gyros will suffer slight offset after being soldered so measure VzeroRate for each axis output using a voltmeter, usually this value will not change over time once the gyro was soldered, if it variates – write a calibration routine to measure it before device start-up, user must be instructed to keep device in still position&amp;nbsp; upon start-up for gyros to calibrate).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Sensitivity – is the sensitivity of your gyroscope it is expressed in mV / (deg / s) often written as mV/deg/s , it basically tells you how many mV will the gyroscope output increase , if you increase the rotation speed by one deg/s. The sensitivity of&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/store/acc-gyro&quot; style=&quot;color: #0099ff;&quot; target=&quot;_blank&quot;&gt;Acc_Gyro&lt;/a&gt;&amp;nbsp;board is for example 2mV/deg/s or 0.002V/deg/s&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Let&#39;s take an example, suppose our ADC module returned following values:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
AdcGyroXZ = 571&lt;br /&gt;AdcGyroXZ = 323&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Using the above formula, and using the specs parameters of&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/store/acc-gyro&quot; style=&quot;color: #0099ff;&quot; target=&quot;_blank&quot;&gt;Acc_Gyro&lt;/a&gt;&amp;nbsp;board we&#39;ll get:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RateAxz = (571 * 3.3V / 1023 – 1.23V) / ( 0.002V/deg/s) =~ 306 deg/s&lt;br /&gt;RateAyz = (323 * 3.3V / 1023 – 1.23V) / ( 0.002V/deg/s) =~ -94 deg/s&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In other words the device rotates around the Y axis (or we can say it rotates in XZ plane) with a speed of 306 deg/s and around the X axis (or we can say it rotates in YZ plane) with a speed of -94 deg/s. Please note that the negative sign means that the device rotates in the opposite direction from the conventional positive direction. By convention one direction of rotation is positive. A good gyroscope specification sheet will show you which direction is positive, otherwise you&#39;ll have to find it by experimenting with the device and noting which direction of rotation results in increasing voltage on the output pin. This is best done using an oscilloscope since as soon as you stop the rotation the voltage will drop back to the zero-rate level. If you&#39;re using a multimeter you&#39;d have to maintain a constant rotation rate for at least few seconds and note the voltage during this rotation, then compare it with the zero-rate voltage. If it is greater than the zero-rate voltage it means that direction of rotation is positive.&lt;/div&gt;
&lt;h2 style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 18px; font-style: italic; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
Part 3. Putting it all together. Combining accelerometer and gyroscope data.&lt;/h2&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
If you&#39;re reading this article you probably acquired or are planning to acquire a IMU device, or probably you&#39;re planning to build one from separate accelerometer and gyroscope devices.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;strong&gt;NOTE:&amp;nbsp;&lt;/strong&gt;FOR PRACTICAL IMPLEMENTATION AND TESTING&amp;nbsp; OF THIS ALGORITHM PLEASE READ THIS ARTICLE:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://www.starlino.com/imu_kalman_arduino.html&quot; style=&quot;color: #0099ff;&quot;&gt;http://starlino.com/imu_kalman_arduino.html&lt;/a&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The first step in using a combination IMU device that combines an accelerometer and a gyroscope is to align their coordinate systems. The easiest way to do it is to choose the coordinate system of accelerometer as your reference coordinate system. Most accelerometer data sheets will display the direction of X,Y,Z axes relative to the image of the physical chip or device. For example here are the directions of X,Y,Z axes as shown in specifications for the&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/store/acc-gyro&quot; style=&quot;color: #0099ff;&quot; target=&quot;_blank&quot;&gt;Acc_Gyro&lt;/a&gt;&amp;nbsp;board:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;img alt=&quot;acc_gyro axes&quot; height=&quot;164&quot; src=&quot;http://www.starlino.com/wp-content/uploads/data/imu_guide/acc_gyro_axes.png&quot; style=&quot;border: none;&quot; width=&quot;272&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Next steps are:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
- identify the gyroscope outputs that correspond to RateAxz , RateAyz values discussed above.&lt;br /&gt;- determine if these outputs need to be inverted due to physical position of gyroscope relative to the accelerometer&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Do not assume that if a gyroscope has an output marked X or Y, it will correspond to any axis in the accelerometer coordinate system, even if this output is part of an IMU unit. The best way is to test it.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Here is a sample sequence to determine which output of gyroscope corresponds to RateAxz value discussed above.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
- start from placing the device in horizontal position. Both X and Y outputs of accelerometer would output the zero-g voltage (for example for&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/store/acc-gyro&quot; style=&quot;color: #0099ff;&quot; target=&quot;_blank&quot;&gt;Acc_Gyro&lt;/a&gt;&amp;nbsp;board this is 1.65V)&lt;br /&gt;- next start rotating the device around the Y axis, another way to say it is that you rotate the device in XZ plane, so that X and Z accelerometer outputs change and Y output remains constant.&lt;br /&gt;- while rotating the device at a constant speed note which gyroscope output changes, the other gyroscope outputs should remain constant&lt;br /&gt;- the gyroscope output that changed during the rotation around Y axis (rotation in XZ plane) will provide the input value for AdcGyroXZ, from which we calculate RateAxz&lt;br /&gt;- the final step is to ensure the rotation direction corresponds to our model, in some cases you may have to invert the RateAxz value due to physical position of gyroscope relative to the accelerometer&lt;br /&gt;- perform again the above test, rotating the device around the Y axis, this time monitor the X output of accelerometer (AdcRx in our model). If AdcRx grows (the first 90 degrees of rotation from horizontal position), then AdcGyroXZ should decrease. This is due to the fact that we are monitoring the gravitation vector and when device rotates in one direction the vector will rotate in oposite direction (relative to the device coordonate system, which we are using). So, otherwise you need to invert RateAxz , you can achieve this by introducing a sign factor in&amp;nbsp;&lt;strong&gt;Eq.3&lt;/strong&gt;, as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RateAxz = InvertAxz * (AdcGyroXZ * Vref / 1023 – VzeroRate) / Sensitivity , where InvertAxz is 1 or -1&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
same test can be done for RateAyz , by rotating the device around the X axis, and you can identify which gyroscope output corresponds to RateAyz, and if it needs to be inverted. Once you have the value for InvertAyz, you should use the following formula to calculate RateAyz:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RateAyz = InvertAyz * (AdcGyroYZ * Vref / 1023 – VzeroRate) / Sensitivity&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
If you would do these tests on&amp;nbsp;&lt;a href=&quot;http://www.starlino.com/store/acc-gyro&quot; style=&quot;color: #0099ff;&quot;&gt;Acc_Gyro&lt;/a&gt;&amp;nbsp;board you would get following results:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
- the output pin for RateAxz is GX4 and InvertAxz = 1&lt;br /&gt;- the output pin for RateAyz is GY4 and InvertAyz = 1&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
From this point on we&#39;ll consider that you have setup your IMU in such a way that you can calculate correct values for Axr, Ayr, Azr (as defined Part 1. Accelerometer) and RateAxz, RateAyz (as defined in Part 2. Gyroscope). Next we&#39;ll analyze the relations between these values that turn out useful in obtaining more accurate estimation of the inclination of the device relative to the ground plane.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
You might be asking yourself by this point, if accelerometer model already gave us inclination angles of Axr,Ayr,Azr why would we want to bother with the gyroscope data ? The answer is simple: accelerometer data can&#39;t always be trusted 100%. There are several reason, remember that accelerometer measures inertial force, such a force can be caused by gravitation (and ideally only by gravitation), but it might also be caused by acceleration (movement) of the device. As a result even if accelerometer is in a relatively stable state, it is still very sensitive to vibration and mechanical noise in general. This is the main reason why most IMU systems use a gyroscope to smooth out any accelerometer errors. But how is this done ? And is the gyroscope free from noise ?&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The gyroscope is not free from noise however because it measures rotation it is less sensitive to linear mechanical movements, the type of noise that accelerometer suffers from, however gyroscopes have other types of problems like for example drift (not coming back to zero-rate value when rotation stops). Nevertheless by averaging data that comes from accelerometer and gyroscope we can obtain a relatively better estimate of current device inclination than we would obtain by using the accelerometer data alone.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In the next steps I will introduce an algorithm that was inspired by some ideas used in Kalman filter, however it is by far more simple and easier to implement on embedded devices. Before that let&#39;s see first what we want our algorithm to calculate. Well , it is the direction of gravitation force vector R = [Rx,Ry,Rz] from which we can derive other values like Axr,Ayr,Azr or cosX,cosY,cosZ that will give us an idea about the inclination of our device relative to the ground plane, we discuss the relation between these values in Part 1. One might say – don&#39;t we already have these values Rx, Ry , Rz from&amp;nbsp;&lt;strong&gt;Eq.2&lt;/strong&gt;&amp;nbsp;in Part 1 ? Well yes, but remember that these values are derived from accelerometer data only, so if you would be to use them directly in your application you might get more noise than your application can tolerate. To avoid further confusion let&#39;s re-define the accelerometer measurements as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Racc – is the inertial force vector as measured by accelerometer, that consists of following components (projections on X,Y,Z axes):&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RxAcc = (AdcRx * Vref / 1023 – VzeroG) / Sensitivity&lt;br /&gt;RyAcc = (AdcRy * Vref / 1023 – VzeroG) / Sensitivity&lt;br /&gt;RzAcc = (AdcRz * Vref / 1023 – VzeroG) / Sensitivity&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So far we have a set of measured values that we can obtain purely from accelerometer ADC values. We&#39;ll call this set of data a &quot;vector&quot; and we&#39;ll use the following notation.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Racc = [RxAcc,RyAcc,RzAcc]&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Because these components of Racc can be obtained from accelerometer data , we can consider it an input to our algorithm.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Please note that because Racc measures the gravitation force you&#39;ll be correct if you assume that the length of this vector defined as follows is equal or close to 1g.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
|Racc| = SQRT(RxAcc^2 +RyAcc^2 + RzAcc^2),&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
However to be sure it makes sense to update this vector as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Racc(normalized) = [RxAcc/|Racc| , RyAcc/|Racc| , RzAcc/|Racc|].&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This will ensure the length of your normalized Racc vector is always 1.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Next we&#39;ll introduce a new vector and we&#39;ll call it&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rest = [RxEst,RyEst,RzEst]&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
This will be the output of our algorithm , these are corrected values based on gyroscope data and based on past estimated data.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Here is what our algorithm will do:&lt;br /&gt;- accelerometer tells us: &quot;You are now at position Racc&quot;&lt;br /&gt;- we say &quot;Thank you, but let me check&quot;,&lt;br /&gt;- then correct this information with gyroscope data as well as with past Rest data and we output a new estimated vector Rest.&lt;br /&gt;- we consider Rest to be our &quot;best bet&quot; as to the current position of the device.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Let&#39;s see how we can make it work.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We&#39;ll start our sequence by trusting our accelerometer and assigning:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rest(0) = Racc(0)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
By the way remember Rest and Racc are vectors , so the above equation is just a simple way to write 3 sets of equations, and avoid repetition:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RxEst(0) = RxAcc(0)&lt;br /&gt;RyEst(0) = RyAcc(0)&lt;br /&gt;RzEst(0) = RzAcc(0)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Next we&#39;ll do regular measurements at equal time intervals of T seconds, and we&#39;ll obtain new measurements that we&#39;ll define as Racc(1), Racc(2) , Racc(3) and so on. We&#39;ll also issue new estimates at each time intervals Rest(1), Rest(2), Rest(3) and so on.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Suppose we&#39;re at step n. We have two known sets of values that we&#39;d like to use:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rest(n-1) – our previous estimate, with Rest(0) = Racc(0)&lt;br /&gt;Racc(n) – our current accelerometer measurement&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Before we can calculate Rest(n) , let&#39;s introduce a new measured value, that we can obtain from our gyroscope and a previous estimate.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We&#39;ll call it Rgyro , and it is also a vector consisting of 3 components:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rgyro = [RxGyro,RyGyro,RzGyro]&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We&#39;ll calculate this vector one component at a time. We&#39;ll start with RxGyro.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;img alt=&quot;gyro model&quot; height=&quot;380&quot; src=&quot;http://www.starlino.com/wp-content/uploads/data/imu_guide/03.png&quot; style=&quot;border: none;&quot; width=&quot;450&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Let&#39;s start by observing the following relation in our gyroscope model, from the right-angle triangle formed by Rz and Rxz we can derive that:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
tan(Axz) = Rx/Rz =&amp;gt; Axz = atan2(Rx,Rz)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Atan2 might be a function you never used before, it is similar to atan, except it returns values in range of (-PI,PI) as opposed to (-PI/2,PI/2) as returned by atan, and it takes 2 arguments instead of one. It allows us to convert the two values of Rx,Rz to angles in the full range of 360 degrees (-PI to PI). You can read more about&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Atan2&quot; style=&quot;color: #0099ff;&quot; target=&quot;_blank&quot;&gt;atan2 here&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So knowing RxEst(n-1) , and RzEst(n-1) we can find:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Axz(n-1) = atan2( RxEst(n-1) , RzEst(n-1) ).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Remember that gyroscope measures the rate of change of the Axz angle. So we can estimate the new angle Axz(n) as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Axz(n) = Axz(n-1) + RateAxz(n) * T&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Remember that RateAxz can be obtained from our gyroscope ADC readings. A more precise formula can use an average rotation rate calculated as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RateAxzAvg = ( RateAxz(n) + RateAxz(n-1) ) / 2&lt;br /&gt;Axz(n) = Axz(n-1) + RateAxzAvg * T&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The same way we can find:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Ayz(n) = Ayz(n-1) + RateAyz(n) * T&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Ok so now we have Axz(n) and Ayz(n). Where do we go from here to deduct RxGyro/RyGyro ? From&amp;nbsp;&lt;strong&gt;Eq. 1&lt;/strong&gt;&amp;nbsp;we can write the length of vector Rgyro as follows:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
|Rgyro| = SQRT(RxGyro^2 + RyGyro^2 + RzGyro^2)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Also because we normalized our Racc vector, we may assume that it&#39;s length is 1 and it hasn&#39;t changed after the rotation, so it is relatively safe to write:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
|Rgyro| = 1&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Let&#39;s adopt a temporary shorter notation for the calculations below:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
x =RxGyro , y=RyGyro, z=RzGyro&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Using the relations above we can write:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
x = x / 1 = x / SQRT(x^2+y^2+z^2)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Let&#39;s divide numerator and denominator of fraction by SQRT(x^2 + z^2)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
x = ( x / SQRT(x^2 + z^2) ) / SQRT( (x^2 + y^2 + z^2) / (x^2 + z^2) )&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Note that x / SQRT(x^2 + z^2) = sin(Axz), so:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
x = sin(Axz) / SQRT (1 + y^2 / (x^2 + z^2) )&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now multiply numerator and denominator of fraction inside SQRT by z^2&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
x = sin(Axz) / SQRT (1 + y^2&amp;nbsp; * z ^2 / (z^2 * (x^2 + z^2)) )&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Note that z / SQRT(x^2 + z^2) = cos(Axz) and y / z = tan(Ayz), so finally:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
x = sin(Axz) / SQRT (1 + cos(Axz)^2 * tan(Ayz)^2 )&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Going back to our notation we get:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RxGyro = sin(Axz(n)) / SQRT (1 + cos(Axz(n))^2 * tan(Ayz(n))^2 )&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
same way we find that&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RyGyro = sin(Ayz(n)) / SQRT (1 + cos(Ayz(n))^2 * tan(Axz(n))^2 )&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;em&gt;&lt;strong&gt;Side Note: it is possible to further simplify this formula. By dividing both parts of the fraction by sin(Axz(n)) you get:&lt;/strong&gt;&lt;br /&gt;RxGyro =&amp;nbsp; 1&amp;nbsp; / SQRT (1/&amp;nbsp;&lt;strong&gt;sin(Axz(n))^2&lt;/strong&gt;&amp;nbsp; + cos(Axz(n))^2 /&amp;nbsp;&lt;strong&gt;sin(Axz(n))^2&lt;/strong&gt;&amp;nbsp; * tan(Ayz(n))^2 )&lt;br /&gt;RxGyro =&amp;nbsp; 1&amp;nbsp; / SQRT (1/ sin(Axz(n))^2&amp;nbsp; + cot(Axz(n))^2&amp;nbsp; *&amp;nbsp;&lt;strong&gt;sin(Ayz(n))^2&amp;nbsp; / cos(Ayz(n))^2&lt;/strong&gt;&amp;nbsp;)&amp;nbsp;&lt;br /&gt;now add and substract &amp;nbsp;&amp;nbsp;&amp;nbsp; cos(Axz(n))^2/sin(Axz(n))^2&amp;nbsp;&amp;nbsp; = cot(Axz(n))^2&lt;br /&gt;RxGyro =&amp;nbsp; 1&amp;nbsp; / SQRT (1/ sin(Axz(n))^2&amp;nbsp;&amp;nbsp;&lt;strong&gt;-&amp;nbsp; cos(Axz(n))^2/sin(Axz(n))^2&lt;/strong&gt;&amp;nbsp;&amp;nbsp; + cot(Axz(n))^2&amp;nbsp; * sin(Ayz(n))^2&amp;nbsp; / cos(Ayz(n))^2&amp;nbsp;&amp;nbsp;&lt;strong&gt;+ cot(Axz(n))^2&amp;nbsp;&lt;/strong&gt;)&lt;br /&gt;and by grouping&amp;nbsp; terms 1&amp;amp;2 and then 3&amp;amp;4&amp;nbsp; we get&amp;nbsp;&lt;br /&gt;&lt;strong&gt;RxGyro =&amp;nbsp; 1&amp;nbsp; / SQRT (1&amp;nbsp; + &amp;nbsp; cot(Axz(n))^2 * sec(Ayz(n))^2 ), &amp;nbsp; &amp;nbsp;&amp;nbsp; where&amp;nbsp; cot(x) = 1 / tan(x)&amp;nbsp; and&amp;nbsp; sec(x) = 1 / cos(x)&lt;/strong&gt;&lt;br /&gt;This formula uses only 2 trigonometric functions and can be computationally less expensive. If you have Mathematica program you can verify it&lt;/em&gt;&lt;em&gt;by evaluating &amp;nbsp;&amp;nbsp; FullSimplify [Sin[A]^2/ ( 1 + Cos[A]^2&amp;nbsp; * Tan[B]^2)]&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now, finally we can find:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RzGyro&amp;nbsp; =&amp;nbsp; Sign(RzGyro)*SQRT(1 – RxGyro^2 – RyGyro^2).&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Where Sign(RzGyro) = 1 when RzGyro&amp;gt;=0 , and Sign(RzGyro) = -1 when RzGyro&amp;lt;0.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
One simple way to estimate this is to take:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Sign(RzGyro) = Sign(RzEst(n-1))&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;em&gt;In practice be careful when RzEst(n-1) is close to 0. You may skip the gyro phase altogether in this case and assign:&amp;nbsp; Rgyro = Rest(n-1). Rz is used as a reference for calculating Axz and Ayz angles and when it&#39;s close to 0, values may overflow and trigger bad results. You&#39;ll be in domain of large floating point numbers where tan() / atan() function implementations may lack precision.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
So let&#39;s recap what we have so far, we are at step&amp;nbsp;&lt;strong&gt;n&lt;/strong&gt;&amp;nbsp;of our algorithm and we have calculated the following values:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Racc – current readings from our accelerometer&lt;br /&gt;Rgyro – obtained from Rest(n-1) and current gyroscope readings&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Which values do we use to calculate the updated estimate Rest(n) ? You probably guessed that we&#39;ll use both. We&#39;ll use a weighted average, so that:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rest(n) = (Racc * w1 + Rgyro * w2 ) / (w1 + w2)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We can simplify this formula by dividing both numerator and denominator of the fraction by w1.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rest(n) = (Racc * w1/w1 + Rgyro * w2/w1 ) / (w1/w1 + w2/w1)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
and after substituting w2/w1 = wGyro we get:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Rest(n) = (Racc + Rgyro * wGyro ) / (1 + wGyro)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
In the above formula wGyro tells us how much we trust our gyro compared to our accelerometer. This value can be chosen experimentally usually values between 5..20 will trigger good results.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
The main difference of this algorithm from Kalman filter is that this weight is relatively fixed , whereas in Kalman filter the weights are permanently updated based on the measured noise of the accelerometer readings. Kalman filter is focused at giving you &quot;the best&quot; theoretical results, whereas this algorithm can give you results &quot;good enough&quot; for your practical application. You can implement an algorithm that adjusts wGyro depending on some noise factors that you measure, but fixed values will work well for most applications.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
We are one step away from getting our updated estimated values:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RxEst(n) = (RxAcc + RxGyro * wGyro ) / (1 + wGyro)&lt;br /&gt;RyEst(n) = (RyAcc + RyGyro * wGyro ) / (1 + wGyro)&lt;br /&gt;RzEst(n) = (RzAcc + RzGyro * wGyro ) / (1 + wGyro)&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
Now let&#39;s&amp;nbsp; normalize this vector again:&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
R = SQRT(RxEst(n) ^2 + RyEst(n)^2 +&amp;nbsp; RzEst(n)^2 )&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
RxEst(n) = RxEst(n)/R&lt;br /&gt;RyEst(n) = RyEst(n)/R&lt;br /&gt;RzEst(n) = RzEst(n)/R&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, Times, serif; font-size: 14.857142448425293px; margin-bottom: 10px; padding: 0px;&quot;&gt;
And we&#39;re ready to repeat our loop again.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/6837593500157219007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/imu-guide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6837593500157219007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6837593500157219007'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/imu-guide.html' title='IMU Guide'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-5845050439163991255</id><published>2013-04-14T17:54:00.000+10:00</published><updated>2013-04-14T18:03:39.653+10:00</updated><title type='text'>Kalman filter vs Complementary filter</title><content type='html'>(source:&amp;nbsp;&lt;a href=&quot;http://robottini.altervista.org/tag/complementary-filter&quot;&gt;http://robottini.altervista.org/tag/complementary-filter&lt;/a&gt;&amp;nbsp;)&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
The use of accelerometer and gyroscope to build autonomous robots, such as the self-balancing, requires a math filter in order to merge the signals returned by the sensors.&lt;br /&gt;
The gyroscope has a drift and in a few time the values returned are completely wrong.&amp;nbsp;The accelerometer, from the other side, &amp;nbsp;returns&amp;nbsp;a true value when the acceleration is progressive but it suffers much the vibrations, returning values of the angle wrong.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
Usually a math filter is used to mix and merge the two values, in order to have a correct value: the &amp;nbsp;Kalman filter .&amp;nbsp;This is the best filter you can use, even from a theoretical point of view, since it is one that minimizes the errors from the true signal value.&amp;nbsp;However it is very difficult to understand. &amp;nbsp;In fact, the filter needs to be able to calculate the coefficients of the matrices, the process-based error, measurement error, etc. that are not trivial.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
In the hobbistic world, recently are emerging other filters, called&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;complementary filters&lt;/strong&gt;.&amp;nbsp;In fact, they manage both high-pass and low-pass filters simultaneously.&amp;nbsp;&lt;b&gt;The low pass filter filters high frequency signals (such as the accelerometer in the case of vibration) and high pass filters that filter low frequency signals (such as the drift of the gyroscope).&lt;/b&gt;&amp;nbsp;By combining these filters, you get a good signal, without the complications of the Kalman filter. (side note regarding sensor fusion: Accelerometer requires low pass filter, Gyro requires high pass filter, Vision require low pass filter)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
Making a study from a theoretical point of view, the discussion is complicated and is beyond the scope of this tutorial. The complementary filters can be have different ‘orders’. Here I speak about the so-called first-order filter that filter already well, and the second-order filter which filter even better.&amp;nbsp;Clearly, going from first to second order, the algorithm is more complicated to use and perhaps there is no gain so obvious &amp;nbsp;to justify the increase in complexity.&lt;br /&gt;
A great introduction to the first order complementary filters applied to the an accelerometer and a gyroscope, comes from MIT (&lt;a href=&quot;http://web.mit.edu/scolton/www/filter.pdf&quot; style=&quot;color: #0071bb; margin: 0px; padding: 0px;&quot;&gt;here&lt;/a&gt;). It introduces the filter in a a very simple &amp;nbsp;mode.&amp;nbsp;On this document is based the first Arduino algorithm:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, &#39;Lucida Console&#39;, Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Nimbus Mono L&#39;, &#39;Bitstream Vera Sans Mono&#39;; font-size: 12px; margin-bottom: 1em; margin-top: 1em; overflow: auto; padding: 0.4em; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// a=tau / (tau + loop time)&lt;/span&gt;
&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// newAngle = angle measured with atan2 using the accelerometer&lt;/span&gt;
&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// newRate = angle measured using the gyro&lt;/span&gt;
&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// looptime = loop time in millis()&lt;/span&gt;

&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; tau&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;0.075&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; a&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;0.0&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; Complementary&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; newAngle&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; newRate&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt; looptime&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; dtC &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;looptime&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;1000.0&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
a&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;tau&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;tau&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;dtC&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
x_angleC&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; a&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;x_angleC &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; newRate &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; dtC&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008c00; margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt;a&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;newAngle&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; x_angleC&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
It&amp;nbsp;’enough to choose&amp;nbsp;the response time of&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;tau (please see&amp;nbsp;&lt;/em&gt;&lt;a href=&quot;http://web.mit.edu/scolton/www/filter.pdf&quot; style=&quot;background-color: transparent; color: #0071bb; margin: 0px; padding: 0px;&quot;&gt;here&lt;/a&gt;&amp;nbsp;&lt;em style=&quot;font-size: 13.142857551574707px; margin: 0px; padding: 0px;&quot;&gt;for Tau selection process&lt;/em&gt;&lt;em style=&quot;font-size: 13.142857551574707px; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;)&lt;/em&gt;&lt;span style=&quot;font-size: 13.142857551574707px;&quot;&gt;, to send the arguments,&amp;nbsp;ie the angle measured with the accelerometer and the gyroscope, the time&amp;nbsp;of the loop&amp;nbsp;and you get&amp;nbsp;in&amp;nbsp;two lines, the angle calculated by the filter.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
The algorithm&amp;nbsp;at the base of&amp;nbsp;the second order&amp;nbsp;complementary&amp;nbsp;filter&amp;nbsp;is described&amp;nbsp;&lt;a href=&quot;http://www.rcgroups.com/forums/showatt.php?attachmentid=2477096&amp;amp;d=1240377331&quot; style=&quot;color: #0071bb; margin: 0px; padding: 0px;&quot;&gt;here&lt;/a&gt;.&amp;nbsp;Indeed&amp;nbsp;it is not&amp;nbsp;described&amp;nbsp;at all, but&amp;nbsp;now&amp;nbsp;we’ve&amp;nbsp;figured out how&amp;nbsp;the filter works&amp;nbsp;by the MIT’s documentation. The&amp;nbsp;principle is the same,&amp;nbsp;the algorithm&amp;nbsp;is more complicated.&amp;nbsp;The translation&amp;nbsp;of this algorithm for the Arduino:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, &#39;Lucida Console&#39;, Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Nimbus Mono L&#39;, &#39;Bitstream Vera Sans Mono&#39;; font-size: 12px; margin-bottom: 1em; margin-top: 1em; overflow: auto; padding: 0.4em; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// newAngle = angle measured with atan2 using the accelerometer&lt;/span&gt;
&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// newRate = angle measured using the gyro&lt;/span&gt;
&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// looptime = loop time in millis()&lt;/span&gt;

&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; Complementary2&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; newAngle&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; newRate&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt; looptime&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; k&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #008c00; margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; dtc2&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;looptime&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;1000.0&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;

x1 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;newAngle &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt;   x_angle2C&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;k&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;k&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
y1 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; dtc2&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;x1 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; y1&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
x2 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; y1 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;newAngle &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt;   x_angle2C&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #008c00; margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;k &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; newRate&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
x_angle2C &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; dtc2&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;x2 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; x_angle2C&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; x_angle2C&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
Here too we just have &amp;nbsp;to set the&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;k&lt;/em&gt;&amp;nbsp;and&amp;nbsp;magically&amp;nbsp;we get&amp;nbsp;the angle.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
If we want to apply&amp;nbsp;the Kalman filter, we can re-use one of the codes already present in internet. This&amp;nbsp;is the&amp;nbsp;code that I&amp;nbsp;copied from the&amp;nbsp;Arduino&amp;nbsp;forum (&lt;a href=&quot;http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1284738418/15&quot; style=&quot;color: #0071bb; margin: 0px; padding: 0px;&quot;&gt;here&lt;/a&gt;):&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, &#39;Lucida Console&#39;, Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Nimbus Mono L&#39;, &#39;Bitstream Vera Sans Mono&#39;; font-size: 12px; margin-bottom: 1em; margin-top: 1em; overflow: auto; padding: 0.4em; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// KasBot V1 - Kalman filter module&lt;/span&gt;

&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; Q_angle  &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;0.01&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;//0.001&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; Q_gyro   &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;0.0003&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;  &lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;//0.003&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; R_angle  &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;0.01&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;  &lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;//0.03&lt;/span&gt;

&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; x_bias &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008c00; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; P_00 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008c00; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; P_01 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008c00; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; P_10 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008c00; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; P_11 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008c00; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt;  y&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; S&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; K_0&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; K_1&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// newAngle = angle measured with atan2 using the accelerometer&lt;/span&gt;
&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// newRate = angle measured using the gyro&lt;/span&gt;
&lt;span style=&quot;color: dimgrey; margin: 0px; padding: 0px;&quot;&gt;// looptime = loop time in millis()&lt;/span&gt;

&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; kalmanCalculate&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; newAngle&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; newRate&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt; looptime&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt; dt &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;looptime&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #008c00; margin: 0px; padding: 0px;&quot;&gt;1000&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
x_angle &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; dt &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;newRate &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt; x_bias&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
P_00 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt; dt &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;P_10 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; P_01&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; Q_angle &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; dt&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
P_01 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt; dt &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; P_11&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
P_10 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt; dt &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; P_11&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
P_11 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; Q_gyro &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; dt&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;

y &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; newAngle &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt; x_angle&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
S &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; P_00 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt; R_angle&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
K_0 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; P_00 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt; S&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
K_1 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; P_10 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt; S&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;

x_angle &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;  K_0 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; y&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
x_bias  &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;  K_1 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; y&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
P_00 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; K_0 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; P_00&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
P_01 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; K_0 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; P_01&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
P_10 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; K_1 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; P_00&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
P_11 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; K_1 &lt;span style=&quot;color: #808030; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; P_01&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: maroon; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; x_angle&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: purple; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
To&amp;nbsp;get the answer,&amp;nbsp;you have to set&amp;nbsp;3 parameters:&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Q_angle,&amp;nbsp;R_angle,R_gyro&lt;/em&gt;.&amp;nbsp;The activity&amp;nbsp;is&amp;nbsp;a bit&amp;nbsp;complicated&amp;nbsp;.&lt;br /&gt;
But&amp;nbsp;what happens with&amp;nbsp;these algorithms? &amp;nbsp;Similar&amp;nbsp;curves&amp;nbsp;are obtained? &amp;nbsp;Here’s a comparison:&lt;br /&gt;
There&amp;nbsp;are 5&amp;nbsp;curves:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
&lt;a href=&quot;http://robottini.altervista.org/kalman-filter-vs-complementary-filter/confrontofiltri1&quot; rel=&quot;attachment wp-att-322&quot; style=&quot;color: #0071bb; margin: 0px; padding: 0px;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-large wp-image-322&quot; height=&quot;237&quot; src=&quot;http://robottini.altervista.org/wp-content/uploads/2011/08/confrontofiltri1-1024x406.jpg&quot; style=&quot;border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgb(183, 169, 154); display: block; margin: 0px auto; padding: 3px; text-align: center;&quot; title=&quot;confrontofiltri1&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
Color&amp;nbsp;lines:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 19.428571701049805px; margin: 0.4em 0px 1em; padding: 0px;&quot;&gt;
&lt;li style=&quot;list-style-position: outside; margin: 0px 0px 0px 1.6em; padding: 0px;&quot;&gt;&lt;span style=&quot;color: red; margin: 0px; padding: 0px;&quot;&gt;Red&lt;/span&gt;&amp;nbsp;- accelerometer&lt;/li&gt;
&lt;li style=&quot;list-style-position: outside; margin: 0px 0px 0px 1.6em; padding: 0px;&quot;&gt;&lt;span style=&quot;color: lime; margin: 0px; padding: 0px;&quot;&gt;Green&lt;/span&gt;&amp;nbsp;-&amp;nbsp;Gyro&lt;/li&gt;
&lt;li style=&quot;list-style-position: outside; margin: 0px 0px 0px 1.6em; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #3366ff; margin: 0px; padding: 0px;&quot;&gt;Blue&lt;/span&gt;&amp;nbsp;-&amp;nbsp;Kalman filter&lt;/li&gt;
&lt;li style=&quot;list-style-position: outside; margin: 0px 0px 0px 1.6em; padding: 0px;&quot;&gt;Black&amp;nbsp;- complementary filter&lt;/li&gt;
&lt;li style=&quot;list-style-position: outside; margin: 0px 0px 0px 1.6em; padding: 0px;&quot;&gt;&lt;span style=&quot;color: gold; margin: 0px; padding: 0px;&quot;&gt;Yellow&lt;/span&gt;&amp;nbsp;-&amp;nbsp;the second order&amp;nbsp;complementary&amp;nbsp;filter&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
As you can see&amp;nbsp;the signals&amp;nbsp;filtered&amp;nbsp;are very similarly.&amp;nbsp;Note that&amp;nbsp;in the presence of&amp;nbsp;vibrations, the accelerometer&amp;nbsp;(red) generally&amp;nbsp;go crazy. &amp;nbsp;The gyro&amp;nbsp;(green) has a&amp;nbsp;very strong drift&amp;nbsp;increasing int the time.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
Now let’s see&amp;nbsp;a comparison&amp;nbsp;only between&amp;nbsp;a filtered signal.&amp;nbsp;That&amp;nbsp;kalman (&lt;span style=&quot;color: lime; margin: 0px; padding: 0px;&quot;&gt;green&lt;/span&gt;), complementary&amp;nbsp;(black) and complementary second-order&amp;nbsp;(&lt;span style=&quot;color: gold; margin: 0px; padding: 0px;&quot;&gt;yellow&lt;/span&gt;).&amp;nbsp;You can see how&amp;nbsp;the&amp;nbsp;Kalman&amp;nbsp;is a bit&amp;nbsp;late vs complementary&amp;nbsp;filters,&amp;nbsp;but it is more responsive to the&amp;nbsp;vibration.&amp;nbsp;In this&amp;nbsp;case the&amp;nbsp;second order&amp;nbsp;filter&amp;nbsp;does not return an ideal curve, probably I have to work&amp;nbsp;a bit&amp;nbsp;on the coefficients.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;aligncenter&quot; height=&quot;314&quot; src=&quot;http://robottini.altervista.org/wp-content/uploads/2011/08/confrontofiltri2-1024x537.jpg&quot; style=&quot;border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgb(183, 169, 154); display: block; margin: 0px auto; padding: 3px; text-align: center;&quot; title=&quot;confrontofiltri2&quot; width=&quot;600&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica; font-size: 13.142857551574707px; line-height: 16px; margin-bottom: 0.3em; margin-top: 0.6em; padding: 0px; text-align: justify;&quot;&gt;
In conclusion&amp;nbsp;I think&amp;nbsp;that the&amp;nbsp;complementary&amp;nbsp;filter, in this case&amp;nbsp;the&amp;nbsp;first order,&amp;nbsp;can be used in place of the&amp;nbsp;Kalman filter.&amp;nbsp;The&amp;nbsp;smoothing&amp;nbsp;is good and the algorithm&amp;nbsp;is much&amp;nbsp;simpler than&amp;nbsp;Kalman.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/5845050439163991255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/kalman-filter-vs-complementary-filter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/5845050439163991255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/5845050439163991255'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2013/04/kalman-filter-vs-complementary-filter.html' title='Kalman filter vs Complementary filter'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-5595465975548836354</id><published>2013-03-18T21:27:00.000+11:00</published><updated>2013-03-18T21:28:47.779+11:00</updated><title type='text'>Turtlebot Navigation Report and Code</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
One of the group in my robotics class (group consist of Zongyuan Ge, Yonhon Ng, Yonsen Ng, Lu Xia&lt;br /&gt;
&lt;div class=&quot;Affiliation&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;Affiliation&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
and Yuantao Zhang)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Abstract:&lt;/b&gt;&lt;br /&gt;
In this project, we are given the task of implementing algorithm for our Turtlebot (Ted) to escape from an enclosure and to detect several objects after successfully escaped. We have implemented a maximum distance finding algorithm which coordinates with an obstacle avoidance module which works at&lt;br /&gt;
the same time to find the exit. Then we bridged OpenCV into our code and used SURF to detect key points in the image and match them with pictures in the library. Though we have encountered many difficulties, the project is finally accomplished and tested.&lt;br /&gt;
&lt;br /&gt;
Report:&lt;br /&gt;
&lt;a href=&quot;https://docs.google.com/file/d/0B8gYxW2umHiVSlI0LXZjdnFjT0U/edit?usp=sharing&quot;&gt;https://docs.google.com/file/d/0B8gYxW2umHiVSlI0LXZjdnFjT0U/edit?usp=sharing&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Code:&lt;br /&gt;
&lt;a href=&quot;https://docs.google.com/file/d/0B8gYxW2umHiVRVd1WHZHQjNIeWM/edit?usp=sharing&quot;&gt;https://docs.google.com/file/d/0B8gYxW2umHiVRVd1WHZHQjNIeWM/edit?usp=sharing&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/5595465975548836354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2013/03/turtlebot-navigation-report-and-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/5595465975548836354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/5595465975548836354'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2013/03/turtlebot-navigation-report-and-code.html' title='Turtlebot Navigation Report and Code'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-7570266191304092494</id><published>2012-04-27T14:30:00.001+10:00</published><updated>2012-04-27T14:30:12.887+10:00</updated><title type='text'>Adjacency/Incidence Matrix</title><content type='html'>&lt;b&gt;Adjacency&amp;nbsp;Matrix&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;An adjacency matrix&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;is a means of representing which vertices&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;(or nodes) of a graph are adjacent&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;to which other vertices.&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYysiZGdx8NfrCNTQiUhgQWdG2qMuLZFMG43R837ATjq23_YxDGqaDM96Yds0Mi1yKpHh_9G99s-xqpqoipdw5StwTMj7QPM7RguhM5uiUNbl2Bv0R78CXD0Qyy8GF_bLeEXUSrV1z_o0/s1600/AdjacencyMatrix_1001.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;185&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYysiZGdx8NfrCNTQiUhgQWdG2qMuLZFMG43R837ATjq23_YxDGqaDM96Yds0Mi1yKpHh_9G99s-xqpqoipdw5StwTMj7QPM7RguhM5uiUNbl2Bv0R78CXD0Qyy8GF_bLeEXUSrV1z_o0/s320/AdjacencyMatrix_1001.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Incidence Matrix&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;The incidence matrix of the undirected graph is a matrix consisting of 4 rows (corresponding to the four vertices, 1-4) and 4 columns (corresponding to the four edges, e1-e4):&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjThCeZt4nFi0WrbRGLL8ZdRf3hB0-LgKOJN8xsyy9NE6i04-NxQUAnoE3z6UQJJla5831cCI3HQgwPgpiN1nOq3lo8YzqjBPZnDoFFHCuxhbqOpNP0vPW2czPzEineGE-KGKF_t4DEufo/s1600/250px-Labeled_undirected_graph.svg.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjThCeZt4nFi0WrbRGLL8ZdRf3hB0-LgKOJN8xsyy9NE6i04-NxQUAnoE3z6UQJJla5831cCI3HQgwPgpiN1nOq3lo8YzqjBPZnDoFFHCuxhbqOpNP0vPW2czPzEineGE-KGKF_t4DEufo/s1600/250px-Labeled_undirected_graph.svg.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhte7PIVTQGmoxEkKnkCR6HhOQhSLfWiHfqR570jyqRrBtVX-YWpm5VSCQmYjRolFcbCvhgMndzOdM_zgujYwO-yopg5rVrrdhs5Gl7ny9UUDofXK_jna_5FE_r-JsxuuBnujGJ3QvAJJ0/s1600/0888482fd451085c434ef19921601900.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhte7PIVTQGmoxEkKnkCR6HhOQhSLfWiHfqR570jyqRrBtVX-YWpm5VSCQmYjRolFcbCvhgMndzOdM_zgujYwO-yopg5rVrrdhs5Gl7ny9UUDofXK_jna_5FE_r-JsxuuBnujGJ3QvAJJ0/s1600/0888482fd451085c434ef19921601900.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/7570266191304092494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/adjacencyincidence-matrix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/7570266191304092494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/7570266191304092494'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/adjacencyincidence-matrix.html' title='Adjacency/Incidence Matrix'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYysiZGdx8NfrCNTQiUhgQWdG2qMuLZFMG43R837ATjq23_YxDGqaDM96Yds0Mi1yKpHh_9G99s-xqpqoipdw5StwTMj7QPM7RguhM5uiUNbl2Bv0R78CXD0Qyy8GF_bLeEXUSrV1z_o0/s72-c/AdjacencyMatrix_1001.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-7241361859113838716</id><published>2012-04-13T16:44:00.000+10:00</published><updated>2013-07-08T02:50:34.773+10:00</updated><title type='text'>Aileron, Rudder and Elevator (Pictorial Description)</title><content type='html'>&lt;b&gt;Aileron&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;The ailerons are used to control the aircraft in&amp;nbsp;&lt;/span&gt;roll&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;, which results in a change in heading due to the tilting of the lift vector. The two ailerons are typically interconnected so that one goes down when the other goes up: the down-going aileron increases the&amp;nbsp;&lt;/span&gt;lift&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;on its wing while the up-going aileron reduces the lift on its wing, producing a rolling&amp;nbsp;&lt;/span&gt;moment&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;about the aircraft&#39;s longitudinal axis.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;Ailerons are usually situated near the wing tip, but may sometimes be situated nearer the wing root. The terms &quot;outboard aileron&quot; and &quot;inboard aileron&quot; are used to describe these positions respectively. The word&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;aileron&lt;/i&gt;&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;is French for &quot;little wing&quot;.&lt;/span&gt; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUptTbnd9Y5rFtJWOpWS5YZuTtAM58JjAyA_ewDr1i7kGbHhm-iVC2uwRDDvca6RHp5ywBGV5uSjQCOxVP3Xu9SAyVQajJnsS0hc8qLisk5zObpnNOt451ooZteMwKt6Iuh0Ti1U3VOEQ/s1600/aroll.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;258&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUptTbnd9Y5rFtJWOpWS5YZuTtAM58JjAyA_ewDr1i7kGbHhm-iVC2uwRDDvca6RHp5ywBGV5uSjQCOxVP3Xu9SAyVQajJnsS0hc8qLisk5zObpnNOt451ooZteMwKt6Iuh0Ti1U3VOEQ/s320/aroll.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b style=&quot;font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;Rudder&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;A&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;rudder&lt;/b&gt;&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;is a device used to steer a&amp;nbsp;&lt;/span&gt;ship&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;,&amp;nbsp;&lt;/span&gt;boat&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;,&amp;nbsp;&lt;/span&gt;submarine&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;,&amp;nbsp;&lt;/span&gt;hovercraft&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;,&amp;nbsp;&lt;/span&gt;aircraft&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;or other conveyance that moves through a medium (generally air or water). On an aircraft the rudder is used primarily to counter&amp;nbsp;&lt;/span&gt;adverse yaw&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;p-factor&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;and is not the primary control used to turn the airplane. A rudder operates by redirecting the fluid past the hull or fuselage, thus imparting a turning or yawing motion to the craft.&lt;/span&gt; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKDhmMF19asBnGfEK_Zvy6Pin3F5d6YthqMWiNCFrHzkv5RVJ45YXoAOPLMFE81uMZTVAWilXc5mf_huI3WCeGkE4JUb-ntKnREjWA1mGINuIFGCJK3nmkuY_pqjvNpps6tU8Ok82bsO8/s1600/Aileron_yaw.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKDhmMF19asBnGfEK_Zvy6Pin3F5d6YthqMWiNCFrHzkv5RVJ45YXoAOPLMFE81uMZTVAWilXc5mf_huI3WCeGkE4JUb-ntKnREjWA1mGINuIFGCJK3nmkuY_pqjvNpps6tU8Ok82bsO8/s320/Aileron_yaw.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;b&gt;Elevator&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;Elevators&lt;/b&gt;&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;are&amp;nbsp;&lt;/span&gt;flight control surfaces&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;, usually at the rear of an&amp;nbsp;&lt;/span&gt;aircraft&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;, which control the aircraft&#39;s orientation by changing the&amp;nbsp;&lt;/span&gt;pitch&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;of the aircraft, and so also the&amp;nbsp;&lt;/span&gt;angle of attack&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;of the wing. In simplified terms, they make the aircraft nose-up or nose-down.&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;(Ascending and descending are more a function of the wing—aircraft typically land nose up.) An increased wing angle of attack will cause a greater&amp;nbsp;&lt;/span&gt;lift&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;to be produced by the profile of the&amp;nbsp;&lt;/span&gt;wing&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;, and a slowing of the aircraft speed. A decrease in angle of attack will produce an increase in speed. The elevators may be the only pitch control surface present (and are then called a slab elevator or&amp;nbsp;&lt;/span&gt;stabilator&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;), or may be hinged to a fixed or adjustable surface called a&amp;nbsp;&lt;/span&gt;tailplane&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;or horizontal&amp;nbsp;&lt;/span&gt;stabilizer&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;.&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJEruV-4-3fLg2-a1Plz695j7xdUm_EVEJORF-EzqmCegAS_VkoqxKwmZGvfaqfKF7qdg0OQam3LKLq0tpiejMJaaHlgAkBw1nJdWjFugiKg228pRbplLxYPSODv-MQdig_lPAMIc3t-w/s1600/Aileron_pitch.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;257&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJEruV-4-3fLg2-a1Plz695j7xdUm_EVEJORF-EzqmCegAS_VkoqxKwmZGvfaqfKF7qdg0OQam3LKLq0tpiejMJaaHlgAkBw1nJdWjFugiKg228pRbplLxYPSODv-MQdig_lPAMIc3t-w/s320/Aileron_pitch.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/7241361859113838716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/aileron-rudder-and-elevator-pictorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/7241361859113838716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/7241361859113838716'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/aileron-rudder-and-elevator-pictorial.html' title='Aileron, Rudder and Elevator (Pictorial Description)'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUptTbnd9Y5rFtJWOpWS5YZuTtAM58JjAyA_ewDr1i7kGbHhm-iVC2uwRDDvca6RHp5ywBGV5uSjQCOxVP3Xu9SAyVQajJnsS0hc8qLisk5zObpnNOt451ooZteMwKt6Iuh0Ti1U3VOEQ/s72-c/aroll.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-3998007089069912087</id><published>2012-04-11T14:13:00.001+10:00</published><updated>2012-04-11T14:28:40.381+10:00</updated><title type='text'>Glossary of RC Helicopters</title><content type='html'>&lt;strong style=&quot;text-align: left;&quot;&gt;Introduction&lt;/strong&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;In this guide i will use the T-Rex 500 as the example, to guide you through the various components of the helicopter. I am not however recommending this as a beginners model. Under one-on-one tuition it is possible to learn on this aircraft, and in fact its flight characteristic can be set to be very docile and beginner friendly. But it is aimed more towards the mid to high end range and competition flight, they are also many times more expensive than a basic ready to fly box set, that a beginner should be aiming for.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp8Em6blUQ5hTW_a9KkNr2Il4yNIeVSePYZ_NC6SzaPDoinkraVdOZm1XuYr0cPXihwzNDVQLTgvhfjCxLnFJcIQQLVgAzkq9-4yp1_eFmZ_tQFANph-4ufvLcGTMlLsNY17ynYD-nh10/s1600/1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp8Em6blUQ5hTW_a9KkNr2Il4yNIeVSePYZ_NC6SzaPDoinkraVdOZm1XuYr0cPXihwzNDVQLTgvhfjCxLnFJcIQQLVgAzkq9-4yp1_eFmZ_tQFANph-4ufvLcGTMlLsNY17ynYD-nh10/s1600/1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;strong style=&quot;text-align: left;&quot;&gt;Helicopter Mechanics&lt;/strong&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAYH08SuB0WVT24VNxhLO_UNlmHJy2LynkElTu-fX3iD1RuHxHFG-I-KPaZ_xMZ6OGHP08tiZLKNBBZR3B3cQnex3GuWsrW4w0VCOHfkXTOWwmvNzSe1hKJonVYB4iN208hmziqM3FBVE/s1600/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAYH08SuB0WVT24VNxhLO_UNlmHJy2LynkElTu-fX3iD1RuHxHFG-I-KPaZ_xMZ6OGHP08tiZLKNBBZR3B3cQnex3GuWsrW4w0VCOHfkXTOWwmvNzSe1hKJonVYB4iN208hmziqM3FBVE/s1600/2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;strong style=&quot;text-align: left;&quot;&gt;Airframe&lt;/strong&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;Usually injection moulded. But also on more expensive models constructed from carbon fibre, and Aluminium. Providing a rigid frame to piece all of the components together, and transfer the power between the motor and rotor head. It also serves as a frame to hold the electronics. Modern pod and boom sport models, are semi exposed except for a fiberglass painted canopy that covers the first half of the airframe via some simple retaining clips. This aids in orientation of the aircraft whilst in flight, and helps to improve aerodynamics.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGYk15xD5X3jpgziQ0zDSZeIFisawOlhEunUnslU4Lxc9wx01i68juhDU6S5yp34OVLtY87vJTkHTy9_8emphcZWC1WhO-2Nn3P5xHDQ5J3JaiYqcz36FamJp0CzcSao4jCAeweMK7Fvg/s1600/3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGYk15xD5X3jpgziQ0zDSZeIFisawOlhEunUnslU4Lxc9wx01i68juhDU6S5yp34OVLtY87vJTkHTy9_8emphcZWC1WhO-2Nn3P5xHDQ5J3JaiYqcz36FamJp0CzcSao4jCAeweMK7Fvg/s1600/3.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;strong style=&quot;text-align: left;&quot;&gt;Tail&lt;/strong&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;Between the tail unit and main frame is the tail boom, it provides a route for the tail drive system and control linkages. It is necessary to have the rear rotor blades at a larger diameter than the main rotor blades away from the main frame. Usually there are also two support structures coming from the base of the helicopter frame, to a fixed point along the boom to aid structural rigidity. This is also where the horizontal stabilizer fins are located, a bit further towards the rear we find the vertical stabilizer connected to the tail drive unit. The power is normally transferred to the tail from the main motor via a belt drive, but it is also possible to have torque tube drives, that have a fixed drive shaft powering it. The rudder control on the radio controls the yaw of the helicopter via changes in pitch of the tail blades.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_pvN_AjjYDNaIA5XyqYZhkGRhxIwLO7CIgdApc0Je-c-tnAU_tEYCBy95AJv5V2pA4q8u9tN0PXeUV4nOsrFkmneGUubLHM3eROW07YJyW6hClOOqCXmXydJl4vkAT2dw9LL3hBjMh7Q/s1600/4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_pvN_AjjYDNaIA5XyqYZhkGRhxIwLO7CIgdApc0Je-c-tnAU_tEYCBy95AJv5V2pA4q8u9tN0PXeUV4nOsrFkmneGUubLHM3eROW07YJyW6hClOOqCXmXydJl4vkAT2dw9LL3hBjMh7Q/s1600/4.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;strong style=&quot;text-align: left;&quot;&gt;Swashplate&lt;/strong&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;This is one of the most important parts of a RC helicopter, it is how the movements from the servos are transferred to the rotor blades, and finally translated into a movement of the helicopter in the direction required. It allows the stationary helicopter frame and servos to apply movement to the spinning blades pitch. In order to produce propulsion in a certain direction, as the blades spin, at certain points along the circumference of the rotation, the pitch of the blade changes, thereby creating more lift on the left side than the right for example. This will then cause the helicopter to move to the right. This is the Aileron control on the radio, and produces a sideways banking motion. It is the same theory for the Elevator control, it rocks the swashplate forwards and backwards, like the Aileron moves it from side to side.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh26tDZbm2JHG7bpw4fRmnbIdHKWU4cYctxpwdEGJWjfKNNNyxn6AL-rVO7midneCFS3_mcHk2bMG1xuEeLQo-xTzXWzg2zp1fg-DBrPMSFzsLn4D3A6hp7O7KP9ME1gqmu8RRa27ChzuM/s1600/5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh26tDZbm2JHG7bpw4fRmnbIdHKWU4cYctxpwdEGJWjfKNNNyxn6AL-rVO7midneCFS3_mcHk2bMG1xuEeLQo-xTzXWzg2zp1fg-DBrPMSFzsLn4D3A6hp7O7KP9ME1gqmu8RRa27ChzuM/s1600/5.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;strong style=&quot;text-align: left;&quot;&gt;Rotor-head&lt;/strong&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;Relatively simple compared to the swashplate, as most of the control mixing has been done there. The main components here are the blade grips, they are able to rotate to allow for the changes in pitch of the individual blade. Also on the rotor head is the flybar, this is to provide a mechanical form of stabilization to the inherently unstable aircraft. To provide control to the rotor head, we have a complex mixture of washout arms, bell crank arms, mixer arms, pitch control arms and flybar control arms. All working together to keep the helicopter in the air. I wont go into detail on these in this section, as the particular setup varies from one helicopter to another. I will however go into more detail in the mechanical setup section of this website.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;A combination of rotor pitch and head speed gives the helicopter lift. When applying increasing pitch on both blades at the same time, this will produce lift, but also increased drag effects will reduce the head speed. On a modern transmitter, the throttle, and pitch are mixed to counter act this and keep a constant head speed, this is also where a engine governer comes into force on a nitro model.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvBc77BRL1fK3wGf6ijIxCh1baWdsQtMHdjeV0-ea8aaVBlNf0JHGfRC5tIC0TFiOL2yK7j0QukbZShyphenhyphenKw7pRdVWDQj7VgwiLAcuP19rNCBNbjHxSxMDvhbg4YKYnfNEOUXN8o0011Io0/s1600/6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvBc77BRL1fK3wGf6ijIxCh1baWdsQtMHdjeV0-ea8aaVBlNf0JHGfRC5tIC0TFiOL2yK7j0QukbZShyphenhyphenKw7pRdVWDQj7VgwiLAcuP19rNCBNbjHxSxMDvhbg4YKYnfNEOUXN8o0011Io0/s1600/6.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;To calculate head speed, we look at the rating of the motor, so a 3000 Kv motor will rotate at 3000 rpm per volt. So the T-Rex 500 runs at 22.2 v. This means the motor will spin at 66,600 rpm when the full voltage is applied, it then makes sense that at half throttle, we will have 33,300 rpm. It is then a simple case of working out the ratio between the teeth on the motor pinion and main gear to give us our head speed. So as an example, if for every one turn of the main gear, the motor turns 40 times, we would have a head speed of 1665 rpm.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFKsdaMLuWSgFDdnlTItrvXufXZOG5f-Y5b3CGKr4tlJsYiFJXyP2zi_tZ2rl1sVTTHqqnqQ-La7j7h_XQ0YgPjHN7NFRvTtFLQMOq5nyrGe_m254obFBA3ba2bTqkITdkNzbRft17KHs/s1600/7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFKsdaMLuWSgFDdnlTItrvXufXZOG5f-Y5b3CGKr4tlJsYiFJXyP2zi_tZ2rl1sVTTHqqnqQ-La7j7h_XQ0YgPjHN7NFRvTtFLQMOq5nyrGe_m254obFBA3ba2bTqkITdkNzbRft17KHs/s1600/7.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;strong style=&quot;text-align: left;&quot;&gt;Speed Controller and Motor&lt;/strong&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;Unlike a nitro model where we have a mechanical mixture control and servo, on a electric helicopter we have a brushless motor and electronic speed controller [ESC]. The speed controller acts as many units in one. Supplying the appropriate voltage to the motor, providing power to the electronics, controlling headspeed, battery level warnings, and many more features. Most ESC&#39;s will have a built in battery eliminator circuit (BEC) to maintain the correct voltages to the receiver and ultimately the servos and gyro. If you have a nitro model, this will be a separate unit, and the helicopter electronics will have there own, smaller Li-Po batter pack. The ESC usually will connect to the motor via 3 cables, positive, negative and data. it is important when working on your helicopter on the ground, to disconnect the motor from the speed controller, to avoid accidental arming and spooling up.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzSKKdc86CMlxDtGL1G8SyfqZepMaiWcxmZWaP9D4l1zfKfcVJ-3G1Tb3spimacuyyuNT_DfUVoccOBf-YlFhyifiWIHB29ehFMjr3jkT2za1FsR9phVTgOoZowVXgcFRlx4cUHjB6wbE/s1600/8a.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzSKKdc86CMlxDtGL1G8SyfqZepMaiWcxmZWaP9D4l1zfKfcVJ-3G1Tb3spimacuyyuNT_DfUVoccOBf-YlFhyifiWIHB29ehFMjr3jkT2za1FsR9phVTgOoZowVXgcFRlx4cUHjB6wbE/s1600/8a.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;strong style=&quot;text-align: left;&quot;&gt;Servo&#39;s and Gyro&lt;/strong&gt;&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;If you have a 120 degree swashplate you will have 3 servos mixed to control the swashplate movement. This is known as eCCPM, the controls are mixed on the transmitter, to allow the three servos to control the four directions of motion applied on the cyclic control. Some helicopters use 90 degree non-ccpm swashplates, but on the majority of current helicopters these are much less common. A quick visual inspection of your swashplate will allow you to identify easily which type you have.&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; text-align: left;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;Lastly we have the tail servo, usually attached directly to the tail boom, or tucked away inside the main frame below were the tail boom interfaces with the frame. This provides the control for the pitch of the rear tail blades, to allow the model to yaw and rudder control. However, it is necessary to incorporate a gyro between the receiver and servo, to control the position of the tail. Due to the force of the tail rotor, it will generally always want to move. Also looking at the laws of motion, once moving it will want to continue on that path until operated on by an external force. So a gyro counteracts this. It keeps the tail locked steady in one position, when you give some left rudder, it moves left, but the moment you stop the control input the tail comes to sharp stop. Without this you would have to be constantly balancing the tail, and the other controls.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvnzDPNymoWuLpTWqBxIirNWBWHQ0ou7OJ_crkM4O5wk-c7_Ttt88Faj53U4nWRDQDOSLRq7gQP31j689SjZdIZAglibDF8cVxITYYPWhjy5CvcAlN2UXYr_7UdT5Diu8hAAeCDMfYW9E/s1600/8b.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvnzDPNymoWuLpTWqBxIirNWBWHQ0ou7OJ_crkM4O5wk-c7_Ttt88Faj53U4nWRDQDOSLRq7gQP31j689SjZdIZAglibDF8cVxITYYPWhjy5CvcAlN2UXYr_7UdT5Diu8hAAeCDMfYW9E/s1600/8b.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/3998007089069912087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/glossary-of-rc-helicopters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/3998007089069912087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/3998007089069912087'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/glossary-of-rc-helicopters.html' title='Glossary of RC Helicopters'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp8Em6blUQ5hTW_a9KkNr2Il4yNIeVSePYZ_NC6SzaPDoinkraVdOZm1XuYr0cPXihwzNDVQLTgvhfjCxLnFJcIQQLVgAzkq9-4yp1_eFmZ_tQFANph-4ufvLcGTMlLsNY17ynYD-nh10/s72-c/1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-2092969603757660682</id><published>2012-04-11T14:08:00.001+10:00</published><updated>2012-04-11T14:09:23.793+10:00</updated><title type='text'>Helicopters</title><content type='html'>Helicopters have very complex mechanics. They contain many tens of thousands of moving parts. The basic principles of how they work can be grasped relatively quickly though. A horizontal power driven rotor provides lift to a helicopter, more commonly known as the main rotor. This produces a reaction torque. This is counteracted by the vertical tail rotor.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.kempley-helicopters.com/images/mech1_thumb.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Helicopter torque reaction&quot; border=&quot;0&quot; class=&quot;img_right&quot; src=&quot;http://www.kempley-helicopters.com/images/mech1_thumb.png&quot; style=&quot;border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; margin-top: 0px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot; title=&quot;Helicopter torque reaction&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Main Rotor&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Helicopter lift is generated by the main rotor. The rotor blades spin, cutting through the air. Sucking it in from above and directing it downwards to produce thrust. Each blade must be able to hold the weight of the helicopter equally. So if the helicopter was to weigh 2000 kg, each blade needs to be able to support 1000 kg. Multiplied by the respective gravitational factor. Depending on the specific style of flight. Pulling a tight turn, generating 2G, would mean the helicopter now effectively weighs 4000kg.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk74SYX16H9l588FiBQJJ2HwJJN_d9jitDHNTJczh54IvKv99rYkKNvsyDDAOJIW6SxT2gV4pR6ttZUZzIaluoUaidD0-48bdufPyvU7N2VcjpyngXYePNgvK8TtEKIXbvJr9UYNHqiVY/s1600/helicopter_descrption.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;287&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk74SYX16H9l588FiBQJJ2HwJJN_d9jitDHNTJczh54IvKv99rYkKNvsyDDAOJIW6SxT2gV4pR6ttZUZzIaluoUaidD0-48bdufPyvU7N2VcjpyngXYePNgvK8TtEKIXbvJr9UYNHqiVY/s320/helicopter_descrption.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Tail Rotor&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The tail rotor is very important, when the main rotor spins, it causes a torque reaction. The helicopter will want to spin in the opposite direction to the blades. A rear tail rotor will counteract this, also known as a anti-torque unit. Derived directly from newtons third law, the tail rotor will cancel out the torque generated by the main rotor.&lt;br /&gt;
&lt;br /&gt;
Another technology is NOTAR, NO TAil Rotor. This directs a jet of air down the tail shaft, and mechanics at the end of the boom divert it to the required direction to keep the helicopter stationary. One main advantage is how silent the system is, making for a very quiet helicopter.</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/2092969603757660682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/helicopters-have-very-complex-mechanics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/2092969603757660682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/2092969603757660682'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/helicopters-have-very-complex-mechanics.html' title='Helicopters'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk74SYX16H9l588FiBQJJ2HwJJN_d9jitDHNTJczh54IvKv99rYkKNvsyDDAOJIW6SxT2gV4pR6ttZUZzIaluoUaidD0-48bdufPyvU7N2VcjpyngXYePNgvK8TtEKIXbvJr9UYNHqiVY/s72-c/helicopter_descrption.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-4771734757473858247</id><published>2012-04-11T13:59:00.000+10:00</published><updated>2012-04-11T13:59:25.370+10:00</updated><title type='text'>How Servo Works!</title><content type='html'>Servos are controlled by sending them a pulse of variable width. The control wire is used to send this pulse. The parameters for this pulse are that it has a minimum pulse, a maximum pulse, and a repetition rate. Given the rotation constraints of the servo, neutral is defined to be the position where the servo has exactly the same amount of potential rotation in the clockwise direction as it does in the counter clockwise direction. It is important to note that different servos will have different constraints on their rotation but they all have a neutral position, and that position is always around 1.5 milliseconds (ms).&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8b-9VXSDmu42zKF0ibCaOqKm8HC8i1byNJoag5-D3AeMZBVjBeo4W-prO2jKv_PWkpNbOQ5i3A13posLL6odU03L_2VXG2QyvY5_h5DETx4P2LBzGRsLnxgVfsB_bIYgR4qBY-ixuXrk/s1600/Servo_1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8b-9VXSDmu42zKF0ibCaOqKm8HC8i1byNJoag5-D3AeMZBVjBeo4W-prO2jKv_PWkpNbOQ5i3A13posLL6odU03L_2VXG2QyvY5_h5DETx4P2LBzGRsLnxgVfsB_bIYgR4qBY-ixuXrk/s320/Servo_1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The angle is determined by the duration of a pulse that is applied to the control wire. This is called Pulse width Modulation. The servo expects to see a pulse every 20 ms. The length of the pulse will determine how far the motor turns. For example, a 1.5 ms pulse will make the motor turn to the 90 degree position (neutral position).&lt;br /&gt;
&lt;br /&gt;
     When these servos are commanded to move they will move to the position and hold that position. If an external force pushes against the servo while the servo is holding a position, the servo will resist from moving out of that position. The maximum amount of force the servo can exert is the torque rating of the servo. Servos will not hold their position forever though; the position pulse must be repeated to instruct the servo to stay in position.&lt;br /&gt;
&lt;br /&gt;
     When a pulse is sent to a servo that is less than 1.5 ms the servo rotates to a position and holds its output shaft some number of degrees counterclockwise from the neutral point. When the pulse is wider than 1.5 ms the opposite occurs. The minimal width and the maximum width of pulse that will command the servo to turn to a valid position are functions of each servo. Different brands, and even different servos of the same brand, will have different maximum and minimums. Generally the minimum pulse will be about 1 ms wide and the maximum pulse will be 2 ms wide.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWcW2JXLrtj6md_68ioJKHPVNcrXDnQJgGaM4aSVlwLu5qx5FcVZoAUSzolD_LB8WsccGRDysQv2mP9_4PIHkuJL0dXRt_5Weaeow1Wycq8YqyxGRNLQW2e4LqFtndZGNW8dZqmEtCiZ0/s1600/Servo_2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;65&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWcW2JXLrtj6md_68ioJKHPVNcrXDnQJgGaM4aSVlwLu5qx5FcVZoAUSzolD_LB8WsccGRDysQv2mP9_4PIHkuJL0dXRt_5Weaeow1Wycq8YqyxGRNLQW2e4LqFtndZGNW8dZqmEtCiZ0/s320/Servo_2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Another parameter that varies from servo to servo is the turn rate. This is the time it takes from the servo to change from one position to another. The worst case turning time is when the servo is holding at the minimum rotation and it is commanded to go to maximum rotation. This can take several seconds on very high torque servos.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimbWCydccSJQEWlkwDonblJMfycoRlelTyzP-KCjjpQahWK8A62gPeU9x7VD8UtZaGFryRsHmEtlyxPombTug1gYmX6s2gswUjGTKOV8zsNFmiY12WMZzG96aC7lQrbw67cuNJ1YKbtL4/s1600/Servo_3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;166&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimbWCydccSJQEWlkwDonblJMfycoRlelTyzP-KCjjpQahWK8A62gPeU9x7VD8UtZaGFryRsHmEtlyxPombTug1gYmX6s2gswUjGTKOV8zsNFmiY12WMZzG96aC7lQrbw67cuNJ1YKbtL4/s320/Servo_3.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/4771734757473858247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/how-servo-works.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/4771734757473858247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/4771734757473858247'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/how-servo-works.html' title='How Servo Works!'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8b-9VXSDmu42zKF0ibCaOqKm8HC8i1byNJoag5-D3AeMZBVjBeo4W-prO2jKv_PWkpNbOQ5i3A13posLL6odU03L_2VXG2QyvY5_h5DETx4P2LBzGRsLnxgVfsB_bIYgR4qBY-ixuXrk/s72-c/Servo_1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-6180612040122544500</id><published>2012-04-10T13:31:00.000+10:00</published><updated>2012-04-10T13:31:42.238+10:00</updated><title type='text'>LiPo Batteries Guide and Regulator</title><content type='html'>&lt;b&gt;What is a LiPo?&lt;/b&gt;&lt;br /&gt;
LiPo or Lithium Polymer is a type of battery chemistry.  These batteries are excellent for use in an application such as remote control aircraft due to their high energy to weight ratio.  However, they do require a little special care to make sure that they always work as expected and to minimise risk of battery failure.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivu2BwOTbshZNQqAFlx3T2eu5rrE1XsUIO9RPqBQ23PBOdfLJCSLBkpewkqvMmPpQKrbTFL50lbILDQ31Yck7ipkINnkDbr82uWff3Ahl2Fwp1YJ9H4M8s4i_pAEkCjbzUarcXT4DUYHw/s1600/30C+2100-LiPo.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;207&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivu2BwOTbshZNQqAFlx3T2eu5rrE1XsUIO9RPqBQ23PBOdfLJCSLBkpewkqvMmPpQKrbTFL50lbILDQ31Yck7ipkINnkDbr82uWff3Ahl2Fwp1YJ9H4M8s4i_pAEkCjbzUarcXT4DUYHw/s320/30C+2100-LiPo.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
LiPos can be dangerous if overcharged, or over-discharged.  Lithium burns very quickly when exposed to air, so fast that it looks like the lithium is exploding.  &lt;br /&gt;
&lt;br /&gt;
Nominal or resting voltage - 3.7v/cell (volts per cell)&lt;br /&gt;
Charged or peak voltage - 4.2v/cell&lt;br /&gt;
&lt;br /&gt;
Charged or peak voltage is the maximum voltage the battery pack will store.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Naming convention&lt;/b&gt;&lt;br /&gt;
A battery is a collection of cells.  All batteries have a naming convention which is designed to help the user identify how many cells the battery is made of and in what configuration they are. every cell has a capacity (stored energy), measured in mAh (milliamp hours) and a voltage, measured in volts.  Cells within a battery can be connected in series or parallel.  Please note that all the cells must be exactly alike.&lt;br /&gt;
&lt;br /&gt;
Series connection - add the voltages of each cell together while the capacity of the whole battery remains the same as for 1 cell.&lt;br /&gt;
Parallel connection - add the capacities of each cell together while the voltage of the whole battery remains the same as for 1 cell.&lt;br /&gt;
&lt;br /&gt;
For example, lets say we have a bunch of 1000mAh 3.7v cells.&lt;br /&gt;
&lt;br /&gt;
If we connect 3 cells in series, the battery would be a 11.1v (3.7v + 3.7v + 3.7v) 1000mAh battery.&lt;br /&gt;
If we connect 3 cells in parallel, the battery would be a 3.7v 3000mAh (1000mAh + 1000mAh + 1000mAh) battery.&lt;br /&gt;
&lt;br /&gt;
Now, with regard to the naming convention, the battery is named according to the following: the voltage of the whole battery, the capacity in mAh, the number of cells in series and then number of cell series in the battery.&lt;br /&gt;
&lt;br /&gt;
The above 2 examples would be named as follows:&lt;br /&gt;
&lt;br /&gt;
3s1p 11.1v 1000mAh - a battery made up of 3x 1000mAh cells connected in series.&lt;br /&gt;
1s3p 3.7v 3000mAh  - a battery made up of 3x 1000mAh cells connected in parallel.&lt;br /&gt;
&lt;br /&gt;
A 14.8v 2200mAh 4s1p LiPo battery would mean that the battery is made up of 4x 2200mAh 3.7v LiPo cells connected in series.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;C rating - what is it and what does it mean?&lt;/b&gt;&lt;br /&gt;
The C rating, or discharge rating of the pack is a very important concept to understand if you&#39;re going to be doing anything with LiPo batteries.  A LiPo pack should have a C rating on the label, anywhere from 10C to 40C typically. The C rating is the maximum safe discharge current, measured in Amps, that the battery is capable of delivering.  The C is simply the capacity of the pack, and the rating is given with a precursor number, ie 20C.&lt;br /&gt;
&lt;br /&gt;
Lets take the battery pack above, the 14.8v 2200mAh 4s1p LiPo.  If it was a 20C pack, then the maximum discharge in amps would be calculated as follows: 20x2200 = 44000mAh.  To get the value in amps you divide the answer by 1000 as 1Amp = 1000milliAmps.  44000/1000 = 44Amps.  This pack&#39;s maximum discharge current is 44A.  Any setup which draws more than that current will risk damaging the battery.&lt;br /&gt;
&lt;br /&gt;
As a general rule, at ChargedRC we always recommend that you set up your power system to pull no more than 80% of the max charge rate at full power.  This leaves you with a bit of headroom just in case.  If your pack&#39;s max discharge rate was 50A, aim for your setup to pull 40A at full power on the ground.  If you need more amps (and we all do ;) ), consider a higher C rated battery pack, or a pack of larger capacity.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Charging&lt;/b&gt;&lt;br /&gt;
Please charge your LiPo battery only on a charger specifically designed for LiPo batteries.  Those chargers will have a special LiPo charging mode.  There may also be just a normal charge mode, as well as a balance charge mode.  Please check your LiPo before you charge it.  Look for signs of swelling of the individual cells, any discolouration or if any part of the pack is warm.  If your pack has any of those characteristics, please DO NOT charge or discharge it.&lt;br /&gt;
&lt;br /&gt;
Now that the naming convention has been described, please make sure of the following when charging:&lt;br /&gt;
&lt;br /&gt;
When you plug your battery in to charge and begin charging, wait and make sure that the voltage on the display screen of the charger does not exceed whatever the pack voltage is.  Ie if you have a 4cell (4s) pack, the voltage should not exceed 16.8v (4.2v x 4).  &lt;br /&gt;
If the charger is capable of doing a balance charge (charging all the cells in the pack individually and at the same time), make sure that all the cells are around the same voltage&lt;br /&gt;
Never leave a charging battery unattended&lt;br /&gt;
Always charge your battery on a non-flammable surface or in a container specially designed for charging LiPo batteries&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Charge Rate&lt;/b&gt;&lt;br /&gt;
A lot of people ask us what charge rate to use for their LiPo. Charging your LiPo at the correct rate is essential to ensuring the life and quality of the pack, as well as charging it as fast as possible, but within its limits.  The answer though is very simple.  Unless otherwise stated, a battery&#39;s charge rate is simply 1C.&lt;br /&gt;
&lt;br /&gt;
If you had a 2200mAh battery, the charge rate would be 2.2A (2200/1000).&lt;br /&gt;
If you had a 5000mAh battery, the charge rate would be 5A.&lt;br /&gt;
&lt;br /&gt;
We hope that this guide gives you a better understanding of LiPo batteries. If you have any questions, please jump on our forum, or contact us for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;I crashed :(  Is my battery still OK?&lt;/b&gt;&lt;br /&gt;
Everyone crashes, we&#39;ve all done it and it&#39;s a part of the hobby. If you happen to crash an aircraft which is powered with a LiPo, please approach the crash site carefully. Disconnect the battery from the ESC very carefully, and try not to touch the pack too much.  If you can, move the pack somewhere out of the way and keep an eye on it for at least 30 minutes.  Watch for swelling or softness on the battery surface and if any part of it heats up.  As explained above, Lithium reacts very violently with air.  The pack may have somehow been punctured in the crash.  If the puncture is very small, it can take quite a while for air to work its way into the pack. If the pack is swelled or puffed DO NOT touch the pack directly.  The battery is definitely damaged and you should follow the disposal instructions.  Also, if the pack is deformed or damaged in any way PLEASE do not use it again and dispose of it carefully as per the instructions below.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;LiPo battery disposal&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In order to properly dispose of a LiPo battery, you must first discharge it as low as possible. Please, if the battery has been damaged DO NOT discharge it, just proceed with the next step&lt;br /&gt;
Fill a bucket or some plastic container (NO METAL) with water, and add salt.  Add approximately 1/4 cup of salt for every litre of water.  The container may have a lid but must not be air tight&lt;br /&gt;
Immerse the battery in the salt water fully.  Make sure that even the power connectors are submerged.  Leave the battery for at least 2 weeks.&lt;br /&gt;
After 2 weeks, remove the battery, wrap in newspaper and dispose of in rubbish bin like normal rubbish.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Battery balancing&lt;/b&gt;&lt;br /&gt;
Battery balancing and battery redistribution refer to techniques that maximize a battery&#39;s capacity to make all of its energy available for use and increase the battery&#39;s lifetime. Balancers are often found in Lithium ion battery packs. Typically, the individual cells in a battery have somewhat different capacities and may be at different levels of State Of Charge (SOC). Without redistribution, discharging must stop when the cell with the lowest capacity is empty (even though other cells are still not empty); this limits the energy that can be taken from and returned to the battery.&lt;br /&gt;
&lt;br /&gt;
Without balancing, the cell of smallest capacity is a “weak point”, it can be easily overcharged or over-discharged while cells with higher capacity undergo only partial cycle. For the higher capacity cells to undergo full charge/discharge cycle of the largest amplitude, balancer should “protect” the weaker cells; so that in a balanced battery, the cell with the largest capacity can be filled without overcharging any other (i. e. weaker, smaller) cell, and it can be emptied without over-discharging any other cell. Battery balancing is done by transferring energy from or to individual cells, until the SOC of the cell with the lowest capacity is equal to the battery&#39;s SOC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Battery Regulators&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes we need voltage regulators with batteries (A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level). One of the useful battery regulator is Turnigy HV SBEC 5A switch regulator (input 8-42V, output 5V or 6V Select-able).  &lt;a href=&quot;http://www.hobbyking.com/hobbyking/store/__18521__Turnigy_HV_SBEC_5A_Switch_Regulator_8_42V_input_.html&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx0VwdW9KJwNK9MljmbJOoQyaSEvsZOL6AYuzY0cRd_6oAkDvABRiTVX2RJfhfXCNwIsGCBDzG_HoCin_fO7SLoQ0uIJhsGr6XZTGpzyG4q7CJTtM1_ECItXl5gcyUSTknYbN5Eeer0QQ/s1600/18521.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;186&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx0VwdW9KJwNK9MljmbJOoQyaSEvsZOL6AYuzY0cRd_6oAkDvABRiTVX2RJfhfXCNwIsGCBDzG_HoCin_fO7SLoQ0uIJhsGr6XZTGpzyG4q7CJTtM1_ECItXl5gcyUSTknYbN5Eeer0QQ/s320/18521.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/6180612040122544500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/lipo-batteries-guide-and-regulator.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6180612040122544500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/6180612040122544500'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/lipo-batteries-guide-and-regulator.html' title='LiPo Batteries Guide and Regulator'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivu2BwOTbshZNQqAFlx3T2eu5rrE1XsUIO9RPqBQ23PBOdfLJCSLBkpewkqvMmPpQKrbTFL50lbILDQ31Yck7ipkINnkDbr82uWff3Ahl2Fwp1YJ9H4M8s4i_pAEkCjbzUarcXT4DUYHw/s72-c/30C+2100-LiPo.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-1100299385470036673</id><published>2012-04-10T12:31:00.001+10:00</published><updated>2012-04-10T12:39:47.840+10:00</updated><title type='text'>Align 600 -Servo Configuration (Aileron, Rudder, Elevator)</title><content type='html'>Download the picture for pictorial description.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHfFp6UCDjdTKV-WS9U0-bVPtr0IHQY0RjflrdskpriCvqjc_TVJKID2AkIrkq-FJQb18uAIi0h_c7URICpOwsLcXAqTX2ymCkwl823MXNp6v9OIgG4VRumTckradubZ2Jp3F_Fr68K_o/s1600/T-Rex+600+servo+illustration.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;115&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHfFp6UCDjdTKV-WS9U0-bVPtr0IHQY0RjflrdskpriCvqjc_TVJKID2AkIrkq-FJQb18uAIi0h_c7URICpOwsLcXAqTX2ymCkwl823MXNp6v9OIgG4VRumTckradubZ2Jp3F_Fr68K_o/s320/T-Rex+600+servo+illustration.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/1100299385470036673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/align-600-servo-configuration-aileron.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/1100299385470036673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/1100299385470036673'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/align-600-servo-configuration-aileron.html' title='Align 600 -Servo Configuration (Aileron, Rudder, Elevator)'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHfFp6UCDjdTKV-WS9U0-bVPtr0IHQY0RjflrdskpriCvqjc_TVJKID2AkIrkq-FJQb18uAIi0h_c7URICpOwsLcXAqTX2ymCkwl823MXNp6v9OIgG4VRumTckradubZ2Jp3F_Fr68K_o/s72-c/T-Rex+600+servo+illustration.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-8230870344498523256</id><published>2012-04-10T12:12:00.000+10:00</published><updated>2012-04-10T12:12:52.320+10:00</updated><title type='text'>Servos Connection to Receiver (Spectrum AR7000) - DX7</title><content type='html'>Many people get confused when trying to connect the Radio receiver in their electric powered helicopters, and this is quite understandable as the documentation is usually less than helpful to those that do not understood it all.&lt;br /&gt;
&lt;br /&gt;
So this Tip and Trick will try to cut through the jargon and let you now how to work out the connections on most types of radios.&lt;br /&gt;
&lt;br /&gt;
One of the first areas people don&#39;t understand is how there are TWO AILERON SERVOS.  Well, one one side they are called AILERON, but the other side is not called that at all, it is commonly known as PITCH.  However, very few RX have a PITCH connection, and you need to use the AUX1 connection.&lt;br /&gt;
&lt;br /&gt;
Also, some RX units have names for the connections, others use numbers alone, which is even harder to understand.&lt;br /&gt;
&lt;br /&gt;
So let&#39;s look first at a very common 6 channel receiver, the one provided by ESKY for the Belt CP. You can see below that it uses numbering, starting from 1 and going through to 6 with an additional B connection at the far end.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdccUJc0jYPKGyZV4AFZGyDYF8sxtDedVJT6WFaI3Q1OXvqUqMDKsVVqPdmvQFz-l5HKJ4kH5Sxx8a0IJ6lPqGW4T2jo29g6b4maB-s6AK44gIBKDWrFFH0ohKPqtsFUZbkpKwV6FLlz0/s1600/Pu51282.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdccUJc0jYPKGyZV4AFZGyDYF8sxtDedVJT6WFaI3Q1OXvqUqMDKsVVqPdmvQFz-l5HKJ4kH5Sxx8a0IJ6lPqGW4T2jo29g6b4maB-s6AK44gIBKDWrFFH0ohKPqtsFUZbkpKwV6FLlz0/s320/Pu51282.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The Esky 6 channel Rx, which uses numbering to identify the channels.  NB - MOST RX&#39;s use the same numbers to identify the same channels.&lt;br /&gt;
In this case we have Channels 1-6 + a B Channel&lt;br /&gt;
&lt;br /&gt;
This is an older NEC 7 channel receiver, and you may have already noticed that it has a Batter channel at the left end, so yes, you were right, that is exactly what the &quot;B&quot; means on the Esky RX. &lt;br /&gt;
So, by looking at the NEC RX (above right), we can see quite easily what the various channels re for on BOTH RX&#39;s.&lt;br /&gt;
     &lt;br /&gt;
Channel 1&lt;br /&gt;
Channel 2&lt;br /&gt;
Channel 3&lt;br /&gt;
Channel 4&lt;br /&gt;
Channel 5&lt;br /&gt;
Channel 6&lt;br /&gt;
Channel 7&lt;br /&gt;
Channel B&lt;br /&gt;
    Throttle&lt;br /&gt;
Aileron (NB - maybe the left or right servo)&lt;br /&gt;
Elevator&lt;br /&gt;
Rudder&lt;br /&gt;
GEAR (often used for gyro control in helicopters)&lt;br /&gt;
Auxiliary 1 (Used as Pitch, or in other words, the OTHER Aileron servo)&lt;br /&gt;
Auxiliary 2 (Spare for helicopters)&lt;br /&gt;
Battery - only used if you use an board 4.8V battery pack to power the Radio equipment&lt;br /&gt;
  &lt;br /&gt;
So, now you can hopefully see the correlation between numbers and actual words.  Almost ALL RX&#39;s will use this same channel layout on their RX&#39;s.&lt;br /&gt;
Equally important to know about is the way around the connections should be made. The servo wires have either Red, Black and white wires, or Orange, Brown and yellow which corresponds to the previous wiring colour directly. In both cases, the white or yellow leads are the SIGNAL lead.&lt;br /&gt;
&lt;br /&gt;
All connections to the RX MUST HAVE THE CONNECTIONS THE SAME WAY AROUND, so that the white lead is always the same side.  Although not guaranteed,  most RX&#39;s expect the white signal lead to be on the logical top of each connection&lt;br /&gt;
&lt;br /&gt;
The Black and red wires are the power, and in fact, these two pins are connected right across the RX internally, so as long as you get the wire from the ESC the right way around, ALL other connectors will immediately have power on them.&lt;br /&gt;
&lt;br /&gt;
So, as far as electric powered helicopters are concerned : &lt;br /&gt;
&lt;br /&gt;
THROTTLE channel is where you plug the 3 wire lead in from the ESC (Electronic Speed Controller).&lt;br /&gt;
&lt;br /&gt;
AILERON Channel is where one or other of the aileron servos are connected. This can vary, so it is often a matter of trial and error to see which is correct for which servo.  If the swash plate moves the wrong way when you move the cyclic stick left and right, switch the connections between channel 2 and channel 6.&lt;br /&gt;
&lt;br /&gt;
ELEVATOR Channel is where you plug in the 3 wire lead from the elevator servo&lt;br /&gt;
&lt;br /&gt;
RUDDER Channel is where you plug in the 3 wire lead from the rudder servo, or more commonly, the lead from the gyro, and then connecting the rudder servo to the connector provided on the gyro so that the gyro is in circuit with the rudder servo.&lt;br /&gt;
&lt;br /&gt;
GEAR Channel is of no real use to many helicopters, and is almost universally used to control the gain of the gyro, which switches it between RATE mode and HH (Heading Hold) modes. Quite often you will find this is just a single wire connection that comes from the gyro, and the wire must go into the signal channel in the RX.  You can use a different channel on computer radios if you wish by programming your selection in the TX.&lt;br /&gt;
&lt;br /&gt;
AUXILIARY 1 handles the OTHER AILERON Channel, together with Channel 1.&lt;br /&gt;
&lt;br /&gt;
AUXILIARY 2 is a usually a spare Channel if you have it.  Some expensive radios may have even more AUX Channels, but these are always programmed for use in the Radio TX.&lt;br /&gt;
&lt;br /&gt;
BATTERY is rarely used with electric helicopters, as we use the main LIPO battery for all our power requirements via the ESC.  However, those flying nitro and gasser helicopters will use this to provide the power to the radio system and servos as they will not have a Lipo or an ESC.</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/8230870344498523256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/servos-connection-to-receiver-spectrum.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/8230870344498523256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/8230870344498523256'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2012/04/servos-connection-to-receiver-spectrum.html' title='Servos Connection to Receiver (Spectrum AR7000) - DX7'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdccUJc0jYPKGyZV4AFZGyDYF8sxtDedVJT6WFaI3Q1OXvqUqMDKsVVqPdmvQFz-l5HKJ4kH5Sxx8a0IJ6lPqGW4T2jo29g6b4maB-s6AK44gIBKDWrFFH0ohKPqtsFUZbkpKwV6FLlz0/s72-c/Pu51282.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2866652313268705224.post-279223377803214239</id><published>2011-08-05T14:59:00.000+10:00</published><updated>2011-08-05T14:59:54.820+10:00</updated><title type='text'>A headset that reads your brainwaves</title><content type='html'>Tan Le, a Vietnamese-Australian telecommunications entrepreneur, is president and co-founder of  &lt;a href=&quot;http://www.emotiv.com/apps/epoc/299/&quot;&gt;Emotiv Systems &lt;/a&gt;, a neuro-engineering company that developed a breakthrough interface technology for digital media, taking inputs directly from the brain. Tan Le&#39;s vision is to revolutionize human-computer input in the same way the graphic user interface did 20 years ago&lt;br /&gt;
&lt;br /&gt;
Based on the latest developments in neuro-technology, has developed a revolutionary new personal interface for human computer interaction. The Emotiv EPOC wireless neuro headset captures, understand and processes the thoughts in your brain to carry out actions on your PC. The real life application possibilities across industries like gaming, healthcare, security, market research etc has already got them partnerships with the who is who of research and investment world. Emotiv is also actively involving the developer community by offering them software kit to create applications that can be controlled by your mind.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;inline embed embed-media&quot;&gt; &lt;br /&gt;
&lt;iframe width=&quot;460&quot; height=&quot;287&quot; src=&quot;http://www.youtube.com/embed/7utG3NqhBoU?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;span class=&quot;caption&quot;&gt; &lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;
Tan Le gives live demonstration of the headset at TEDx platform:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;inline embed embed-media&quot;&gt; &lt;br /&gt;
&lt;iframe width=&quot;460&quot; height=&quot;287&quot; src=&quot;http://www.youtube.com/embed/78qX1r4lk68?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;span class=&quot;caption&quot;&gt; &lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://usmanqayyum.blogspot.com/feeds/279223377803214239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://usmanqayyum.blogspot.com/2011/08/headset-that-reads-your-brainwaves.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/279223377803214239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2866652313268705224/posts/default/279223377803214239'/><link rel='alternate' type='text/html' href='http://usmanqayyum.blogspot.com/2011/08/headset-that-reads-your-brainwaves.html' title='A headset that reads your brainwaves'/><author><name>Usman Qayyum</name><uri>http://www.blogger.com/profile/08561250883860100154</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/7utG3NqhBoU/default.jpg" height="72" width="72"/><thr:total>1</thr:total></entry></feed>