{"id":503,"date":"2019-08-25T15:32:16","date_gmt":"2019-08-25T15:32:16","guid":{"rendered":"https:\/\/www.protowrxs.com\/?page_id=503"},"modified":"2019-08-25T15:32:17","modified_gmt":"2019-08-25T15:32:17","slug":"drhead","status":"publish","type":"page","link":"https:\/\/www.protowrxs.com\/index.php\/robotics\/drhead\/","title":{"rendered":"DrHead"},"content":{"rendered":"\n<h2>Decapitated Robot HEAD i.e. &#8220;dread&#8221;<\/h2>\n\n\n\n<p>\n<strong>November 2015<\/strong>\n<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" width=\"320\" height=\"426\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrHeadHead1.png\" alt=\"\" class=\"wp-image-504\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrHeadHead1.png 320w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrHeadHead1-225x300.png 225w\" sizes=\"(max-width: 320px) 85vw, 320px\" \/><\/figure><\/div>\n\n\n\n<p>\nThe\n basic goal of DRHEAD is to have fun with a decapitated head.. wait, \nthat really doesn\u2019t sound right does it. Anyhow, that is what he is and \nhe is something silly and simple at first but with options to grow, \nDRHEAD has a little bit of entertainment built in from just his looks \nalone. Pretty handsome feller no? He is really just a clone of my old \nBox Head robot and uses the same basic code but still provides some fun \nand entertainment.\n\n<\/p>\n\n\n\n<h2>The Story<\/h2>\n\n\n\n<p>\nI had a printed this skull and tophat before Halloween back in 2014 but \nnever did anything with it. By the time the eyeballs I bought for it \narrived from across the big pond I had lost interest before anything \ndeveloped. With Halloween 2015 approaching I thought he needed brought \nto life.\n<\/p>\n\n\n\n<p>\nHe uses the Box Head core code for voice recognition but I really didn\u2019t\n like any of the Microsoft SAPI5 voices (yes the master PC is an old XP \nlaptop) for text to speech for him. I didn\u2019t want to reuse the Sam \nvoice, as that is Box Head\u2019s personality and the other old SAPI5 voices \njust didn\u2019t fit. I finally found the eSpeak app \n(http:\/\/espeak.sourceforge.net\/) and by changing the pitch a bit came up\n with something that seems rather \u201cDRHEADish\u201d to me. It\u2019s a little slow \nresponding as I am firing off the command line version outside of the \nVB.net app to talk, but it works.\n<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"DRHead - Decapitated Robot Head\" width=\"840\" height=\"630\" src=\"https:\/\/www.youtube.com\/embed\/0SbZSzyyH9E?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\nI needed a stand for him and ran across another skull and spine model. I\n liked the skull I had better and after printing out the spine it seems \nto work fine. The other skull would actually be easier to animate \nhowever if anyone wants to give it a try. \nhttp:\/\/www.thingiverse.com\/thing:194928 \n\n\n\n<\/p>\n\n\n\n<h2>Personality<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" width=\"320\" height=\"598\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrheadHeadRed.jpg\" alt=\"\" class=\"wp-image-505\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrheadHeadRed.jpg 320w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrheadHeadRed-161x300.jpg 161w\" sizes=\"(max-width: 320px) 85vw, 320px\" \/><\/figure><\/div>\n\n\n\n<p>\nBasically\n he is just your run of the mill \u201cblue eyed skull with a top hat\u201d, but \nthe bulging eyes and blinking blue along with the polite but different \nEnglish voice helps to make him fun. Pretty normal actually. I \noriginally wanted pan AND tilt for his neck but after looking at the \nprinted parts it seemed overly difficult and he really doesn\u2019t have the \nability to follow a face or anything so I settled on pan only\u2026 or \u201cneck \nrotation\u201d to be more decapitated head specific.\n<\/p>\n\n\n\n<p>\nHaving recently read this excellent article on making your robot more \nhuman posted on RobotRebels.org by Killer Angel (Read it Here yourself) \n(OR the RobotRebels.org post here), and thought I\u2019d take a stab at it \nusing RGB LEDs for a blinking simulation. Trust me, you will NOT find \nout about \u201chuman blinking traits using an Arduino\u201d and LED by searching \nfor \u201cArduino blinking LED\u201d.. you know why. \ud83d\ude42 So after reading the \nblinking information in the above robot article I threw together some \nbasic code to allow blinking and it seems to work ok. It really isn\u2019t \nusing any of those specific tips yet but should be able to eventually \nsuch as blink before move, etc. The LEDs are NOT hooked to a PWM pin so \nthey are really just on or off but it seems to work.\n\n<\/p>\n\n\n\n<h2>Configuration and Functions<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" width=\"320\" height=\"426\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrehadGuts.jpg\" alt=\"\" class=\"wp-image-506\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrehadGuts.jpg 320w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrehadGuts-225x300.jpg 225w\" sizes=\"(max-width: 320px) 85vw, 320px\" \/><\/figure><\/div>\n\n\n\n<p>\nAgain,\n like Box Head, DRHEAD has at least two pieces to the puzzle going on. \nThe PC is listening for voice commands and acting on them by responding \nto preset phrases, getting data from the web and speaking it, and\/or \nsending commands via serial to the Arduino that is doing the animation. \nThe Arduino does send back results from the commands, but the PC really \nisn\u2019t doing anything with them at this time. Maybe later.\n<\/p>\n\n\n\n<p>\nUsing the eSpeak text to speech does work but as mentioned, there is a \nbit more latency between the command to speak and the actual sounds. \nSince I haven\u2019t set anything up to use the sound output to animate \nspeech, that created a bit of a challenge for getting some type of jaw \nanimation working. For now the Arduino pauses a bit before either \nopening his jaw during speech or randomly animating his jaw if you tell \nhim to \u201cPlease animate your jaw\u201d to set that mode. Really not even close\n but hey, he\u2019s a skull for goodness sake, how much can he really \npronunciate? One cool thing about eSpeak is the command line can change \nthe pitch and speed of the voice easily as well as the speaking voice \nbase language. I\u2019ve added pitch and speech commands to move things \nup\/down or faster\/slower just for fun.\n<\/p>\n\n\n\n<p>\nThe jaw animation is pretty limited but just getting the jaw to move was\n more work than expected. When I put the jaw on in 2014 I intentionally \nused some big paper clip wire up through the jaw into the skull to allow\n moving it. However, after getting the neck rotation servo inside the \nskull it was impossible to get another 9g in there. I ended up using a \n2.5g servo and found out they are pretty fragile after messing one up \ntrying to get it positioned and \u201cplastic welded\u201d.. ok, whateve, hot \nglued into place.\n<\/p>\n\n\n\n<p>\nThe back of the bulging eyes were cut out\u2026 hmm, again that just sounds \nbad.. but anyhow, they were cut out until the RGB LEDs would fit into \nthe eyes. I like blue so his default eye color is blue although you can \nchange it to red by telling him \u201cPlease be angry\u201d&#8230; you do actually do \nhave to use the \u201cplease\u201d to make that work. He has green eyes as well as\n shown in the video.\n\n<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" width=\"320\" height=\"240\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrHeadHeadGuts.jpg\" alt=\"\" class=\"wp-image-507\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrHeadHeadGuts.jpg 320w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DrHeadHeadGuts-300x225.jpg 300w\" sizes=\"(max-width: 320px) 85vw, 320px\" \/><\/figure><\/div>\n\n\n\n<h2>Basic Pin Layout<\/h2>\n\n\n\n<p>\n0 Serial to PC\n<br>1 Serial to PC\n<br>2 Leaving for maybe future serial to other device like BoxHead\n<br>3 Leaving for maybe future serial to other device like BoxHead\n<br>4 Neck Rotate Servo\n<br>5 Jaw Animation Servo\n<br>6\n<br>7 Left Eye Red LED\n<br>8 Left Eye Blue LED\n<br>9 Left Eye Green LED\n<br>10 Right Eye Red LED\n<br>11 Right Eye Blue LED\n<br>12 Right Eye Green LED\n<br>13 PIR Input &#8211; not used yet\n<br>14\n<br>A0 FUTURE LDR Input\n<br>A1\n<br>A2\n<br>A3\n<br>A4 I2C Left for Future\n<br>A5 I2C Left for Future\n<br>A6\n<br>A7\n\n\n<\/p>\n\n\n\n<h2>So what does he really do?<\/h2>\n\n\n\n<p>\nReally right now all he can do is sit around and listen and tell me the \nstatus of our work systems, the house systems, the weather, read some \nheadlines, tell me how many days to holidays such as his favorite one \nHalloween, and control some things around the house like Box Head does.\n<\/p>\n\n\n\n<p>\nHe has a couple somewhat snappy comebacks from specific questions or if \nyou ask him to do the same thing twice but otherwise he just hangs \naround and waits for a command. I\u2019ve added some randomness so he\u2019s not \nalways saying \u201cOK\u201d. Pretty simple stuff to just and an interjection \nfunction that returns different possibilities such as OK, Sure, Sounds \nGood, etc. That was actually addressed in the human type robot article \nas well. There are other locations such as when he is saying \u201cLet me \ncheck\u201d that could have more options such as \u201cI\u2019m not sure\u201d, \u201cWell it \nappears that\u201d, etc.\n\n\n\n<\/p>\n\n\n\n<h2>Next Steps<\/h2>\n\n\n\n<h2>Dictation Type of Listen Option<\/h2>\n\n\n\n<p>\nI really want to figure out how to jump back and forth in the SAPI \ncomponent between command and dictation so he (and Box Head) can ask you\n your name or a specific question and can then parse or speak what he \nheard. I\u2019m surprised I can\u2019t find any examples that work and I really am\n not a good enough coder to apparently figure it out myself yet. I know I\n can never get freeform voice commands to work but by mixing in specific\n inputs when prompted it could be helpful for interaction.\nRandom Responses and Head Movement\n<\/p>\n\n\n\n<p>\nI also want to add some more randomness to the different parts of the \nresponses to make him feel more natural and have settled on feeding my \nRandomInterjection() function with types such as PREFIX, POSITIVE, \nNEGATIVE, WAIT, etc. This makes it easy to add new interjections by just\n adding them to a comma delimited string.\n<\/p>\n\n\n\n<p>\nI have code in the Arduino that is supposed to move his head around \nrandomly or wander about a little but it\u2019s not working so I need to work\n on that as well. When it was working it was too jerky so in my attempts\n to make it better I apparently broke it. That is on the top of the list\n to resolve and update.\n\n<\/p>\n\n\n\n<h2>More Automated Home Interaction<\/h2>\n\n\n\n<p>\nThere are many, many things I can add to both DRHEAD and Box Head to \nintegrate with our automated home. Since I developed the front end to \nthe house as a web app, I can easily add to the Box Head control page to\n control and report on things for current and future \u201cHeadBots\u201d as \ndesired. I do NOT allow them to do certain things like open the garage \ndoor or disarm the alarm, etc from a security standpoint but they can \nturn lights on and off, close the garage door, clear the dryer notice, \narm the alarm, tell the house goodnight and various other functions.\n<\/p>\n\n\n\n<p>\nFunny thing is I always wanted to add voice controls to the house but \nnever could get it figured out on the HA PC to work across more areas. \nWith DRHEAD and Box Head that is actually pretty easy.\n<\/p>\n\n\n\n<h2>More Sensors<\/h2>\n\n\n\n<p>\nI also need to activate the PIR in his base so he can feed some \nenvironmentals back to the PC code so it knows how to respond better. \nJust know that something is close to him can allow him to wake up \nhimself or make snide comments like Box Head can saying \u201cYou are getting\n into my personal space\u201d when asked. \n<\/p>\n\n\n\n<p>\nHe could use a LDR or light sensor so he knows if it\u2019s dark or not and \nbe quiet when it\u2019s dark by going to sleep or something similar. \n<\/p>\n\n\n\n<p>\nEven thought of adding a cheap compass so he can know which direction he\n is facing. There are a few pins left and the I2C pins are open so there\n are lots of options there.\nArduino Triggered Events\n<\/p>\n\n\n\n<p>\nHe and Box Head also need the ability to trigger the PC from the Arduino\n side. Right now the PC controls the Arduino and polls for a response \nafter a command. I need to add a timer to go check for commands from the\n Arduino even if nothing is going on in the PC side. That will allow \nsome environmental triggered activities.\n<\/p>\n\n\n\n<h2>Closing<\/h2>\n\n\n\n<p>\nIf nothing else at least I used the 3D skull and validated I can move \nthe Box Head concept to another PC and animated head thingy dealy. He\u2019s \nsimilar but quite different from Box Head which is good. He\u2019ll likely \nend up in another room somewhere away from Box Head to expand the voice \ncontrol options of the automated home and just to provide some \nentertainment. I\u2019m actually printing out a scaled down woman\u2019s face that\n may be more fitting for the Anna voice that is in Win 7\/8\/etc and will \nlikely copy the code over to use more specifically for work junk for the\n fun of it.\n<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" width=\"320\" height=\"427\" src=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DRHeadSmaller.jpg\" alt=\"\" class=\"wp-image-508\" srcset=\"https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DRHeadSmaller.jpg 320w, https:\/\/www.protowrxs.com\/wp-content\/uploads\/2019\/08\/DRHeadSmaller-225x300.jpg 225w\" sizes=\"(max-width: 320px) 85vw, 320px\" \/><\/figure><\/div>\n\n\n\n<h2>For now Happy Halloween 2015 and welcome DRHEAD to the world.<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Decapitated Robot HEAD i.e. &#8220;dread&#8221; November 2015 The basic goal of DRHEAD is to have fun with a decapitated head.. wait, that really doesn\u2019t sound right does it. Anyhow, that is what he is and he is something silly and simple at first but with options to grow, DRHEAD has a little bit of entertainment &hellip; <a href=\"https:\/\/www.protowrxs.com\/index.php\/robotics\/drhead\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;DrHead&#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\/503"}],"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=503"}],"version-history":[{"count":1,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/503\/revisions"}],"predecessor-version":[{"id":509,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/pages\/503\/revisions\/509"}],"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=503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/categories?post=503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.protowrxs.com\/index.php\/wp-json\/wp\/v2\/tags?post=503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}