<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-349913348023849562</id><updated>2012-01-17T09:04:27.634-08:00</updated><title type='text'>inspired by segway™ - making a self-balancing 2 wheel vehicle</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-180138765296200680</id><published>2009-11-02T11:56:00.001-08:00</published><updated>2009-11-02T11:59:12.495-08:00</updated><title type='text'>Arduino code</title><content type='html'>I see some of you are interested in the code.. well here it is, unedited:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;//------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;int xPin = 2;    // select the input pin for the potentiometer&lt;br /&gt;int gyroPin = 1;&lt;br /&gt;int steerPin = 3;&lt;br /&gt;int ledPin = 13;   // select the pin for the LED&lt;br /&gt;int pwmPinL = 9;&lt;br /&gt;int pwmPinR = 10;&lt;br /&gt;int enPin = 7;&lt;br /&gt;&lt;br /&gt;float angle = 0;&lt;br /&gt;float angle_old = 0;&lt;br /&gt;float angle_dydx = 0;&lt;br /&gt;float angle_integral = 0;&lt;br /&gt;float balancetorque = 0;&lt;br /&gt;float rest_angle = 0;&lt;br /&gt;float currentspeed = 0;&lt;br /&gt;int steeringZero = 0;&lt;br /&gt;int steering = 0;&lt;br /&gt;int steeringTemp = 0;&lt;br /&gt;&lt;br /&gt;float p = 8;  //2&lt;br /&gt;float i = 0;  //0.005&lt;br /&gt;float d = 1300;    //1000&lt;br /&gt;&lt;br /&gt;float gyro_integration = 0;&lt;br /&gt;float xZero = 0;&lt;br /&gt;int gZero = 445;    //this is always fixed, hence why no initialisation routine&lt;br /&gt;unsigned long time, oldtime;&lt;br /&gt;int pwmL;&lt;br /&gt;int pwmR;&lt;br /&gt;boolean over_angle = 0;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt; unsigned int i = 0;&lt;br /&gt; unsigned long j = 0;      //maximum possible value of j in routine is 102300 (100*1023)&lt;br /&gt;&lt;br /&gt; pinMode(ledPin, OUTPUT);  // declare the ledPin as an OUTPUT&lt;br /&gt; Serial.begin(115200);&lt;br /&gt; analogReference(EXTERNAL);&lt;br /&gt; //----------------------------------------------------&lt;br /&gt; TCCR1B = TCCR1B &amp;amp; 0b11111000 | 0x01;&lt;br /&gt; analogWrite(pwmPinL,127);&lt;br /&gt; analogWrite(pwmPinR,127);&lt;br /&gt; digitalWrite(enPin,HIGH);&lt;br /&gt; pinMode(enPin,OUTPUT);&lt;br /&gt; digitalWrite(enPin,LOW);&lt;br /&gt; //-----------------------------------------------------&lt;br /&gt; delay(100);&lt;br /&gt; for (i = 0; i &lt; j =" j" steeringzero =" analogRead(steerPin);" xzero =" j/100;" oldtime =" micros();" time =" micros();"&gt;= (oldtime+5000)){&lt;br /&gt;   oldtime = time;&lt;br /&gt;   calculateAngle();&lt;br /&gt;&lt;br /&gt;   steering = (analogRead(steerPin) - steeringZero)/(15+(abs(angle)*8));&lt;br /&gt;&lt;br /&gt;   //-----OVER ANGLE PROTECTION-----&lt;br /&gt;   if (angle &gt; 20 || angle &lt; -20) {            digitalWrite(enPin,HIGH);       over_angle = 1;       delay(500);     }     //-----END-----          if (over_angle) {       //if over_angle happened, give it a chance to reset when segway is level       if (angle &lt;&gt; -1) {&lt;br /&gt;       digitalWrite(enPin, LOW);&lt;br /&gt;       over_angle = 0;&lt;br /&gt;     }&lt;br /&gt;   }&lt;br /&gt;   else  {&lt;br /&gt;&lt;br /&gt;     //-----calculate rest angle-----&lt;br /&gt;     if (currentspeed &gt; 10)&lt;br /&gt;     {&lt;br /&gt;       rest_angle = 0;&lt;br /&gt;     //-----END-----     &lt;br /&gt;     angle_integral += angle;&lt;br /&gt;     balancetorque = ((angle+rest_angle)*p) + (angle_integral*i) + (angle_dydx*d);      &lt;br /&gt;     angle_dydx = (angle - angle_old)/200;    //now in degrees per second&lt;br /&gt;     angle_old = angle;&lt;br /&gt;     currentspeed += (balancetorque/200);&lt;br /&gt;&lt;br /&gt;     pwmL = (127 + balancetorque + steering);&lt;br /&gt;&lt;br /&gt;     //-----COERCE-----&lt;br /&gt;     if (pwmL &lt; pwml =" 0;"&gt; 255)&lt;br /&gt;       pwmL = 255;&lt;br /&gt;     //-----END-----&lt;br /&gt;&lt;br /&gt;     pwmR = (127 - balancetorque + steering);&lt;br /&gt;&lt;br /&gt;     //-----COERCE-----&lt;br /&gt;     if (pwmR &lt; pwmr =" 0;"&gt; 255)&lt;br /&gt;       pwmR = 255;&lt;br /&gt;     //-----END-----&lt;br /&gt;&lt;br /&gt;     analogWrite(pwmPinL, pwmL);&lt;br /&gt;     analogWrite(pwmPinR, pwmR);&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void calculateAngle() {&lt;br /&gt; //Analogref could be as small as 2.2V to improve step accuracy by ~30%&lt;br /&gt; //uses small angle approximation that sin x = x (in rads). maybe use arcsin x for more accuracy?&lt;br /&gt; //analogref is off the gyro power supply voltage, and routine is calibrated for 3.3V. maybe run acc/gyro/ref off 1 3.3V regulator, an&lt;br /&gt; //accurately measure that.&lt;br /&gt; //routine runs at 200hz because gyro maximum response rate = 200hz&lt;br /&gt; float acc_angle = 0;&lt;br /&gt; float gyro_angle = 0;&lt;br /&gt;&lt;br /&gt; acc_angle = (((analogRead(xPin)-xZero)/310.3030)*(-57.2958);&lt;br /&gt; gyro_angle = ((analogRead(gyroPin) - gZero)*4.8099)/200;&lt;br /&gt; gyro_integration = gyro_integration + gyro_angle;              //integration of gyro and gyro angle calculation &lt;br /&gt; angle = (gyro_integration * 0.99) + (acc_angle * 0.01);      //complementary filter&lt;br /&gt; gyro_integration = angle;                                      //drift correction of gyro integration&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;                  &lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-180138765296200680?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/180138765296200680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/11/arduino-code.html#comment-form' title='54 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/180138765296200680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/180138765296200680'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/11/arduino-code.html' title='Arduino code'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>54</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-5940474159578874931</id><published>2009-06-29T15:57:00.000-07:00</published><updated>2009-06-29T16:00:52.634-07:00</updated><title type='text'>Riding the 95% finished product!</title><content type='html'>&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-2577d005eb65630a" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v11.nonxt5.googlevideo.com/videoplayback?id%3D2577d005eb65630a%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330343435%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D801A25069E65678D18265832CB43593C62866B0C.CE0EA5EC782C0E8E9BF32697D13B24FE245F55C%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D2577d005eb65630a%26offsetms%3D5000%26itag%3Dw160%26sigh%3DntH5MPntq7lc3_g1fF_cF2hlMSQ&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v11.nonxt5.googlevideo.com/videoplayback?id%3D2577d005eb65630a%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330343435%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D801A25069E65678D18265832CB43593C62866B0C.CE0EA5EC782C0E8E9BF32697D13B24FE245F55C%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D2577d005eb65630a%26offsetms%3D5000%26itag%3Dw160%26sigh%3DntH5MPntq7lc3_g1fF_cF2hlMSQ&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-5940474159578874931?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=2577d005eb65630a&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/5940474159578874931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/06/riding-95-finished-product.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/5940474159578874931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/5940474159578874931'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/06/riding-95-finished-product.html' title='Riding the 95% finished product!'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-1848505771664282396</id><published>2009-06-20T06:31:00.000-07:00</published><updated>2009-06-20T06:36:45.907-07:00</updated><title type='text'>Video demonstration of motor working</title><content type='html'>&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-ef4436e8966167eb" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v9.nonxt8.googlevideo.com/videoplayback?id%3Def4436e8966167eb%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330343435%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D4D36E099E4F575BE3FB91C43C6830EA14F1515BF.34AD5D80FDCA4B8CCF1D644F19C5CD70153FD09A%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Def4436e8966167eb%26offsetms%3D5000%26itag%3Dw160%26sigh%3DOl1HLzd_kodShVofrv7tXGXgEFU&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v9.nonxt8.googlevideo.com/videoplayback?id%3Def4436e8966167eb%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330343435%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D4D36E099E4F575BE3FB91C43C6830EA14F1515BF.34AD5D80FDCA4B8CCF1D644F19C5CD70153FD09A%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Def4436e8966167eb%26offsetms%3D5000%26itag%3Dw160%26sigh%3DOl1HLzd_kodShVofrv7tXGXgEFU&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-1848505771664282396?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=ef4436e8966167eb&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/1848505771664282396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/06/blog-post.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1848505771664282396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1848505771664282396'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/06/blog-post.html' title='Video demonstration of motor working'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-1787747177711629430</id><published>2009-06-03T08:56:00.001-07:00</published><updated>2009-06-03T08:59:06.365-07:00</updated><title type='text'>ESCs, power wiring and fuses...</title><content type='html'>&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/ESCsMounted.jpg" border="0" alt="ESCs Mounted" width="400"&gt;&lt;br /&gt;&lt;br /&gt;At the top are the 2 electronic speed controllers, in the centre are the 2 fuses (1 40amp fuse for each controller). At the bottom is a test placement of the batteries, I've yet to make a mounting for them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-1787747177711629430?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/1787747177711629430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/06/escs-power-wiring-and-fuses.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1787747177711629430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1787747177711629430'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/06/escs-power-wiring-and-fuses.html' title='ESCs, power wiring and fuses...'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-3300435140002782609</id><published>2009-04-26T06:44:00.001-07:00</published><updated>2009-04-26T06:46:28.745-07:00</updated><title type='text'>OSMC</title><content type='html'>I have finished the Open Source Motor Controller boards:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/OSMC.jpg" border="0" alt="DIY Segway"&gt;&lt;br /&gt;&lt;br /&gt;I am using Deans T Connectors which I've read can handle upto 100A, but I doubt this could be sustained, but it does have the fact the body of the connector is made of nylon style plastic, not acrylic, so heat wouldn't deform it. So 100A could well be possible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-3300435140002782609?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/3300435140002782609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/04/osmc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/3300435140002782609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/3300435140002782609'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/04/osmc.html' title='OSMC'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-1718005096902596593</id><published>2009-04-26T06:34:00.000-07:00</published><updated>2009-04-26T06:37:34.269-07:00</updated><title type='text'></title><content type='html'>Its been a while since I've made progress but here is the latest:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/Wood.jpg" border="0" alt="Diy Segway"&gt;&lt;br /&gt;&lt;br /&gt;I reclaimed this beautiful wood from an old broken flightcase, its plywood with a hard diamond pattern finish.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-1718005096902596593?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/1718005096902596593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/04/its-been-while-since-ive-made-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1718005096902596593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1718005096902596593'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/04/its-been-while-since-ive-made-progress.html' title=''/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-1673826685880845974</id><published>2009-01-18T07:56:00.000-08:00</published><updated>2009-01-18T08:10:34.176-08:00</updated><title type='text'>Calculating platform angle</title><content type='html'>&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/Sensors.jpg" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;I have written arduino code to calculate the platform angle and it works perfectly!&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/Graph.jpg" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;This is a graph made in Processing which is taking the angle calculated by the arduino from the serial port. I am oscillating the board quickly.&lt;br /&gt;&lt;br /&gt;I am using the complementary filter approach documented by alot of balancing robots. The actual code is something like:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;val = ((((analogRead(xPin)-xZero)/148.48)* 180/3.1415926535897932384626433832795))*-1);   //accelerometer angle calculation&lt;br /&gt;&lt;br /&gt;valG = valG + ((analogRead(gyroPin) - gZero)*4.8099347014925373134328358208962)/200;      //integration of gyro and gyro angle calculation&lt;br /&gt;&lt;br /&gt;angle = (val * 0.005) + (valG * 0.995);      //complementary filter&lt;br /&gt;&lt;br /&gt;valG = angle;              //drift correction of gyro integration&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I can tell it works as intended, because if i rotate the board flat on the table, the gyro senses it, whilst the accelerometer is still flat, so you see it increase and then decay slowly back to zero, rather like a capacitor discharge curve. This shows the accelerometer correcting the gyro's 'drift'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-1673826685880845974?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/1673826685880845974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/01/calculating-platform-angle.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1673826685880845974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1673826685880845974'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/01/calculating-platform-angle.html' title='Calculating platform angle'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-5182603331742014314</id><published>2009-01-16T07:35:00.001-08:00</published><updated>2009-01-16T07:36:48.677-08:00</updated><title type='text'>Riding it without power!</title><content type='html'>I quickly cut up a bit of plywood to stand on, and was tempted to stand on it. &lt;br /&gt;To my suprise, using my hands on the tires to balance me, I can actually move around and maintain balance. Although it probably helps that I can ride a unicycle and have those skills!&lt;br /&gt;&lt;br /&gt;This is thanks to the weight of the motors to counterbalance me though!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-5182603331742014314?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/5182603331742014314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/01/riding-it-without-power.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/5182603331742014314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/5182603331742014314'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/01/riding-it-without-power.html' title='Riding it without power!'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-5518594648675917742</id><published>2009-01-15T10:26:00.001-08:00</published><updated>2009-01-15T10:29:26.059-08:00</updated><title type='text'>Frame Done!</title><content type='html'>I have added the motor mounts and painted the frame with Black Hammerite.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/PaintedFrame.jpg" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;A great thing about having the platform below the wheel axis is the inherant stability, evident by the fact that it stands by itself!&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/GroundClearance.jpg" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;The ground clearance is pretty good too!&lt;br /&gt;&lt;br /&gt;Now I take a break from frame building and focus on the electronics.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-5518594648675917742?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/5518594648675917742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/01/frame-done.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/5518594648675917742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/5518594648675917742'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/01/frame-done.html' title='Frame Done!'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-1479022790361896280</id><published>2009-01-12T16:03:00.000-08:00</published><updated>2009-01-12T16:08:10.933-08:00</updated><title type='text'>Almost Completed Frame</title><content type='html'>After lots of hacksawing...&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/Hacksaw.jpg" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;I have finally finished the basic frame. &lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/FrameProgress.jpg" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;The plan next is to weld on the motor mounts, sand down the frame and spray it in black textured paint to give a tough and attractive finish.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-1479022790361896280?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/1479022790361896280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/01/almost-completed-frame.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1479022790361896280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/1479022790361896280'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/01/almost-completed-frame.html' title='Almost Completed Frame'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-7664698247538305428</id><published>2009-01-06T12:50:00.000-08:00</published><updated>2009-01-06T12:56:04.860-08:00</updated><title type='text'>Frame Base</title><content type='html'>I welded together the base of the frame tonight, interesting feeling is having heat in your hands and 0 degrees celsius elsewhere, it was cold outside tonight!&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/BaseFrame.jpg" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;I'll be doing the wheel support arches when I receive the wheels to confirm measurements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-7664698247538305428?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/7664698247538305428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/01/frame-base.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/7664698247538305428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/7664698247538305428'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/01/frame-base.html' title='Frame Base'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-6130689621823309852</id><published>2009-01-06T05:07:00.000-08:00</published><updated>2009-01-06T05:11:31.908-08:00</updated><title type='text'>Motors</title><content type='html'>I got the 750W motors today from Technobots.&lt;br /&gt;One runs at 1.5A idle (at 24V) and the other at 1.8A idle, probably due to manufacturing tolerances. Maybe I'll have problems with tracking straight when its finished?&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/Motors-1.jpg" border="0" alt="Photobucket"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-6130689621823309852?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/6130689621823309852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/01/motors.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/6130689621823309852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/6130689621823309852'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/01/motors.html' title='Motors'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-4222910630150879001</id><published>2009-01-05T09:34:00.000-08:00</published><updated>2009-01-05T09:45:30.266-08:00</updated><title type='text'>Disc Mount Sprockets</title><content type='html'>I received the disc mount sprockets today:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/Sprockets.jpg" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;Hopefully tomorrow will bring 2 front 20" disc hub quick release wheels and then progress will be possible!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-4222910630150879001?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/4222910630150879001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/01/disc-mount-sprockets.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/4222910630150879001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/4222910630150879001'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/01/disc-mount-sprockets.html' title='Disc Mount Sprockets'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-3889873655939057944</id><published>2009-01-03T03:34:00.000-08:00</published><updated>2009-01-03T10:34:48.717-08:00</updated><title type='text'>Accurate Frame CAD Drawing</title><content type='html'>I found Google Sketchup to be very hard to use and therefore I couldn't create a decent CAD drawing. I transferred to using Solidworks at my university and drafted this:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/AccurateFrame.jpg" border="0" width="400" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;And rendered this:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/FrameRender.jpg" border="0" alt="Photobucket"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://img.photobucket.com/albums/v14/macaba/diysegway/FrameRenderBig.jpg"&gt;Big Frame Picture&lt;/a&gt;&lt;br /&gt;&lt;a href="http://img.photobucket.com/albums/v14/macaba/diysegway/Mockup.jpg"&gt;Mockup with Tires&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-3889873655939057944?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/3889873655939057944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/01/accurate-frame-cad-drawing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/3889873655939057944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/3889873655939057944'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/01/accurate-frame-cad-drawing.html' title='Accurate Frame CAD Drawing'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-2643465056913966992</id><published>2009-01-01T16:46:00.001-08:00</published><updated>2009-01-01T16:54:37.291-08:00</updated><title type='text'>Initial CAD Drawing</title><content type='html'>I knocked up a concept CAD drawing in Google Sketchup to get a feel of the design. Having tweaked it, I'm satisfied that it will be good.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/Frame-1.jpg" border="0" alt="Photobucket" width="400"&gt;&lt;br /&gt;&lt;br /&gt;Points to note:&lt;br /&gt;&lt;br /&gt;- The foot platform is below the centre of the wheels. This may help its stability, but more importantly it reduces the step up and travelling height.&lt;br /&gt;- The wheels are supported from both sides. Whilst this may have an unsightly look to the frame, it means the design is cheaper as it can use standard bicycle parts. &lt;br /&gt;- The overall width is 600mm, this was my target width to easily drive through doorways.&lt;br /&gt;- When the motors are installed, there should be ground clearance between 75-100mm.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-2643465056913966992?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/2643465056913966992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2009/01/initial-cad-drawing.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/2643465056913966992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/2643465056913966992'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2009/01/initial-cad-drawing.html' title='Initial CAD Drawing'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-493650667128199556</id><published>2008-12-31T08:55:00.000-08:00</published><updated>2009-01-01T16:43:48.977-08:00</updated><title type='text'>Balancing Electronics</title><content type='html'>The balancing electronics consist of a gyro and accelerometer. The outputs of these are combined with complementary filters as the gyro works best at high speed, and the accelerometer works best at low speed. (More precisely- the gyro drifts over time, so a high pass filter will eliminate this drift from the output, like eliminating DC offset. Also, summing the accelerometer over time will equal zero, whereas integrating the gyro over time will equal the drift offset, not zero.)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Gyro&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/GyroModule.jpg" alt="Photobucket" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;table align="center" border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;Product Number&lt;/td&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;DC-SS010&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#99ccff"&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" width="211" align="center"&gt;Product Name&lt;/td&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" width="491" align="center"&gt;&lt;div align="center"&gt;Angular Rate Sensor XV-3500CB Gyroscope Prototype PCB&lt;/div&gt;&lt;div align="center"&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#ffffff"&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;Operating Temperature&lt;/td&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;0℃to+80℃&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#99ccff"&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;Storage Temperature&lt;/td&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;-10℃ to 85℃&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#ffffff"&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;Defection Range&lt;/td&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;-100deg/s to +100deg/s&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#99ccff"&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;Scale Factor&lt;/td&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;0.65mV/deg/s&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#ffffff"&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;&lt;p&gt;Voltage output of sensor in static&lt;/p&gt;&lt;p&gt;Typical Value&lt;/p&gt;&lt;/td&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;&lt;p&gt;1320mV~1380mV&lt;/p&gt;&lt;p&gt;1350mV&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#99ccff"&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;Dimensions&lt;/td&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;32(mm) x 19(mm)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;Net Weight&lt;/td&gt;&lt;td style="color: rgb(0, 0, 0);" valign="middle" align="center"&gt;10g/0.3oz&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;I bought this gyro breakout board from eBay, and time will tell whether it will serve my purpose nicely. Key specs of the XV-3500cb is:&lt;br /&gt;&lt;br /&gt;Frequency response:   200hz&lt;br /&gt;Angular response:        +/- 100 degrees/sec&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Accelerometer&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.photobucket.com/albums/v14/macaba/diysegway/AccelerometerModule.jpg" alt="Photobucket" border="0" /&gt;&lt;br /&gt;&lt;p&gt;Quick features list:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Supply voltage: 5V.&lt;/li&gt;&lt;li&gt;X/Y/Z Axis analogue output voltage: 1.65V at zero g (ratiometric output).&lt;/li&gt;&lt;li&gt;Audio amplifier output: 250mW into 8 ohm.&lt;/li&gt;&lt;li&gt;Multiplexer control voltage 0/5V.&lt;/li&gt;&lt;li&gt;0-2kHz bandwidth (can be limited by adding external capacitance to analogue axis output).&lt;/li&gt;&lt;li&gt;Module uses standard 0.1" pitch DIP pin spacing and is breadboard/stripboard friendly for fast prototyping without special tools.&lt;/li&gt;&lt;li&gt;The module dimensions are approximately 10mm x 20mm.&lt;/li&gt;&lt;li&gt;Acceleration range +/-2g.&lt;/li&gt;&lt;li&gt;On-board stable 3V3 supply for sensor.&lt;/li&gt;&lt;li&gt;No external components required for most applications.&lt;/li&gt;&lt;li&gt;Power 'ON' LED&lt;/li&gt;&lt;/ul&gt;I bought this accelerometer breakout from eBay. It uses the LIS302SG accelerometer IC. This looks like an ideal accelerometer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-493650667128199556?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/493650667128199556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2008/12/balancing-electronics.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/493650667128199556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/493650667128199556'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2008/12/balancing-electronics.html' title='Balancing Electronics'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-349913348023849562.post-2211524419911006423</id><published>2008-12-30T14:49:00.000-08:00</published><updated>2009-10-20T11:26:08.491-07:00</updated><title type='text'>What? Why? How?</title><content type='html'>A few years ago, I had seen Trevor Blackwell's &lt;a href="http://www.tlb.org/scooter.html"&gt;page&lt;/a&gt; on building a vehicle inspired by the segway™, which he subsequently followed up with an &lt;a href="http://www.tlb.org/scooter2.html"&gt;updated version&lt;/a&gt;. I was very impressed but not inspired to build my own just yet.&lt;br /&gt;&lt;br /&gt;I went on holiday to Jersey and &lt;a href="http://web.lesmielles.com/segway_channel_islands/segway_ci/segway_tours.htm"&gt;had a go&lt;/a&gt; on a segway there, and I just knew I had to have/build one.&lt;br /&gt;&lt;br /&gt;The basic plan:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Frame&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Build from &lt;a href="http://www.diy.com/diy/jsp/bq/nav/nav.jsp?action=detail&amp;amp;fh_secondid=9283762&amp;amp;fh_view_size=6&amp;amp;fh_eds=%3f&amp;amp;fh_location=%2f%2fcatalog01%2fen_GB%2fcategories%3C%7B10082%7D%2fcategories%3C%7B10085%7D%2fcategories%3C%7B10087%7D%2fspecificationsProductType%3dsheet_metal___tubing%2fspecificationsMaterial%3dSteel%2fspecificationsSpecificProductType%3dsteel_oblong_tube&amp;amp;fh_refview=lister&amp;amp;ts=1230677976494&amp;amp;isSearch=false"&gt;steel box section&lt;/a&gt;, using a minimal amount to maximum effectiveness. Can not use aluminium as cannot weld this myself, but I can use a MIG welder to weld a steel frame together.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Wheels&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Use 20" bicycle wheel with disc brake mount hubs. This allows me to bolt on a &lt;a href="http://www.electricscooterparts.com/sprockets.html"&gt;sprocket&lt;/a&gt; to the standard 6 bolt disc brake mount.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Motors&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Use &lt;a href="http://www.technobots.co.uk/acatalog/Online_Catalogue_500W_to_1000W_Motors_77.html"&gt;750W motors&lt;/a&gt; for upto 1HP rated operation. Use 1:5.4 chain drive reduction ratio to bring 2800RPM down to 520RPM for an approximate top speed of 31MPH.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Electronics&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Use &lt;a href="http://www.robotpower.com/products/osmc_info.html"&gt;OSMC H-Bridge&lt;/a&gt; to drive the motors at upto 160A continuous if needed. Use &lt;a href="http://www.arduino.cc/"&gt;Arduino&lt;/a&gt; to control OSMC and keep the balance by reading a gyro and an accelerometer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/349913348023849562-2211524419911006423?l=diysegway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diysegway.blogspot.com/feeds/2211524419911006423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diysegway.blogspot.com/2008/12/what-why-how.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/2211524419911006423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/349913348023849562/posts/default/2211524419911006423'/><link rel='alternate' type='text/html' href='http://diysegway.blogspot.com/2008/12/what-why-how.html' title='What? Why? How?'/><author><name>Macaba</name><uri>http://www.blogger.com/profile/12896071063465778367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
