Thursday, February 27, 2014

An Infra-Red Leash for an Electronic Dog?

One of the things I intend to implement is the ability for this robot to follow me or a target I designate. I was thinking about how I could implement this feature and thought I would just record my thoughts so far.

I had been planning on cannibalizing a WII remote at some point for its infra red camera. I did some looking around on the internet today and I found another useful Intructables project on how to extract the Wi Remote's infrared camera and the hardware that monitors it and connect it to an Arduino.  It then cranks out the x,y coordinates of the four strongest infrared sources it sees and makes them available to the Arduino.

One of the experiments I need to perform is to see if I can use this camera to track an infrared LED I could then wear one and have the robot follow me by attempting to center the x coordinate by rotating its body as it moved.

The distance from the center point of the display in y would be proportional to the distance from the target. If I had some idea as to the average distance from the floor the LED was mounted on the target I may even be able to calculate distance. At close range the LED may go outside the field of view anyway in which case you would have to assume you had reached the target.
I have not thought much yet about where on the robot to mount it. Would there be any advantage to placing it inside the head which can move up and down in the Y axis?

This camera has been used to create simple electronic whiteboards as well.  Perhaps I could also use it as an input device for drawing in the air or on a white board as well. Another interesting fact I did not know is that WII remotes use bluetooth to communicate and can be paired with any laptop with bluetooth build in. Bluetooth is not really an option for me since I don't want to add another radio if I can avoid it. I am already planning on using WIFI for remote control and internet access.

Wednesday, February 26, 2014

Moving My Dog

Though there are a lot of other interesting parts to talk about, whenever I talk about my robotics project (or what is Dad doing in the basement) with my family, they always ask me, "When is it going to move?". I then explain that it is going to take me a while to work out a safe means of controlling the two Razor E-100 scooters I have purchased to form the heart of the drive system.

With a top speed of 10 mph, max load of 120 lbs and a service time of 40 minutes we are talking about something that, if it goes out of control could seriously hurt someone or destroy itself in an impact. This robot is going to have two of these inside and weigh more like 60 lbs when completed so being able to control the motor at far less then it maximum speed is important.

Also of concern is the high current, relatively, that a large DC motor requires. This motor can draw anywhere from 5-15 Amps at 24 volts. The original scooter comes with a controller that manages motor speed that I had to discard because it has a safety feature which detects voltage generated by the motor when the wheels move and prevents it from starting until the rider pushes off and squeezes the throttle. This is never going to happen with a robot unless you want to kick it to get it moving. The built in control system had to be discarded.

If you are interested in what this motor can do a full speed, just search for Razor E-100 on you tube and you can see kids literally zooming all over the place. I needed to demonstrate that the motor could be controlled at low speed with sufficient power to move a 60 lb load. Varying the input voltage is not a good solution because it will cut off the motor entirely before it gets anywhere as near slow enough for my needs. Slowing the motor with a resistor in series is also just a waste of power. What needed to be done was to pulse the 24 volt power supply and vary the frequency to control the effective power being delivered to the motor. This is called Pulse Width Modulation (PWM).

The motor must also be able to be controlled by an Arduino and relays are too slow to do the job so a solid state (transistor based) solution is the way to go. The most common way to control a DC motor's speed and direction by an input signal that an Arduino can generate is by using an H-Bridge circuit. I also needed one that could handle high current loads. I wanted to go with off the shelf parts, particularly for this component, because I am not a fan of fires. I went with the Megamoto Motor Control Shield for Arduino.

If you look at the specs, it can easily handle my expected load with a safety margin but to be able to control each scooter motor independently, I will need two shields but they are designed to stack on top of each other (see the link above). They will also use six of the digital output pins on the Arduino which are a precious resource but it will be worth it for all the trouble this board will save me. Right now I only own one but I will have to purchase a second one soon. Until I do there will be no backing up for this guy. He will only be able to move and turn in a forward direction.

To wrap up this post, here is a video of my breadboarded version of this shield in action. I wrote test sketches that allowed me to slow the motor down to a very reasonable speed. Please ignore the hair brush and the diet pepsi in the shot. The important thing is to see the Arduino is controlling the scooter.




I am starting to collect links and useful documents in a Springpad project which you can check out as well. That is it for this post. Will do another soon.

Tuesday, February 25, 2014

Building My Own Dog

For a while now I have been thinking of creating my own robotics project based on Raspberry PI and Arduino. Even though my day job is in software engineering, my undergraduate degree was in electrical engineering and I don’t get to use those skills as much as I would like. I wanted this project to be a platform for autonomous robotic software experiments when it is complete. I also wanted to make something that had some elements of interesting external design. There are too many robots that are just a collection of components bolted together without any thought to how they look, aesthetically  . Since I am also a Doctor Who fan, I thought of K9.
He is strictly cutting edge 70’s technology on the outside but he was also a wheeled base platform with enough room inside for multiple control system projects which fit the bill perfectly.

It turned out I was not the first person to build one of these, at least as an accurate show prop. There is a K9 builder’s club with the details of many other people’s efforts in building K9 shells over the years. This site includes tons of construction examples and tips. Another useful project site for construction of an, in this case radio controlled, K9 prop can be found at Instructables . This site also had copies of accurate plans for constructing the shell. I will try to make the shell as accurate as possible while still allowing it to be functional as a real world robot.

With all this help in the construction of a K9 shell all the remained was the planning of the components to place inside to create, essentially, a roaming unix box on wheels. Each of the moving parts on the external shell would require its own servo motor. These moving parts include the ears, nose and tail. The head itself also moves but it will require a heavier duty motor than the standard RC hobby servos I have on hand.

Taking a tip from the Instructables project, the main drive motors will be cannibalized from two electric scooters. These scooters will also provide lead-acid batteries to act as a power source. These batteries may not be enough to allow for extended operation and I may have to add additional batteries before I am done. 

It will take at least two Arduinos to manage this set for motors. These Arduinos will also be used to collect data from the ultrasonic range sensor and to control the keyboard and LCD display located on the back of the robot.

Two Arduinos are not enough to provide a meaningful software platform for autonomous movement, multimedia playback, internet access, or to drive the RGB display on the side of the robot. This requires a Raspberry PI. The PI will act as the real brain of the robot. It will access the Arduino data over its USB bus, process it and then issue orders back to the Arduinos to control motion and manage its keyboard and displays. This may or may not be fast enough to be practical and I will keep you posted when I have verified that this can work.

This is a project I am working on in my spare time. I estimate it will take about three years to complete and I have already been working on it in my spare time for about a year. I slowly acquire skills and parts I need as I go along and each system I get working is a small win that will hopefully build into both a fun robotic platform and a showpiece of science fiction anachronism/history.

I intend to post updates here documenting my progress, the materials I use and the solutions I find as I progress through this project. Each step gets me a little closer to completing the project and it feels really good to produce something physical instead of virtual like software. I have included a few pictures of the construction of the outer shell to get things started. 
Miter

Here is a shot over a year old of the entire shell constructed out of cardboard to test out the plans I got from Instructables. I learned a lot by fitting the cardboard pieces together that helped me later when I would be working in wood.
(It is sitting on my foosball table)

Next came the slow process of cutting similar pieces out of MDF board. I really am learning woodworking as I go. This was done only with the tools I had on hand which where a Scroll Saw and a Miter Saw. I don't have an extensive workshop and these are not the optimal tools for the job but they did the trick. Here they are.
 Using a scroll saw to cut the multiple panels that form the insets throughout the lower section of the body was an education I got from you tube. Thank you Scroll Saw Workshop! For months all I had to show for my efforts were a few wooden panels.

Finally, I began the assembly process. This is where I discovered the benefits of Heavy Duty Liquid Nails glue. This stuff works and quickly to join the separate MDF panels when combined with some clamps I purchased from Home Depot. Here is a shot from the assembly process.

As time marched on, I started priming and sanding and things started looking up.


I am slowly making progress. Here is one more shot of the shell which shows the dorsal control panel.



Next post I will start describing the electronic components I have been working on and show more construction shots. Progress is slow but rewarding. More to come soon.