Tuesday, October 11, 2011

DIY Telepresence Robot - Part 9

Upgraded Power Management

So after several months of operation I encountered a number of problems with the design.  I would frequently (twice a day) lose control of the original robot and have to reboot the system because of connection problems in the USB/Serial interface between the laptop and iRobot Create.  Additionally I had semi-frequent problems (twice a week) maintaining proper control of the PowerPod.  It would occasionally go crazy, escape my control, and orient itself at odd angles.  Those problems were annoying but relatively manageable for a while.  However, when the battery charger in my original iRobot Create broke and I had to replace the iRobot, I began to have even worse issues.  In addition to the original control loss problems, the iRobot Create would frequently "brown-out" while docking which would drop power to the laptop and leave it dead in the water.  I would have to get a coworker to help me power up the system each time.  These problems almost always occurred during the docking maneuver which itself draws a large amount of power, so without much evidence to go on I hypothesized that it was a power management issue.

I originally wired the laptop to theoretically draw up to 3A of power from the Create, but honestly I never really did any boundary testing to determine whether the hardware could handle this type of draw.  Maybe the Create power pins cannot actually supply the 3A (maybe only 1 pin can draw fully at a time) or there is an undocumented total power limit that the battery can supply to the hardware.  When this power ceiling is exceeded the Create crashes and power cycles.  Another possibility is that the power state transition between not-charging and charging is sometimes not very smooth and causes a momentary drop in power.  Either way it seemed like the best thing to do would be to minimize power draw as much as possible.  I only had circumstantial evidence, but with nothing else to go on I went ahead and made changes in both hardware and software to reduce and smooth power usage.

First, I wanted to take all of my USB components off the laptop motherboard power supply.  The video camera and PowerPod in particular both draw a fair amount of power and it might be difficult for this low power netbook to power them adequately while also running itself.  Spreading out the power draw across multiple circuits might help minimize stress on the system.  I bought a cheap off-brand powered 4-port USB 2.0 hub.  The hub accepts a 5V power supply so I bought an extra voltage converter to step from the battery voltage down to 5V and a simple breakout connector to hook it up with.

SWADJ3 Voltage Converter

I wired power pin 11 and ground pin 16 to the SWADJ3 input.  Next I adjusted the SWADJ3 until it output 5V DC.  Then I cut the AC/DC converter off the USB hub power cable and rewired the power cable to the SWADJ output so that the USB hub could now be powered directly from the iRobot Create battery.

Installed SWADJ3

Now I was able to unplug the three USB cables that were plugged into the laptop and replace them with a single USB connector to the hub.  The three previous USB connected components: iRobot Create, PowerPod, and webcam were all plugged into the hub and receive power directly from the Create instead of the laptop.

4-Port USB Hub
Cleaned USB Cables
In addition I modified the software to allow for manual toggling of both the Skype video feed and the netbook screen.  This reduces the battery draw by about 300mA - 400mA and gives the Create itself more power to draw from.  This low power mode is especially helpful during auto-docking when the Create needs a lot of power.  Since the iRobot Create plays a little song upon successful docking, it is not strictly necessary to visually monitor the docking maneuver.  I can simply watch the TPRobot docking and voltage indicators and listen to the Skype audio feed to determine when the robot has docked.

I have been operating with these changes for the past three weeks and the results have been very positive.  First off - I seem to have eliminated the PowerPod problems.  Moving it to a dedicated power source really seems to have solved that issue.  Not once have I experienced a loss of control over the PowerPod and I find myself using the neck even more now that I have confidence that it will work properly.  In addition the changes seem to have resolved the problem that would cause the battery to slowly drain over the weekend. For two weekends straight the robot has stayed alive for the entire duration without my intervention.  This was totally unexpected and a nice surprise for me.

But most importantly, I have GREATLY reduced both the USB/Serial interface connection problem and the docking power loss problem.  Whereas before, I would experience these problems 2-3 a day now I only see them 2-3 times a week.  These were the key problems that plagued me daily and rendered the robot nearly unusable.  Unfortunately I have not completely eliminated those issues, so the robot is still not stable enough to be used in a completely autonomous manner, but the inconveniences now are infrequent enough that they don't really bother me much anymore.  Having to ask a coworker to reboot my machine once a week is not a significant burden, so I am currently satisfied with the design and will probably not try to improve it anymore in these regards.  If I were to attempt to improve its stability even more, I would probably try and reinsert the battery into the laptop.  That would at least prevent the laptop from ever crashing due to brown-out.  The cost however would be to significantly increase the weight and stress on the PowerPod and since I have new components planned for the head, I don't want to disturb that part of the design.

Here is the updated TPRobot software that I am using.  It has the toggle controls for video and screen under the View menu.  Currently I am turning off both video and screen during docking in order to minimize battery draw.  In addition there is an alpha version of a shared whiteboard included that I have been developing so that I can easily make sketches on the robot screen.  It is functional now but not finished, and I will cover it in more detail in a future post.

TPRobot_0.8.2.zip


Saturday, September 17, 2011

Robot upgrades

I reworked the robot power system a little bit and made some software changes to try and fix the problems that I have been having with it.  I ran the robot remotely for three days this week to test the changes.  Bad news first:  I have not completely eliminated the glitches.  I had a couple of power failures this week requiring a reboot.  Good news:  It seems that the robot is significantly more stable than before.  Even though I had a couple problems I was able to predict them by monitoring the power system, so I think that I will be able to handle it in the future.  As a bonus, I have significantly reduced or eliminated some other glitches that plagued the original system.   The loss of the serial/USB connection only occurred once this week where before it would occur 2-3 times per day.  Also I have not any problems with the PowerPod.  I want to give it another full week of testing before I draw any conclusions, but if this stability persists I will post another part to the robot project detailing the changes that were made.

Friday, September 2, 2011

Sick Robot

My previous iRobot Create apparently did "burn out" its charging circuitry and was not able to charge its battery.  I ordered a new Create, replaced the old one, and it fixed that problem.  So my robot was back up for a few days but now I have a new problem!  Very frequently the Create drops power to the serial pins when docking.  When that happens the netbook goes - poof!, and instantly turns off.  A major problem!  So I am currently diagnosing the problem and trying to come up with a fix.  My current plan is:

1. Determine if a lower power draw can help the problem.  For example, turning off the screen or the video feed during docking.

2. Wire pin 9 instead of pin 12 which should should give me unregulated access to the battery and hopefully no power loss.

Those would be relatively easy fixes requiring no structural changes, but if I can't get either of those to work then I might have to resort to

3. Change the design and put the battery back into the netbook.  That would require refashioning the "table" and putting a lot more weight up top.  It would protect the netbook from any power drops.  I don't really want to do this because I worry that it might cause problems with the PowerPod, but I may have no choice.

Monday, August 29, 2011

DIY Telepresence Robot - Part 8

Users Guide

This guide gives an overview of the control software, the robot behavior, Skype integration, and guidelines to keep the robot up and running.  If handled correctly the robot is capable of autonomous operation for weeks at a time, but to keep the robot healthy it must be carefully monitored and used on a near daily basis.  Left unattended over a weekend and the robot will likely die (refer to the Problems section for details) 

Robot Controller

The TPRobot program is actually two applications in one.  One instance runs on the Asus netbook and functions as the Create and PowerPod controller and listens for commands from the control computer, and another instance runs on the control computer and sends commands over the Internet to the first instance.  These two aspects of the application or depicted visually as a tab control.  The first tab is called "Local Connect" and embodies the robot interface.  It has settings to interface the Create, the PowerPod, and to create a command listener.


  • iRobot Serial Port - The COM port number for interfacing with the iRobot Create
  • Tracker Pod - Enables attachment and control of the Eagletron PowerPod.
  • Allow Network Control - Enables a network command listener.  Connections and commands are sent through the Skype network.
  • Password - Skype authenticates which accounts are able to connect and issued commands to TPRobot and all Skype traffic is encrypted.  However, for additional security this password is also used to authenticate the connecting peer.
  • Attach - Attempts to connect to the Create and PowerPod.  Once connected the robot will be in "drive" mode and the battery will not be charging - even when it is sitting on the charger.
  • Detach - Disconnects from the Create and PowerPod and puts the Create into charging mode.  You must detach the robot to charge the battery.

      Remote Controller

      The second tab - called the "Skype Connect" tab is used to configure the remote controller.  All communication between the two applications is sent via the Skype network.  Skype is primarily thought of as a VOIP app, but it is also a generic communication platform that can be leveraged to send messages between external applications.  The Skype application serves as a proxy, setting up the connection and handling the data transmission.  The bandwidth is not terribly high but for an application like this it is more than adequate.  The benefit is that Skype handles all the messy details of connectivity, firewall traversal, encryption, and message reconstruction for you.


      • Skype ID - The Skype ID of the account being used on the netbook.  Separate accounts and ID's should be used for the netbook and control computer.
      • Password - This should match the password configured on the netbook.
      • Connect - Creates an authenticated Skype connection to the robot controller.  Upon successful connection the screen will be turned on and the robot will be automatically "attached" and drive mode initiated. 
      • Disconnect - Closes the connection to the robot controller.  The robot interface is "detached" and the charge mode is initiated.  To reduce the power draw on the battery while in charge mode the robot screen is also turned off.

        Driving Controls

        The driving controls are all keyboard based using a layout familiar to gamers.  
        • Move Forward     - W
        • Move Backward  -  S
        • Turn Left              -  A
        • Turn Right            -  D
        • Up-Shift               - Space
        • Look Up              - Up Arrow OR NumPad 5
        • Look Down         -  Down Arrow OR NumPad 8
        • Look Left            -  Left Arrow OR NumPad 4
        • Look Right           - Right Arrow OR NumPad 6
        • Look Straight       - NumPad 7
        The left hand moves the robot around using the WASD key set.  Holding down the movement keys will accelerate the robot in the desired direction and letting go will decelerate.  There are four "gears" to increase robot speed.  Tap the space bar while holding down the move keys to up-shift to the next gear and increase maximum speed.  There is no explicit down-shift key.  When the robot decelerates to a full stop, the gear automatically returns to one.

        IMPORTANT:  The TPRobot window must maintain keyboard focus for the controls to operate properly.  If you click on a different window while driving, the robot may continue moving even after you release the keys.  Click back on the TPRobot window to regain control again.

        The right hand controls the PowerPod.  Each tap of the arrow keys or number pad will rotate the head a few degrees.  In practice, head movement is not used very often.  I usually just drive with the left and keep my hand on the mouse - only stopping to adjust the head if I bump into something or to talk to a person that is standing.  Even then I typically only use the look up and look down controls because looking right and left is functionally the same as turning right and left.

        The bottom half of the UI displays the robot speed and sensor status.
        • Speed -  The text displays the independent speed of each wheel, while the progress indicator shows the total forward or backward speed of the robot.  The digit to the right of the progress indicator shows the current gear.
        • Dock - Turns orange when the robot is within proximity (about 8 feet) and facing towards the charging base.  Turns green when the robot has successfully docked and has electrical contact with the charging base.
        • Auto Dock - The button becomes enabled when the charger base proximity light is on.  Clicking it initiates the auto-dock function - during which time all drive controls are disabled and the robot will automatically enter a search pattern and attempt to dock with the charge base and start the charging cycle.  The auto dock feature is very imprecise and will often take 2 or 3 attempts before correctly docking.  It is best to line up the robot manually before selecting Auto Dock.
        • Bump - Turns red when the robot hits an obstacle and the front bumper is activated.  The robot will immediately stop all forward momentum when a bump is detected.  There are no bump sensors for the rear or sides of the robot.
        • Error - Turns red if a software exception occurs on the robot controller.
        • Battery - Displays battery capacity and usage data.  The text indicates the actual voltage and current draw detected on the battery.  The progress indicator gives an "estimate" of the amount of battery capacity left.  The progress indicator is not always accurate - especially when the robot is sitting on the charger.  After a few minutes of usage the progress indicator becomes more accurately calibrated.
        Scripts

        To customize the robot functionality, the robot controller can execute batch file scripts.  Any batch files found in the \run\scripts folder will be made available under the "File->Run Scripts" menu.  Scripts located on the robot controller can be executed by the control computer.  Just about anything can be performed by the scripts, but the two useful examples provided in the release are RestartComputer.bat and RefreshWireless.bat the purpose of which should be obvious.
          Problems

          The robot has some major flaws.  I have explored them a bit and - so far have not come up with permanent solutions.  However, I have discovered ways to work around these problems and have come to terms with them.  Once you learn to manage these issues the robot can be operated with very little outside help for weeks at at time.  Still it is a good idea to have someone at the office that is well acquainted with the robot and its flaws to help you out when necessary.

          Updated Solutions 10/11/2011-> Part 9: Upgraded Power Management

          1. Charging
          The biggest problems with the robot have to do with the battery draining.  On a full charge the robot can operate for over an hour making short drives and video conferencing.  That is ample time to talk to people and then get back to the charger.  The problems start at the charger.  When the iRobot Create docks with the charger it enters into its charge cycle and the battery light will start slowly blinking red.  During this time the netbook is still on and drawing power, but the battery is still able to charge up.  Once the battery becomes fully charged the Create will then show a solid green light and enter into a trickle charge state that is designed to keep the battery full.  A flaw in the Create firmware prevents it from taking into account the current draw of the netbook however, and it never notices that the netbook is slowly draining the battery.  It fails to reenter the charge state and it continues to show a green light for several hours while it drains away until - poof !  The battery and the netbook die.

          There is no way to put the netbook into a low power "sleep" state because it must be ready at all times to accept control requests.  The Asus motherboard does not support "wake on wireless LAN", so it cannot be put to sleep.  The only way around the problem is to continually send a "reboot" command to the Create so that it will recheck the battery and restart the charge cycle.  (Luckily there is an undocumented command 7 that handles this).  So the TPRobot application must connect to the robot once every hour to send a reboot command and keep the battery charged.  Great! - but that will only keep it alive for about 2 days straight.  Even with this "hack" in place the Create somehow slowly loses track of the correct battery charge level, and the only way to recalibrate it is to take it off the charger and drive it around for a few seconds.  After recalibration it can then be placed back on the charger and the process can start all over again.  So at a minimum you MUST connect to the robot every one or two days and drive it around for a few moments - even on the weekends.  Following this procedure I have been able to keep the robot operating continuously for a month.  So that's not so bad -- except in conjunction with the next flaw.

          2. Serial-USB Disconnect
          This problem is more difficult to diagnose.  Sometimes when the Create is getting back on the charger it momentarily drops its hardware connection to the netbook.  This happens fairly frequently - maybe one out of every five times that it docks.  As a result the TPRobot application loses all contact with the Create and is not able to reconnect to it without throwing an error.  (Unauthorized Access Exception).  Without the ability to communicate with the Create, the TPRobot is unable to send the reboot commands and so - again the robot battery will drain within a few hours.  There are two ways to fix this.  First - if a person physically unplugs and replugs the Create USB cable into the netbook, then the TPRobot application will be able to reestablish a connection.  However if a person is not available then the only other way to fix it remotely is to reboot the netbook.  So the second procedure the operator must follow is to notice whenever the TPRobot loses contact with the Create and send a Windows reboot command.  This capability has been built into the software to simplify this task.

          3. Docking power loss.
          Similar to the above problem and a relatively new but serious problem.  I only experienced it after 3 months of operation after replacing my Create robot with a new one.  Sometimes during docking (presumably on the transition between non-charging and charging) the Create will drop all power to the netbook and the netbook will instantly turn off.  I have yet to understand this problem but it does not bode well for the overall design.  It may have been a mistake to remove the battery from the netbook - at least with the battery, these brown outs would not be catastrophic.

          4. PowerPod Craziness
          Another difficult problem.  Once every week or two I will lose complete control of the PowerPod when attempting to rotate it.  I don't know if it's a transient power issue or software bugs in the drivers, but whatever happens is catastrophic.  The PowerPod will just suddenly rotate to maximum on both axis (look up at ceiling) and the motors will stay engaged trying to rotate even further.  Attempting to rotate it back has inconsistent results.  Often it will just move all to way in another direction.  The only way to fix it seems to be to "detach" the TPRobot interface, unplug the USB cable on the back of the PowerPod, and physically force it back into home position.  Then reconnect the USB and try to gain control again.  This may have to be done one or more times before the hardware and drivers finally synchronize.  I don't really have not investigated this problem very much so I cannot really say whether it is a fault with the hardware integration, the Eagletron driver software, or the TPRobot software.

           Next-> Part 9: Upgraded Power Management

              Thursday, August 25, 2011

              DIY Telepresence Robot - Part 7

              Software Install

              Designing and creating the hardware was a relatively straight forward task.  I had a few false starts and design changes, but since I used high level parts the construction came together rather quickly.  The software however is a much longer and on-going project - not because it is particularly difficult but simply because that is the nature of software development.  Software takes a long time to mature properly, and between work and home-life I only have a few hours a week to work on side projects like this.  I considered selling the software since it represents a good chunk of investigation, time, and expertise on my part.  However with selling a product comes the moral obligation of quality assurance and ongoing support - neither of which I am willing to commit to.  Plus - I have taken my fair share of open-source and sample code from the Net over the years, and I figure it's about time that I pay back that debt, so I am releasing all of the source code and binaries for free under the "whatever the hell you want to do with it" license.

              Before installing the control software you have to set up the OS and support software.  Here is a guide for configuring the netbook (as best as I can remember).  If something is missing contact me and I can update this procedure.

              1. Set Auto-login
              Configure your login account so that it will automatically log in on startup because you will probably need to remotely reboot the computer fairly often.  (Be aware of any company security policies that this may affect)

              2. Disable automatic power management
              You don't want your computer going to sleep on you, so go into your power options and set the computer to never dim the screen, never turn off the screen, and never sleep when plugged in.  It's a good idea to reduce the brightness of your screen a bit to draw less power and increase your battery life.  Disable any screen savers.

              3. Disable unnecessary applications.
              To conserve power you don't want a bunch of background apps burning CPU cycles.  I can't be specific here but go through your Services, installed applications, and startup apps and remove as much clutter as you can.  For example - virus scanners, auto-updating software, file indexers, quick start services, tray tools, etc.. are all useless since this machine is dedicated to a single app.

              4. Install some type of VNC or Remote Desktop software.
              At some point you will absolutely need to log in to your desktop and diagnose or configure your environment.  Having remote desktop software is a life saver instead of asking a coworker to come and handle it.

              5. Install the web cam.
              Just install the basic drivers and avoid any extra applications that come with it.

              6. Install Skype.
              One crucial feature that was removed in recent versions of Skype (5+) is the "auto-answer with full-screen video" feature.  This is really important since you want your robot to automatically answer your video call when you Skype it and display your face in full screen without any human intervention.  For this reason you should install a legacy version of Skype that still has this all-important feature.  I am using Skype 4.2.0.187 and that works well for me and is compatible with a Skype 5 peer call.

              Setup a new Skype account for the robot and configure Skype to auto-launch and auto-login at startup.  Also configure Skype to use the LifeCam video and microphone and set it to auto-answer with full screen video.  Another issue is that Skype attempts to automatically adjust the microphone level when it detects silence.  When having a conversation with someone this is fine, but while driving around in silence it tends to amplify all the robot motor noises and bumps to an annoying level.  It is a good idea to configure Skype with a fixed mic level to minimize this noise.

              7. Install Eagletron PowerPod Service.
              The software interface to the PowerPod is in the form of an ActiveX control that communicates indirectly with the hardware via a Service application.  The "Eagletron TrackerPod Service" should be installed to startup automatically.  You can install it indirectly through their tester utility, or you can get it directly here.
              TrackerCam_setup_SERVICE_5.3.1.29.zip

              8.  Install the TPRobot application on the netbook.
              This application serves both as the direct robot interface and also the remote control app.  It was based originally on Johnny Lee's C# robot driver and still has the same basic GUI design and a few snippets of code left from that project, however the bulk of the code has been completely rewritten (still in C#).  The TPRobot application should be added to the Startup folder so that it automatically launches on startup.  The source and binaries are here.  There is no installer so just unzip the contents to a location of your choice.
              TPRobot_0.6.2.zip

              9.  Register the Skype interface
              From the command line type "regsvr32 Skype4COM.dll"

              10. Run the application.
              Execute \run\TPRobot.exe

              11. Install TPRobot on the control computer.
              Repeat steps 6 and 8-10 on a your control computer at home.  You should create a personal Skype account instead of reusing the robot account.

              The next post will be devoted to how to use the software and the robot.
              Disclaimer:  While this code has settled down significantly over the last couple of months to a relatively stable and usable level - this is still very much prototype/alpha level code and there is much room for improvement.  Most of the problems now are just annoyances, but there are still a couple of major problems that you must be constantly aware of.  I will detail all of this in the next post.

              Next-> Part 8: Software Usage

              Monday, August 22, 2011

              robot troubles

              Finally had my first major break-down of the telepresence robot after 3 months of operation.  A week and a half ago I tried to connect on Monday morning and found that the computer was down.  Not an entirely unusual occurrence - I have had occasional battery drains over the weekend if I fail to monitor the robot.  However the usual attempts at battery recharge failed.  Assuming the battery had somehow gone bad, I purchased a new battery, charged it up, got the robot working again one night and then the next morning - same thing - battery drained.  After a number of unsuccessful attempts to charge the batteries I have given up and decided that the on-board charger has broken.  I don't have the patience to deal with the back-and-forth with tech support to try and get this thing resolved.  I am really spoiled and I miss my virtual presence at the office, so I went ahead and ordered a new Create and hopefully that will fix the problem.  I hope this is not a frequent occurrence.

              DIY Telepresence Robot - Part 6

              Final Assembly

              Once all the parts have been created, we just need to put everything together to finish the robot.  When we built the body frame in part 4 we did not permanently attach the vertical shaft to the H-foot in order to allow for cables.  It is now time to run those cables.  Carefully drill and smooth an oval shaped hole in the back of the support shaft about 8 inches from the top.  It is best to drill several adjacent holes using small drill bits, and then use increasingly larger bits until the holes merge into a single oval.  The oval should be large enough to comfortably pass a Type-A USB connector through.  This will be the where the cables exit the shaft on their way to the netbook.

              Push the USB end of the Create USB to Robot Cable through the hole in the bottom of the H-foot and snake the cable up through the bottom of the shaft and out through the oval hole.  Now feed the newly created netbook power cord (up or down) through the vertical shaft and H-foot as well.  With both cables in place now we can connect the body frame.  Tap the vertical shaft all the way onto the H-foot being careful not to damage or bend any part of the frame.  It may be helpful to sand down the H-foot connector a little to ease this process.

              Before attaching the body frame, turn the iRobot Create over and use the supplied wheel clamps to fasten the wheels in the retracted position.  Now turn it back over and  use the 1 1/4" long 6-32 mounting screws to attach the finished body frame to the iRobot Create.




              Plug the DB-25 connector and the round Mini-DIN serial cable into the Create.  Neatly secure all the extra cabling and the AnyVolt3 in the Create cargo bay area using some electrical tape and/or twist ties.  The picture below shows what my cargo bay looks like.  (The gray coiled cable is just some extra unattached wire that I included for future use.  I also added some DC plug connectors to the AnyVolt3 to make it easier to disconnect the electrical system.)

              Cargo Bay

              Screw the Eagletron and notebook platform onto the bolt at the top of the shaft.  Then press the netbook onto the platform and make sure it is centered and securely fastened with the velcro.  Insert the power plug and the iRobot serial to USB cable to the netbook.  Attach a USB cable from the back of the Eagletron to the netbook.

              Place the webcam on the top of the open netbook screen and fasten it with tape or velcro.  Plug the webcam's USB cable into the netbook.  The USB cables will bow out to the sides of the robot and may occasionally brush against walls and doors.  USB right angle adapters can be used to reduce the width of these cables.  Once everything is attached, use some wire management clips and ingenuity to secure the extra cabling.  The picture below shows what I managed to come up with, but I really didn't try that hard and I am sure others could vastly improve the appearance of their robot.

              Rear cables

              The last thing that needs to be done is to create of a docking station.  You should clear a small 4x4 area of all obstructions and floor clutter.  Secure the iRobot home base charger on the floor with some tape so the robot will not push it out of position.  Plug the charger base in and make sure the power cords are well out of the approach pathway.  To assist docking I fastened a cheap mirror behind the charge base so that I can better see the robot in relation to the wall and charger on approach.

              Docking Station

              The robot is complete.  Now we just need to install and configure the software.

              Next--> Part 7: Software Install

              Saturday, August 13, 2011

              DIY Telepresence Robot - Part 5

              The Electrical System

              Powering the netbook is one of the more interesting design problems.  Johnny Lee came up with a novel solution.  He modified the charger base to output 110V AC instead of DC.  Then he piled both AC/DC converter bricks onto the iRobot and charged it and the netbook using AC power supplied by the charger.  The advantage to this approach is simplicity.  By keeping both electrical systems intact and separate, he avoided the design problems associated with unifying them.  But keeping both power systems on the robot adds weight to the unit - creating docking problems.  More importantly, the conversion of the charger base to AC and the exposure of high-voltage contacts creates a potential fire hazard which renders the design inappropriate for a place of business.

              Initially I tried to keep the dual electrical system but address its problems by designing a custom plug and socket mechanism.  The socket would capture and engage the plug during auto-docking to charge the netbook, but the iRobot docking motion proved to be too erratic for a physical solution.  No plug mechanism had enough positional tolerance.  So instead I abandoned dual electrical systems and decided to unify the systems and power the netbook directly from the iRobot battery.

              Luckily the iRobot Create already has an electrical pathway to its battery through its serial interface so no physical modifications have to be made to the iRobot.  The only remaining problem then is to convert the battery feed to the proper voltage and current for the netbook.  The power requirements for the Asus 1015PE are 19 Volts and 2.1 Watts as listed on the AC/DC converter brick.  To meet this non-standard voltage, I found a nifty little product called the AnyVolt3.  It can take any input voltage from 5 to 30V and step it up or down to any output voltage between 3 and 24Vwith reasonable efficiency.  The output voltage is adjusted by a little potentiometer dial on the unit.  Our iRobot battery supplies a voltage ranging from about 12V to 16V depending on its charge level, so we just need to boost the power by 3 or 4V for the Asus netbook.  If you choose a different netbook, then the AnyVolt3 should easily be able to accommodate its different voltage requirement.

              AnyVolt3

              The Asus claims to draw up to 2.1 Amps of power.  I hooked up a multimeter to test this but never saw that much current draw from the netbook during normal usage even with all the robot components connected and operating.  I assume that a 2.1A draw could occur during charging, but that's not possible without a battery attached.  So the netbook does a pretty good job of power management and the normal power draw sits somewhere around 0.5A with occasional spikes only going as high as 1.2A under load conditions.  Looking at the iRobot Create serial interface we see that pins 10, 11, and 12 each supply the battery voltage at 1.5 Amps a piece, so in theory I could get all the power I needed from a single pin.  However the AnyVolt3 draws more current than it outputs when up-converting voltage.  In other words, if the netbook is drawing 1.2A, then the AnyVolt3 will be drawing MORE than 1.2A in order to generate 19V.  To be on the safe side I used two pins in parallel to provide up to 3A to satisfy the full currency requirement.

              Hooking all this up is incredibly simple.  Plug a male DB-25 serial connector into the iRobot.  Now cut two short lengths (about 10") of power wire and connect one of them to pin 10 and the other one to pin 12.  If you use a serial breakout board connector then you can simply screw the wires in and avoid soldering.  The other ends of both power wires will overlap and screw in to the positive input terminal of the AnyVolt3.  Now cut a short length of ground wire and string it between pin 14 (GND) of the serial connector and the negative input terminal of the AnyVolt3.

              Next configure the AnyVolt3 output voltage.  Power on the iRobot and use a voltage meter to test the output terminal of the AnyVolt3.  Turn the AnyVolt's potentiometer until you detect a 19V output voltage.  To finish the wiring first cut the DC end of the netbook power cord just above the AC/DC converter brick.  Attach the cut ends of the wire to the positive and negative output terminals of the AnyVolt3.  Finally plug the power plug into the netbook.

              Electrical Wiring


              In summary, the iRobot serial interface should be connected by three wires (2 positive, 1 ground) to the AnyVolt3 input and the netbook should be connected to the AnyVolt3 output through its power cord.  You should now be able to boot up and test the netbook without a battery using only the power supplied by the iRobot.  The electrical system is now complete.  Fully charged, the robot and netbook can operate between 1 and 1 1/2 hours assuming that it only travels short distances and mainly sits still during conversations.  That is long enough for most daily activities including short visits to multiple coworker offices and even medium length formal meetings in a conference room.

              There is one major problem with this design.  When the iRobot gets back on the charger, it enters a charging cycle where it draws a large amount of current to charge the battery with.  In order to remain responsive the netbook must stay powered and awake at all times - even on the charger, so the netbook is drawing a bit of current during the charge cycle as well.  We can minimize the impact by doing things in software like turning off the screen, but we cannot eliminate it, so we are left with a minimum draw of about 250mA just to keep the netbook alive.  You would expect that the iRobot charger would compensate for the netbook draw and be able to keep the battery fully charged, but there is a flaw in the iRobot design.

              Once the iRobot detects that it has fully charged the battery, it enters into a trickle-charge mode that is designed to keep the battery at full charge.  Unfortunately during this mode the iRobot never bothers to test whether the battery is staying charged or has a draw on it.  It just assumes that the trickle is enough, but our netbook draw far exceeds the trickle charge, and so the battery will eventually drain even if the robot is sitting on the charger and the green "full charge" light is on.  Once the battery drains, it is difficult to get the robot "unconfused" about its charge state and operating properly.  I have implemented some software tricks to "mostly" overcome this problem but I have not been able to fully solve it, and so battery health is a constant and nagging issue with this robot.  I will go into some more detail about this when I cover the software in a future post.

              With the electrical system complete we have manufactured all of the robot parts, so we just need to put all the pieces together the complete the robot assembly.  The next post will cover the final assembly.

              Next--> Part 6: Final Assembly

              Friday, August 5, 2011

              DIY Telepresence Robot - Part 4

              Building the Body

              Construction of the body frame is an easy task because of the simplicity of working with the EZ Tube construction system.  The body design has to be as light as possible but strong enough to withstand the weight and stress of the head.  I considered using Styrofoam, PVC pipe, and even wood, but these materials were all heavier and bulkier than I expected and not nearly as sturdy as aluminum.  It would have been necessary for me to build a "box" like structure to gain the required rigidity.  Aluminum allowed me to simplify the body down to just a single strut and the EZ Tube part dimensions, shapes, and ease of assembly coincided exactly with what I needed.

              The body is formed by creating a support strut and mounting base from the EZ tube parts.  First cut a 30" length of tube using a hack-saw or table saw.  This will be the vertical shaft and its length will position the robot head at just the correct height to talk comfortably with someone seated at a desk.  Now cut two short 3 7/16" lengths of aluminum tube and use them to attach the three composite T connectors so that they form an H shaped foot with one of the connector ends pointing vertically from the center.

              The H foot should be wide enough so that when placed on top of the Create, the ends sit directly over the four 6-32 screw holes on the top of the Create.  iRobot conveniently designed the Create so that a five pound load centered between these four screws will counter the weight at the front of the unit and balance the Create robot almost perfectly.  Thus the mounting screws in the H foot should be positioned so that the vertical shaft  is perfectly centered between them.  Create a paper template of the screw holes and use it to mark, position, and drill the holes in the H foot.  Using progressively larger bits, drill a large hole straight up through the middle of the foot into the vertical connector large enough to shove a Type-A USB connector through.  We will use this hole to hide some of our cables within the aluminum shaft.

              Next cut off the tips of the H foot (excluding the vertical one) since they don't add any stability, are not used as connectors, and are simply dead weight.  Then remove the cargo bay tailgate to eliminate more dead weight.  Gently connect the 30" shaft to the H foot.  DO NOT FULLY HAMMER THE SHAFT ONTO THE FOOT YET.  We only want a temporary connection for positioning.  Use 1 1/4" long 6-32 screws and thin washers on top and bottom to attach the H foot to the Create.  Be careful not to over-tighten or allow the foot to angle.  Use a level tool to ensure that the shaft is perfectly vertical.  If not level then use additional washers under the foot to level it.  The mounted foot should look this.




              The next thing we will do is to create an attachment between the vertical aluminum shaft and the Eagletron PowerPod.  Luckily the PowerPod has a standard camera tripod mounting screw hole on the bottom of it, so all we need to do is create a sturdy screw mount for it.  To do this we take the EZ tube adjustable foot end-piece and remove the foot.  That leaves an end piece with a perfect little hole in it.  All we have to do now is take a 1 1/4" x 1/4"-20 bolt and push it upwards through the hole.  Now use a flange nut with the flat end facing upwards to lock the bolt into place.

              Screw the PowerPod onto the bolt until it is fairly tight.  Turn the bolt in the socket and continue tightening until both the PowerPod and the bolt feel tight and locked into place and are facing straight forward.  Now apply some super glue to lock the bolt in position.  Finally, tap the end-piece into the aluminum shaft.  You may need to use a knife to shave off some of the plastic to accomplish this.  The finished end piece and bolt should look like this.


              We are now done with the structural elements of the robot.  In the next post we will implement the electrical system so we can power the laptop from the Create battery.


              Tuesday, August 2, 2011

              DIY Telepresence Robot - Part 3

              Building the Head

              Robot Head

              Construction of the robot "head" is the the most delicate part of the project.  It involves the creation of a custom bracket to mount the laptop on the Eagletron PowerPod.  The PowerPod forms the neck of the robot.  It is a small motorized platform that can rotate both horizontally (pan) and vertically (tilt).  The mounting platform itself measures about 2"x2" across and comes with a removable camera mounting bolt that can be used to attach a variety of video cameras.  To avoid making modifications to the netbook shell, the mounting bolt will be removed and the netbook bottom will be attached to a flat platform surface using velcro.  (Adhesive tape can also be used but velcro allows the netbook to be easily removed and reattached)  At 2"x2" the PowerPod is too small to form a sturdy connection with the laptop using only velcro, so a larger mounting surface will be created using a thin sheet of aluminum.

              Another reason to create the custom mount is to reduce weight.  The PowerPod is designed to support video cameras up to 3 lbs.  Our netbook is lighter than 3lbs, however its weight distribution is very different than a video camera.  A video camera holds all of its mass in an evenly distributed box with the center of gravity just an inch or two above the bottom.  Our laptop has an L shape when open, and its center of gravity sits high and towards the rear, so to avoid stressing the PowerPod motors we should ensure that the weight is well below 3lbs.

              The easiest thing we can do to shed weight is to remove the battery from the netbook.  It's heavy and since we will be powering the netbook from the iRobot battery, it's also redundant. The Asus battery forms the lower rear surface of the netbook, so removing it leaves a large cavity on the bottom of the netbook instead of a smooth surface.  This cavity sits right below the center of gravity of the open netbook.  We will need to mount the laptop as close as possible to the center of gravity right under the battery cavity.

              To provide support under the battery cavity we create an aluminum curve.  The flat bottom part of the curve will support the base of the laptop and provide a large surface for velcro adhesion.  The top part of the bracket will gently curve into the battery compartment to support the center of gravity.  To create the curve bend a 6.5" x 12" x 0.04" aluminum sheet around a 3/4" wooden dowel rod.  Then use a hack-saw to cut the two ends of the sheet to the proper length and a mallet and pliers to refine the shape.  (a vise and a table saw would have been helpful but I had neither.)  Finally file down the sharp edges to avoid scratching the laptop.


              Curved Aluminum Sheet

              Now the aluminum curve must be attached to the PowerPod.  Remove the 4 screws that hold the mounting clamps to the PowerPod mounting plate.  Measure and drill out four holes in the aluminum sheet that match the holes of the mounting plate.  The holes must be oriented so that the mounting plate will be centered laterally and sit as far back as possible on the curve.  The hole alignment has to be near perfect.  Create and use a paper template to ensure that the holes are spaced precisely and be careful not to let the drill drift.  Use a drill press if possible.  Attach the aluminum curve to the PowerPod with the four screws.

              Use some electrical tape to pad and soften the top of the curve surface where it contacts the battery compartment to avoid scratching.  Finally stick a couple of wide velcro strips to the aluminum surface and to the bottom of the laptop.  The finished product should look like this.

              Finished Platform

              The netbook should be able to sit on the bracket in an open position without toppling it and the velcro adhesion should be strong enough to easily withstand tilting and shaking of the unit.

              That completes the neck and head of the robot.  In my next post we will construct the tower "body" and attach the neck to the body of the robot.

              Next -> Part 4: Building the Body

              Sunday, July 31, 2011

              DIY Telepresence Robot - Part 2

              Parts List

              Construction of the robot is more of an assembly task than a true manufacturing task.  A collection of high level parts loosely thrown together - the robot can be assembled quite quickly.  Construction of the body frame requires a small amount of craftmanship but even so - the whole robot can be built in a day (a weekend at most) using common tools.  Many of the parts are only found online, but some may be purchased locally if the price is competitive.  Here is the list of parts...

              - iRobot Create Programmable Robot  $130
              http://store.irobot.com/product/index.jsp?productId=2586252&cp=3311368.2591511&s=D-StorePrice-IRBT&parentPage=family

              - APS Battery $70
              http://store.irobot.com/product/index.jsp?productId=3001463&cp=2804606.3335976&ab=CMS_AccSuper_080309&s=D-StorePrice-IRBT&parentPage=family
              Since we're going to be tapping the battery for the netbook, we want the highest capacity, fastest charging battery.

              - Home Base Charger $70
              http://store.irobot.com/product/index.jsp?productId=2598729&cp=2804606.3335976&ab=CMS_AccSuper_080309&s=D-StorePrice-IRBT&parentPage=family

              - Create USB to Robot Cable $20
              http://store.irobot.com/product/index.jsp?productId=2818673&cp=2804606.3335976&ab=CMS_AccSuper_080309&s=D-StorePrice-IRBT&parentPage=family

              - Asus Eee PC 1015PE (or similar) ~$250
              Stock in this exact model may be diminishing or hard to find at a good price.  Any netbook in that class should do however.  Higher priced ones are not better.  They just add stuff like larger hard drives, better battery, etc which you DO NOT NEED.  The battery is going to be removed from the unit and the software requirements are minimal.  Your primary constraint is weight.  2 to 2.5 lbs is ideal.  The voltage requirements on different models may vary from the 1015PE but the electrical components we will be using can accommodate a wide range of voltages so different computer models should not effect the electrical design.  More troublesome might be the form factor of the netbook.  The platform we will be building integrates the netbook battery cavity into the structure, so if another model's chassis differs dramatically from the 1015 then the build instructions may not transfer to it, and you will have to come up with your own structural solution.

              - Microsoft LifeCam Cinema WebCam $55 (or less)
              http://www.newegg.com/Product/Product.aspx?Item=N82E16826105321
              The netbook webcam sucks.  Picture quality, motion, light correction, and auto-focus are of utmost importance for navigation so you want a decent webcam.

              - Eagletron PowerPod $180
              http://www.trackercam.com/TCamWeb/powerpod.htm
              A nifty little gadget that we will be used as the robot's neck.  It has a very strict weight limit of 3lbs.  That's why the netbook has to be very light.

              - AnyVolt 3  $55
              http://www.dimensionengineering.com/AnyVolt3.htm
              An awesome little gadget for generalized voltage conversion.  This will be used to convert the iRobot's battery voltage to the laptop's voltage.

              - DB25 Breakout Board (BRKSD25M-R) $22
              http://www.winfordeng.com/products/brksd25.php
              This is a bit of a splurge item.  Honestly you could just a get a $2 connector from Radio Shack and solder it, but I am lazy and terrible at soldering so this little item was gold for me.  I built the entire robot without having to do a single solder!  If you feel comfortable soldering, then save yourself a few bucks.


              - EZ Tube Construction materials ~$20 ??? (lost my receipt so I don't have the exact pricing)
              http://www.eztube.com/connectors/connectors.html
                - 1 x 100-100 Plain square aluminum tubing
                - 3 x 100-305 Composite T
                - 1 x 100-328 Adjustable Foot with plastic insert
              These will form the body of the robot.  These guys have an unusable online ordering system so just phone in the order instead.

              - Aluminum Sheet (6.5" x 12" x 0.04") $4
              http://www.onlinemetals.com/merchant.cfm?id=240&step=2&top_cat=60
              This sheet will be fashioned into a little "table" for the laptop and needs to be light but sturdy enough to support the laptop.  You can buy aluminum sheeting at Home Depot, but I think the thickness may be 0.032" which is a little too thin.  I found that 0.04 or even 0.05 thickness is about right.  I ordered mine online from this site because they offer a range of thicknesses and also can provide a custom cut which is convenient.  It is probably a good idea to pick up 2 of these because constructing the table is a precision task and is easy to mess up.

              - Construction Materials
              A few extra items that can be picked up at Home Depot, Lowes, and Radio Shack.
                - 4 x 1 1/4" 6-32 bolts
                - thin electrical wiring (20 or 22 gauge)
                - 1 1/4" x 1/4"-20 bolt (standard camera tripod size)
                - flange nut that fits the bolt
                - velcro
                - wire management clips

              So all told, the total is something like $875 (parts) + $100 (shipping fees) + $25 (extras) = $1000
              Tax isn't included here but the price is still pretty close to accurate.


              Next -> Part 3: Building the Head

              Wednesday, July 27, 2011

              DIY Telepresence Robot - Part 1





              This is the first in a series of posts on how to build a telepresence robot.  As I mentioned in the previous post - my robot has fundamentally improved my telecommuting experience.  It facilitates casual and more personal contact with coworkers, improves the quality of communication with them, allows me to participate in impromptu discussions and meetings, enhances my feelings of involvement at the office, and improves the perception of my availability and work ethic among my coworkers.  I highly recommend it to anyone who telecommutes regularly.

              First off - I owe a huge amount of thanks and credit to Johnny Lee and his blog for the idea.  I have been following the development of professional telepresence robots for the last 3 or 4 years with growing anticipation, because I immediately understood what a huge impact they could have on my telecommuting experience.  Unfortunately their development has been slow and the few that are available are all marketed towards CEO's and upper management and thus cost on the order of $10K+.  When Johnny's robot hit the Web a few months ago, it was a revelation to me.  Instead of waiting for the market, I realized that even a software guy like me could assemble a working robot without too much cost or engineering expertise.  I started designing my own robot almost immediately.

              The result is what I consider an incremental yet much improved design over Johnny's robot.  The basic design is the same.  A small netbook on a raised platform mounted on a Roomba vacuum cleaner - basically just a roving netbook.  Wireless communication and custom software loaded on the netbook is used to control the Roomba from a remote location and move the whole contraption around.  Skype video conferencing is used to see during navigation and also to communicate face-to-face with other people.  A self-charging docking station is used to keep the batteries charged and the unit powered.

              Telepresence Robot

              Additionally I developed a number of improvements over the original design.  They are...
              • The power system has been completely redesigned to power the netbook directly from the iRobot battery.  The electrical system is simpler, easier to construct, and more elegant.  Also no dangerous and warranty voiding electrical modifications need to be made to any of the components which makes the robot much safer to install in a place of business.
              • A rotating "neck" has been added to the robot so that it can look up/down and side-to-side independently from the robot base.  This comes in handy during navigation (avoiding floor obstacles) and when looking upwards to talk to a person that is standing.
              • The body frame and netbook have been reversed so that they face towards the front of the iRobot allowing the front bumper sensors to be used.  The robot immediately stops when it bumps into obstacles
              • The body frame is simple, light, and easy to construct
              • The structural weight has been reduced to less than 5lbs (the carrying capacity of the iRobot).  At this weight the robot has no trouble auto-docking.
              • A high quality webcam was added to improve vision and navigation.
              • The control software transmissions piggy-back over the Skype connection.  No custom ports must be opened on the corporate firewall.  If Skype can get out of the network, then the robot can be accessed.  Likewise, the controller software only needs Skype access, so I can just as easily use the robot from my laptop at Starbucks or from an airport as I can from my home.

              To be fair there are also a few disadvantages to my design.  With more parts and more complexity comes less stability.  Software exceptions, hardware errors, or battery drains occur fairly frequently (two or three times a week), and I often require assistance from coworkers to tinker with the robot.  However, each software iteration has gradually reduced these problems.  Also the additional parts are an additional expense.  I created my robot for about $1000 instead of Johnny's purported $500 - although I don't actually believe his figure.  That quote really only includes two major parts (iRobot and netbook) and cannot possibly include things like the docking station, body frame, etc..  The actual cost of his robot I speculate is closer to $700.  My cost estimate includes all of these additional parts plus the shipping costs.

              In the coming posts I will give the parts list and a detailed construction tutorial.  The construction is actually quite easy requiring no special skills or knowledge (not even soldering) and utilizing only basic tools and an electrical kit.  The source code, binaries, and installation instructions will be provided as well.

              WARNING: The hardware design and software are offered for free without any guarantees of quality or obligations of support.  I have done my best to disclose accurate information about the performance, successes, and shortcomings of the robot.  Make no mistake - this is very much a prototype piece of equipment and there are still many unresolved issues, so if you decide to build one you should expect some problems and you should plan on having to monitor the robot and make frequent adjustments.

              Next -> Part 2: Parts List

              Telecommuting Tools

              My current toolset includes the following in order of importance:

              1. VPN
              Having a VPN into the corporate network is an obvious must.
               
              2. Microsoft Remote Desktop
              We are a Windows shop so Remote Desktop is a given.  Some people like to fool around with VNC, but honestly that is only useful if you are dealing with Linux.  In Windows, Remote Desktop is really the only way to go for the simple reason of speed.  All of the VNC variants out there suffer from the same fundamental weakness.  They are all essentially "screen scrapers" that sample pixels from the screen buffer and transmit compressed images.  Remote Desktop is hooked into the Windows interface at a lower level and instead transmits GDI type calls like FillRect and DrawText which are orders of magnitude smaller and more efficient than transmission of image data.  VNC can never equal the speed and responsiveness of Remote Desktop.  I really don't even notice the difference between remotely controlling computers from the office or from home.  I can remotely manage our entire server room with virtually zero loss of efficiency. 

              3. Telepresence Robot
              My robot is the most recent addition and has had an enormous impact on the quality of my interactions at work.  I used to spend a lot of time drafting emails or on the phone with my coworkers, but both of those methods tend to infuse conversations with a bit of distance and formality.  They are nothing like the casual conversations and informal pow-wows that occur in person where so much crucial information is created and shared.  In my company you will often stumble upon small hallway meetings that evolve into design discussions where important decisions are made.  Communication by email, IM, phone, video-conferencing all miss out on these impromptu events.  You only get the summary of the discussion afterwards once everything has already been decided.

              My robot changed all that.  Now I can cruise around just as I would at the office and engage people casually.  I can feel the daily "pulse" of the office.  It really makes me feel much more involved.  Even if I just have a quick question that would take me 30 seconds to send via email, I will often take the extra 5 minutes to do it with the robot because the quality of communication is so much better.  It also has a psychological effect on coworkers (and bosses) because it gives the impression that you are more available.  Even if you spend 10 minutes everyday just buzzing around to say hi, doing nothing but wasting time - the perception is that you are actually doing more work because people notice your presence.

              Stay tuned, because I will soon begin a series of posts that will give detailed instructions on how to build this telepresence robot.

              4. Email
              Of course for detailed or formal communications, there is no substitute for email.


              5.  Custom "Screen Sharing" Software
              The one major weakness of Remote Desktop is that it does not allow the sharing of a desktop between users so you can't do joint development and trouble shooting, code reviews, etc. which is crucial for a software team.   Of course Remote Assistance is Microsoft's answer to this and it works really well once you have established a session.  It uses the same API as Remote Desktop so responsiveness and fidelity are fantastic.  Unfortunately the process of establishing a session is so cumbersome that it is burdensome to use.  So instead, I wrote my own desktop sharing application that uses the Remote Assistance API but bypasses or streamlines the process of creating a session.  The goal is to be able to come into someone's office (via robot) and then take a look over their shoulder at their computer to discuss what they are working on - just as you would in person.  My app comes close to achieving this.  At some point I will be sharing the code for that software on this blog.

              6. Skype Voice and Video Conferencing
              I still rely on Skype for some communication - particularly if I am going to be engaged in long debugging or code review sessions.  In those situations, the robot can be a bit of a distraction and simple hands-free voice is more appropriate.


              With these 6 tools, I can do just about everything that I would normally do in person.  The only thing that is really missing is white-boarding.  So far I have not found an adequate substitute for standing in front of a whiteboard with a few people and sketching out designs and exploring concepts -- but I'm still working on it.

              Tuesday, July 26, 2011

              Hello World

              I work as a lead developer at a small software company.   I also live about 200 miles from the job site, and so for the past four years I have been primarily telecommuting to work.  During that time I have experimented with many approaches, tried a lot of available software, and developed many of my own tools to improve the telecommuting experience.  I work closely with about 5 - 7 teammates on a daily basis and my current experience is about 80-85% as effective as being there in person.  This site is intended to be a sort of brain-dump of my thoughts, experiences, and tools for effective telecommuting.