Tuesday, July 24, 2007

PBR Motor Controller

{PBR = Phidget>Battery>Relay }

I made an enclosure for the Phidgets and the relays. I got the metal box from an old power supply I had lying around. I also added some switches to switch the main battery and the relay circuit on or off. This box allows me to save space on the robot. If you look in the pictures before; the
battery,relays, and phidgets were just spread out everywhere, with wires making a big mess. This box is much nicer and smaller. I can't wait to try out the box with my wheelchair motors( they should arrive in the near future...) The wires for the motors are hidden in this picture, but they come out from the back of the box.

Circuit is as follows: Each motor is connected to two DPDT relays, giving a total of four DPDT relays. The relays are powered by four AA batteries and are switched on by the Phidgets Interface. Each relay is DPDT, meaning there are two poles to be switched. SO whenever a relay is triggered it is switching BOTH positive and negative current to the motor. The reason for this is due to the fact that if a motor were to be wired with two switches meant to turn the motor in two directions( each switch controls a motor movement) instead of four switches to control motor direction, a short circuit will result ,killing the battery and potentially producing an electrical fire.

The battery, Phidgets Interface, and relays are all stored in an aluminum box. The enclosure is from a power supply and is all metal. In order for the relays and Phidgets Interface not to short circuit upon touching the metal, a thin plastic film was glued onto the surface. Two switches were placed in the front of the enclosure. The bottom black switch is responsible for switching the main battery that runs the motors. The red switch above it is responsible for switching the battery that powers the relays.


Here is the schematic of the relay to motor interface.

Monday, July 23, 2007

Motors Ordered




I just ordered two wheelchair motors with 12" wheels from eBay for a total of $135 ,including shipping. Not bad deal, because these motors are very powerful( can carry over 200 pounds). Due to the strength of these motors I might add a small step for me to stand on and then I would add a joystick to control the robot manually . The motors will probably come in next week and the base will be built by the second week of August. Maybe even sooner if the motors arrive early.
I'm also going to buy a deep-cycle wheelchair battery from eBay, or perhaps I can find a substitute for that battery. Up on top is a quick 3D model I drew of the base( in Google SketchUp)

Sunday, July 22, 2007

New Base

I'm currently working on another, improved base for Chives. The base will consist of two motors, two casters, and an 18" by 18" aluminum square about 1/2 inch thick. I'm still researching motors, so if anybody knows of any strong,cheap ones please email me. My choices rite now are 2 NPC gearmotor kits ($160 from Robot Marketplace, total of $320 for both wheels), or 2 Drive Modules( $120 from Trossen Robotics, total of $240 for both wheels), or 2 AME motors(total of $100 from Robot Marketplace) and 2 wheels(total of $20 from Robot Marketplace) as well as mounting hardware(total of $20). Here are the totals:
NPC Gearmotor = $320 *Most powerful with bigger wheels for more clearance
Drive Modules= $240 *Less Powerful with only about half an inch for clearance
AME Motors and Wheels = $140 *Cheapest, medium power but have to assemble and all parts aren't designated for each other

The base I can get for around 20 bucks from any sheet metal place. I have casters at home. If I had sponsors I would be able to get the best parts and have the perfect robot. So I'll have to make it perfect using brains instead of money and I'll measure seven times and cut once.

[I ended up picking wheelchair motors from eBay]

Sunday, July 15, 2007

Even More Pics







More pics




Chives Version 1.4 Completed




I finished the basic butler robot today. All it is now is a voice controlled motorized base with a wireless web camera. The voice recognition works very well and the internet control of it is amazing. The drive system is not perfect, it doesn't travel perfectly straight. It worked better than I expected but after all, its just two old powerwheel motors with bike wheels hot glued to them. Not bad. Phidgets worked well also, they stopped working for an hour(I put in too high current,oops). Then they went back to normal and everything was perfect. Ill post more detailed information later but for now, just look at the pics. Also, I might make room on my server for guests to just view the robot video feed ,however they won;t be able to control the robot.Thats my job.
A picture says a thousand words....

Uh Oh

The Phidgets Interface Kit broke. I woke up one morning and the interface switch just remained closed and didn't switch. However ,the LEDs still lighted up. I'm going to call up Trossen Robotics and probably get it repaired.
Why me, why is it always me?

[Edit on 8/15/07: The Phidgets weren't broken, they just received too much current. Its ight now! Sorry Trossen Robotics...]

Go to my blog for more details on my project which uses phidgets, my robot butler.

Internet Control

I can now control my laptop and the Phidgets over the internet by using SimpleDesktop.
Its free software which allows me to see the screen of the remote machine and control it. Its really cool because I have a webcamera and I can see a room remotely and make the computer talk to people that enter from another computer. The Phidgets activate the relays and drive the robot.


The SimpleDesktop Server can be accessed through any web browser that has java enabled.
Cool and simple!

Friday, July 13, 2007

Interface Details

This is the details of how the interface works.
The computer runs a visual basic program with command buttons which can be activated by voice or by clicks (read my previous posts about the voice control). Each command button contains an instruction which tells the Phidgets 0/16/16 Interface Kit which outputs to initiate.
The Phidgets Serial Interface is a really cool device. It connects to your USB port and has 16 digital inputs and 16 digital outputs with LED indicators by each pin. A simple command is sent to the USB port in the visual basic program to turn on an output or to detect an input. A sample command is "IFKit.OutputState(0) = True" to turn on pin 0. There is more code that must be done to set up the Phidgets though. It took me a half hour to figure out how to use Phidgets and another 3 hours to find out why my program wasn't working( I hadn't added the Phidgets Library as a reference in Visual Basic 6.
After that it was just making the program more visual and more effective. I put in a timer( not the standard one, I used the ccrpTimer ,you can find it online for Visual Basic) to control the outputs so that the robot will only go forward for 5 seconds and then stop, instead of it continuously going forward. Then I added a video feed from my Logitech Quickcam and some other minute fixes to the program.
You can find sample programs for Phidgets online by TrossenRobotics as well as prices for different Phidgets. I got all digital interface with 32 pins for 100 bucks. It was well worth it.
Please Email me if you have any questions or comments.

Interface Program ScreenShot

Interface Completed

My interface to the robot from my computer is completed. (Using phidgets)
My program has buttons for driving and a video feed from a webcam. Outputs are directly controlled from that program and inputs are detected there for the robot to respond accordingly.
Check the comments for this post to see pictures and Visual Basic code.

Saturday, July 7, 2007

Voice Control

Processor- Dell Laptop
Voice recognition software- Dragon Naturally Speaking 9
Control Software- Visual Basic Program
Microphone- Logitech Webcam
Interface- Phidgets 0/16/16 Interface Kit


[Screenshot of Program at Bottom of Page]


Dragon software reads my visual basic program for command buttons. My command buttons' captions are words like Go Forward or STOP. Whenever the Dragon software hears any of those captions being spoken it clicks on it automatically. These buttons are all programmed with commands to control the robot which is connected to the phidgets. The computer runs a visual basic program with command buttons which can be activated by voice or by clicks (read my previous posts about the voice control). Each command button contains an instruction which tells the Phidgets 0/16/16 Interface Kit which outputs to initiate.

The Phidgets Serial Interface is connected to the USB port and has 16 digital inputs and 16 digital outputs with LED indicators by each pin. A simple command is sent to the USB port in the visual basic program to turn on an output or to detect an input. A sample command is "IFKit.OutputState(0) = True" to turn on pin 0. Video feed from my Logitech Quickcam and some other minute fixes to the program were added later on.
The all digital interface with 32 pins was purchased for 100 bucks.

AT&T Text to Speech was used to generate confirmation messages. If I were to say Go Forward then the GO Forward button would be clicked by the Dragon program and a sound would be played. (A voice saying "Going Forward"). Each command given( besides Cruise Control ) lasts for a certain number of seconds before all motors receive a STOP command automatically from the computer.

To start the voice command program the user most first open Dragon Naturally Speaking in the background. Then the user says "Listen." The voice recognition software then clicks the "Listen" button found on the page. This links to the Start Command page where a AI voice says "I am listening". On that page there is only one button, whose caption reads "Chives." Until now we have only told Chives to start the voice command program, so now we have to tell him to actually listen for commands. So the user says "Chives", and the big "Chives" button onscreen is clicked. This leads us to the voice command list. The user now says a voice command and that command button is clicked. The clicking of that button sends an instruction to the phidgets which in turn react electrically in some way. After each command, excluding movement commands, the page is automatically link back to the Chives page. Also, an AI voice is played corresponding to each command to show confirmation.

Here is a sample dialogue:

User : "Listen"

Robot: "I am listening"

User : "Chives"

Robot: "Yes Master"

User: "Go Forward"

Robot : "Going Forward"

(Both motors are turning clockwise for 3 seconds)

Robot: (After 3 seconds) “I have stopped”

***Commands must be made in that order. However, the second time around, the user is only sent back to the Chives page so that the user would say "Chives, go backward" and so as not to confuse the robot if anybody happens to say go backward in normal conversation.