Society of Robots
Search and Index
MISC
 Parts List
 Robot Forum
 Chat
 Member Pages
 Axon MCU
 Robot Books
 Shop
 Contact

SKILLS
 How To Build
  A Robot
  Tutorial

 Calculators
 Mechanics
 Programming
 Miscellaneous

 Robots
 Space

HARDWARE
 Actuators
 Batteries
 Electronics
 Materials
 Microcontrollers
 Sensors

SCIENCE
 Robot Journals
 Robot Theory
 Conferences


    Voice Recognition with Axon Tutorial

    The VRbot
    The VRbot is a cheap light-weight way of adding voice control to your robot, and this tutorial will show you how.

    notes:
    But before we start, there are limitations to it. It's not reliable if there is background noise and you're standing away from the robot. Servos are so loud the robot cannot receive commands when servos are moving. The VRbot is also sometimes flakey during the bootup sequence. Lastly, the vocabulary is limited to two dozen words. But yes, stringing words into sentences can get you further.

    issues:
    My major complaint about the VRbot is that the creator isn't interested in community support. It's entirely closed source, and they delete any posts on their forum that explains how VRbot works. I lost a week debugging because they refused to divulge what regulator or capacitors they used to filter VCC - the suspected cause of the power reset flakiness you will experience. As soon as they stopped selling the VRbot (they now sell an updated product which basically is the same thing), they deleted all information relating to it (documentation, help files, etc.) off their website. On one hand I think they are trying to protect themselves from people copying their product - understandable. But in doing so they treat their customers like untrustworthy thieves . . .

    Anyway, enough with my rants. Lets build some robots!

    Step 1: Wire it Up
    There are three things to wire up.

    Attach the four wires to your VRbot as in the below image, matching the colors:
    Tx - transmit data
    Rx - receive data
    VCC - 3.3V to 5.5V
    Gnd - ground

    Next, attach those four wires to your Axon or Axon Mote. As described in the UART tutorial, Tx goes to Rx, and Rx goes to Tx. And of course VCC goes to 5V regulated on the Axon (or 3.3V regulated on the Axon Mote), and ground to ground.

    For the Axon II, I used UART0 (U0) for this tutorial. T is Tx, R is Rx, and G is ground (not used).


    image: VRbot wired up to Axon II

    For the Axon Mote, I used UART1 (U1).


    image: VRbot wired up to Axon Mote

    And don't forget to add your battery to the Axon pin labeled Bat (for battery; B for Axon Mote).

    Step 2: Preparing for the VRbot GUI
    You must now hook up your VRbot by USB to your computer for configuring voice commands. There are two ways to do this: using a TTL to USB adapter, or configuring your Axon to work as an adapter.

    If you choose to use a ~$15 TTL to USB adapter, see my UART tutorial for more info. You connect Tx to Rx, Rx to Tx, Gnd to ground, and VCC to Vin, and you're set to go.

    If you want to save a few bucks and use the Axon as an adapter, just keep the wiring as you already have it and plug in USB to your computer. You will need to upload a special program called usbuart0.hex (for Axon/Axon II) or moteU2S.hex (for Axon Mote) which can be found in the source code zip file mentioned later in this tutorial (both set to 38400bps). This program simply tells the Axon to exchange all data between UART0 and the USB - just like a TTL to USB adaptor.

    warning: Do NOT use a .hex written for the Axon II and program it to the Axon Mote, and vice-versa.


    image: VRbot wired up to Axon Mote

    Step 3: The VRbot GUI
    The VRbot website has a tutorial on how to use the GUI, so I'm not going to go into detail.

    Load up the VRbot GUI. At the top left, select your COM port and click the connect button.

    If it connects, you are in luck. If it doesn't, which is often the case with the VRbot, do the follow things to debug:
    - double check all wiring
    - use multi-meter to check voltages/battery
    - do a complete power reset of the Axon/VRbot, try to connect
    - with Axon on, unplug the VRbot power only, then plug it back in and try to connect

    Step 4: Configure Voice Commands
    Now we are going to configure voice commands. First, on the left menu click '1 Group'. Then, using the buttons such as Add Command and Train Command, add in your commands by following the instructions.

    It will ask you to train your voice twice for each command. You will have this urge to speak slow and clear directly into the microphone, but DO NOT DO THIS. Instead, you want to speak in a realistic way. For example, if your robot will always be ~3 feet away from you, train it by speaking 3 feet away from the microphone. And if your robot moves around, train once speaking from above the microphone and the second time from the side of the microphone. Although you can't hear the difference, sound waves can vary greatly when changing the direction of that sound.

    The point is, you want it to train your voice in the most realistic manner possible. After training, use the Test Group button to verify it's working well. You can always retrain otherwise.

    Oh, and I usually turn off my air-conditioner when using it. It's too noisy.

    The below image (click to enlarge) shows the commands I entered. If you are going to use my source code, make sure you do it just like I have it.


    image: fully configured VRbot GUI

    Step 5: Programming the Axon
    This is the part where you tell the Axon what to do when it receives a voice command. My sample code only let's you do what you see in the video. If you want to make changes or add more commands, you'll have to write your own code.

    If you have never programmed an Axon before, you must first read the Getting Started tutorial for your respective Axon.

    - load up my demo in Project Designer
    - make sure servos modified for 360
    - configure your servos in PD, etc.
    - when generating, make sure to include Voice_Recognition folder (separate folder to add: C:My_Robots\Voice_Recognition) , calibrated properly, and mounted in the right direction

    And finally, upload the compiled .hex to your Axon as usual.

    Step 6:
    You can try to see if your robot works right away. However, robots rarely work on the first try so you'll need to do some debugging.

    For that, you will need a terminal program. My favorite is HyperTerminal. See this tutorial on how to use HyperTerminal (and other terminal programs).

    Only one program can connect on a COM port at a time. You must disconnect with the VRbot GUI before you can connect with HyperTerminal.

    After you are connected at 230,400 kpbs, turn on the Axon. You should immediately see a set of messages. Speak a command and see if it does anything.

    If it just says 'voice recognition initializing ...' and appears frozen, then VRbot isn't working right. You have just discovered that the VRbot is very very flakey. If it doesn't respond, power reset just the VRbot (let the Axon remain powered). Also, go through the debugging instructions in 'Step 3: The VRbot GUI'. It should work after a few headaches.

    Voice Recognition Robot

    About Other Languages
    In the video example I used both English and Thai. The VRbot module supports English, Italian, Japanese, and German - so how'd I get Thai to work? Thai (like Chinese) is a tonal language, which means by changing the pitch as you pronounce a word will change the meaning of the word. The VRbot isn't capable of understanding tonal changes. However, as the word library programmed into the VRbot is incredibly small, word choices can be selected in a manner that tonal invariance wouldn't be a problem.

    Additional Links
    Source code can be downloaded here:
    Axon II Voice Recognition Demo code
    Axon II VR two languages example code

    The VRbot Module was purchased from Sparkfun: http://www.sparkfun.com/products/9753
    And the VRbot homepage. The latest version of the VRbot is called EasyVR and from the user point of view is exactly the same.

    GUI, and support documents relating to VRbot (3mb).

    Other Eratta
    The VRbot has one more nasty bug. It will, on it's own, randomly delete Indexes in Groups, randomly mix up the training between the Indexes, and move trained Index numbers from one Group to another Group (ie randomly swapping/deleting/adding pre-trained voice data). If this happens, you must wipe the entire memory using the GUI, do a power reset for 5+ seconds, then re-configure it from scratch.



Get Your Ad Here

Has this site helped you with your robot? Give us credit - link back, and help others in the forums!
Society of Robots copyright 2005-2014
forum SMF post simple machines