{"id":6042,"date":"2013-08-24T20:57:03","date_gmt":"2013-08-24T20:57:03","guid":{"rendered":"http:\/\/www.22balmoralroad.net\/wordpress\/?p=6042"},"modified":"2017-07-19T11:31:09","modified_gmt":"2017-07-19T11:31:09","slug":"braaaaaaains","status":"publish","type":"post","link":"https:\/\/60chequersavenue.net\/wordpress\/2013\/08\/braaaaaaains\/","title":{"rendered":"Braaaaaaains!"},"content":{"rendered":"<p>So, whilst waiting for parts to turn up and paint to dry, I thought I&#8217;d make a start on the controls for R2. Simplest would be to just have the drive wheels, dome, and a couple of other bits controlled from a standard hobby RC controller. I&#8217;ve got a <a href=\"http:\/\/www.spektrumrc.com\/Products\/Default.aspx?ProdId=SPM8800\">eight channel<\/a> one and a few spare receivers so it would&#8217;ve been trivial to do that. However, I wanted something a bit more fancy. I&#8217;m wanting to have the panels on the dome to be controllable, as well as various controls for the main body panels, arms, fire extinguisher, etc.<\/p>\n<p>My thoughts for this is to use a <a href=\"http:\/\/www.raspberrypi.org\/\">Raspberry Pi<\/a>, along with a bunch of peripherals on an i2c bus. <a href=\"http:\/\/www.adafruit.com\/\">Adafruit<\/a> do a nice i2c <a href=\"http:\/\/www.adafruit.com\/products\/815\">16 channel servo<\/a> board which a couple of should give enough channels to control everything I want. I will be putting one of these in the dome for all the various flaps, and another in the body for speed controllers and door mechanisms. Using a Pi will give me lots of power for doing controlling the servos and playing sounds, and hopefully I won&#8217;t need a real time OS. Future plans will involve voice recognition and maybe even facial recognition!<\/p>\n<p>I&#8217;m also wanting to do this as modularly as possible, so to this end my first bit of programming was a daemon to run that listens for commands and sends signals over i2c to the servo controllers. My thinking behind this is that I can write many different interfaces for controls, from a simple web\/PHP interface for testing and such like, to another interface to translate bluetooth signals from a PS3 controller. I&#8217;ll also be able to write a scripting system to do preset motions.<\/p>\n<p><a href=\"http:\/\/www.22balmoralroad.net\/wordpress\/wp-content\/uploads\/IMG_0397_CR2_embedded_1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-6043 alignright\" src=\"http:\/\/www.22balmoralroad.net\/wordpress\/wp-content\/uploads\/IMG_0397_CR2_embedded_1-300x214.jpg\" alt=\"IMG_0397_CR2_embedded_1\" width=\"300\" height=\"214\" \/><\/a><\/p>\n<p>I&#8217;ve put the code for my <a href=\"https:\/\/github.com\/dpoulson\/r2_control\">R2 Control<\/a> software up on <a href=\"http:\/\/github.com\">github<\/a> to keep track of changes and such like. If anyone else feels the urge to use it, or even contribute, they are more than welcome to. I&#8217;m no programmer, so I may be going down the wrong path for all this, but its a learning experience. The code seems to work pretty well for now, but still needs to be tested in R2. Theres still a couple of things I need to add before I start doing any of the other programs. Currently the servos will move as fast as possible to their new position so I need to add a loop in there to allow different speeds. I also need to add support for multiple i2c addresses. I should have these things coded in fairly soon hopefully, and once my hinges for the dome turn up I can start installing it all and testing.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, whilst waiting for parts to turn up and paint to dry, I thought I&rsquo;d make a start on the controls for R2. Simplest would be to just have the drive wheels, dome, and a couple of other bits controlled from a standard hobby RC controller. I&rsquo;ve got a eight channel one and a few [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,36],"tags":[74,96,98,133,138,141],"class_list":["post-6042","post","type-post","status-publish","format-standard","hentry","category-geek","category-r2d2","tag-code","tag-geek","tag-github","tag-programming","tag-python","tag-r2d2-2"],"_links":{"self":[{"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/posts\/6042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/comments?post=6042"}],"version-history":[{"count":2,"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/posts\/6042\/revisions"}],"predecessor-version":[{"id":6284,"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/posts\/6042\/revisions\/6284"}],"wp:attachment":[{"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/media?parent=6042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/categories?post=6042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/60chequersavenue.net\/wordpress\/wp-json\/wp\/v2\/tags?post=6042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}