{"id":206,"date":"2017-08-18T05:41:16","date_gmt":"2017-08-18T11:41:16","guid":{"rendered":"https:\/\/twopotatoe.net\/?page_id=206"},"modified":"2019-12-28T13:19:55","modified_gmt":"2019-12-28T20:19:55","slug":"fivepotatoe","status":"publish","type":"page","link":"https:\/\/twopotatoe.net\/?page_id=206","title":{"rendered":"FivePotatoe"},"content":{"rendered":"<p><iframe loading=\"lazy\" title=\"FivePotatoe\" width=\"580\" height=\"435\" src=\"https:\/\/www.youtube.com\/embed\/9pQcHJDpBWg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>FivePotatoe was created as a gift for my grandchildren in Australia but also serves other useful purposes.\u00a0 It is simply a <a href=\"https:\/\/www.pololu.com\/product\/3575\">Balboa self-balancing robot from Pololu<\/a>.\u00a0 This is a very nicely designed\u00a0\u2014 both mechanically and electrically \u2014robot which is infinitely modifiable, particularly since a Raspberry Pi can be directly mounted on the motherboard.\u00a0 The only significant addition is the BlueSMIRF module which allows it to be controlled from an Android app.<\/p>\n<p>A Raspberry Pi is not used here but any additional functionality would probably go on the &#8220;Pi&#8221; since there is little extra program space left on the Baloa&#8217;s 32U4.\u00a0 Adding a Pi to this increases the options tremendously.\u00a0 First of all, there is already Bluetooth on the Pi, so the BlueSMIRF is not needed.\u00a0 Secondly, a number of other options then become possible including the addition of other sensors along with more complex navigation.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-thumbnail wp-image-208\" src=\"https:\/\/twopotatoe.net\/wp-content\/uploads\/2017\/08\/img_1352_35801206363_o-e1503056240244-150x150.jpg\" alt=\"\" width=\"150\" height=\"150\" \/> \u00a0 <a href=\"https:\/\/twopotatoe.net\/wp-content\/uploads\/2017\/08\/img_1353_35801207073_o-e1503056254277.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-thumbnail wp-image-207\" src=\"https:\/\/twopotatoe.net\/wp-content\/uploads\/2017\/08\/img_1353_35801207073_o-e1503056254277-150x150.jpg\" alt=\"\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p>The balancing code used on FivePotatoe is derived from TwoPotatoe.\u00a0 I have not made TwoPotatoe&#8217;s code available since it is still under constant revision and, in addition, it is complex and difficult to understand.\u00a0 The basic algorithm is contained in FivePotatoe&#8217;s code so this is a good opportunity to expose it to a wider audience.\u00a0 You can find the code on <a href=\"https:\/\/github.com\/robertstuart\/FivePotatoe\">Github<\/a>.<\/p>\n<p>Here is some general information for anyone who would like to clone FivePotatoe.\u00a0 If you have questions, you can join the <a href=\"https:\/\/forum.pololu.com\/t\/balboa-robot-using-twopotatoe-balancing-algorithm-and-bluetooth-control\/13188\">Pololu form <\/a>and leave a reply to my post there.\u00a0 That way others can see your question and my response.<\/p>\n<ol>\n<li>Other than connecting the BlueSMIRF to pins 1 and 2, and the button to pin 5, the Balboa board is completely unmodified.<\/li>\n<li>Any changes in wheel size, gear ratio, or weight distribution\u2014such as the addition of a Pi\u2014will probably require changes to the &#8220;cosFactor&#8221;.\u00a0 This factor can be adjusted directly from the controller with buttons 5 and 6.\u00a0 This value is displayed as the first data item on the screen.\u00a0 When you find the right value, you should put it in the code and compile it.<\/li>\n<li>The button at the top simply makes it much easier to start up.\u00a0 Pressing this button while holding FivePotatoe upright starts it running.\u00a0 If you press this button while lying down, FivePotatoe goes into its &#8220;down&#8221; mode and can be self-righted and put into its &#8220;up&#8221; mode with some deft manipulation of the joystick.<\/li>\n<li>When self-righting, the motors draw a significant momentary current from the batteries.\u00a0 This can cause enough disruption in the power to cause the 32U4 to reset.\u00a0 A reset is indicated when you hear the startup beep from the buzzer.\u00a0 With standard alkaline batteries, this can become a problem as the batteries drain.\u00a0 I suspect that rechargeable batteries, particularly LiPo batteries, are better in this respect.<\/li>\n<li>FivePotatoe uses the <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=org.projectproto.btjoystick&amp;hl=en\">Joystick Bluetooth Commander <\/a>app for android devices.\u00a0 On the Android app, set the six button labels to &#8220;Run&#8221;,&#8221;Fast&#8221;,&#8221;Beep&#8221;,&#8221;&#8221;,&#8221;+cos&#8221;,&#8221;-cos&#8221;.\u00a0 Set the\u00a0 data labels to &#8220;cos&#8221;,Heading&#8221;,&#8221;Battery&#8221;.<\/li>\n<li>Because the center of gravity is very near the wheel axis, this robot is able to self-right, which is one its neatest characteristics.\u00a0 Unfortunately, the tradeoff is that it cannot handle rough ground or even deep carpet, nor can it go up any but the slightest slope.\u00a0 If you are considering powering it with a LiPo battery, it would be interesting to mount the battery high up and see the change in its operating characteristics.\u00a0 The cosFactor, described above, would obviously need to be adjusted.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>FivePotatoe was created as a gift for my grandchildren in Australia but also serves other useful purposes.\u00a0 It is simply a Balboa self-balancing robot from Pololu.\u00a0 This is a very nicely designed\u00a0\u2014 both mechanically and electrically \u2014robot which is infinitely modifiable, particularly since a Raspberry Pi can be directly mounted on the motherboard.\u00a0 The only [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-206","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/twopotatoe.net\/index.php?rest_route=\/wp\/v2\/pages\/206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twopotatoe.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/twopotatoe.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/twopotatoe.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/twopotatoe.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=206"}],"version-history":[{"count":11,"href":"https:\/\/twopotatoe.net\/index.php?rest_route=\/wp\/v2\/pages\/206\/revisions"}],"predecessor-version":[{"id":316,"href":"https:\/\/twopotatoe.net\/index.php?rest_route=\/wp\/v2\/pages\/206\/revisions\/316"}],"wp:attachment":[{"href":"https:\/\/twopotatoe.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}