{"id":532,"date":"2019-08-25T15:56:19","date_gmt":"2019-08-25T15:56:19","guid":{"rendered":"https:\/\/www.protowrxs.com\/?page_id=532"},"modified":"2019-08-25T15:56:21","modified_gmt":"2019-08-25T15:56:21","slug":"sir-robert","status":"publish","type":"page","link":"https:\/\/www.protowrxs.com\/index.php\/robotics\/sir-robert\/","title":{"rendered":"Sir Robert"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"500\" height=\"395\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_Dissasemble.jpg\" alt=\"\" class=\"wp-image-533\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_Dissasemble.jpg 500w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_Dissasemble-300x237.jpg 300w\" sizes=\"(max-width: 500px) 85vw, 500px\" \/><\/figure>\n\n\n\n<p>\nHaving built TED the BiPed ( and NED, a 5 servo design I&#8217;ve never \nposted) and&nbsp;having watched the BoB revolution, and up until recently not\n having a 3D printer, I left the BoBs for others to build. Recently I \ndecided to go ahead and print a BoB as the printer seemed to be working \nwell with Jinx and other LMRians help. Once printed I was even \nconsidering giving it away to someone that wanted to build one. But then\n someone posted a link to a little bot \n(http:\/\/learn.adafruit.com\/trinket-powered-rover) that had the STL files\n for a silly mustache that clips to an ultrasonic sensor.\n\n<\/p>\n\n\n\n<p>I looked at the empty BoB shell and thought I have to see what a \n\u2018stache looks like on him. I made a quick print of the mustache and \nstuck it up there and actually LOL\u2019d. Someone else in the SB said he \nneeded a tophat so a quick search turned up one, a not so quick print \nyielded a nice little hat for the BoB and he looked quite official. \nK120189, the BoB GoD and creator thereof, donned him \u201cRobert\u201d so that \nmust be his name.\n\n<\/p>\n\n\n\n<p>Just a note: Unlike most of my bot posts, this one really isn\u2019t \nvery close to \u201cdone\u201d. Still a bit of coding I want to do once the \nplatform is stable. Also want to add some more sensors such as light and\n sound and play a bit more with making him entertaining. But with the \ncore done figured I\u2019d post him up. Will update as new things are added \nto him.\n&nbsp;\n<\/p>\n\n\n\n<h2>Sir RoBert Brains and Senses<\/h2>\n\n\n\n<p>\n\nWith Sir RoBert destined to be built, I began planning the layout, \nfunctions, etc. My obvious choice of a BoB Brain was a ProMini clone \nwhich I still love working with and am getting quite familiar with. Add \nthe under $5 US price tag for a 328 CPU and it\u2019s hard to beat in my \nopinion. Sir RoBert is fitted out with a normal ultrasonic sensor but \nit\u2019s a bit more of a challenge to implement other sensors on this \nplatform. \n<\/p>\n\n\n\n<p>The normal ultrasonic sensor is obvious and useful for object \navoidance but getting anything else like light dependent resistors \n(LDRs) etc mounted somewhere is a challenge. Additionally I really like \nhaving an infrared (IR) input on my builds to allow switching the \n\u201crobotmode\u201d variable for different features like roam, light follow, \nattack, wag, RC, etc. BUT I also want the build to look as appealing as \npossible. For the IR sensor I kept sticking it on different places \naround the BoB head and nothing really looked right until I stuck it \nabove the mustache like a nose. Perfect fit in my opinion and that is \nwhere it stuck.\n<\/p>\n\n\n\n<p>Getting light sensing on a BoB is a little trickier. It\u2019s also \nnot overly useful under my standard code on a biped that is twisting \naround back and forth all the time creating odd lighting patterns, but I\n still wanted to have the left\/right light sensor features. I picked up \nsome Radio Shack 3mm Ambient Light Sensors \nhttp:\/\/www.radioshack.com\/product\/index.jsp?productId=22472186 and will \nput them in the outer LED mouth holes for some type of light sensing. He\n at least needs to know which side of his face is brighter \/ darker and \ncan respond. The key for sensing while moving is to only sense when his \nhead is flat \/ forward which can be accomplished by a variable that is \nupdated through the walk cycles. It could also be done with an \naccelerometer \/ Gyro \/ IMU solution but seems overly complicated for my \nneeds. I haven\u2019t added the light sensors yet but will be doing so in the\n near future.\n\n<\/p>\n\n\n\n<h2>Plug and Play<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"500\" height=\"373\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_Connections.jpg\" alt=\"\" class=\"wp-image-534\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_Connections.jpg 500w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_Connections-300x224.jpg 300w\" sizes=\"(max-width: 500px) 85vw, 500px\" \/><\/figure>\n\n\n\n<p>I really never realized how small the BoB head is until trying to get\n things stuffed into the head instead of on the outside. I really wanted\n everything in his head but still wanted and needed to be able to get to\n his brain and \u201cinside his head\u201d when needed. After thinking about long \nwires to do it, I looked a bit closer and it seemed like a set of \nfemale\/mail headers would make a \u201cplug and play\u201d BoB head. I used two 90\n degree male header pins on the bottom glued to the tops of the hip \nservos and glued the matching female headers on the inside sides of the \nhead. To help line things up when putting the head on the base I added a\n couple pins that line up with the screw holes on the sides of the head.\n<\/p>\n\n\n\n<p>It is now pretty easy to pull the head off, add stuff, fix stuff,\n etc and put him back together without a rats nest\u2026 well, too much of a \nrats nest at least, of wires, confusing connections, etc. Not perfect \nbut pretty handy so far.\n\n<\/p>\n\n\n\n<h2>Pin In\/Outs<\/h2>\n\n\n\n<h3>Connected to head<\/h3>\n\n\n\n<p>2 \n<br>3 &nbsp;\n<br>4 &nbsp;Sonar In\/Out (Using single pin mode)\n<br>5 &nbsp;Ch1 Input\n<br>6 &nbsp;Ch2 Input\n<br>Not Connected to Head headers\n<br>7 &nbsp;\n<br>8 &nbsp;Right Ankle\n<br>9 &nbsp;Right Hip\n<br>10 &nbsp;Left Hip\n<br>11 &nbsp;Left Ankle\n<br>12 &nbsp;Red LED\n<br>Connected to Head\n<br>13 &nbsp;Speaker\n<br>A0 &nbsp;IR Input\n<br>A1 &nbsp;(Future Left Eye\/Light)\n<br>A3 &nbsp;(Future Right Eye\/Light)\n<br>A4\n<br>Not Connected to Head\n<br>A4 Green LED\n<br>A5 Blue LED\n<br>A6 \n<br>A7 \n\n<\/p>\n\n\n\n<h2>Remote Robert<\/h2>\n\n\n\n<p>\nThinking one evening (yeah, scary thing, I know) I thought it would be \ncool to be able to radio control Sir RoBert with an regular radio \ncontrol car controller that I had laying around. Only a two channel so \nsome challenges but seems it could be done. My original thought was \npurely a free form, Arduino in the middle, solution where RC wheel input\n leans left and right and throttle moves right leg \/ left legs in a \nwalking pattern. &nbsp;\n<\/p>\n\n\n\n<p>This works pretty good to me allow the steering wheel to rock Sir \nRoBert left and right and the throttle to move his hips back and forth. \nWalking is a bit of a challenge to get it coordinated but with this free\n form way of controlling him he can get pretty crazy acting bouncing \nback and forth and shuffling his hips. Rocking for a formal old man.\n<\/p>\n\n\n\n<p>That will work and is still a cool way to play with the bot \nmaking him move from foot to foot and shuffle or walk around. After \nInput from K120189 in the SB made enlightened me to the point that the \nradio control could also be used to trigger the \u201cdrivemode\u201d settings I \nuse. I.e. throttle back and he walks forward on the standard routine, \nreverse backs up, right turns right, combo walks and turns. So you can \nreally just \u201cdrive\u201d Robert around.. albeit not very fast.\n<\/p>\n\n\n\n<p>Expanding on above, I have a \u201cdrivemode\u201d variable in my code for \nmost all my robots. That determines for each loop if the robot is just \nstopped, going forward, backwards, turning in place, turning gradually, \netc. That way any input can subsume another for obstacle avoidance, etc.\n In the RC \u201crobotmode\u201d case, the loop simple reads the radio receiver \ninput and sets the mode or drives the servos in a new mode for direct \naccess. Simple but works for me.\n\n<\/p>\n\n\n\n<h2>Filling the Head<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"500\" height=\"374\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_BaseLMR.jpg\" alt=\"\" class=\"wp-image-535\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_BaseLMR.jpg 500w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_BaseLMR-300x224.jpg 300w\" sizes=\"(max-width: 500px) 85vw, 500px\" \/><\/figure>\n\n\n\n<p>\n\nSo with that wonderful plan in mind I built up the robot putting an old \n75mhz RC receiver I had laying around in the very top of his head and \nthen piled everything else in on top of that. Getting all the wiring \nlined out right is a challenge in such a small place but it all seemed \nto work out. The biggest challenge is getting power and ground runs to \nall the sensors, header, speaker, etc so I piggy backed the nose IR \nsensor off the Ultrasonic sensor which saved on connection pair. I then \nused the two channel connectors to the RC radio only running power in \none and ground in the other removing an additional connection there.\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"500\" height=\"374\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_HeadLMR.jpg\" alt=\"\" class=\"wp-image-536\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_HeadLMR.jpg 500w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_HeadLMR-300x224.jpg 300w\" sizes=\"(max-width: 500px) 85vw, 500px\" \/><\/figure>\n\n\n\n<p>I found a tiny charger jack and power supply from an old cell phone \nand worked it into the back of the head, dropped in a small SPDT switch \nto turn him on \/ put in charge mode, and messed with a single RGB LED \nfor some type of light. He really needs a bunch of 3mm LEDs but I didn\u2019t\n have them so the RGB setup has to do for now.\n\n\n<\/p>\n\n\n\n<p>At first I thought it would be really cool to embed a USB\/TTL \nadapter into RoBert to allow any USB connection for programming, etc. I \nfilled up the square hole in the back with one, set it all up and then \nrealized I needed a USB extender cable to hook him up to the computer. \nNext I found that every time I plugged RoBert into the computer I had to\n wait for the USB to be found, re-select it sometimes, etc to program. \nWith my lousy programming skills and the 1,000 times it takes \ndebug\/fix\/re-upload my code that wasn\u2019t going to work. I resolved it by \nremoving the USB adapter and just extending the standard +5v\/Gnd\/Xmt\/Rcv\n pin headers on the ProMini. Much easier and I can keep the same serial \nport for programming nearly all my bots. I did have to add an external \nreset button since I do not use the auto-reset wiring scheme but easy to\n do.\n<\/p>\n\n\n\n<p>With everything installed I loaded up my standard TED code, \ntweaked a few servo end limits and let him try to get around. Does ok \nactually but still needs some limit adjustments as he will fall over \npretty easily. But working so next I thought I\u2019d try free form radio \ncontrol.\n\n<\/p>\n\n\n\n<h2>Remote Gone Wrong<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"500\" height=\"374\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_BackLMR.jpg\" alt=\"\" class=\"wp-image-537\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_BackLMR.jpg 500w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/Robert_BackLMR-300x224.jpg 300w\" sizes=\"(max-width: 500px) 85vw, 500px\" \/><\/figure>\n\n\n\n<p>\n\nI added another \u201crcrawmode\u201d robot mode and added the code to read the \nreceiver controls thinking it would be pretty easy. Initially I was just\n powering him off the USB connection and the RC stuff worked fine. So I \nunplugged him, turned him on and selected RC mode with the IR remote\u2026 \nand he went into spasms\u2026 twisting and turning and going stupid silly. \nHmm.. ok, what is going on. First I thought maybe a library was \nconflicting while I was reading pulse in but it worked while tethered? \nIt finally dawned on me while looking into the head that the old 75mhz \nradio was mounted right next to the little Pololu 5v step up\/down \nregulators that I use. I really figured that was it so I bypassed the \nregulator and powered things up from a different pack. No problems like \nthat. Great, so my old timey radio isn\u2019t going to work.\n<\/p>\n\n\n\n<p>Next step, move to 2.4g setup. I already had an extra 2.4g receiver \nfrom my RC Truck racing days and a transmitter that could drive it so \nnow I had to dig the old receiver from it\u2019s mounting point underneath \nEVERYTHING else in the head. Only broke ONE wire doing it\u2026 surprised. \nNext I squeezed the new receiver in, wired it all back up and it worked!\n\n<\/p>\n\n\n\n<h2>Future Work<\/h2>\n\n\n\n<p>\n\nSir RoBert needs some time spend on code to get him balanced out but \notherwise he should be able to roam, avoid to a degree, dance with RC, \nplay a few songs, and do the hokey pokey like most of my other bots. \nIt\u2019s all there, it\u2019s just a matter of tuning settings for this \nparticular platform but what I like about Sir RoBert is that he doesn\u2019t \nlook like a \u201crobot\u201d thrown together with scrap parts, he actually looks \nlike a little toy guy.\n\n<\/p>\n\n\n\n<h2>Unintended Results<\/h2>\n\n\n\n<p>\n\nMaxHires and I talked a bit in the shoutbox about how bad code creates \ngood, or at least interesting results and Sir RoBert does have some of \nthat. There is still some issue with conflicting libraries, timers, or \ninterrupts so the servos have the \u201cjitters\u201d.. BUT since Sir Robert is \nsupposed to be old I\u2019m just passing it off as being an \u201cold man\u201d.\n\n<\/p>\n\n\n\n<h2>Sir RoBert Videos<\/h2>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Sir RoBert the BoB Robot\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/HeRGX1kOYxk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Having built TED the BiPed ( and NED, a 5 servo design I&#8217;ve never posted) and&nbsp;having watched the BoB revolution, and up until recently not having a 3D printer, I left the BoBs for others to build. Recently I decided to go ahead and print a BoB as the printer seemed to be working well &hellip; <a href=\"https:\/\/www.protowrxs.com\/index.php\/robotics\/sir-robert\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Sir Robert&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":19,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"spay_email":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/532"}],"collection":[{"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/comments?post=532"}],"version-history":[{"count":1,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/532\/revisions"}],"predecessor-version":[{"id":538,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/532\/revisions\/538"}],"up":[{"embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/19"}],"wp:attachment":[{"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}