Asked — Edited

Multiple Servo Control Using Speech Recognition.

My Current project is a custom made robot for the Children's Museum that has two arms that move, with wrists that turn and two Eyes that open and close.

How do I go about using the speech Recognition commands to operate multipule servos at the same time. For example: I want to say "Robot Blink" and have the two servos that control the iris's to both open and close at the same time. They are connected to D13 and D14 on the EZ-B board.

I also what to be able to do the same with both arms, so it can raise it arms straight up to the side of the robots head when I say the command "Robot arms up"

How do I go about doing this as the scripting commands only allow you do use one servo at a time.

Dan S.


ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

United Kingdom
#1  

Put the 2 servo commands one after the other, they will run pretty much at the same time.


# Move servos to position 70
Servo(D13,70)
Servo(D14,70)

# Wait 1 second
Sleep(1000)

# Move both servos to position 10
Servo(D13,10)
Servo(D14,10)

To the right of the command line in speech recognition is a small icon of a pencil, click it to open a bigger scripting dialogue.

#2  

Rich: do I do this through ARC after I open up the speech recognition contol?

Dan S.

United Kingdom
#3  

Yes, when I get home I'll pop up some screenshots if you're still stuck

#4  

Rich: I think I see what you ment. I think I have it, but will have to test it to see if that is what I needed. I found the pencil you were talking about.

Dan S.

#5  

Rich: One other thing, When useing the speech recognition commands, does it always have to start out with "Robot" or can you uses something else. Foe example, this robot is called "Mind Munchie" and they would like it to respond to it's name. So can I use Mind Munchie in place of Robot?

Dan S.

United Kingdom
#6  

I've not used voice recognition much but I think you can use anything in the box, you probably don't even need the prefix, just "move left" should work.

#7  

Rich: never mind on that last question. I found out that I can use Mind Munchie instead of the word Robot to give commands. I have the Winking and Blinking working and working on the script for the arm movement now.

Still need to work on getting the Sparkfun MP3 Trigger to work with voice commands yet, but that should be easy to do.

Dan S.

United Kingdom
#8  

If you already have the scripts written you can always use the ControlCommand() to have voice recognition start (or stop) those scripts.

#9  

Rich: I have all the functions working now with voice command, except for making the wrists move. This is something I still need to figure out as they are powered by two small gear motors about and inch in diameter. I had planned on operating them using a second H-Bridge to power both left and right wrists in the same manor that you would drive a two wheel robot. But I am already using a Robo Claw 2x30 ( Sabretooth 2x25 clone ) to drive the robot about.

So I need to look into seeing how I can use two H-Bridges, so I can use the second one for the wrist movements.

Dan S.

United Kingdom
#10  

Depending on the HBridge used the script commands will be different.

Some use digital on/offs on the ports to send it forwards or reverse at full speed with a 5th wire for PWM control. If it's one of those then


Set(D14, on)

would do it... provided it's on D14 of course. That would basically activate one of the motor forwards, or reverse.

Another way I've seen on some is just PWM on the port


PWM(D14,100)

would send it full speed.

Hopefully that makes enough sense. On the cloud (if you click on user details under my name on the left) is a Dagu example which uses PWM and On/Offs for speed and direction, in it is a custom Movement Panel with scripts in for the directions etc. which may expand on the above a bit better.