<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Starlino Electronics</title>
	<atom:link href="http://www.starlino.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.starlino.com</link>
	<description>Electronics and Robotics Projects, Tutorials, Reviews, Experiments</description>
	<lastBuildDate>Sun, 08 Apr 2012 02:07:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Add a simple mechanical fine tune control to any bench instrument without voiding warranty</title>
		<link>http://www.starlino.com/add-a-simple-mechanical-fine-tune-control-to-any-bench-instrument-without-voiding-warranty.html</link>
		<comments>http://www.starlino.com/add-a-simple-mechanical-fine-tune-control-to-any-bench-instrument-without-voiding-warranty.html#comments</comments>
		<pubDate>Fri, 11 Nov 2011 00:11:19 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[Fun Projects]]></category>
		<category><![CDATA[Tricks and Tips]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[fine-tune]]></category>
		<category><![CDATA[power supply]]></category>

		<guid isPermaLink="false">http://www.starlino.com/add-a-simple-mechanical-fine-tune-control-to-any-bench-instrument-without-voiding-warranty.html</guid>
		<description><![CDATA[I was looking for a way to make the adjustment for my power supply more precise and easier to dial let&#8217;s say to a voltage like 3.3 , but without a built-in fine tune potentiometer this was difficult so I found one of those foam rings that are always on top of a CD box, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/image.png"><img alt="image" border="0" height="461" src="http://www.starlino.com/wp-content/uploads/2011/11/image_thumb.png" style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" width="614" /></a></p>
<p>I was looking for a way to make the adjustment for my power supply more precise and easier to dial let&rsquo;s say to a voltage like 3.3 , but without a built-in fine tune potentiometer this was difficult so I found one of those foam rings that are always on top of a CD box, and it fit perfectly over the dial making it bigger and now easier to dial any voltage. This works based on the &ldquo;gears&rdquo; principle&nbsp; &#8211; with the larger &ldquo;gear&rdquo; attached , finger has to travel a longer distance to make same change, thus easier to dial anything in between that was before harder. </p>
<p>Plain and simple, but just thought to share the non-warranty voiding trick &ndash; acceptable choice if you can&rsquo;t really open up the power supply and add a new potentiometer in series with the main one.&nbsp; I am also glad I finally found a use for those CD foam rings <img alt="Smile" class="wlEmoticon wlEmoticon-smile" src="http://www.starlino.com/wp-content/uploads/2011/11/wlEmoticon-smile.png" style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" /> If you&rsquo;re curious what power supply it is on the picture, it is a Tenma budget 10A linear power supply works well except the above mentioned lack of fine-tune dial.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/add-a-simple-mechanical-fine-tune-control-to-any-bench-instrument-without-voiding-warranty.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some (Free!) Feedback for TI MSP430 LaunchPad&#8217;s Development and Marketing Team</title>
		<link>http://www.starlino.com/launchpad_feedback.html</link>
		<comments>http://www.starlino.com/launchpad_feedback.html#comments</comments>
		<pubDate>Tue, 18 Oct 2011 00:54:47 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[News and Discussions]]></category>
		<category><![CDATA[launchpad ti mcu msp430]]></category>

		<guid isPermaLink="false">http://www.starlino.com/some-free-feedback-for-ti-msp430-launchpads-development-and-marketing-team.html</guid>
		<description><![CDATA[I finally got a minute to play with the MSP430 LaunchPad Kit I received, well almost for free from TI and immediately got some feedback to share with the development and marketing team. First overall I think Launchpad is a great product and I am looking forward to seeing it improve, secondly my understanding is [...]]]></description>
			<content:encoded><![CDATA[<div class="post-content">
<p>I finally got a minute to play with the MSP430 LaunchPad Kit I received, well almost for free from TI and immediately got some feedback to share with the development and marketing team.</p>
<p>First overall I think Launchpad is a great product and I am looking forward to seeing it improve, secondly my understanding is that its targeted market is starting engineers , hobbyist and alike &hellip; and I am speaking from that perspective.</p>
<p>I know you might hate me for this and maybe this is a banned word in your company but you should really look at <b>Arduino </b> and try to understand why it became so popular, in a nutshell let me break it down:</p>
<p>- the secret is in details, you might have a better product at a better price but if you can&rsquo;t present it correctly it will not catch up with developers<br />
		- simplicity , simplicity , simplicity, too much information is as bad as no information, getting started manual DOES NOT have to be 182 pages long, half of which are telling about the entire TI lineup and various clock setup , get straight to the point show us the fun part !<br />
		- people don&rsquo;t want so many options, so you must make choices for them , for example &ndash; choose a fixed clock mode (crystal or internal clock) and make it standard, let advanced users hack it if necessary, this will also make Launchpad programs more portable if you choose and &ldquo;official&rdquo; operating clock speed.<br />
		- make a free compiler and IDE : it makes no sense to have a paid compiler and charge a developer &ldquo;pennies&rdquo; compared to what that developer can bring you in hardware sales if he uses your chips , instead of spending money on giveaways and free lunches at trade shows , etc, just give the developers a free unlimited IDE and compiler, best promotion you can make and best boost in hardware sales for the future ! It is no coincidence Arduino was based on AVR the only major MCU manufacture to have multi-platform free compilers and IDE (both Microchips and TI&rsquo;s free editions are limited and crippled).<br />
		- give free and no &ldquo;string attached&rdquo; MCU samples as Microchip has, same reason as above , you can&rsquo;t cook dinner with MCUs if someone is ordering them they are an engineer and they might make a product that will use millions of your chips in the future, if you don&rsquo;t make samples easy and fast , he might choose Microchip because today he is a student and he is broke, call it fate or whatever &ndash; unfair but fair ..<br />
		- in coding hide all the ugly details like the clock setup , in worst case scenario make a &ldquo;launchpad&rdquo; header file to contain all the technical stuff, if you make the &ldquo;blinking led&rdquo; program a one or two line program than you know you&rsquo;re on the right way !<br />
		- make changing pin direction (output / input) prettier and more straightforward and avoid the | (OR) bit assignments, in worst case you can use some macros (as I explain here <a href="../port_macro.html">http://www.starlino.com/port_macro.html</a>) , this style of assignments is confusing for beginners</p>
<p>Well that&rsquo;s it for now, i might add more ideas &hellip; so check back or contact me directly if you&rsquo;d like more feedback.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/launchpad_feedback.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Arduino &#8211; to clone or not to clone ?</title>
		<link>http://www.starlino.com/arduino-to-clone-or-not-to-clone.html</link>
		<comments>http://www.starlino.com/arduino-to-clone-or-not-to-clone.html#comments</comments>
		<pubDate>Wed, 27 Jul 2011 03:18:02 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[News and Discussions]]></category>
		<category><![CDATA[arduino microchip ti]]></category>

		<guid isPermaLink="false">http://www.starlino.com/arduino-to-clone-or-not-to-clone.html</guid>
		<description><![CDATA[Microchip started marketing an Arduino clone called chipKit. Is this a correct decision to clone an open source platform as opposed to Texas Instrument&#39;s decision to create it&#39;s own platform LaunchPad ? &#160; &#160; By the way the TI&#39;s platform is really cheap, I would say cheaper than components and PCB + shipping. Obviously TI [...]]]></description>
			<content:encoded><![CDATA[<p><img border="0" height="321" src="http://www.starlino.com/wp-content/uploads/2011/07/TDGL002_chipKITTM_Uno-32TM_Web.jpg" title="" width="450" /></p>
<p>Microchip started marketing an Arduino clone called <a href="http://www.microchip.com/pagehandler/en-us/chipKIT-Development-Platform.html" target="_blank">chipKit</a>. Is this a correct decision to clone an open source platform as opposed to Texas Instrument&#39;s decision to create it&#39;s own platform <a href="http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_%28MSP-EXP430G2%29" target="_blank">LaunchPad</a> ?</p>
<p>&nbsp;</p>
<p><img border="0" src="http://www.starlino.com/wp-content/uploads/2011/07/300px-LaunchPad_wireframe1.png" title="" /></p>
<p>&nbsp;</p>
<p>By the way the TI&#39;s platform is really cheap, I would say cheaper than components and PCB + shipping. Obviously TI wants more people to use it, however what it is lacking is the relaxed open-source crowd around it.</p>
<p>Is Arduino really something to follow ? What do you think ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/arduino-to-clone-or-not-to-clone.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DCM Tutorial &#8211; An Introduction to Orientation Kinematics</title>
		<link>http://www.starlino.com/dcm_tutorial.html</link>
		<comments>http://www.starlino.com/dcm_tutorial.html#comments</comments>
		<pubDate>Fri, 27 May 2011 02:15:31 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[IMU Theory and Experiments]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[Acc_Gyro]]></category>
		<category><![CDATA[dcm]]></category>
		<category><![CDATA[gyro]]></category>
		<category><![CDATA[gyroscope]]></category>
		<category><![CDATA[imu]]></category>
		<category><![CDATA[inclination]]></category>
		<category><![CDATA[kinematics]]></category>
		<category><![CDATA[mems]]></category>
		<category><![CDATA[orientation]]></category>
		<category><![CDATA[sensor]]></category>

		<guid isPermaLink="false">http://www.starlino.com/?p=226</guid>
		<description><![CDATA[Introduction This article is a continuation of my IMU Guide, 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 [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This article is a continuation of my <a href="http://www.starlino.com/imu_guide.html">IMU Guide</a>, 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 “<a href="http://www.starlino.com/imu_kalman_arduino.html">Using a 5DOF IMU</a>” 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 <a href="http://www.gadgetgangster.com/367">acc_gyro_6dof</a> sensor. </p>
<h2>Prerequisites</h2>
<p>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:   <br />Cartesian Coordinate System &#8211; <a href="http://en.wikipedia.org/wiki/Cartesian_coordinate_system">http://en.wikipedia.org/wiki/Cartesian_coordinate_system</a>    <br />Rotation &#8211; <a href="http://en.wikipedia.org/wiki/Rotation_%28mathematics%29">http://en.wikipedia.org/wiki/Rotation_%28mathematics%29</a>    <br />Vector scalar product &#8211; <a href="http://en.wikipedia.org/wiki/Dot_product">http://en.wikipedia.org/wiki/Dot_product</a>    <br />Vector cross product &#8211; <a href="http://en.wikipedia.org/wiki/Cross_product">http://en.wikipedia.org/wiki/Cross_product</a>    <br />Matrix Multiplication &#8211; <a href="http://en.wikipedia.org/wiki/Matrix_multiplication">http://en.wikipedia.org/wiki/Matrix_multiplication</a>    <br />Block Matrix &#8211; <a href="http://en.wikipedia.org/wiki/Block_matrix">http://en.wikipedia.org/wiki/Block_matrix</a>    <br />Transpose Matrix &#8211; <a href="http://en.wikipedia.org/wiki/Transpose">http://en.wikipedia.org/wiki/Transpose</a>    <br />Triple Product &#8211; <a href="http://en.wikipedia.org/wiki/Triple_product">http://en.wikipedia.org/wiki/Triple_product</a></p>
<h2>Notations</h2>
<p>Vectors are marked in <b>bold text </b>-<b> </b>so for example “<b>v</b>”<b> </b>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).</p>
<h2>Part 1. The DCM Matrix</h2>
<p>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 <i>Fig. 1</i>). Let’s also define <b>i, j, k</b> to be unity vectors co-directional with the body frame’s x, y, and z axes &#8211; in other words they are versors of Oxyz and let <b>I, J, K </b>be the versors of global frame OXYZ. </p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0024.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image002[4]" border="0" alt="clip_image002[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0024_thumb.jpg" width="279" height="249" /></a></p>
<p><i>Figure 1</i></p>
<p>Thus, by definition, expressed <b>in terms of global coordinates</b> vectors <b>I, J, K</b> can be written as:</p>
<p><b>I</b><sup>G</sup> = {1,0,0}<b><sup> T</sup></b>, <b>J</b><sup>G</sup>={0,1,0}<b><sup> T</sup></b> , <b>K</b><sup>G</sup> = {0,0,1}<b><sup> T </sup></b></p>
<p><i>Note: we use {…}<sup> T </sup>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.</i></p>
<p>And similarly, <b>in terms of body coordinates </b>vectors<b> i, j, k </b>can be written as:</p>
<p><b>i</b><sup>B</sup> = {1,0,0}<b><sup> T</sup></b>, <b>j</b><sup>B</sup>={0,1,0}<b><sup> T</sup></b> , <b>k</b><sup>B</sup> = {0,0,1}<b><sup> T</sup></b></p>
<p>Now let’s see if we can write vectors <b>i, j, k </b>in terms of global coordinates. Let’s take vector <b>i </b>as an example and write its global coordinates:</p>
<p><b>i</b><sup>G</sup> = {i<sub>x</sub><sup>G</sup> , i<sub>y</sub><sup>G </sup>, i<sub>z</sub><sup>G</sup>}<b><sup> T</sup></b></p>
<p>Again, by example let’s analyze the X coordinate i<sub>x</sub><sup>G</sup>, it’s calculated as the length of projection of the <b>i </b>vector onto the global X axis. </p>
<p>i<sub>x</sub><sup>G </sup>= |<b>i</b>| cos(X,<b>i</b>) = cos(<b>I</b>,<b>i</b>)</p>
<p>Where |<b>i</b>| is the norm (length) of the <b>i</b> unity vector and cos(<b>I</b>,<b>i</b>) is the cosine of the angle formed by the vectors <b>I</b> and <b>i</b>. Using the fact that |<b>I</b>| = 1 and |<b>i</b>| = 1 (they are unit vectors by definition). We can write:</p>
<p>i<sub>x</sub><sup>G </sup>= cos(<b>I</b>,<b>i</b>) = |<b>I</b>||<b>i</b>| cos(<b>I</b>,<b>i</b>) = <b>I.i </b></p>
<p>Where <b>I.i</b>. is the scalar (dot) product of vectors <b>I</b> and <b>i</b>. For the purpose of calculating scalar product <b>I.i </b>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: <b>I.i = I</b><sup>B</sup><b>.i</b><sup>B</sup> = <b>I</b><sup>G</sup><b>.i</b><sup>G </sup>= cos(<b>I</b><sup>B</sup><b>.i</b><sup>B</sup>) = cos(<b>I</b><sup>G</sup><b>.i</b><sup>G</sup>) , so for simplicity we’ll skip the superscript in scalar products <b>I.i , J.j , K.k </b>and in cosines<b> </b>cos(<b>I</b>,<b>i</b>), cos(<b>J</b>,<b>j</b>), cos(<b>K</b>,<b>k</b>).</p>
<p>Similarly we can show that:</p>
<p>i<sub>y</sub><sup>G</sup> = <b>J.i</b><sup> </sup>, i<sub>z</sub><sup>G</sup>=<b>K.i </b>, so now we can write vector <b>i</b> in terms of global coordinate system as:</p>
<p><b>i</b><sup>G</sup>= {<b> I.i, J.i, K.i</b>}<sup>T</sup><b> </b></p>
<p>Furthermore, similarly it can be shown that <b>j</b><sup>G</sup>= {<b> I.j, J.j, K.j</b>}<sup> T</sup><b> , k</b><sup>G</sup>= {<b> I.k, J.k, K.k</b>}<sup> T</sup>.</p>
<p>We now have a complete set of global coordinates for our body’s versors <b>i, j, k </b>and we can organize these values in a convenient matrix form:</p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0044.gif"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image004[4]" border="0" alt="clip_image004[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0044_thumb.gif" width="620" height="74" /></a><i> (Eq. 1.1)</i><i>     <br /></i></p>
<p>This matrix is called Direction Cosine Matrix for now obvious reasons &#8211; it consists of cosines of angles of all possible combinations of body and global versors. </p>
<p>The task of expressing the global frame versors <b>I</b><sup>G</sup>, <b>J</b><sup>G</sup>, <b>K</b><sup>G</sup> in body frame coordinates is symmetrical in nature and can be achieved by simply swapping the notations <b>I, J, K </b>with <b>i, j, k, </b>the results being:</p>
<p><b>I</b><sup>B</sup>= {<b> I.i, I.j, I.k</b>}<sup>T</sup><b> </b>,<b> J</b><sup>B</sup>= {<b> J.i, J.j, J.k</b>}<sup>T</sup><b> , K</b><sup>B</sup>= {<b> K.i, K.j, K.k</b>}<sup>T</sup><b> </b></p>
<p>and organized in a matrix form: </p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0064.gif"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image006[4]" border="0" alt="clip_image006[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0064_thumb.gif" width="620" height="74" /></a><i> (Eq. 1.2)</i></p>
<p>It is now easy to notice that DCM<sup>B</sup> = (DCM<sup>G</sup>)<sup>T </sup>or <sup></sup>DCM<sup>G</sup> = (DCM<sup>B</sup>)<sup>T </sup>, in other words the two matrices are translates of each other, we’ll use this important property later on. </p>
<p>Also notice that DCM<sup>B</sup>. DCM<sup>G</sup> = (DCM<sup>G</sup>)<sup>T</sup> .DCM<sup>G</sup> = DCM<sup>B</sup>. (DCM<sup>B</sup>)<sup>T</sup> = I<sub>3</sub> , where I<sub>3</sub> is the 3&#215;3 identity matrix. In other words the DCM matrices are orthogonal.</p>
<p>This can be proven by simply expanding the matrix multiplication in block matrix form:</p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0084.gif"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image008[4]" border="0" alt="clip_image008[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0084_thumb.gif" width="624" height="145" /></a><i> (Eq. 1.3)</i></p>
<p>To prove this we use such properties as for example: <b>i</b><sup>GT</sup>.<b> i</b><sup>G</sup> = |<b> i</b><sup>G</sup>||<b> i</b><sup>G</sup>|cos(0) = 1 and <b>i</b><sup>GT</sup>.<b> j</b><sup>G</sup> = 0 because (<b>i </b>and<b> j</b> are orthogonal) and so forth.</p>
<p>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). </p>
<p>Let’s consider such a vector with body coordinates:</p>
<p><b>r</b><sup>B</sup>= {<b> </b>r<sub>x</sub><sup>B</sup>, r<sub>y</sub><sup>B</sup>, r<sub>z</sub><sup>B</sup>}<sup> T</sup> and let’s try to determine its coordinates in the global frame, by using a known rotation matrix DCM<sup>G</sup>. </p>
<p>We start by doing following notation:</p>
<p><b>r</b><sup>G</sup> = { r<sub>x</sub><sup>G</sup> , r<sub>y</sub><sup>G</sup> , r<sub>z</sub><sup>G</sup> } <sup>T</sup>.</p>
<p>Now let’s tackle the first coordinate r<sub>x</sub><sup>G</sup>:</p>
<p>r<sub>x</sub><sup>G</sup> = |<b> r</b><sup>G</sup>| cos(<b>I</b><sup>G</sup>,<b>r</b><sup>G</sup>) , because r<sub>x</sub><sup>G</sup> is the projection of <b>r</b><sup>G</sup> onto X axis that is co-directional with <b>I</b><sup>G</sup>.</p>
<p>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:</p>
<p>|<b> r</b><sup>G</sup>| = |<b> r</b><sup>B</sup>| , |<b> I</b><sup>G</sup>| = |<b> I</b><sup>B</sup>| = 1 and cos(<b>I</b><sup>G</sup>,<b>r</b><sup>G</sup>) = cos(<b>I</b><sup>B</sup>,<b>r</b><sup>B</sup>), so we can use this property to write</p>
<p>r<sub>x</sub><sup>G</sup> = |<b> r</b><sup>G</sup>| cos(<b>I</b><sup>G</sup>,<b>r</b><sup>G</sup>) = |<b> I</b><sup>B</sup> ||<b> r</b><sup>B</sup>| cos(<b>I</b><sup>B</sup>,<b>r</b><sup>B</sup>) = <b>I</b><sup>B</sup>.<b> r</b><sup>B</sup> = <b>I</b><sup>B</sup>. {<b> </b>r<sub>x</sub><sup>B</sup>, r<sub>y</sub><sup>B</sup>, r<sub>z</sub><sup>B</sup>}<sup> T</sup> , by using one the two definition of the scalar product.</p>
<p>Now recall that <b>I</b><sup>B</sup>= {<b> I.i, I.j, I.k</b>}<sup>T</sup><b> </b>and by using the other definition of scalar product:</p>
<p>r<sub>x</sub><sup>G</sup> = <b>I</b><sup>B</sup>.<b> r</b><sup>B</sup> = {<b> I.i, I.j, I.k</b>}<sup>T</sup><b> . </b>{<b> </b>r<sub>x</sub><sup>B</sup>, r<sub>y</sub><sup>B</sup>, r<sub>z</sub><sup>B</sup>}<sup> T</sup> = r<sub>x</sub><sup>B</sup><b> I.i </b>+<b> </b>r<sub>y</sub><sup>B</sup><b> I.j </b>+ r<sub>z</sub><sup>B</sup><b> I.k</b></p>
<p>In same fashion it can be shown that:</p>
<p>r<sub>y</sub><sup>G</sup> = r<sub>x</sub><sup>B</sup><b> J.i </b>+<b> </b>r<sub>y</sub><sup>B</sup><b> J.j </b>+ r<sub>z</sub><sup>B</sup><b> J.k     <br /></b>r<sub>z</sub><sup>G</sup> = r<sub>x</sub><sup>B</sup><b> K.i </b>+<b> </b>r<sub>y</sub><sup>B</sup><b> K.j </b>+ r<sub>z</sub><sup>B</sup><b> K.k</b></p>
<p>Finally let’s write this in a more compact matrix form:</p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0104.gif"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image010[4]" border="0" alt="clip_image010[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0104_thumb.gif" width="386" height="80" /></a><i> (Eq. 1.4)</i><b></b></p>
<p><b></b></p>
<p>Thus the DCM matrix can be used to covert an arbitrary vector <b>r<sup>B</sup></b> expressed in one coordinate system B, to a rotated coordinate system G. <b></b></p>
<p>We can use similar logic to prove the reverse process:</p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0124.gif"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image012[4]" border="0" alt="clip_image012[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0124_thumb.gif" width="125" height="26" /></a><i> (Eq. 1.5)</i></p>
<p>Or we can arrive at the same conclusion by multiplying both parts in <i>(Eq. 1.4) </i>by DCM<sup>B</sup> which equals to DCM<sup>GT</sup>, and using the property that DCM<sup>GT</sup>.DCM<sup>G</sup> = I<sub>3</sub> , see (<i>Eq. 1.3)</i>:<sup></sup></p>
<p>DCM<sup>B</sup><b> r</b><sup>G</sup> = DCM<sup>B</sup> DCM<sup>G</sup><b> r</b><sup>B</sup> = DCM<sup>GT</sup> DCM<sup>G</sup><b> r</b><sup>B</sup> = I<sub>3</sub><b> r</b><sup>B </sup>= <b>r</b><sup>B</sup><b></b></p>
<h4></h4>
<h2>Part 2. Angular Velocity</h2>
<p>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 <i>(Eq. 1.4) </i>and <i>(Eq. 1.5). </i>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 <b>r </b>and define it’s coordinates at time t to be <b>r</b>(t). Now let’s consider a small time interval dt and make the following notations: <b>r</b> = <b>r</b> (t) , <b>r’</b>= <b>r</b> (t+dt) and d<b>r = r</b>’ – <b>r</b>:<sub></sub></p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0144.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image014[4]" border="0" alt="clip_image014[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0144_thumb.jpg" width="199" height="205" /></a></p>
<p><i>Figure 2</i></p>
<p>Let’s say that during a very small time interval dt → 0 the vector <b>r </b>has<b> </b>rotated about an axis co-directional with a unity vector <b>u</b><sub> </sub>by an angle dθ and ended up in the position <b>r’</b>. Since <b>u </b>is our axis of rotation it is perpendicular to the plane in which the rotation took place (the plane formed by<b> r</b> and <b>r</b>’) so <b>u </b>is orthogonal to both <b>r</b> and <b>r</b>’. There are two unity vectors that are orthogonal to the plane formed by <b>r</b> and <b>r’</b>, they are shown on the picture as <b>u </b>and <b>u’</b> since we’re still defining things we’ll choose the one that is co-directional with the cross product <b>r</b> x <b>r’</b>, following the rule of <a href="http://en.wikipedia.org/wiki/Right-hand_rule">right-handed coordinate system</a>. Thus because <b>u </b>is a unity vector |<b>u</b>| = 1 and is co-directional with <b>r</b> x <b>r’ </b>we can deduct it as follows:<b></b></p>
<p><b>u</b> =<b> </b>(<b>r</b> x <b>r</b>’) / |<b>r</b> x <b>r</b>’| =<b> </b>(<b>r</b> x <b>r</b>’) / (|<b>r</b>||<b> r</b>’|sin(dθ)) = <b></b>(<b>r</b> x<b> r</b>’) / (|<b>r</b>|<sup>2</sup> sin(dθ)) <i>(Eq. 2.1)</i><b></b></p>
<p>Since a rotation does not alter the length of a vector we used the property that|<b> r</b>’| = |<b>r</b>|. </p>
<p>The linear velocity of the vector <b>r </b>can<b> </b>be defined as the vector:</p>
<p><b>v = </b>d<b>r </b>/ dt = (<b> r</b>’ &#8211; <b>r</b>) / dt <i>(Eq. 2.2)</i></p>
<p>Please note that since our dt approaches 0 so does dθ → 0, hence the angle between vectors <b>r</b> and d<b>r </b>(let’s call it α)<b> </b>can be found from the isosceles triangle contoured by <b>r </b>, <b>r’ </b>and<b> </b>d<b>r: </b></p>
<p>α = (π – dθ) / 2 and because dθ → 0 , then α → π/2 </p>
<p>What this tells us is that <b>r </b>is perpendicular to<b> </b>d<b>r</b> when dt → 0 and hence <b>r</b> is perpendicular to <b>v</b> since <b>v</b> and d<b>r</b> are co-directional from<b> </b><i>(Eq. 2.2): </i></p>
<p><b><i>v</i></b> ⊥ r <i>(Eq. 2.21)</i> <b></b></p>
<p>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:</p>
<p><b>w </b>= (dθ/dt ) <b>u </b><i>(Eq. 2.3)</i><b></b></p>
<p>Indeed the norm of the <b>w</b> is |<b>w</b>| = dθ/dt and the direction of <b>w </b>coincides with the axis of rotation <b>u</b>. Let’s expand <i>(Eq. 2.3) </i>and try to establish a relationship with the linear velocity <b>v:</b></p>
<p>Using <i>(Eq. 2.3) </i>and<i> (Eq. 2.1)</i>:</p>
<p><b>w </b>= (dθ/dt ) <b>u </b>= (dθ/dt ) (<b>r</b> x<b> r</b>’) / (|<b>r</b>|<sup>2</sup> sin(dθ)) </p>
<p>Now note that when dt → 0, so does dθ → 0 and hence for small dθ, sin(dθ) ≈ dθ , we end up with:</p>
<p><b>w </b>= (<b>r</b> x<b> r</b>’) / (|<b>r</b>|<sup>2</sup> dt) <i>(Eq. 2.4)</i></p>
<p>Now because <b>r</b>’ = <b>r</b> + d<b>r</b> , d<b>r</b>/dt = <b>v , r </b>x <b>r = 0 </b>and using the distributive property of cross product over addition:</p>
<p><b>w </b>= (<b>r</b> x (<b>r</b> + d<b>r)</b>) / (|<b>r</b>|<sup>2</sup> dt) = (<b>r</b> x <b>r</b> + <b>r </b>x d<b>r)</b>) / (|<b>r</b>|<sup>2</sup> dt) = <b>r </b>x (d<b>r</b>/dt) / |<b>r</b>|<sup>2</sup></p>
<p>And finally:</p>
<p><b>w </b>= <b>r</b> x <b>v </b>/ |<b>r</b>|<sup>2</sup>­ <i>(Eq. 2.5)</i></p>
<p>This equation establishes a way to calculate angular velocity from a known linear velocity <b>v</b>. </p>
<p>We can easily prove the reverse equation that lets us deduct linear velocity from angular velocity:</p>
<p><b>v </b>=<b> w </b>x<b> r </b>­ <i>(Eq. 2.6)</i></p>
<p>This can be proven simply by expanding <b>w</b> from <i>(Eq. 2.5) </i>and using vector <a href="http://en.wikipedia.org/wiki/Triple_product">triple product</a> rule (<b>a </b>x <b>b</b>) x <b>c</b> = (<b>a</b>.<b>c</b>)<b>b</b> &#8211; (<b>b</b>.<b>c</b>)<b>a</b>. Also we’ll use the fact that <b>v </b>and<b> r </b>are perpendicular <i>(Eq. 2.21)</i> and thus <b>v</b>.<b>r </b>= 0</p>
<p><b>w </b>x<b> r </b>=<b> </b>(<b>r</b> x <b>v </b>/ |<b>r</b>|<sup>2</sup>­) x <b>r </b>= (<b>r</b> x <b>v) </b>x <b>r</b> / |<b>r</b>|<sup>2</sup>­ = ((<b>r</b>.<b>r</b>) <b>v</b> + (<b>v</b>.<b>r</b>)<b>r</b>) / |<b>r</b>|<sup>2</sup>­ = ( |<b>r</b>|<sup>2</sup>­ <b>v</b> + 0) |<b>r</b>|<sup>2 </sup>= <b>v</b></p>
<p>So we just proved that <i>(Eq. 2.6)</i> is true. Just to check <i>(Eq. 2.6) </i>intuitively &#8211; from <i>Figure 2 </i>indeed <b>v </b>has the direction of <b>w </b>x<b> r </b>using the right hand rule and indeed <b><i>v</i></b> ⊥ <b>r </b>and <b><i>v</i></b> ⊥ <b>w </b>because it is in the same plane with<b> r </b>and <b>r’</b>.</p>
<h4></h4>
<h2>Part 3. Gyroscopes and angular velocity vector </h2>
<p>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 <b>K </b>pointing to the zenith or vector <b>I </b>pointing North &#8211; then it would appear to an observer inside the device that these vector rotate about the device center. Let w<sub>x </sub>, w<sub>y </sub>, w<sub>z </sub>be the outputs of a gyroscope expressed in rad/s &#8211; 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: <a href="http://www.starlino.com/imu_guide.html">http://www.starlino.com/imu_guide.html</a> . If we query the gyroscope at regular, small time intervals <b>dt, </b>then what gyroscope output tells us is that during this time interval the earth rotated about gyroscope’s <i>x</i> axis by an angle of dθ<sub>x</sub> = w<sub>x</sub>dt, about <i>y</i> axis by an angle of dθ<sub>y</sub> = w<sub>y</sub>dt and about <i>z</i> axis by an angle of dθ<sub>z</sub> = w<sub>z</sub>dt. These rotations can be characterized by the angular velocity vectors: <b>w</b><sub>x<b> </b></sub>= w<sub>x</sub><b> i </b>= {w<sub>x </sub>, 0<sub> </sub>, 0<sub> </sub>}<sup>T </sup>, <b>w</b><sub>y<b> </b></sub>= w<sub>y</sub><b> j </b>= { 0<sub> </sub>, w<sub>y </sub>, 0<sub> </sub>}<sup>T</sup> , <b>w</b><sub>z<b> </b></sub>= w<sub>z</sub><b> k </b>= { 0<sub> </sub>, 0, w<sub>z </sub>}<sup>T</sup> , where <b>i,j,k </b>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 <i>(Eq. 2.6)</i>: </p>
<p>d<b>r</b><sub>1</sub> = dt <b>v</b><sub>1</sub><b> </b>= dt (<b>w</b><sub>x</sub><b> </b>x<b> r</b>) ; d<b>r</b><sub>2</sub> = dt <b>v</b><sub>2</sub><b> </b>= dt (<b>w</b><sub>y</sub><b> </b>x<b> r</b>) ; d<b>r</b><sub>3</sub> = dt <b>v</b><sub>3</sub><b> </b>= dt (<b>w</b><sub>z</sub><b> </b>x<b> r</b>) <i>. </i></p>
<p>The combined effect of these three displacements will be:</p>
<p>d<b>r </b>= d<b>r</b><sub>1 </sub>+ d<b>r</b><sub>2 </sub>+ d<b>r</b><sub>3 </sub>= dt (<b>w</b><sub>x</sub><b> </b>x<b> r </b>+ <b>w</b><sub>y</sub><b> </b>x<b> r </b>+<b> w</b><sub>z</sub><b> </b>x<b> r</b>) = dt (<b>w</b><sub>x</sub><b> </b>+ <b>w</b><sub>y</sub><b> </b>+<b> w</b><sub>z</sub>) x<b> r </b>(cross product is distributive over addition)<b></b></p>
<p>Thus the equivalent linear velocity resulting from these 3 transformations can be expressed as:</p>
<p><b>v</b> = d<b>r/</b>dt = (<b>w</b><sub>x</sub><b> </b>+ <b>w</b><sub>y</sub><b> </b>+<b> w</b><sub>z</sub>) x<b> r </b>= <b>w </b>x<b> r </b>, where we introduce <b>w</b> = <b>w</b><sub>x</sub><b> </b>+ <b>w</b><sub>y</sub><b> </b>+<b> w</b><sub>z</sub> = {w<sub>x </sub>, w<sub>y </sub>, w<sub>z </sub>}</p>
<p>Which looks exactly like <i>(Eq. 2.6) </i>and suggests that<i> </i>the combination of three <b>small</b> rotations about axes x,y,z characterized by angular rotation vectors <b>w</b><sub>x</sub><b> </b>, <b>w</b><sub>y</sub><b> </b>,<b> w</b><sub>z</sub> is equivalent to one <b>small</b> rotation characterized by angular rotation vector <b>w</b> = <b>w</b><sub>x</sub><b> </b>+ <b>w</b><sub>y</sub><b> </b>+<b> w</b><sub>z</sub> = {w<sub>x </sub>, w<sub>y </sub>, w<sub>z </sub>}. Please note that we’re stressing out that these are <b>small</b> 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 <i>(Eq. 2.6) </i>was that dt is really small, and thus the rotations dθ<i><sub> </sub></i>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<sub>x </sub>, w<sub>y </sub>, w<sub>z </sub>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.</p>
<h2>Part 4. DCM complimentary filter algorithm using 6DOF or 9DOF IMU sensors</h2>
<p>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 <b>I </b>versor points North, <b>K </b>versor points to the Zenith and thus, with these two versors fixed, the <b>J </b>versor<b> </b>will be constrained to point<b> </b>West.</p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0164.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image016[4]" border="0" alt="clip_image016[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0164_thumb.jpg" width="359" height="331" /></a></p>
<p><i>Figure 3 </i></p>
<p>Also let’s consider the body coordinate system to be attached to our IMU device (acc_gyro used as an example), </p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0184.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image018[4]" border="0" alt="clip_image018[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0184_thumb.jpg" width="257" height="175" /></a></p>
<p><i>Figure 4 </i></p>
<p>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.</p>
<p>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 <b>K</b><sup>B</sup>. If the 3 axis accelerometer output is <b>A </b>= {A<sub>x </sub>, Ay , A<sub>z</sub> } and we assume that there are no external accelerations or we have corrected them then we can estimate that <b>K</b><sup>B</sup> = -<b>A</b>. (See this IMU Guide for more clarifications <a href="http://www.starlino.com/imu_guide.html">http://www.starlino.com/imu_guide.html</a>).</p>
<p>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 <b>M </b>= {M<sub>x </sub>, My , M<sub>z</sub> }, then according to our model <b>I</b><sup>B</sup> is pointing North , thus <b>I</b><sup>B</sup> = <b>M</b>.</p>
<p>Knowing <b>I</b><sup>B</sup> and <b>K</b><sup>B</sup> allows us calculate <b>J</b><sup>B</sup> = <b>K</b><sup>B</sup> x <b>I</b><sup>B</sup>.</p>
<p>Thus an accelerometer and a magnetometer alone can give us the DCM matrix , expressed either as DCM<sup>B</sup> or DCM<sup>G </sup></p>
<p>DCM<sup>G</sup> = DCM<sup>BT</sup> = [<b>I</b><sup>B</sup>,<b> J</b><sup>B</sup>,<b> K</b><sup>B</sup>]<sup>T</sup></p>
<p>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 <b>r<sup>B</sup></b> = {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 <i>(Eq. 1.4)</i>:</p>
<p><b>r</b><sup>G</sup><b> </b>= DCM<sup>G</sup> <b>r</b><sup>B</sup></p>
<p>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.</p>
<p>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.</p>
<p>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<sup>G</sup> = DCM<sup>BT </sup>).</p>
<p>We’ll now go ahead and introduce such an algorithm.</p>
<p>We’ll work with the DCM matrix that consists of the versors of the global (earth’s) coordinate system aligned on each row:</p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0204.gif"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image020[4]" border="0" alt="clip_image020[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0204_thumb.gif" width="624" height="149" /></a></p>
<p>If we read the rows of DCM<sup>G</sup> we get the vectors <b>I</b><sup>B</sup>,<b> J</b><sup>B</sup>,<b> K</b><sup>B</sup>. We’ll work mostly with vectors <b>K</b><sup>B</sup> (that can be directly estimated by accelerometer) and vector <b>I</b><sup>B </sup>(that can be directly estimated by the magnetometer). The vector <b>J</b><sup>B </sup>is simply calculated as <b>J</b><sup>B</sup> = <b>K</b><sup>B</sup> x <b>I</b><sup>B</sup> , since it’s orthogonal to the other two vectors (remember versors are unity vectors with same direction as coordinate axes).</p>
<p>Let’s say we know the zenith vector expressed in body frame coordinates at time t<sub>0</sub> and we note it as <b>K</b><sup>B</sup><sub>0. <i></i></sub>Also let’s say we measured our gyro output and we have determined that our angular velocity is <b>w = </b>{w<sub>x </sub>, w<sub>y </sub>, w<sub>z </sub>}. 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 <b>K</b><sup>B</sup><sub>1G </sub>. And we find it using <i>(Eq. 2.6)</i>:<i></i></p>
<p><b>K</b><sup>B</sup><sub>1G</sub> ≈ <b>K</b><sup>B</sup><sub>0</sub> + dt<b> v </b>= <b>K</b><sup>B</sup><sub>0</sub> + dt (<b>w<sub>g</sub> </b>x<b> K</b><sup>B</sup><sub>0</sub>) = <b>K</b><sup>B</sup><sub>0</sub> + ( d<b>θ<sub>g</sub> </b>x<b> K</b><sup>B</sup><sub>0</sub>) </p>
<p>Where we noted d<b>θ<sub>g</sub> </b>= dt <b>w<sub>g</sub></b>. Because <b>w<sub>g</sub> </b>is angular velocity as measured by the gyroscope. We’ll call d<b>θ<sub>g</sub> </b>angular displacement. In other words it tells us by what <b>small</b> angle (given for all 3 axis in form of a vector) has the orientation of a vector <b>K</b><sup>B</sup> changed during this <b>small</b> period of time dt.</p>
<p>Obviously, another way to estimate <b>K</b><sup>B</sup> is by making another reading from accelerometer so we can get a reading that we note as <b>K</b><sup>B</sup><sub>1A </sub>.</p>
<p>In practice the values <b>K</b><sup>B</sup><sub>1G</sub> will be different from from <b>K</b><sup>B</sup><sub>1A. </sub>One was estimated using our gyroscope and the other was estimated using our accelerometer.</p>
<p>Now it turns out we can go the reverse way and estimate the angular velocity <b>w</b><sub>a</sub> or angular displacement d<b>θ<sub>a ­</sub></b>=<b> </b>dt <b>w<sub>a</sub></b> , from the new accelerometer reading <b>K</b><sup>B</sup><sub>1A­ </sub>, we’ll use <i>(Eq. 2.5):</i></p>
<p><b>w</b>­<sub>a</sub><b> </b>= <b>K</b><sup>B</sup><sub>0</sub> x <b>v<sub>a</sub> </b>/ |<b> K</b><sup>B</sup><sub>0</sub>|<sup>2</sup>­</p>
<p>Now <b>v</b><sub>a </sub>= (<b>K</b><sup>B</sup><sub>1A­ </sub>- <b>K</b><sup>B</sup><sub>0</sub>) / dt , and is basically the linear velocity of the vector <b>K</b><sup>B</sup><sub>0</sub>. And |<b> K</b><sup>B</sup><sub>0</sub>|<sup>2</sup>­­ = 1 , since <b>K</b><sup>B</sup><sub>0</sub> is a unity vector. So we can calculate: </p>
<p>d<b>θ<sub>a ­</sub></b>=<b> </b>dt <b>w<sub>a </sub></b>= <b>K</b><sup>B</sup><sub>0</sub> x (<b>K</b><sup>B</sup><sub>1A­ </sub>- <b>K</b><sup>B</sup><sub>0</sub>)</p>
<p>The idea of calculating a new estimate <b>K</b><sup>B</sup><sub>1 ­</sub> that combines both <b>K</b><sup>B</sup><sub>1A</sub> and <b>K</b><sup>B</sup><sub>1G</sub> is to first estimate d<b>θ </b>as a weighted average of<b> </b>d<b>θ<sub>a</sub> </b>and d<b>θ<sub>g</sub></b> :    <br /><b><sub>       <br /></sub></b>d<b>θ </b>= <b></b>(s<sub>a</sub> d<b>θ<sub>a</sub> </b>+<b> </b>s<sub>g</sub> d<b>θ<sub>g</sub></b>) / (s<sub>a</sub> + s<sub>g­</sub>), 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.</p>
<p>And then <b>K</b><sup>B</sup><sub>1 ­ </sub>is calculated similar to how we calculated <b>K</b><sup>B</sup><sub>1G</sub>:</p>
<p><b>K</b><sup>B</sup><sub>1</sub> ≈ <b>K</b><sup>B</sup><sub>0</sub> + ( d<b>θ </b>x<b> K</b><sup>B</sup><sub>0</sub>) </p>
<p>Why we went all the way to calculate d<b>θ </b>and did not apply the weighted average formula directly to <b>K</b><sup>B</sup><sub>1A</sub> and <b>K</b><sup>B</sup><sub>1G </sub>? Because d<b>θ </b>can be used to calculate the other elements of our DCM matrix in the same way:</p>
<p><b>I</b><sup>B</sup><sub>1</sub> ≈ <b>I</b><sup>B</sup><sub>0</sub> + ( d<b>θ </b>x<b> I</b><sup>B</sup><sub>0</sub>) </p>
<p><b>J</b><sup>B</sup><sub>1</sub> ≈ <b>J</b><sup>B</sup><sub>0</sub> + ( d<b>θ </b>x<b> J</b><sup>B</sup><sub>0</sub>) </p>
<p>The idea is that all three versors <b>I</b><sup>B</sup>,<b> J</b><sup>B</sup>,<b> K</b><sup>B</sup> are attached to each other and will follow the same angular displacement d<b>θ </b>during our small interval dt. So in a nutshell this is the algorithm that allows us to calculate the DCM<sub>1</sub> matrix at time t<sub>1 </sub>from our previous estimated DCM<sub>0 </sub>matrix at time t­­<sub>0</sub>. 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.</p>
<p>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.</p>
<p>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 <b>K</b><sup>B</sup><sub> </sub>vector it estimates the vector pointing North <b>I</b><sup>B</sup>. Following the same logic as we did for our accelerometer we can determine the angular displacement according to the updated magnetometer reading as being:</p>
<p>d<b>θ<sub>m ­</sub></b>=<b> </b>dt <b>w<sub>m </sub></b>= <b>I</b><sup>B</sup><sub>0</sub> x (<b>I</b><sup>B</sup><sub>1M­ </sub>- <b>I</b><sup>B</sup><sub>0</sub>)</p>
<p>Now let’s incorporate it into our weighted average:</p>
<p>d<b>θ </b>= <b></b>(s<sub>a</sub> d<b>θ<sub>a</sub> </b>+<b> </b>s<sub>g</sub> d<b>θ<sub>g </sub></b>+<b> </b>s<sub>m</sub> d<b>θ<sub>m</sub></b>) / (s<sub>a</sub> + s<sub>g</sub> +<sub>­ </sub>s<sub>m</sub>)</p>
<p>From here we go the same path to calculate the updated DCM<sub>1­</sub></p>
<p><b>I</b><sup>B</sup><sub>1</sub> ≈ <b>I</b><sup>B</sup><sub>0</sub> + ( d<b>θ </b>x<b> I</b><sup>B</sup><sub>0</sub>) , <b>K</b><sup>B</sup><sub>1</sub> ≈ <b>K</b><sup>B</sup><sub>0</sub> + ( d<b>θ </b>x<b> K</b><sup>B</sup><sub>0</sub>) and <b>J</b><sup>B</sup><sub>1 </sub>≈ <b>J</b><sup>B</sup><sub>0</sub> + ( d<b>θ </b>x<b> J</b><sup>B</sup><sub>0</sub>), </p>
<p>In practice we’ll calculate <b>J</b><sup>B</sup><sub>1 </sub>= <b>K</b><sup>B</sup><sub>1 </sub>x <b>I</b><sup>B</sup><sub>1,</sub> after correcting <b>K</b><sup>B</sup><sub>1 </sub>and <b>I</b><sup>B</sup><sub>1 </sub>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.</p>
<p>So if vectors <b>I</b><sup>B</sup><sub>0</sub>,<b> J</b><sup>B</sup><sub>0</sub>,<b> K</b><sup>B</sup><sub>0 </sub>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 <b>I</b><sup>B</sup><sub>1</sub>,<b> J</b><sup>B</sup><sub>1</sub>,<b> K</b><sup>B</sup><sub>1 </sub>, 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. </p>
<p>First let’s see how we can ensure that two vectors are orthogonal again. Let’s consider two unity vectors <b>a </b>and <b>b</b> 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 <b>b’</b> that is orthogonal to <b>a</b> and that is in the same plane formed by the vectors <b>a </b>and <b>b. </b>Such a vector is easy to find as shown in Figure 5. First we find vector <b>c = a x b </b>that by the rules of cross product is orthogonal to both <b>a</b> and <b>b </b>and thus is perpendicular to the plane formed by <b>a</b> and <b>b</b>. Next the vector <b>b’ = c x a </b>is calculated as the cross product of <b>c</b> and <b>a. </b>From the definition of cross product <b>b’ </b>is orthogonal to <b>a </b>and because it is also orthogonal to <b>c</b> &#8211; it end up in the plane orthogonal to <b>c</b> , which is the plane formed by <b>a </b>and <b>b. </b>Thus <b>b’</b> is the corrected vector we’re seeking that is orthogonal to <b>a</b> and belongs to the plane formed by <b>a</b> and <b>b</b>.     <br /><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0224.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image022[4]" border="0" alt="clip_image022[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0224_thumb.jpg" width="307" height="272" /></a></p>
<p><i>Figure 5</i></p>
<p>We can extend the equation using <a href="http://en.wikipedia.org/wiki/Triple_product">the triple product rule</a> and the fact that <b>a.a</b> = |<b>a</b>| = 1:</p>
<p><b>b’</b> = <b>c</b> x <b>a</b> = (<b>a</b> x <b>b</b>) x <b>a</b> = -<b>a</b> (<b>a</b>.<b>b</b>) + b(<b>a</b>.<b>a</b>) = <b>b</b> – <b>a</b> (<b>a.b</b>) = <b>b </b>+<b> d , </b>where <b>d </b>=<b> &#8211; a (a.b) </b>(Scenario 1, <b>a</b> is fixed <b>b</b> is corrected)</p>
<p>You can reflect a little bit on the results … So we obtain corrected vector <b>b’ </b>from vector <b>b </b>by adding a “correction” vector<b> d </b>=<b> &#8211; a (a.b). </b>Notice that <b>d</b> is parallel to <b>a</b>. Its direction is dependent upon the angle between <b>a</b> and <b>b</b>, for example in Figure 5 <b>a</b>.<b>b</b> = cos (<b>a</b>,<b>b</b>) &gt; 0 , because angle between <b>a</b> and <b>b</b> is less than<b> </b>90°thus <b>d </b>has opposite direction from <b>a</b> and a magnitutde of cos(<b>a</b>,<b>b</b>)<b> </b>=<b> </b>sin(<b>b,b’</b>).</p>
<p>In the scenario above we considered that vector <b>a </b>is fixed and we found a corrected vector <b>b’</b> that is orthogonal to <b>a</b>. We can consider the symmetric problem – we fix <b>b</b> and find the corrected vector <b>a’:</b></p>
<p><b>a’ </b>= <b>a</b> – <b>b</b> (<b>b</b>.<b>a</b>) = <b>a</b> – <b>b</b> (<b>a</b>.<b>b</b>) = <b>a</b> + <b>e</b>, where <b>e </b>=<b> </b>-<b> b </b>(<b>a.b</b>) (Scenario 2, <b>b</b> is fixed <b>a</b> is corrected)</p>
<p>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:</p>
<p><b>a’ </b>= <b>a</b> – <b>b</b> (<b>a</b>.<b>b</b>) / 2 (Scenario 3, both <b>a</b> and <b>b</b> are corrected)    <br /><b>b’ </b>= <b>b</b> – <b>a</b> (<b>a</b>.<b>b</b>) / 2</p>
<p><a href="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0244.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image024[4]" border="0" alt="clip_image024[4]" src="http://www.starlino.com/wp-content/uploads/2011/11/clip_image0244_thumb.jpg" width="307" height="272" /></a></p>
<p><i>Figure 6</i></p>
<p>This is an relatively easy formula to calculate on a microprocessor since we can pre-compute Err = (<b>a</b>.<b>b</b>)/2 and then use it to correct both vectors:</p>
<p><b>a’ </b>= <b>a</b> &#8211; Err * <b>b</b>    <br /><b>b’ </b>= <b>b</b> &#8211; Err * <b>a</b></p>
<p>Please note that we’re not proving that <b>a’</b> and <b>b’ </b>are orthogonal in Scenario 3, but we presented the intuitive reasoning why the angle between <b>a’</b> and <b>b’</b> will get closer to 90°if we apply the above corrective transformations. </p>
<p>Now going back to our updated DCM matrix that consists of three vectors <b>I</b><sup>B</sup><sub>1</sub>,<b> J</b><sup>B</sup><sub>1</sub>,<b> </b>we apply the following corrective actions before reintroducing the DCM matrix into the next loop:</p>
<p>Err = ( <b>I</b><sup>B</sup><sub>1</sub> . <b>J</b><sup>B</sup><sub>1 </sub>) / 2</p>
<p><b>I</b><sup>B</sup><sub>1</sub><sup>’ </sup>= <b>I</b><sup>B</sup><sub>1</sub> – Err * <b>J</b><sup>B</sup><sub>1     <br /></sub><b>J</b><sup>B</sup><sub>1</sub><sup>’ </sup>= <b>J</b><sup>B</sup><sub>1</sub> – Err * <b>I</b><sup>B</sup><sub>1     <br /></sub><b>I</b><sup>B</sup><sub>1</sub><sup>’’ </sup>= Normalize[<b>I</b><sup>B</sup><sub>1</sub><sup>’</sup>]    <br /><b>J</b><sup>B</sup><sub>1</sub><sup>’’ </sup>= Normalize[<b>J</b><sup>B</sup><sub>1</sub><sup>’</sup>]    <br /><b>K</b><sup>B</sup><sub>1</sub><sup>’’ </sup>= <b>I</b><sup>B</sup><sub>1</sub><sup>’’</sup> x <b>J</b><sup>B</sup><sub>1</sub><sup>’’</sup></p>
<p>Where Normalize[<b>a</b>] = <b>a </b>/ |<b>a</b>| , is the formula calculating the unit vector co-directional with <b>a</b>. </p>
<p>So finally our corrected DCM<sub>1</sub> matrix can be recomposed from vectors <b>I</b><sup>B</sup><sub>1</sub><sup>’’</sup>, <b>J</b><sup>B</sup><sub>1</sub><sup>’’</sup>, <b>K</b><sup>B</sup><sub>1</sub><sup>’’ </sup>that have been ortho-normalized (each vector constitutes a row of the updated and corrected DCM matrix).</p>
<p>We repeat the loop to find DCM<sub>2 ,</sub> DCM<sub>3 ,</sub> or in general DCM<sub> n </sub>, at any time interval n.</p>
<h2>References </h2>
<p>1. <a href="http://www.amazon.com/gp/product/1441917497/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;tag=librarian06-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399353&amp;creativeASIN=1441917497">Theory of Applied Robotics: Kinematics, Dynamics, and Control (Reza N. Jazar)</a></p>
<p>2. <a href="http://www.amazon.com/gp/product/0321287134/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;tag=librarian06-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399349&amp;creativeASIN=0321287134">Linear Algebra and Its Applications (David C. Lay)</a></p>
<p>3. <a href="http://www.amazon.com/gp/product/0470528338/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;tag=librarian06-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399353&amp;creativeASIN=0470528338">Fundamentals of Matrix Computations (David S. Watkins)</a></p>
<p>4. <a href="http://gentlenav.googlecode.com/files/DCMDraft2.pdf">Direction Cosine Matrix IMU: Theory (W Premerlani)</a></p>
<h2>Additional Notes</h2>
<p>For the implementation of the algorithm for now see my quadcopter project in particular releases 6/7 have a nice <a href="http://processing.org/" target="_blank">Processing </a>program for visual display of the DCM matrix and a model plane. The entire code is on SVN repository:</p>
<p><a href="http://code.google.com/p/picquadcontroller/source/browse/?r=7#svn%2Ftrunk" target="_blank">http://code.google.com/p/picquadcontroller/source/browse/?r=7#svn%2Ftrunk</a>     </p>
<p>The code is in imu.h file:</p>
<p><a href="http://code.google.com/p/picquadcontroller/source/browse/trunk/imu.h?r=7" target="_blank">http://code.google.com/p/picquadcontroller/source/browse/trunk/imu.h?r=7</a>     </p>
<p>A PDF Version of this article is available here</p>
<p><span style="background-color: #ffff00"><strong><a href="http://www.starlino.com/wp-content/uploads/data/dcm_tutorial/Starlino_DCM_Tutorial_01.pdf" target="_blank">DCM Tutorial &#8211; An Introduction to Orientation Kinematics by Starlino (PDF, Rev 0.1 Draft)</a>             </strong></span></p>
<p>Please mention and link to the source when using information in this article: </p>
<p><a href="http://www.starlino.com/dcm_tutorial.html">http://www.starlino.com/dcm_tutorial.html</a> </p>
<p>Starlino Electronics&#160; // Spring , 2011</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/dcm_tutorial.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Use extra-long headers to hold a board on a  pogo pins testing jig</title>
		<link>http://www.starlino.com/headers-to-hold-board-on-pego-testing-jig.html</link>
		<comments>http://www.starlino.com/headers-to-hold-board-on-pego-testing-jig.html#comments</comments>
		<pubDate>Wed, 16 Mar 2011 03:53:13 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[Soldering and DIY Fabrication]]></category>

		<guid isPermaLink="false">http://www.starlino.com/?p=215</guid>
		<description><![CDATA[Adafruit has a nice tutorial on how to build a neat testing jig that allows you to test a breakout board without having to actually solder the header. So I decided to build one for&#160; the the acc_gyro boards. But how do you hold the board in place ? Using screws is secure but takes [...]]]></description>
			<content:encoded><![CDATA[<p>Adafruit has a nice tutorial on how to build a <a href="http://ladyada.net/make/pogojig/" target="_blank">neat testing jig</a> that allows you to test a breakout board without having to actually solder the header.</p>
<p>So I decided to build one for&nbsp; the the <a href="http://gadgetgangster.com/213" target="_blank">acc_gyro</a> boards. But how do you hold the board in place ? Using screws is secure but takes long time to put a board in and out. I needed a faster way to test a larger amount of boards.</p>
<p>Well after several experimentations with velcro tape, rubber bands , and even custom fitted clamps made out of polymorth , I arrived at this simple solution, just use some headers with extra long leads , the pictures tell it all:</p>
<p><img alt="" height="480" src="http://www.starlino.com/wp-content/uploads/data/pogo_test_rig/pogo_test_rig_holder_1.jpg" width="720" /></p>
<p>The board is basically held by the plastic parts of 2 long headers. You simply spread them apart, insert the board and then , when they come back together they hold the board in place by the spring action of the pogo pins that pushes the board up.</p>
<p><img alt="" src="http://www.starlino.com/wp-content/uploads/data/pogo_test_rig/pogo_test_rig_holder_2.jpg" /></p>
<p>To remove the board simply spread the headers again and the board pops up &#8230;</p>
<p>Hope the method could be useful to someone , so decided to share.</p>
<p>//starlino//</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/headers-to-hold-board-on-pego-testing-jig.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Radioshack Replies</title>
		<link>http://www.starlino.com/radioshack-replies.html</link>
		<comments>http://www.starlino.com/radioshack-replies.html#comments</comments>
		<pubDate>Wed, 29 Dec 2010 16:42:29 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[News and Discussions]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[radioshack]]></category>
		<category><![CDATA[store]]></category>

		<guid isPermaLink="false">http://www.starlino.com/?p=185</guid>
		<description><![CDATA[So we finally received a reply from Radioshack &#34;Wake Up Letter to Radioshack&#34;&#160; it was posted in the comments (and has been confirmed to be coming from Radioshacks corporate). Here it is: Dear Electronics Hobbyists of America, We have heard your voices. We are not going to deny that we have let the hobbyist business [...]]]></description>
			<content:encoded><![CDATA[<p>So we finally received a reply from Radioshack &quot;<a href="http://www.starlino.com/wake-up-letter-to-radioshack-the-hobbyists-are-back.html">Wake Up Letter to Radioshack</a>&quot;&nbsp; it was posted in the comments (and has been confirmed to be coming from Radioshacks corporate). Here it is:</p>
<div class="comment-text">
<blockquote>
<p><em>Dear Electronics Hobbyists of America,</em></p>
<p><em>We have heard your voices. We are not going to deny that we have let the hobbyist business run on auto-pilot for several years now. The times changed, so we changed with it. Now the times are changing again. Hobbyists have remained dedicated to RadioShack for the better part of a century and we recognize that you deserve the same dedication from us. Our goal is to substantiate our loyalty to you. We know we must have a greater selection of products that you want and as much of it as you need. We promise we are working on it and that it is as important to us as it is to you. In the last two years, we have added over 150 new items to our technical assortment. We are working on a plan to get more hobby kits and test equipment into stores but we don&rsquo;t expect that to be the end of the conversation. We do not underestimate the power of the online community, and we would love to hear more from you. We think this is a great beginning to a dialogue and we are listening.</em></p>
<p><em>RadioShack-Team Technical</em></p>
</blockquote>
</div>
<p>Well Radioshack first thank you for replying and not ignoring us altogether. But we would like to see more actions being done. As a reply I will leave you with a related comment from a 10th grade student:</p>
<blockquote>
<p><em>Hello, my name is Nic. I&#39;m in grade 10 and I have an interest in electronics. But I have a lot of restrictions. I live in Canada in a town where there is no electronics shop other than &quot;The Source&quot; (Radioshack was bought out by The Source) which sells overpriced components that aren&#39;t the greatest quality, I&#39;m far away from A1 Electronics which is a brilliant store in missisauga. And There is no Electronics course in my high school.&nbsp; &#8230; <br />
		</em></p>
<p>[Source: <a href="http://www.instructables.com/id/New-Life-for-Old-Printed-Circuit-Boards/">http://www.instructables.com/id/New-Life-for-Old-Printed-Circuit-Boards/</a> ]</p>
<p>&nbsp;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/radioshack-replies.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IMU breakout boards from ST</title>
		<link>http://www.starlino.com/new-cheap-imu-breakout-boards-from-st-dont-miss-out.html</link>
		<comments>http://www.starlino.com/new-cheap-imu-breakout-boards-from-st-dont-miss-out.html#comments</comments>
		<pubDate>Thu, 11 Nov 2010 02:20:27 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[News and Discussions]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[breakout]]></category>
		<category><![CDATA[gyroscope]]></category>
		<category><![CDATA[imu]]></category>
		<category><![CDATA[magenteometer]]></category>

		<guid isPermaLink="false">http://www.starlino.com/?p=163</guid>
		<description><![CDATA[Sign that someone from ST is reading the blogs &#8211; a series of breakout boards directly from ST , just couple of good ones: $26.95&#160; STEVAL-MKI093V1 ( breakout for LYPR540AH&#160; &#8211; 3 axis analog gyro ) http://www.mouser.com/ProductDetail/STMicroelectronics/STEVAL-MKI093V1/?qs=Mmr5WwCtLzNTGieQUi715w%3d%3d Looks like , Mouser has all datasheet , pictures and descriptions wrong at the time of this post. [...]]]></description>
			<content:encoded><![CDATA[<p>Sign that someone from ST is reading the blogs &#8211; a series of breakout boards directly from ST , just couple of good ones:</p>
<p><img alt="" height="361" src="http://www.starlino.com/wp-content/uploads/11-10-2010 9-13-59 PM.png" width="460" /></p>
<p><strong>$26.95&nbsp; </strong><span id="ctl00_ContentMain_lblManufacturerPartNum">STEVAL-MKI093V1 ( breakout for </span><span id="ctl00_ContentMain_lblDescription">LYPR540AH&nbsp; &#8211; </span><span id="ctl00_ContentMain_lblManufacturerPartNum">3 axis analog gyro )<br />
	</span></p>
<p><a href="http://www.mouser.com/ProductDetail/STMicroelectronics/STEVAL-MKI093V1/?qs=Mmr5WwCtLzNTGieQUi715w%3d%3d">http://www.mouser.com/ProductDetail/STMicroelectronics/STEVAL-MKI093V1/?qs=Mmr5WwCtLzNTGieQUi715w%3d%3d<br />
	</a></p>
<p>Looks like , Mouser has all datasheet , pictures and descriptions wrong at the time of this post.</p>
<p><span id="ctl00_ContentMain_lblManufacturerPartNum">correct datasheet&nbsp;&nbsp; <a href="http://www.st.com/stonline/products/literature/bd/17906/steval-mki093v1.pdf ">http://www.st.com/stonline/products/literature/bd/17906/steval-mki093v1.pdf </a></span></p>
<p>&nbsp;</p>
<p><img alt="" height="374" src="http://www.starlino.com/wp-content/uploads/11-10-2010 9-14-26 PM.png" width="490" /></p>
<p>&nbsp;</p>
<p><span id="ctl00_ContentMain_lblMouserPartNum"><strong>$26.95</strong> STEVAL-MKI064V1 (breakout for </span><span id="ctl00_ContentMain_lblDescription">LSM303DLH&nbsp; 3-axis magnetometer + 3-axis accelerometer)<br />
	</span></p>
<p><a href="http://www.mouser.com/ProductDetail/STMicroelectronics/STEVAL-MKI064V1/?qs=Mmr5WwCtLzNMjRxMWs1ArA%3d%3d"><span>http://www.mouser.com/ProductDetail/STMicroelectronics/STEVAL-MKI064V1/?qs=Mmr5WwCtLzNMjRxMWs1ArA%3d%3d</span><br />
	</a></p>
<p>correct datasheet <a href="http://www.st.com/stonline/products/literature/bd/17844/steval-mki064v1.pdf">http://www.st.com/stonline/products/literature/bd/17844/steval-mki064v1.pdf<br />
	</a></p>
<p>&nbsp;</p>
<p>Order while they are in stock :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/new-cheap-imu-breakout-boards-from-st-dont-miss-out.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open pde files with Arduino under Windows</title>
		<link>http://www.starlino.com/oped-pde-files-with-arduino-under-windows.html</link>
		<comments>http://www.starlino.com/oped-pde-files-with-arduino-under-windows.html#comments</comments>
		<pubDate>Sun, 03 Oct 2010 21:16:02 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[Tricks and Tips]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[pde]]></category>

		<guid isPermaLink="false">http://www.starlino.com/?p=149</guid>
		<description><![CDATA[This has been bugging me for while &#8211; I could not associate .pde files with arduino executable , I would select Open With&#8230; choose the executable but it won&#39;t work , so I decided to write a .reg script to correct the problem. After some research turns out other people had the same problem it [...]]]></description>
			<content:encoded><![CDATA[<p>This has been bugging me for while &#8211; I could not associate .pde files with arduino executable , I would select Open With&#8230; choose the executable but it won&#39;t work , so I decided to write a .reg script to correct the problem. After some research turns out other people had the same problem it happens with Windows 7 and might have something to do&nbsp; with having Processing installed, in any case if you have this problem here is the fix.</p>
<p>Create a file called&nbsp; arduino.reg with the following contents:</p>
<hr />
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_CLASSES_ROOT\.pde]<br />
	@=&quot;Arduino.Document&quot;</p>
<p>[HKEY_CLASSES_ROOT\Arduino.Document\shell\open\command]<br />
	@=&quot;\&quot;<span style="background-color: rgb(255, 255, 0);">C:\\arduino\\arduino.exe</span>\&quot; \&quot;%1\&quot;&quot;</p>
<hr />
<p>Please note this assumes your arduino installation was unzipped to <span style="background-color: rgb(255, 255, 0);">C:\arduino\</span> . If different , update accordingly the reg file but make sure to use double quotes \\ for path delimiter as highlighted above.</p>
<p>Next simply double click on the arduino.reg file you have created and the keys will be imported to your registry. Now when you right click on the .pde file you should see arduino as one of the options (and you can make it default program to open pde files).&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/oped-pde-files-with-arduino-under-windows.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ST launches Multi sensor application (MuSA) board platform</title>
		<link>http://www.starlino.com/st-launches-multi-sensor-application-musa-board-platform.html</link>
		<comments>http://www.starlino.com/st-launches-multi-sensor-application-musa-board-platform.html#comments</comments>
		<pubDate>Mon, 20 Sep 2010 13:35:12 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[News and Discussions]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[imu]]></category>
		<category><![CDATA[sensor]]></category>
		<category><![CDATA[ST]]></category>

		<guid isPermaLink="false">http://www.starlino.com/?p=141</guid>
		<description><![CDATA[For $99&#160; MuSA&#160; could be a nice hackable platform for all sorts of motion-enabled applications.&#160; It has a&#160; built-in accelerometer , LCD&#160; and a simple casing. Here is the description from ST: &#34;The platform comes with the LIS331DLH preinstalled on the board, but can support any digitaloutput accelerometer from ST in 3&#215;3 or 3&#215;5 mm [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://www.starlino.com/wp-content/uploads/data/_misc/musa.jpg" /></p>
<p>For $99&nbsp; MuSA&nbsp; could be a nice hackable platform for all sorts of motion-enabled applications.&nbsp; It has a&nbsp; built-in accelerometer , LCD&nbsp; and a simple casing. Here is the description from ST:</p>
<p>&quot;The platform comes with the LIS331DLH preinstalled on the board, but can support any digitaloutput accelerometer from ST in 3&#215;3 or 3&#215;5 mm packages connected to the microcontroller through an SPI interface, as well as the LIS344ALH analog-output accelerometer.</p>
<p>	The MuSA platform features four buttons for navigating the menus. A mini-USB connector is available to exchange data with a PC, depending on the specific application, and also recharges the internal Li-ion battery. The battery is capable of providing power for approximately 7 hours of operation.&quot;</p>
<p>For device demonstration see video here:</p>
<p><a href="http://www.st.com/stonline/domains/support/edemoroom/index.htm?id=14" target="_blank">http://www.st.com/stonline/domains/support/edemoroom/index.htm?id=14</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/st-launches-multi-sensor-application-musa-board-platform.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wake-up letter to Radioshack – the hobbyists are back !</title>
		<link>http://www.starlino.com/wake-up-letter-to-radioshack-the-hobbyists-are-back.html</link>
		<comments>http://www.starlino.com/wake-up-letter-to-radioshack-the-hobbyists-are-back.html#comments</comments>
		<pubDate>Thu, 16 Sep 2010 19:04:00 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[News and Discussions]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://www.starlino.com/?p=121</guid>
		<description><![CDATA[Have you been to Radioshack lately ? You might have needed a part for that last moment project, of course you could buy it online but you need it NOW! So you finally decide to step into that quiet&#160; long forgotten Radioshack store. You walk in and you see cell phones , batteries , chargers [...]]]></description>
			<content:encoded><![CDATA[<p>Have you been to Radioshack lately ? You might have needed a part for that last moment project, of course you could buy it online but you need it NOW! So you finally decide to step into that quiet&nbsp; long forgotten Radioshack store. You walk in and you see cell phones , batteries , chargers , computer accessories, more cell phones ! , and finally in the back, here they are , on the dusty shelves some electronics parts. In an uninviting&nbsp; metal drawer cabinet you see them nicely marked by category, you look around , is it safe to look inside&nbsp; ? or should I call the clerk , &quot;Naaaah he probably has no clue&quot;, is it locked ? will the alarm sound if I open it ? You finally gather the courage to look inside , and you feel like an explorer opening the cabins of Titanic, here is a transistor, a voltage regulator , a kit of resistors &#8211; &quot;I might need it&quot;, a proto-board &#8211; &quot;Nice!&quot;. You finally grabbed a cart of parts, although you didn&#39;t find what you were looking for in first place, you&#39;re little disappointed.&nbsp; You&#39;re&nbsp; finally&nbsp; heading to the register, not without stopping to observe the Radioshack branded&nbsp; multimeters and charges &#8211; and the whole place still feels just like a museum . The clerk was getting nervous already, you didn&#39;t even notice that an hour has passed. Now he is scanning your parts, he looks scared, half of the things he is scanning look dangerous to him, &quot;this guy is up to something dangerous, we are dooooomed !&quot;. Oh no , now he is asking your address , is he going to call the cops ? :) </p>
<p>	If you found yourself in this funny situation you&#39;re not alone, the truth is that<strong> at this time&nbsp; there are no serious retail stores for the electronics hobbyist, however there&#39;s a booming market !</strong>&nbsp;<strong> Due to the current economic environment I doubt that someone would venture to open a nation-wide retail chain like the one Radioshack has, </strong>this being the reason I decided to write an open letter to the company. You might not like the Radioshack company but the truth is that we need them and they need us !</p>
<p><span id="more-121"></span>I am NOT going to send them this letter, instead I will put it out in the wild-wild web&nbsp; and let the natural selection do its work. If it makes (or when it makes)&nbsp; to someone in the Radioshack management&nbsp; &#8211; it means there are enough people who think like I think to make it happen.</p>
<p>That being said , here is the letter, if you&#39;d like to join the petition, leave a comment, post it on your blog, do whatever you feel like, just keep it civilized please.</p>
<p>&quot;Dear RADIOSHACK,</p>
<p>We the electronics hobbyists of America would like to inform you that we are back ! Our soldering irons got cold during the 90&#39;s and 2000&#39;s&nbsp; which made you pull all that interesting stuff to the back shelves. But we are the new generation and we are here to continue what our fathers and mothers have started, we are here to invent , change modify and rebuild this country back to it&#39;s glory days. We need your help though, we want our voices to be heard, we feel like you&#39;re not in touch with reality, while you were sleeping companies like <a href="http://www.adafruit.com/">Adafruit</a>, <a href="http://sparkfun.com/">Sparkfun</a>, <a href="http://makezine.com/">Make Magazine</a> and many many others , have created a huge online community of new engineers and inventors who are the only hope that this country will once again regain it&#39;s edge in the technological field !</p>
<p><strong>You shouldn&#39;t be threatened by these online retailers, neither should they be threatened by you, you should instead try to work together with them.</strong> In fact as a start you should try to resell their kits, they don&#39;t mind anyone copying their work, in fact they publish the schematics, code and advices how to use their products. They are not threatened by anyone, because they will never run out of ideas, they will always be one step ahead, and as long as this happens in our country we all have to gain !</p>
<p>We admire that you started carrying&nbsp; Parallax products, however we find it somehow funny that <a href="http://www.starlino.com/wp-content/uploads/data/radioshack/radioshack_arduino_search_shows_basic_stamps.png" target="_blank">searching for &quot;Arduino&quot; on Radioshack site returns &quot;The BASIC Stamp Kit&quot;</a> , why not just start carrying Arduino just like <a href="http://jameco.com">Jameco </a>recently did ?</p>
<p>If you&#39;re concerned that you don&#39;t have the market yet to pull those products from back shelves and create a larger inventory, don&#39;t forget that a market is not only the market that you have, but the market that you&#39;re going to create. Next time a father or mother&nbsp; enters your store to buy batteries she might see all those interesting electronics kits and decide that&#39;s a good thing for their children to do in order to keep them busy and away from trouble. Why not get more involved in the community and organize or sponsor some electronics clubs, because we know you were sleeping &#8211; they are called nowdays&nbsp; &quot;<a href="http://hackerspaces.org/wiki/List_of_Hacker_Spaces">hackerspaces</a>&quot;. But don&#39;t worry they have nothing to do with hackers and bad guys, in fact they are very friendly and open to anyone.</p>
<p>We understand that things might be tough in the financial chapter right now, it might seem strange but we want to give you our money , just give us the stuff we need!&nbsp; We are here to help and give you feedback. Together&nbsp; we can change many things for the better. Never underestimate the power that our online community has!</p>
<p>With love,</p>
<p>The Electronics Hobbyists of America</p>
<p>&quot;</p>
<p>Once again, if you&#39;d like to join the petition please leave a comment or publish it on your site, let&#39;s hope they will hear us :)</p>
<p>//starlino//&nbsp;&nbsp;</p>
<p>September 16, 2010</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/wake-up-letter-to-radioshack-the-hobbyists-are-back.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Hobby electronics is a serious business !</title>
		<link>http://www.starlino.com/hobby-electronics-is-serious-business.html</link>
		<comments>http://www.starlino.com/hobby-electronics-is-serious-business.html#comments</comments>
		<pubDate>Wed, 15 Sep 2010 23:22:39 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[News and Discussions]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://www.starlino.com/?p=108</guid>
		<description><![CDATA[I can&#39;t help myself but notice that more and more electronics giants are starting to realize that hobby electronics is becoming a serious business ! Newark has just launched their new hobbyist / maker oriented web site www.element14.com as well as their own video blog&#160; persona Ben Heck. When I first saw Ben I thought [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#39;t help myself but notice that more and more electronics giants are starting to realize that hobby electronics is becoming a serious business !</p>
<p><strong>Newark </strong>has just launched their new hobbyist / maker oriented web site <a href="http://www.element14.com/">www.element14.com</a> as well as their own video blog&nbsp; persona Ben Heck. When I first saw Ben I thought &quot;I didn&#39;t know <a href="http://en.wikipedia.org/wiki/Conan_O%27Brien">Conan O&#39;Brian</a> is into electronics. Wait that&#39;s not Conan !&quot;. Just like David L. Jones from <a href="http://eevblog.com">EEVBlog</a> , Ben likes to take things apart even before turning them on. I enjoyed very much his <a href="http://www.youtube.com/watch?v=cdK1jeEJGZY">X-Box tear down and custom foot controlled XBox controller&nbsp;</a> and I am looking forward to seeing more videos like this.</p>
<p><strong>Jameco</strong> has teamed up with <a href="http://makezine.com/">Make Magazine &#39;s</a>&nbsp;&nbsp; <a href="http://blog.makezine.com/archive/author/collin_cunningham/">Collin Cunningham</a> and forged a series of <a href="http://www.youtube.com/watch?v=ihoX7x0RBz8">video tutorials</a> aimed towards electronics beginners. And yes they finally carry <a href="http://www.jameco.com/webapp/wcs/stores/servlet/StoreCatalogDrillDownView?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;search_type=jamecoall&amp;freeText=arduino">Arduino in stock</a>&nbsp; !</p>
<p>In the same spirit , <strong>Texas Instruments</strong> launched few months ago a subsidized development platform <a href="http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_%28MSP-EXP430G2%29?DCMP=launchpad&amp;HQS=Other+PR+launchpadwiki-pr">MSP430 LaunchPad</a> trying to win the hearts of all those Microchip PIC and Atmel AVR fanboys out there. But word along the benches is that it ain&#39;t gonna happen unless they make it Arduino shield pin compatible :).</p>
<p>Old news already &#8211; but <strong>ST</strong> tried a similar move with their <a href="http://www.st.com/mcu/contentid-130-113-STM8S_DISCOVERY.html">STM8S-Discovery kit</a> , not sure how many people they converted but it&#39;s interesting to see some competition going on for this hobbyist /&nbsp; maker , no-longer-niche market.</p>
<p><strong><a href="http://www.adafruit.com/">Adafruit</a></strong> and <strong><a href="http://www.sparkfun.com/">Sparkfun&nbsp;</a></strong> are two wonderful pioneer companies that showed to the world that &nbsp; [title of this post]&nbsp; = TRUE&nbsp; ! They started&nbsp; from zero and reached millions of dollars in sales in just few years. A good example that if you like what you&#39;re doing and you are passionate about it &#8211; you&#39;re going to go a long way.</p>
<p>Overall my feeling is that we are witnessing a new boom right now.&nbsp; Robotics and Electronics is for 2010&#39;s what&nbsp; Internet was for 2000&#39;s and personal computers for 1990&#39;s. For all those still in doubt , or who haven&#39;t&nbsp; send their college applications yet &#8211; this is THE FIELD to work in the next decade ! A lot of wonderful things are just waiting to happen ! Stay tuned and enjoy the ride.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/hobby-electronics-is-serious-business.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hakko 808 Desoldering Tool Review</title>
		<link>http://www.starlino.com/hakko-808-desoldering-tool-review.html</link>
		<comments>http://www.starlino.com/hakko-808-desoldering-tool-review.html#comments</comments>
		<pubDate>Tue, 27 Jul 2010 16:20:03 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[Benchmarks and Reviews]]></category>
		<category><![CDATA[desoldering]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://starlino_wp/?p=42</guid>
		<description><![CDATA[If you&#39;re into electronics sooner or later you will need to desolder something. Also, if you don&#39;t have the proper tools or skills you&#39;ll damage a component or two or even the PCB. Been there done that &#8211; desoldering braid, cheap one-shot mechanical pumps, running the soldering iron from one pin to another &#8230; until [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#39;re into electronics sooner or later you will need to desolder something. Also, if you don&#39;t have the proper tools or skills you&#39;ll damage a component or two or even the PCB. Been there done that &#8211; desoldering braid, cheap one-shot mechanical pumps, running the soldering iron from one pin to another &#8230; until one day I decided to look for a good professional desoldering tool. First I&nbsp; purchased an all-in-one system that among the soldering iron and hot air,&nbsp; had a desoldering funtion. The pump was in the main unit and the desoldering iron was connected by a rubber tube. As it turns out these units have a typical design flaw &#8211; because the pump is so far away from the desoldering iron&nbsp; tip the suction is somewhat weak. Keep in mind that air is flexible so the longer the tube the more pressure is lost along the way. So if you&#39;re buying such a unit make sure the pump is really strong and has a gauge that will allow you to monitor the pressure. That unit has been returned and I am not even going to mention its name ! Then I came across Hakko 808 and until this day this is one of my favorite tools in my workshop. The suction power of this tool is amazing, easy to handle , heats up quickly , not very expensive. It requires regular maintenance (it&#39;s almost like a pet), but if you take care of it you&#39;ll save hours of work and many components and PCBs. Here is an example of what it can do, I received this LiPo charger with some terminal headers that I wanted to replace with different ones:</p>
<p><object height="385" width="480"><param name="movie" value="http://www.youtube.com/v/e3MCUf1ISAw&amp;hl=en_US&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed allowfullscreen="true" allowscriptaccess="always" height="385" src="http://www.youtube.com/v/e3MCUf1ISAw&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" width="480"></embed></object></p>
<p><span id="more-42"></span>Here are close-ups of the before and after desoldering:</p>
<p><img alt="" height="480" src="/wp-content/uploads/data/hako_808_desoldering_tool_review/IMG_1383.JPG" width="640" /></p>
<p><img alt="" height="480" src="/wp-content/uploads/data/hako_808_desoldering_tool_review/IMG_1379.JPG" width="640" /></p>
<p>As you can see desoldering something is really easy, and you get a really-really clean result with this tool.</p>
<p>There are few things to take care of though:</p>
<p>- do not touch the PCB traces for more than one second, this tool is hot and if you heat up the pads for too long it will suck them up<br />
	- buy several tip sizes for different jobs ,&nbsp; i got&nbsp; 1mm (comes in the kit) and additionally I got&nbsp; 1.8mm and 2.3mm tips<br />
	- clean your tool regularly. The most replaced items are the ceramic filters so stock up on those, when they harden from the flux it&#39;s time to replace them.</p>
<p><img alt="" height="897" src="http://www.starlino.com/wp-content/uploads/data/hako_808_desoldering_tool_review/hakko_808_how_to_use.png" width="533" /></p>
<p><em>Source: <a href="http://www.starlino.com/wp-content/uploads/data/hako_808_desoldering_tool_review/Hakko_808_Manual.pdf" target="_blank">Hakko 808 Manual&nbsp; (Download PDF)</a><br />
	</em></p>
<p>Hakko 808 Kit comes with a carry-on case and few spare parts. What is missing is a holder, that you can buy separately (Hakko 633), however the tool will lay on it&#39;s side on the table without touching the surface so that will suffice if you don&#39;t have a holder. Another feature that is missing is a&nbsp; an on/off switch, unplugging this from power outlet is not convenient especially if you have to crawl under the table with a hot tool on the table :)</p>
<p><a href="http://www.starlino.com/wp-content/uploads/data/hako_808_desoldering_tool_review/IMG_1490.JPG" target="_blank"><img alt=""  src="http://www.starlino.com/wp-content/uploads/data/hako_808_desoldering_tool_review/IMG_1490.JPG" width="740" /></p>
</a><p><img alt="" height="480" src="/wp-content/uploads/data/hako_808_desoldering_tool_review/IMG_1385.JPG" width="640" /></p>
<p>Overall Hakko 808 is great tool , worth every penny, and I would buy it again if it breaks, speaking of which it is nicely build and has spare parts available so self-repair is possible and even encouraged and explained in the manual.</p>
<p>//starlino//</p>
<p>&nbsp;</p>
<p><iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS1=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=librarian06-20&amp;o=1&amp;p=8&amp;l=as1&amp;m=amazon&amp;f=ifr&amp;asins=B000ARPULW" style="width: 120px; height: 240px;"></iframe></p>
<p><a href="http://www.amazon.com/gp/product/B000B63604?ie=UTF8&amp;tag=librarian06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B000B63604">Hakko A1229: Hakko Replacement Pre-Filters for 808-5, 10/pkg.</a><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=librarian06-20&amp;l=as2&amp;o=1&amp;a=B000B63604" style="border: medium none ! important; margin: 0px ! important;" width="1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/hakko-808-desoldering-tool-review.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgrade your RC Transmitter with a DIY Tilt Motion Control Module</title>
		<link>http://www.starlino.com/rc_transmitter_accelerometer.html</link>
		<comments>http://www.starlino.com/rc_transmitter_accelerometer.html#comments</comments>
		<pubDate>Thu, 24 Jun 2010 23:44:03 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[IMU Theory and Experiments]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[imu]]></category>
		<category><![CDATA[motion]]></category>
		<category><![CDATA[op-amp]]></category>
		<category><![CDATA[rc]]></category>
		<category><![CDATA[transmitter]]></category>

		<guid isPermaLink="false">http://rc_transmitter_accelerometer</guid>
		<description><![CDATA[If you are into Radio Control Models or robotics chances are that you have an old RC transmitter laying around. This article describes how to create a motion control module for your RC transmitter, that will allow you to control your model or robot by simply tilting the transmitter case. That's right no more wiggling the sticks!]]></description>
			<content:encoded><![CDATA[<p>If you are into Radio Control Models or robotics chances are that you have an old RC transmitter laying around. This article describes how to create a motion control module for your RC transmitter, that will allow you to control your model or robot by simply tilting the transmitter case. That&#39;s right not sticks!</p>
<h2>Demo</h2>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="344" width="425"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/U0FaM6A1zDE&amp;hl=en&amp;fs=1" /><embed allowfullscreen="true" allowscriptaccess="always" height="344" src="http://www.youtube.com/v/U0FaM6A1zDE&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" width="425"></embed></object></p>
<p><span id="more-23"></span>Testing one axis:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="344" width="425"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/GqEDDWv6-ak&amp;hl=en&amp;fs=1" /><embed allowfullscreen="true" allowscriptaccess="always" height="344" src="http://www.youtube.com/v/GqEDDWv6-ak&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" width="425"></embed></object></p>
<h2>Schematic</h2>
<p><img alt="rc_transmitter_motion_control_schematic_full.png" src="data/rc_transmitter_accelerometer/rc_transmitter_motion_control_schematic_full.png" /></p>
<p>&nbsp;</p>
<h2>How it Works</h2>
<p>The RC transmitter uses a potentiometer for each axis, it acts as a voltage divider sending a voltage of 0..5V (the middle position corresponds to 2.5V) to the analog input that is converted into a pule of&nbsp; 1..2ms that is sent over RF.</p>
<p>This module converts (amplifies and shifts) the accelerometer analog output , usually&nbsp; 1.65 +/- 0.4V to the same range of the potentiometer and sends it to the transmitter instead.</p>
<p>An op-amp in an inverting amplifier configuration is used. Vref is set manually by tuning the output to be 2.5V (or the PWM pulse to be 1.5 ms). However it is possible to calculate the theoretical value as follows:</p>
<p>Note that according to the rules of&nbsp; a feedback op-amp the voltage on it&#39;s inverting/non-inverting terminals tends to equalize so &nbsp; V(+) = V(-) and in our case&nbsp; = Vref.</p>
<p>Since no significant current enters the op-amp , the currents going through R1 and R2 are equal:</p>
<p>( V(-) &#8211; Vin ) / R1 = ( Vout &#8211; V(-) ) / R2&nbsp;&nbsp;</p>
<p>(Vref &#8211; Vin) / R1 = (Vout &#8211; Vref) / R2</p>
<p>solving for Vout gives us</p>
<p>Vout = Vref -&nbsp; R2/R1 (Vin &#8211; Vref)&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp; Vref( 1 + R2/R1)&nbsp; &#8211; R2/R1 * Vin</p>
<p>now let&#39;s do some notations</p>
<p>G = &#8211; R2/R1</p>
<p>Vout = Vref( 1 &#8211; G)&nbsp; -&nbsp; G * Vin</p>
<p>According to our schematic&nbsp; G =&nbsp; R2 / R1 =&nbsp; &#8211; 5.12 , this will convert the accelerometer swing of 0.4 V to a swing of&nbsp;&nbsp; 0.4 V * 5.12&nbsp; ~&nbsp; 2V .</p>
<p>We want&nbsp; to make &nbsp; Vin = 1.65&nbsp; correspond to a&nbsp; Vout = 2.5 so we&nbsp; have the equation</p>
<p>2.5 =&nbsp; Vref (1 + 5.12)&nbsp; &#8211; 5.12 * 1.65</p>
<p>from here we find</p>
<p>Vref =&nbsp; (2.5 + 5.12 * 1.65 ) /&nbsp; (1 + 5.12) = 1.78888 V</p>
<p>Well, this is the theoretical value , in practice we adjust the trimmer R3 until the output is 2.5 while the accelerometer is in laying in horizontal position (has an output of 1.65V).</p>
<h2>How to Build</h2>
<p>To build use a small proto-board following schematic. Part numbers are mentioned on schematic. Hook-up with the transmitter is described in images below and on the schematic. For accelerometer use <a href="http://www.gadgetgangster.com/213">Acc_Gyro</a> or similar module, <a href="surface_mount_reflow.html">or build your own accelerometer break-out board</a>.</p>
<h2><img alt="rc_transmitter_tap_in.jpg" src="data/rc_transmitter_accelerometer/rc_transmitter_tap_in.jpg" /></h2>
<h2>&nbsp;</h2>
<h2><img alt="rc_transmitter_tap_in_switch.JPG" src="data/rc_transmitter_accelerometer/rc_transmitter_tap_in_switch.JPG" /></h2>
<p>&nbsp;</p>
<p>The module is mounted in a free space under antenna using double-sided foam tape &#8211; best way to mount an accelerometer to avoid vibration. Note that we get +5V power for the module from the potentiometer contacts. You can test&nbsp; with a led that the power contacts can deliver at least 20mV, the module uses far less &lt;5mA.</p>
<p><img alt="IMG_1485.JPG" src="data/rc_transmitter_accelerometer/IMG_1485.JPG" /></p>
<p>Here is a close-up of the module, as you can see I did&nbsp; <a href="surface_mount_reflow.html">my own accelerometer break-out board</a>, but you can buy a pre-assembled one , there are many choices. You will need an analog accelerometer for this project.</p>
<p><img alt="IMG_1483.JPG" src="data/rc_transmitter_accelerometer/IMG_1483.JPG" /></p>
<p>&nbsp;</p>
<p>Enjoy your new RC Tilt Transmitter. For any comments/questions use the comment form below.</p>
<p>&nbsp;</p>
<p>//starlino//</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/rc_transmitter_accelerometer.html/feed</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Quadcopter Prototype using Acc_Gyro and a PIC</title>
		<link>http://www.starlino.com/quadcopter_acc_gyro.html</link>
		<comments>http://www.starlino.com/quadcopter_acc_gyro.html#comments</comments>
		<pubDate>Wed, 09 Jun 2010 23:27:15 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[Quadcopter]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[gyroscope]]></category>
		<category><![CDATA[imu]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[quadcopter]]></category>

		<guid isPermaLink="false">http://quadcopter_acc_gyro</guid>
		<description><![CDATA[<p>This article introduces a new project I am working on - a&#160; Quadcopter using Acc_Gyro and a PIC. I share some things I learned along the way so far.</p>]]></description>
			<content:encoded><![CDATA[<p>For anyone following this site, here is what I&#39;ve been up to lately &#8211; building a quadcopter based on the <a href="http://gadgetgangster.com/213">Acc_Gyro 5DOF IMU</a> sensor and a 16bit PIC. Although it&#39;s still a work in progress I decided to start putting together an article placeholder and build it up as project evolves. It&#39;s going to be a long one !</p>
<p>The source code will be Open-Source and will be hosted on Google Code, you can get code for quad copter here:</p>
<p><a href="http://code.google.com/p/picquadcontroller/source/browse/#svn/trunk">http://code.google.com/p/picquadcontroller/source/browse/#svn/trunk</a></p>
<p>As usual I like to start with a video demo, it&#39;s basically me controlling the tilt of the quad using a RC controller:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="505" width="640"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/q_BZfG2xYdI&amp;hl=en_US&amp;fs=1&amp;" /><embed allowfullscreen="true" allowscriptaccess="always" height="505" src="http://www.youtube.com/v/q_BZfG2xYdI&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" width="640"></embed></object></p>
<p><span id="more-22"></span>This is a PID feedback algorithm and a &quot;Simplified Kalman Filter&quot; as&nbsp; described in my other articles.</p>
<p>First of all there&#39;s a a RCGroups thread where I first introduced the project</p>
<p>http://www.rcgroups.com/forums/showthread.php?t=1235360</p>
<p>You&#39;ll find some specs there and I will put some material here&nbsp; as well.</p>
<p>Here is Revision 0.1 of schematic (what I started with):</p>
<p><a href="data/PicQuadController/PicQuadControllerRev01.pdf">PicQuadControllerRev01.pdf</a></p>
<p>The major parts list is as follows:</p>
<p><strong>MCU:</strong>&nbsp; DSPIC33FJ128MC802&nbsp; (<a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en532302">http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en532302</a>)</p>
<p><strong>Sensors</strong>: 5DOF Acc_Gyro ( <a href="http://gadgetgangster.com/213">http://gadgetgangster.com/213</a> )&nbsp; + 1Dof Pololu LIST300AL-BREAKOUT (<a href="http://www.pololu.com/catalog/product/765">http://www.pololu.com/catalog/product/765</a>).</p>
<p><strong>Motor Drivers:</strong>&nbsp; Power N-Channel Mosfets (Many choices -Low Rds(on) and rated for the current , I used&nbsp; IRLR8743 ). Schottky diodes to protect against back-EMF ( I used SS2H10-E3/52T )</p>
<p><strong>Frame , motors propellers</strong>: I picked a ready platform that was on sale <a href="http://www.rctoys.com/rc-toys-and-parts/DF-COMPLETE-AIRFRAME/RC-PARTS-DRAGANFLYER-FRAME.html" target="_blank">Dragandfly IV Frame</a> these are actually brushed motors same ones as used in Esky helicopters.</p>
<p>I did some tests on the lift force potential of this frame+motors+props, and was surprise to find out it performed better than some entry-level brushless motors. The lift force of this platform is up to 2.25 lbs.&nbsp; The results of lift-force experiments are compiled in this spreadheet: <a href="data/PicQuadController/MotorLiftPower.pdf" target="_blank">MotorLiftPower.pdf</a>.</p>
<p>How I measured the lift force ?&nbsp; I didn&#39;t have any fancy equipment so I simply fixed the quad in a vise and weighted&nbsp; it it at different throttle levels &#8211; the difference in weight gave me the lift power.</p>
<p><a href="/wp-content/uploads/data/PicQuadController/IMG_1463.JPG" target="_blank"><img alt="IMG_1463.JPG"  src="/wp-content/uploads/data/PicQuadController/IMG_1463.JPG" width="740" /></p>
</a><p>For testing just one motor, I used a string attached to the weight:</p>
<p><a href="/wp-content/uploads/data/PicQuadController/IMG_1460.JPG" target="_blank"><img alt="IMG_1460.JPG"  src="/wp-content/uploads/data/PicQuadController/IMG_1460.JPG" width="740" /></p>
</a><p>I built a test rig out of wood for testing the tilt balancing algorithm as you see in the video.</p>
<p>Here are some close-ups of the motor drivers. You&#39;ll&nbsp; see the Mosfets and the Schottky diodes, also note the extra solder added to support the high currents that will flow through those traces ( up to 5A per motor !).</p>
<p><a href="/wp-content/uploads/data/PicQuadController/IMG_1465.JPG" target="_blank"><img alt="IMG_1465.JPG"  src="/wp-content/uploads/data/PicQuadController/IMG_1465.JPG" width="740" /></p>
</a><p>Finally here is a view on the top of the board ( notice the PIC , the switching regulator&nbsp; ,&nbsp; Acc_Gyro 5DOF IMU and single axes Gyro breakout , from top-left to bottom right).</p>
<p><a href="/wp-content/uploads/data/PicQuadController/IMG_1466.JPG" target="_blank"><img alt="IMG_1466.JPG"  src="/wp-content/uploads/data/PicQuadController/IMG_1466.JPG" width="740" /></p>
</a><p>This is it for now hope to bring you more interesting stuff on this and other projects if time allows&nbsp; !</p>
<p>//starlino//</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/quadcopter_acc_gyro.html/feed</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Play PC games the iPad style  &#8211; Using a PIC with  USB,  accelerometer  and optional Gyroscope</title>
		<link>http://www.starlino.com/usb_thumb_imu.html</link>
		<comments>http://www.starlino.com/usb_thumb_imu.html#comments</comments>
		<pubDate>Tue, 06 Apr 2010 12:43:50 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[Motion Sensing USB Devices]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[Acc_Gyro]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[imu]]></category>
		<category><![CDATA[motion]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[UsbThumb]]></category>

		<guid isPermaLink="false">http://usb_thumb_imu</guid>
		<description><![CDATA[<p>The iPad is finally out - one feature that might caught your attention is the built-in accelerometer and the ability to control a game by tilting the device. But it turns out you can do same thing on your laptop. Read on to find out how.</p>]]></description>
			<content:encoded><![CDATA[<p>The iPad is finally out &#8211; one feature that might caught your attention is the built-in accelerometer and the ability to control a game by tilting the device. For more than a year I was working on a similar idea for the PC Notebook market based on my original&nbsp; motion gamepad project that would&nbsp; allow playing a game by tilting the laptop/netbook. Now that iPad is out I hope that the notebook/netbook manufactures will catch up by incorporating MEMS sensor into their devices. Here is the result of my prototype , it is a USB attached device, but ideally I think this should be embedded into the laptop.</p>
<p><strong>Demo:</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="385" width="640"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/CTSlfDLNlUo&amp;hl=en_US&amp;fs=1&amp;" /><embed allowfullscreen="true" allowscriptaccess="always" height="385" src="http://www.youtube.com/v/CTSlfDLNlUo&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" width="640"></embed></object></p>
<p><span id="more-21"></span></p>
<p><strong>About the project:</strong></p>
<p>For the hardware I used the <a href="http://www.gadgetgangster.com/213">Acc_Gyro</a> sensor and a thumb-size PIC platform <a href="http://www.gadgetgangster.com/240">UsbThumb</a> built around the inexpensive PIC18F14K50 chip that provides all the necessary USB connectivity and ADC inputs.</p>
<p>This setup is actually hardware compatible with my original <a href="http://www.gadgetgangster.com/231">Motion Gamepad</a> design so all the software utilities and firmware will work on the Acc_Gyro + UsbThumb combination that is available as a kit under the name of <a href="http://www.gadgetgangster.com/290">UsbThumbImu </a>. The Acc_Gyro fits on top of UsbThumb and this is not a coincidence since UsbThumb was designed as microcontroller helper for the Acc_Gyro with the idea of being able to provide the USB/Serial/SPI/I2C interface, as well as making use of the built-in 10bit ADC module of the PIC18F14K50.</p>
<p><img alt="" height="244" src="http://www.gadgetgangster.com/scripts/thumbs/pic/290/4433949229_26c3104238_b.jpg" width="300" /></p>
<p>&nbsp;</p>
<p><img alt="" height="244" src="http://www.gadgetgangster.com/scripts/thumbs/pic/290/4434725210_859ebbffe2_b.jpg" width="300" /></p>
<p>&nbsp;</p>
<p>In the pictures above headers are used to connect the device, so the end result is a little taller&nbsp; than you could get if you&#39;d simply solder the two boards together. Both devices have been designed for people that would like to extend&nbsp; or experiment with the existing solution so there is a second row of connectors on the UsbThumb that can be used to connect buttons or other devices to the project.&nbsp;</p>
<p>&nbsp;</p>
<p>All that&#39;s it for now &#8211; hope you liked the project. It was really easy to built having the two important components UsbThumb and Acc_Gyro. You&#39;ll find more info on individual components on my website as well as&nbsp; on the <a href="http://www.gadgetgangster.com/290">GadgetGangster</a> site with whom I partnered to provide kits for anyone interested. If you don&#39;t find the necessary information, or you have any any suggestions, ideas or questions &#8211; as always feel free to drop me a line with in the comment area below.</p>
<p>&nbsp;</p>
<p>//starlino//</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.gadgetgangster.com/240"><br />
	</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/usb_thumb_imu.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Trickster Mouse Emulator – April Fools Day Practical Joke</title>
		<link>http://www.starlino.com/usbthumb_mouse_emulator.html</link>
		<comments>http://www.starlino.com/usbthumb_mouse_emulator.html#comments</comments>
		<pubDate>Wed, 31 Mar 2010 18:57:43 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[Fun Projects]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[UsbThumb]]></category>

		<guid isPermaLink="false">http://usbthumb_mouse_emulator</guid>
		<description><![CDATA[<p>Trickster is a simple application built on UsbThumb platform. It tricks your victim into thinking they have a virus on their computer, by hardware emulating and moving their mouse in circles on intermittent intervals.</p>]]></description>
			<content:encoded><![CDATA[<p>Trickster is a simple application built on UsbThumb platform. It tricks your victim into thinking they have a virus on their computer, by hardware emulating and moving their mouse in circles on intermittent intervals.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="300" width="400"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=10510369&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed allowfullscreen="true" allowscriptaccess="always" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=10510369&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" width="400"></embed></object></p>
<p><span id="more-20"></span>It is basically a customization of Mouse emulation demo that Microchip bundles with their USB Framework.</p>
<p>The code responsible for enabling/disabling mouse emulation is triggered by a timer interrupt like so:</p>
<p>
	<span class="edit_monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OpenTimer0( TIMER_INT_ON &amp;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; T0_16BIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; T0_SOURCE_INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; T0_PS_1_256);</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8230;&#8230;&#8230;&#8230;.</span></p>
<p><span class="edit_monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //These are your actual interrupt handling routines.</span></p>
<p>&nbsp;</p>
<p><span class="edit_monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #pragma interrupt YourHighPriorityISRCode<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void YourHighPriorityISRCode()<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Check which interrupt flag caused the interrupt.<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Service the interrupt<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Clear the interrupt flag<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Etc.<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #if defined(USB_INTERRUPT)<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; USBDeviceTasks();<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endif<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(INTCONbits.TMR0IF){<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; counter_s++; <br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //to interrupt every 1s we need to count FOSC / 4/ 256&nbsp; = 46875 ticks (0xB71B)<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //to count these ticks till overflow we need to set TMR0 to&nbsp; 0xFFFF &#8211; 0xB71B = 0x48E4 <br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TMR0H = 0&#215;48; //will write to TMR0H buffer<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TMR0L = 0xE4; //will write actual TMR0L / TMR0H&nbsp; </p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INTCONbits.TMR0IF = 0;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //This return will be a &quot;retfie fast&quot;, since this is in a #pragma interrupt section</span></p>
<p class="edit_monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8230;&#8230;&#8230;&#8230;&#8230;..</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INTCONbits.TMR0IE = 0;&nbsp; //disable Timer0 interrupt<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(emulate_mode &amp;&amp; counter_s &gt; 3){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // seconds on<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; counter_s = 0;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; emulate_mode = 0;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else if (!emulate_mode &amp;&amp; counter_s &gt; 60){&nbsp;&nbsp;&nbsp;&nbsp; //seconds off<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; counter_s = 0;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; emulate_mode = 1;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INTCONbits.TMR0IE = 1;</p>
<p>&nbsp;</p>
<p><span class="edit_monospace"><br />
	</span></p>
<p>For full source code see:</p>
<p><a href="http://code.google.com/p/usbthumb/source/browse/#svn/trunk/UsbThumbMousePrank" target="_blank">http://code.google.com/p/usbthumb/source/browse/#svn/trunk/UsbThumbMousePrank</a></p>
<p><strong>UsbThumb is an open-hardware platform, anyone can build their own:</strong></p>
<p><a href="http://code.google.com/p/usbthumb/source/browse/#svn/trunk/Hardware" target="_blank">http://code.google.com/p/usbthumb/source/browse/#svn/trunk/Hardware</a></p>
<p>or pick up a prebuilt SMT version of UsbThumb here: <a href="http://www.gadgetgangster.com/303">http://www.gadgetgangster.com/303</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/usbthumb_mouse_emulator.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updating Firmware on USBThumb</title>
		<link>http://www.starlino.com/usbthumb_firmware_upgrade.html</link>
		<comments>http://www.starlino.com/usbthumb_firmware_upgrade.html#comments</comments>
		<pubDate>Thu, 18 Mar 2010 16:57:21 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[USBThumb]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[propeller]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[UsbThumb]]></category>

		<guid isPermaLink="false">http://usbthumb_firmware_upgrade</guid>
		<description><![CDATA[<p>This article describes how to update firmware on USBThumb.</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://gadgetgangster.com/240" target="_blank">USBThumb</a> can be programmed with different firmware, including all Microchip samples from <a href="http://www.google.com/search?q=Microchip+USB+Framework" target="_blank">USB Framwework</a> (use the ones for low pin count USB demo board).</p>
<p>In order to upload a new firmware to USBThumb you need to enter the bootloader mode. This is done by connecting the&nbsp; VPP pin to ground during the time when device is plugged into the USB port.</p>
<p>This can achieved by placing a jumper wire or a 1K resistor (recommended) between GND and VPP pin.</p>
<p><strong>GND pin is number 1, and VPP is number 5. <span style="background-color: rgb(255, 255, 0);">Make sure you do not confuse VPP with the nearby VDD(pin number 4) or you will get a short !!! To be safe use a 1K or 10K resistor instead of the wire.</span> Wire/resistor can be held by the spring action, it only needs to make contact during a split second while the device is plugged. If you plan on making frequent firmware updates , soldering a header is recommended.</strong></p>
<p><img alt="IMG_1408.JPG" src="http://www.starlino.com/wp-content/uploads/data/usbthumb_firmware_upgrade/IMG_1408.JPG" /></p>
<p><span id="more-19"></span>Before plugging the device to USB port,&nbsp; start the &quot;USB HID Bootloader&quot; application (it is installed as part of the Microchip USB Framework, look in C:\Microchip Solutions\USB Device &#8211; Bootloaders\HID &#8211; Bootloader), a copy is placed here for download:</p>
<p><a href="data/usbthumb_firmware_upgrade/HIDBootLoader.zip">HIDBootLoader.zip</a></p>
<p>Next insert the USBThumb into the USB port (with the VPP and GND pins connected) , you should see a &quot;Device attached.&quot; message in the USB HID Bootloader window.</p>
<p>Next steps are simple:</p>
<p>1. Click on &ldquo;Open Hex File&rdquo; button and select the new firmware .HEX file you want to load<br />
	2. Click on &ldquo;Program/Verify&rdquo; and wait for the process to complete<br />
	3. Unplug the device from USB port. Remove the jumber wire/resistor between GND and VPP pin.<br />
	4. Plug the device back and verify the new firmware is working (it depends on firmware and what you expect it to do).</p>
<p>The pictures below illustrate the above steps:</p>
<p><img alt="UsbHidBootloaderSelectFile.png" src="http://www.starlino.com/wp-content/uploads/data/usbthumb_firmware_upgrade/UsbHidBootloaderSelectFile.png" /></p>
<p>&nbsp;</p>
<p><img alt="UsbHidBootloaderBurnFirmware.png" src="http://www.starlino.com/wp-content/uploads/data/usbthumb_firmware_upgrade/UsbHidBootloaderBurnFirmware.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/usbthumb_firmware_upgrade.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using USBThumb as a Propeller Programmer  and  as a USB to Serial Converter</title>
		<link>http://www.starlino.com/usbthumb_propeller_programmer.html</link>
		<comments>http://www.starlino.com/usbthumb_propeller_programmer.html#comments</comments>
		<pubDate>Mon, 15 Mar 2010 22:44:19 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[USBThumb]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[propeller]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[UsbThumb]]></category>

		<guid isPermaLink="false">http://usbthumb_propeller_programmer</guid>
		<description><![CDATA[<p>This article describes how you can use USBThumb as a Propeller Programmer or USB to Serial converter.</p>]]></description>
			<content:encoded><![CDATA[<p>The Parallax&#39;s classic propeller programmer PropPlug&nbsp; is simply a USB to Serial converter, the DTR/RTS signals are used to reset the Propeller chip before starting the programming sequence.</p>
<p>A custom PIC firmware&nbsp; comes preloaded on the <br />
	<a href="http://www.gadgetgangster.com/289" target="_blank">&quot;USBThumb Propeller Programmer&quot;</a> available on GadgetGangster.com, it allows you to use USBThumb as a Propeller Programmer but also as USB to Serial converter.</p>
<p>USBThumb (loaded with <a href="http://code.google.com/p/usbthumb/">USBThumbSerial </a>firmware)&nbsp; is detected on your computer as a standard&nbsp; CDC Modem device and works on all modern operating systems (Windows, Mac os , Linux).</p>
<p>On Windows you might be asked for driver path once you attach the device, simply use the driver part of the Microchip&#39;s USB Framework (it can be found in C:\Microchip Solutions\USB Device &#8211; CDC &#8211; Serial Emulator\inf\win2k_winxp ) , and I am including a copy for direct download here:</p>
<p><a href="data/usbthumb_propeller_programmer/microchip_cdc_win2k_winxp.zip">microchip_cdc_win2k_winxp.zip</a></p>
<p>On Windows you can identify USBThumb&#39;s COM port number from Device Manager:</p>
<p><img alt="3-15-2010 10-24-15 PM.png" src="/wp-content/uploads/data/usbthumb_propeller_programmer/3-15-2010 10-24-15 PM.png" /></p>
<p><span id="more-18"></span>On Mac OS, once you attach the device&nbsp; you will get a prompt &quot;A new network interface has been detected&quot;. Look in the /dev folder. You should see it as &quot;/dev/tty.usbmodem411&quot; or similar.</p>
<p>PropellerTool can scan all available ports and find the one that has a propeller chip attached. So the above step might not be necessary, however if you already know the COM port of USBThumb you can specify it explicitly.</p>
<p>In the PropellerTool go to&nbsp; Edit &gt; Preferences&gt;Operation and update the &quot;Serial Port Search&quot; to the port number of USBThumb (COM15 in my example). In the &quot;Propeller Reset Signal&quot; choose DTR.</p>
<p><img alt="3-15-2010 10-37-28 PM.png" src="/wp-content/uploads/data/usbthumb_propeller_programmer/3-15-2010 10-37-28 PM.png" /></p>
<p>&nbsp;</p>
<p>Next attach the USBThumb to your Propeller development board, USBThumb&#39;s serial&nbsp; 4-pin connector is pin compatible with PropPlug. The pins are marked as follows RX,TX,RST,GND.</p>
<p>To test the communication with the propeller board press F7.</p>
<p>If you experience problems make sure the port is not open by any other software (like for example the propeller terminal software)</p>
<p>In some rare cases if you computer power supply is too noisy, to ensure greater stability you can place a 18pF filtering capacitor between pins 24 (RB5)&nbsp; and 25 (RB6). See picture below:</p>
<p><img alt="usbthumb_adding_filter_capacitor.jpg" src="/wp-content/uploads/data/usbthumb_propeller_programmer/usbthumb_adding_filter_capacitor.jpg" /></p>
<p>You can solder the capacitor permanently between these pins, or if you&#39;re planning to use USBThumb for other projects and you have soldered sockets to the board simply insert the capacitor in the socket between pins 24 and 25. You only need to take this step if you have intermittent problems with PropellerTool not detecting the Propeller chip.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/usbthumb_propeller_programmer.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Exploring a digital I2C/SPI accelerometer (MMA7456L) with Bus Pirate</title>
		<link>http://www.starlino.com/bus_pirate_i2c_tutorial.html</link>
		<comments>http://www.starlino.com/bus_pirate_i2c_tutorial.html#comments</comments>
		<pubDate>Sat, 20 Feb 2010 12:34:45 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[Benchmarks and Reviews]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[spi]]></category>

		<guid isPermaLink="false">http://bus_pirate_i2c_tutorial</guid>
		<description><![CDATA[<p>Bus Pirate is a great tool for exploring new chips using your PC , without the need to integrate the chip into a MCU project. Once I received my unit, i decided to put it to the test by exploring an accelerometer with I2C/SPI interface - the MMA7456L from Freescale. I am writing this in hope that it will help other people get started with BusPirate and I2C protocol in particular. I will only describe the I2C interface in this article but BusPirate is capable of so much more !</p>]]></description>
			<content:encoded><![CDATA[<p>Bus Pirate is a great tool for exploring new chips using your PC , without the need to integrate the chip into a MCU project. Once I received my unit, i decided to put it to the test by exploring an accelerometer with I2C/SPI interface &#8211; the MMA7456L from Freescale. I am writing this in hope that it will help other people get started with BusPirate and I2C protocol in particular. I will only describe the I2C interface in this article but BusPirate is capable of so much more !</p>
<p>The setup of BusPirate was simple. Simply plug it to your USB port, install the FDTI driver (if necessary). After that it will appear as a virtual COM port on you computer. You then can use your terminal of choice to interact with it. Here is sample session in Termite (my choice of terminal software):</p>
<p><img alt="bus pirate terminal termite" height="420" src="/wp-content/uploads/data/bus_pirate_i2c_tutorial/bus_pirate_termite_terminal.png" width="635" /></p>
<p><span id="more-17"></span>You will have to figure out which port your BusPirate is on. If you can&#39;t figure it out, unplug it , observe list of ports, then plug it back to see which new port appeared &#8211; that&#39;s the one. List of COM ports can be found in Device Manager on Windows or in Termite Settings menu. Other COM settings are as follows:</p>
<p><img alt="terminal settigs for buspirate" height="238" src="data/bus_pirate_i2c_tutorial/termite_rs-232_ settigs_for_bus_pirate.png" width="558" /></p>
<p>Using the probe cable accessory, I did all connections on a breadboard guided by the schematic from <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAYQFjAA&amp;url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fsensors%2Fdoc%2Fdata_sheet%2FMMA7456L.pdf&amp;ei=oPp_S4fjOY_T8Abh1bGHBQ&amp;usg=AFQjCNGNzsWiW40VGH6FwGZ9fN5lSUbYlw&amp;sig2=HNX96KK5hB-cLjoAekWL5w" target="_blank">MMA7456L datasheet</a> . You will need just 4 Bus Pirate probes connected to the accelerometer. Below I am showing which ones and where you should connect them:</p>
<p><img alt="buspirate and MMA7456L digital accelerometer connection diagram" height="499" src="/wp-content/uploads/data/bus_pirate_i2c_tutorial/bus_pirate_MMA7456L_connection_schematic.png" width="611" /></p>
<p>On the breadboard this looks something like this (I also have the oscilloscope probes connected to CLK and MOSI):</p>
<p><img alt="bus pirate connected to a breadboard accelerometer" height="480" src="/wp-content/uploads/data/bus_pirate_i2c_tutorial/bus_pirate_breadboard_accelerometer.JPG" width="640" /></p>
<p>First thing to note &#8211; I used some shrink-wrap to isolate the Bus Pirate, but you can also put it in a case.</p>
<p>Second thing to note is that my accelerometer was mounted on a breakout board I made myself, I have a detailed tutorial how you can do SMT mounting and etch your own boards in my article <a href="surface_mount_reflow.html">&quot;DIY Surface Mount on a Budget &#8211; Complete Walkthrough from PCB etching to Reflow&quot; </a>, check it out</p>
<p>Third thing &#8211; don&#39;t forget the the pull-up resistors (10K) on each bus line. It is required to pull-up the SDA and SCL lines (see resistors R1 and R2 on schematic). You can also try the BP pullup feature instead of external resistors.&nbsp; The BusPirate on-board 10K pull-up resistors can be connected to the bus pins, by connecting&nbsp; Vpu pin to a volate pin (3.3V), and then entering the p command to turn the pull-up feature on.</p>
<p>Finally, I used just one decoupling capacitor 0.1uF (the schematic shows 4 caps), also I did not bother to connect the N/C pins to ground.</p>
<p>However for stability you should ground the IADDR0 pin (3), on schematic they show a switch that allows a position where you can change the default address of the device. We won&#39;t need the switch for this experiment.</p>
<p>I later discovered that while using the BusPirate internal pull-up feature (Vpu connected to 3.3V),&nbsp; after I disconnect the oscilloscope probes the setup was no longer working!!! It must be the noise on the bus &#8211; I said to myself. Oscilloscope probes have 18-22pf capacitors that actually eliminate some noise. I encountered this phenomenon many times, so I knew what is going on. I simply added two 18pF capacitors between SDA/SCL pins and ground and I was back in business. The noise is coming most of all from my computer power supply , and while working at 100Khz it becomes an issue.</p>
<p>Ok, so once done with the hardware part, moving on to the BusPirate interface. First send a reset command and check your firmware/hardware version. A command is sent in bus pirate by typing the command # followed by Enter. Now take note of the version I am using , if you&#39;re reading this article in a year or two there might be other versions available, so if something doesn&#39;t make sense , it might be because your have a different version of BusPirate.</p>
<p class="edit_monospace">I2C&gt;<strong style="color: red;">#</strong><br />
	#<br />
	RESET</p>
<p class="edit_monospace">Bus Pirate v3<br />
	Firmware v4.1 Bootloader v4.1<br />
	DEVID:0&#215;0447 REVID:0&#215;3043 (B5)<br />
	http://dangerousprototypes.com<br />
	HiZ&gt;</p>
<p>For a complete list of commands you can type ?, I won&#39;t cover all commands in this article I&#39;ll just explain the ones we use. By default BP is in HiZ mode. HiZ means &quot;High Impedance&quot;. Z is a common symbol for impedance &#8211; simply a fancy way to say that all probes are disconnected. To enter I2C mode simply type <strong>m</strong> and choose the I2C option ( 4 &#8211; in my version of BP). You will be asked other details about I2C setup, I chose 100Khz speed. Once you enter a mode other than HiZ the green MODE led should turn on on your BusPirate.</p>
<p class="edit_monospace">HiZ&gt;<strong style="color: red;">m</strong><br />
	m<br />
	1. HiZ<br />
	2. 1-WIRE<br />
	3. UART<br />
	<strong>4. I2C</strong><br />
	5. SPI<br />
	6. JTAG<br />
	7. RAW2WIRE<br />
	8. RAW3WIRE<br />
	9. PC KEYBOARD<br />
	10. LCD<br />
	(1) &gt;<strong style="color: red;">4</strong><br />
	4<br />
	Mode selected<br />
	Set speed:<br />
	1. ~50KHz<br />
	<strong>2. ~100KHz</strong><br />
	3. ~400KHz<br />
	(1) &gt;<strong style="color: red;">2</strong><br />
	2<br />
	READY</p>
<p>Next step &#8211; you need to turn power supplies on &#8211; you do this by typing W (must be capital <strong>W</strong> !!! lower <strong>w</strong> turns them off). Once this is done, the VREG led will turn on, indicating you have power on your 3.3 and/or 5V pins. We&#39;ll just use the 3.3V pin to power our project and leave the 5V pin alone, however you could selectively turn the later off.</p>
<p class="edit_monospace">I2C&gt;<strong style="color: red;">W</strong><br />
	W<br />
	<strong>POWER SUPPLIES ON</strong></p>
<p>Now it&#39;s time to interact with our accelerometer, BP has a set of macros for each mode that you can check with the (0) command, the (1) macro happens to be a macro that scans all I2C address on the bus and displays the ones present. Each I2C slave device will have a 7bit address ($1D for MMA7456L) that comes in two flavors read(R) and write (W). To obtain the 8bit read/write address you shift the 7bit address to the left (same as multiply by 2) and set the 0th bit to 0 for write, and to 1 for read.</p>
<p class="edit_monospace">
	I2C&gt;<strong style="color: red;">(1)</strong><br />
	(1)<br />
	Searching 7bit I2C address space. <br />
	Found devices at:<br />
	<strong>0x3A(0x1D W) 0x3B(0x1D R) </strong></p>
<p>You can verify that 0x1D * 2 + 0 = 0x3A , 0x1D * 2 +1 = 0x3B.</p>
<p>Now it&#39;s time to read something from the device. The MMA7456L configuration is divided into 1 byte registers that are described in the datasheet, for testing purposes let&#39;s read the register $0D that should contain the device I2C address (0x1D):</p>
<p>Let&#39;s send the following command and look at the output:</p>
<p><span class="edit_monospace">I2C&gt;<strong style="color: red;">{0x3A 0x0D {0x3B r}</strong><br />
	{0x3A 0x0D {0x3B r}<br />
	I2C START BIT<br />
	WRITE: 0x3A ACK<br />
	WRITE: 0x0D ACK<br />
	I2C START BIT<br />
	WRITE: 0x3B ACK<br />
	<strong>READ: 0x1D</strong> NACK<br />
	I2C STOP BIT</span></p>
<p>Now let me explain the BusPirate commands:</p>
<p>{ &#8211; sends a I2C start condition (ST)</p>
<p>} &#8211; send a I2C stop condition (SP)</p>
<p>0x3A 0x0D 0x3B are simply hex numbers representing bytes sent over the bus</p>
<p>r &#8211; reads one byte</p>
<p>There&#39;s no need to send the NAK signal, BusPirate will do it for you and also it will detect and display any AK(ACK) signals received from the slave (the accelerometer).</p>
<p>If this looks like magic to you right now , the following diagram will clarify things, it shows how I used the datasheet in order to construct a BusPirate command that would read one register. The register I am reading is $0D , which happens to be the device address, it should return $1D which is the I2C address for MMA7456L.</p>
<p><img alt="bus pirate i2c timing diagram" height="433" src="/wp-content/uploads/data/bus_pirate_i2c_tutorial/bus_pirate_i2c_tutorial.png" width="735" /></p>
<p>Now let&#39;s talk about writing a byte on the I2C bus.</p>
<p>Before getting acceleration data , we need to put MMA7456L into measurement mode, we also need to specify the sensibility for which there are 3 options 2g/4g/8g. This configuration is done through the Mode Control Register $16 (get the details from <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAYQFjAA&amp;url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fsensors%2Fdoc%2Fdata_sheet%2FMMA7456L.pdf&amp;ei=oPp_S4fjOY_T8Abh1bGHBQ&amp;usg=AFQjCNGNzsWiW40VGH6FwGZ9fN5lSUbYlw&amp;sig2=HNX96KK5hB-cLjoAekWL5w" target="_blank">MMA7456L datasheet</a> , page 9). For our settings we need to send the binary value of : 0b00000101 which sets mode to &quot;measurement&quot;, and g-select to 2g. Let&#39;s do it:</p>
<p class="edit_monospace">I2C&gt;<strong style="color: red;">{0x3A 0&#215;16 0b00000101}</strong><br />
	{0x3A 0&#215;16 0b00000101}<br />
	I2C START BIT<br />
	WRITE: 0x3A ACK<br />
	WRITE: 0&#215;16 ACK<br />
	WRITE: 0&#215;05 ACK<br />
	I2C STOP BIT</p>
<p>Writing a register is even simpler than reading and I will show you how the BusPirate write command relates to the diagram from the MMA7456L datasheet:</p>
<p><a href="/wp-content/uploads/data/bus_pirate_i2c_tutorial/bus_pirate_i2c_write_command.png" target="_blank"><img alt="i2c write command"  src="/wp-content/uploads/data/bus_pirate_i2c_tutorial/bus_pirate_i2c_write_command.png" width="740" /></p>
</a><p>Now that we&#39;ve mastered reading/writing to an I2C bus , we&#39;re ready to read acceleration data. We have the option of reading 8-bit signed values from registers $06,$07,$08. These registers have a 64count/g resolution in 2g mode, meaning that an acceleration of 1 g will be represented as 64 (0&#215;40) and&nbsp; -1g will be represented as -64 (0xBF). We can read 3 consecutive registers from one command line as follows:</p>
<p class="edit_monospace">I2C&gt;<strong style="color: red;">{0x3A 0&#215;06 {0x3B r:3}</strong><br />
	{0x3A 0&#215;06 {0x3B r:3}<br />
	I2C START BIT<br />
	WRITE: 0x3A ACK<br />
	WRITE: 0&#215;06 ACK<br />
	I2C START BIT<br />
	WRITE: 0x3B ACK<br />
	READ 0&#215;03 BYTES:<br />
	<strong>0xFF ACK 0xF8 ACK 0x4A NACK</strong><br />
	I2C STOP BIT</p>
<p>So we got following accelerometer output values for X,Y,Z axes: 0xFF (-1) , 0xF8 (-8) , 0x4A (74) which divided by sensitivity of 64counts per g, give us the values in Gs ~ -0.015g , -0.125g , 1.16g . It is close to what is expected from the output when the device is in horizontal position. The Z output seems to be off. We&#39;ll double check this and deal with it later.</p>
<p>Let&#39;s tilt the device on the X axis and see if it makes any difference in output, I tilted it roughly 45 degrees so that X and Z axis modulus should be roughly close to 64/2 = 32 and Y should remain close to 0.</p>
<p><span class="edit_monospace">I2C&gt;<strong style="color: red;">{0x3A 0&#215;06 {0x3B r:3}</strong><br />
	{0x3A 0&#215;06 {0x3B r:3}<br />
	I2C START BIT<br />
	WRITE: 0x3A ACK<br />
	WRITE: 0&#215;06 ACK<br />
	I2C START BIT<br />
	WRITE: 0x3B ACK<br />
	READ 0&#215;03 BYTES:<br />
	<strong>0xD7 ACK 0xF8 ACK 0x3F NACK</strong><br />
	I2C STOP BIT</span></p>
<p>The results we got this time are X = 0xD7 (-41), Y = 0xF8 (-8), <strong>Z = 0x3F(63 !!!)</strong>, now we can see clear that Z axis reading is offset. Luckily MMA7456L offers a way to correct these values and we&#39;ll use it. From first experiment we can see it needs to be offset by 74 &#8211; 64 ~ 10 counts. We can correct the accelerometer drift (for each axis). For Z axis we&#39;ll be using 2 registers:</p>
<p>&quot;Offset drift Z value (LSB)&quot; &#8211; register $14 <br />
	&quot;Offset drift Z value (MSB)&quot; &#8211; register $15.</p>
<p>But what values should we write ? Let&#39;s start with the fact that our drift is about 10 counts, but this is in 2g scale. Scale in which drift must be specified is apparently 4g , so we need to offset Z by 10*4g/2g = 20 counts (in 4g scale) . Also our correction must be in different direction so the value to write is -20. Expressed as a signed DWORD this is 0xFFEC.</p>
<p>We&#39;ll write 2 registeres at once LSB (least significant byte) first.</p>
<p class="edit_monospace">I2C&gt;<strong style="color: red;">{0x3A 0&#215;14 0xEC 0xFF}</strong><br />
	{0x3A 0&#215;14 0xEC 0xFF}<br />
	I2C START BIT<br />
	WRITE: 0x3A ACK<br />
	WRITE: 0&#215;14 ACK<br />
	WRITE: 0xEC ACK<br />
	WRITE: 0xFF ACK<br />
	I2C STOP BIT</p>
<p>Now let&#39;s check the readings in horizontal position again.</p>
<p class="edit_monospace">I2C&gt;<strong style="color: red;">{0x3A 0&#215;06 {0x3B r:3}</strong><br />
	{0x3A 0&#215;06 {0x3B r:3}<br />
	I2C START BIT<br />
	WRITE: 0x3A ACK<br />
	WRITE: 0&#215;06 ACK<br />
	I2C START BIT<br />
	WRITE: 0x3B ACK<br />
	READ 0&#215;03 BYTES:<br />
	<strong>0xFB ACK 0xF6 ACK 0&#215;41 NACK</strong><br />
	I2C STOP BIT</p>
<p>And here you go &#8211; the value for Z axis has been corrected to 0&#215;41 (65) , close to what&#39;s expected ( 64).</p>
<p><strong><em>In Conclusion:</em></strong></p>
<p>This real life example of exploring and troubleshooting a chip with I2C interface shows what a valuable tool Bus Pirate is. Rather than bore you with a lot of theory and specs I tried to walk you through an example scenario I encountered myself. I hope that I interested you enough in Bus Pirate , accelerometers and digital interfaces in general to do your own further research of this topic.</p>
<p>//starlino//</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/bus_pirate_i2c_tutorial.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino code for IMU Guide algorithm. Using a 5DOF IMU (accelerometer and gyroscope combo)</title>
		<link>http://www.starlino.com/imu_kalman_arduino.html</link>
		<comments>http://www.starlino.com/imu_kalman_arduino.html#comments</comments>
		<pubDate>Fri, 22 Jan 2010 14:03:44 +0000</pubDate>
		<dc:creator>starlino</dc:creator>
				<category><![CDATA[IMU Theory and Experiments]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[gyroscope]]></category>
		<category><![CDATA[imu]]></category>

		<guid isPermaLink="false">http://imu_kalman_arduino</guid>
		<description><![CDATA[<p>This article introduces an&#160; implementation of a simplified filtering algorithm that was inspired by Kalman filter. The Arduino code is tested using a 5DOF IMU unit from GadgetGangster - <a href="http://www.gadgetgangster.com/213">Acc_Gyro</a> . The theory behind this algorithm was first introduced in my <a href="imu_guide.html">Imu Guide article</a>.</p>]]></description>
			<content:encoded><![CDATA[<p>This article introduces an&nbsp; implementation of a simplified filtering algorithm that was inspired by Kalman filter. The Arduino code is tested using a 5DOF IMU unit from GadgetGangster &#8211; <a href="http://www.gadgetgangster.com/367">Acc_Gyro</a> . The theory behind this algorithm was first introduced in my <a href="imu_guide.html">Imu Guide article</a>.</p>
<p>The <a href="http://www.gadgetgangster.com/213">Acc_Gyro</a> is mounted on a regular proto-shield on top of an Arduino Duemilanove board.</p>
<p><img alt="IMG_1359.JPG" src="/wp-content/uploads/data/imu_kalman_arduino/IMG_1359.JPG" /></p>
<p><span id="more-16"></span></p>
<p><strong>Parts needed to complete the project:</strong></p>
<p>- Arduino Duemilanove (or similar Arduino platform)<br />
	- <a href="http://www.gadgetgangster.com/213">Acc_Gyro 5DOF IMU board<br />
	</a>- Protoshield (optional)<br />
	- Breadboard<br />
	- Hook-up wire 22AWG</p>
<p>The hook-up diagram is as follows:</p>
<p><strong>Acc_Gyro</strong> &lt;&#8212;&gt;&nbsp; <strong>Arduino</strong><br />
	5V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&#8212;&gt;&nbsp; 5V&nbsp; <br />
	GND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&#8212;&gt;&nbsp; GND<br />
	AX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&#8212;&gt;&nbsp; AN0<br />
	AY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&#8212;&gt;&nbsp; AN1<br />
	AZ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&#8212;&gt;&nbsp; AN2<br />
	GX4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&#8212;&gt;&nbsp; AN3&nbsp; <br />
	GY4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&#8212;&gt;&nbsp; AN4&nbsp;&nbsp;</p>
<p>Once you have completed the hardware part, load the following sketch to your Arduino.</p>
<p><a href="data/imu_kalman_arduino/Imu_Arduino.zip">imu_arduino.zip</a></p>
<p>Run the project and make sure you are receiving an output on your serial terminal (you can start the terminal from your Arduino IDE).</p>
<p>To analyze the data I have developed a small utility called SerialChart. It is open-source so feel free to customize it for your own needs.</p>
<p>Here is the output from SerialChart software:</p>
<p><img alt="imu_arduino_serial_chart.png" src="/wp-content/uploads/data/imu_kalman_arduino/imu_arduino_serial_chart.png" /></p>
<p>&nbsp;</p>
<p>The test was performed as follows:</p>
<p>- first I was tilting the board slowly (marked &quot;smooth tilting&quot; on the screenshot)</p>
<p>- next I continued tilting the board, but I also started applying some vibration &#8211; by tapping the board quickly with my finger (marked &quot;Titlting with vibration noise&quot;)</p>
<p>As you can see from the chart the filtered&nbsp; signal (red line)&nbsp; is indeed more immune to noise than the accelerometer readings alone (blue line). The filtered signal was obtained by combining the Accelerometer and Gyroscope data. Gyroscope data is important, because if you would simply average the Accelerometer data you would get a delayed signal. Given the simplicity of the code and of the algorithm I am satisfied with the results. One feature that I would like to add is compensation for the drift effect that you might encounter with some gyroscopes. However the Acc_Gyro board proved to be very stable in this respect, since it has built-in high pass filters.</p>
<p>If you&#39;d like to experiment on your own, I recommended first reproducing this testing setup ,&nbsp; then shift slowly towards your application needs. For example you may take the C code and port it to PIC&#39;s C18/C30 or AVR-GCC (it shouldn&#39;t be too dificult).</p>
<p>Below are some useful resources and their descriptions.</p>
<p>SerialChart executables can be downloaded from here:</p>
<p><a href="data/imu_kalman_arduino/SerialChart_01.zip">SerialChart_01.zip</a></p>
<p>Once you start SerialChart application you will need to load the <strong>imu_arduino.scc</strong> configuration file for this project(included in the <a href="data/imu_kalman_arduino/Imu_Arduino.zip">imu_arduino.zip</a>) archive.</p>
<p>In this configuration file make sure to update the &#39;port&#39; settings to Arduino&#39;s COM port. On my computer Arduino was detected on COM3, on yours it might be different.</p>
<p>For more information on configuration file syntax see:</p>
<p><a href="http://code.google.com/p/serialchart/wiki/ConfigurationFileSyntax" target="_blank">http://code.google.com/p/serialchart/wiki/ConfigurationFileSyntax</a></p>
<p>You can also download and compile SerialChart from Google Code:</p>
<p><a href="http://code.google.com/p/serialchart/source/browse/#svn/trunk">http://code.google.com/p/serialchart/source/browse/#svn/trunk</a></p>
<p>You will need a SVN client to checkout the code (I use RapidSVN for Windows).</p>
<p>SerialChart was developed using&nbsp; Qt SDK from Nokia: <a href="http://qt.nokia.com/downloads">http://qt.nokia.com/downloads</a></p>
<p>&nbsp;</p>
<p><strong>UPDATE 2010-03-18</strong></p>
<p>Many people ask me what about the other 2 axis, here is the code that outputs 3 axis, including the SerialChart configuration script.</p>
<p><a href="data/imu_kalman_arduino/Imu_Arduino_3axis_output_2010-03-18.zip">Imu_Arduino_3axis_output_2010-03-18.zip</a></p>
<p>I also removed some overhead code that Alex pointed out in the comments, this reduced the interval between samples.</p>
<p>In the example below I rotate the board around the X axis(blue) which is parallel to the ground.I do it by hand so X is not exactly 0, but close. The axes that change are Y(red) and Z(green).&nbsp; Please note the relationship X^2+Y^2+Z^2 = 1. The dashed&nbsp; cyan, magenta and lime lines are unfiltered signals coming from accelerometer alone (RwAcc).</p>
<p><img alt="imu_kalman_arduino_3_axis_captured.png" src="/wp-content/uploads/data/imu_kalman_arduino/imu_kalman_arduino_3_axis_captured.png" /></p>
<p>&nbsp;</p>
<p>//starlino//</p>
]]></content:encoded>
			<wfw:commentRss>http://www.starlino.com/imu_kalman_arduino.html/feed</wfw:commentRss>
		<slash:comments>77</slash:comments>
		</item>
	</channel>
</rss>

