Asked — Edited

Making A Robot Bear. Need Help

Hi guys! I have successfully created a robot bear, but I am having some problems.

  1. He doesn't listen to voice commands
  2. When he talks, the servo will not stop after he is done. It is a 360 degree servo, and I have tried to get him to talk through scripts and the talk servo. He successful starts moving his mouth, but it will not stop when the audio is done.
  3. Finally, I would like to know how to get him to sing to mp3 music.

I could really use some help, it's my first robot. Thanks!:)


ARC Pro

Upgrade to ARC Pro

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

#1  
  1. Well for one thing a 360 degree servo would not be the right servo for what you want to do... You need to use a regular 180 degree servo.... 360 degree servos are meant as motors to drive your robot around...
#2  

Hi, Have you put the Speech Recognition Control into your project and put in voice commands? Do you have a microphone connect to your computer? You can't use a 360 servo for a talk servo, use a regular servo (180 degree) for your talk servo. Have a look at the tutorials.

#3  

I will try a 180 servo. The reason why I used a 360 servo is because the gears in the mouth only go one way. They cannot go backwards. And yes I do have a microphone and voice commands.:) the 360 works, it just won't stop unless I press stop. I want it to automatically stop on its own.

United Kingdom
#4  

@kaleyblackwell.kb

First off, welcome to the forum. So let's start with the first question about responses to speech recognition.

Q1.

There could be a few reasons to why your bear is not responding when you speak. One reason could be that your computers speech recognition software needs some training to understand your voice better. Another reason could be the "Confidence" levels need to be adjusted in the speech recognition control menu. Take a look at my speech recognition tutorial (linked below), which should tell you everything you need to know to get it up and running properly...

Speech Recognition Tutorial

Q2.

As for the servos, as you have already read from the other guys, 360 servos are not ideal for what you want. A couple of ideas though.

1.) Bearing in mind that I don't know the gear setup, but you could do a bit of hacking and remove some of the mouth gears to leave the main gear of mechanism that moves the mouth open and closed, and as mentioned, attach a 180 servo to move up and down (or whatever). Then you could use the "Talk Servo" control which will do what your after.

2.) If you really have to use a 360 servo, a way around it would be to use some Sleep() commands with the speech commands when your bear talks. If you have a set amount of phrases you want your bear to speak, you could start the servo moving, then insert a sleep command, then stop the servo moving. The sleep command would be the length of the phrase being spoken. For example, if your bear said "Hello. How are you feeling today.", and that phase would take 3 seconds to be spoken, then a script for that would look something like this...

#Assuming you have a 360 servo connected to port D5.
Move(D5, forward)

#Robot says the following phrase which takes 3 seconds.
SayEZB("Hello. How are you feeling today.")

#Set a sleep command for 3 seconds.
Sleep(3000)

#Servo stops moving after 3 seconds.
Move(D5, stop)

You would set the servo speed to whatever you wish it to be, and would have to change each length of the sleep command to the length of each and every phrase spoken in your bears vocabulary. Or you could use..,

#Assuming you have a 360 servo connected to port D5.
Move(D5, forward)

#Robot says the following phrase, and nothing will happen until it finishes speaking.
SayEZBwait("Hello. How are you feeling today.")

#Servo stops moving when the SayEZBWait() command has finished speaking.
Move(D5, stop)

This is the only way I can think of doing it using a 369 servo right now, but as has been suggested, a 180 servo would be a much better option.

Q3.

As for singing along to an MP3, this would be a little more tricky no matter what servo you used. The reason being is that if you had a song playing, and the mouth moving along to everything in the track.

When lyrics were being sung... the mouth would move (good).

With a break in the lyrics and just music playing... the mouth would still move (not so good as the bear would be singing along to no words).

But, if the MP3 track plays through the EZ-B speaker, you can use the "Soundboard V4" control, then you could add scripts to certain parts of the track that has lyrics (ie, get the mouth to move) and get the servo to stop moving when just the music is playing. Below is a link to a "Soundboard" tutorial I wrote, and a "Soundboard v4" tutorial DJ wrote...

Soundboard PC & EZ-B Tutorial

Your First Dance (Soundboard EZ-B Tutorial

Hope that helps, and good luck.:)

#5  

Thanks so much!:) I did try a 180 servo. It does work, but it takes a lot of adjusting. And I will definitely take a look at those tutorials.:)

United Kingdom
#6  

No worries Kaley. If you need any further help, just give us a shout as there's always someone around happy to help.:)

#7  

Yay! His mouth works great, and he listens to voice commands now! Thanks so much for your help! I am still trying to get him to sing however. Is there any code suggestions for that?

United Kingdom
#8  

Great to hear that you got the speech rec working now, and the mouth working too:).

What servo did you end up using in the end... the 180 or 360 contuinious rotation servo? Knowing this, we'll have a better idea of what script example to suggest to you. Also, are you going to use the "Soundboard EZB" control for the singing bit?

#9  

I decided to go with the 180 servo. And starting out, I would like to use the sound board ezb.:)

United Kingdom
#10  

You could use the "Talk Servo" control and set your bears mouth servo up, then add the "Soundboard EZB" and add your MP3, and sing along with SayEZB() commands.

Another way could be to use the servos minimum and maximum positions in a script to make the mouth move for the length of time the singing parts last for, using sleep() commands or changing the servo speed to match the words and pauses being sung to make the mouth move faster or slower depending on what's being sung, which would make it more natural looking.

Follow the "Your First Dance" tutorial to get an idea of how to edit and add script within a music track. Hope that all makes sense.

United Kingdom
#12  

No problem. It's hard to give you a script example, as it would depend on the song, lengths of time for the singing parts, and what words are being sung (for the more natural look). Good luck, and keep us posted on your progress... maybe even a short video if you're game.:)

#13  

Hmmm... it doesn't seem to work.. is there like generic code I could work off of? Sorry about that. I'm very new at scripting.:)

United Kingdom
#14  

Actually thinking about it, using the talk servo control to sing along to an MP3 won't quite do what you want (I was thinking of using speech synthesis to sing along over the MP3, but that's not what you want and wouldn't work very well. Sorry about that). If I understand correctly, you would just like the mouth to move with a song being played.

So that being the case, the second option in post #11 would be the one to use. Use something like...

#Asuming servo is connected to port D5.
#Set a servo speed.

Servospeed(D5,1)

#open mouth
Servo(D5,130)
Sleep(400)

#Close mouth
Servo(D5,70)
Sleep(200)

#Open
Servo(D5,130)
Sleep(300)

#Close
Servo(D5,70)
Sleep(250)

#Open
Servo(D5,130)
Sleep(350)

#Close
Servo(D5,70)

This would go at the starting points of any lyrics being sung on the MP3 track. Add more mouth opening and closing script lines, and change the length of sleeps to go with what is being sung. It may take a while to go through the whole song, but once you get the first verse or chorus of the track right, you'll have an idea of what to do for the rest. Hope that helps a little.

#17  

Just as a future idea to add to the program... maybe there could be a sing servo?:) The bear I remade use to be a teddy ruxpin knockoff that could movie his lips to any cassette tape based on sound volume. Unfortunately because he was a cheap knock off, he fell apart. Thats why I remade him.

United Kingdom
#18  

Great stuff. Pleased to hear you got the little guy singing now. I think the sing servo idea will be a little hard to implement, though not impossible. Nice idea though.;)

#19  

I think a little stereo processing could make an effective sing servo.

Audacity has a "karoke" function that deletes sound that is even across the left and right channels. For 90% of music, this removes most of the foreground vocals and leaves backing vocals and instruments which tend to be recorded stronger on one channel or the other to give the music depth and stereo seperation. It should not be too difficult to do the opposite to programmatically identify the vocals and have a servo move to them. Won't be perfect, but might be close.

Alan