Introducing Questor.
I put a hold on my large robot project Magnus awhile back due to budget and time constraints. I wanted to have a platform that was way smaller, easy to modify for testing purposes and small enough to roam around inside the house autonomously. Questor will serve as a test platform for systems that will eventually be placed in Magnus. Questor was not intended to be a cool looking robot platform, just functional and very basic in appearance. My main goal is for him to be autonomous with the option of me being able to take over remote control separately if needed. I would like for him to be able to automatically find and connect with his battery charger and to eventually have a good A.I.
So here is a first look at him...
The head is made from a small boom box which I thought was neat because of the alien eye look. When illuminated they have a white border with blue eyes. His nose is the camera. Just below that is his voice lights made from an LED flashlight. I actually drilled a hole through the tilt servo case to pass the voice light wires through. The cluster of LEDs above his head are IR LEDs. Here you can see the EZ-B and the R/C Mux and Battle Switch. The LEDs on the silver box are for effect only. They will flash sequentially back and forth. View of the motors and battery compartment area. The power system deck.Weird....the pictures below [b]this line were not intended to be here in this first post. When I made the new post below, it saved the pictures in this post also. When I tried to go back and edit them out of this first post they don't show up on the thread so I can delete them. They belong in the post below....see details for the new wheels in the later post.[/b]
Other robots from Synthiam community

DJ's Robot Blinds Control
Nomad's Adventurebot Cherry

Update: I am once again trying to get Questor's voice lights working. I am now using the transistor that Rich recommended, the TIP-120. I tried the SoundServo control and it sorta kinda works but not very well. One problem is that the L.E.D.s stay on all the time even when there is no voice or sound.
I'll post you a solution to that later Rex
I have some ideas of how to make it work better.
Thanks Rich. We know we can always count on you.
I also tried the PWM control to test the output. By moving the slider I could get the L.E.D.s to go from full off at (0%) to full brightness at (15%). Not sure why it only takes 15% to get to full brightness but, anyway, it will do I guess. So I know the transistor is working. Now if we could just get it to modulate with Questor's voice when he speaks. The other thing that is a problem is I need the voice lights to only flicker when he is speaking and not when there are any other sounds.
When you solve these two items, you will answer the wishes of a lot of people here and elsewhere.
It just needs a script to take the sound value and use that to vary the PWM, which is pretty much what sound servo control does but there are spots where it doesn't work too well. The plan is to get the variable made by the sound servo control (sound servo control set up to a virtual port so it doesn't interfere with anything) and use it in a script with Ifs to set the PWM to specific levels depending on the range the sound variable is in... if that makes sense.
Basically something along the lines of
That (or something similar, PWMs and sound values will probably need tweaking) should allow low volume (background noise, hiss etc) to pass by without turning on the LEDs and have a better variance in it's range with sharp noticeable changes rather than blended/faded changes.
Wonderful...I will try it when I get home today. Thanks for the fast response.
Rich- I could not get the code example to work properly. I tried making adjustments as you said but just never could achieve a satisfactory result.
It was still problematic in that any sound would still cause the L.E.D.s to flicker. I just want only Questor's voice to cause them to flicker. So I set about experimenting with my first attempt at scripting and I got it to perform the way I want. Here is the short video:
Please pardon the bugs you see flying around in the video. It was getting late out in my shop and the bugs were everywhere!
First I needed to figure out how to get them to flicker. My Voice Lights are on port D15. So I came up with a loop script and named it Voice Lights:
Sleep(200) # Delay loop for 200ms to give the SayWait (in the other script) time to start speaking :LOOP SleepRandom(1,90) PWM(D15,1) SleepRandom(1,90) PWM(D15,0) SleepRandom(1,90) PWM(D15,0) SleepRandom(1,90) PWM(D15,0) Goto(LOOP)
Don't know why but a value of 1 is enough to illuminate the L.E.D's to the desired brightness. Then I played around with the SleepRandom settings and the arrangement of things until I got it to flicker the way I wanted.
Then I had to figure out how to make the loop script only run while Questor was speaking and ensure the L.E.D.s turned off when he finished. Had to scratch my head for a while to figure out how to do this.
ControlCommand("Voice Lights", ScriptStart) SayWait(Quesstor is online) ControlCommand("Voice Lights", ScriptStop) PWM(D15,0) # Turns off the Voice Lights Sleep(1000) ControlCommand("Voice Lights", ScriptStart) SayWait(How may I be of service) ControlCommand("Voice Lights", ScriptStop) PWM(D15,0) # Turns off the Voice Lights
The first line starts the Voice Light flicker script. The SayWait line causes the rest of the script to pause until he finishes speaking. The third line executes the moment when he stops speaking and stops the Voice Lights script. The forth line ensures that the Voice Lights are turned off. The fifth line gives a slight pause between phrases.
Then, just to add to the video drama, I added a couple of more lines to make Questor's head "wake up" and turn to face the camera while speaking. Now the L.E.D.s are on only when he is speaking.....yay!
ServoSpeed(D2,4) # set tilt servo speed to slow it down some Servo(D1,59) # rotate the head pan servo toward the camera Servo(D2,50) # bring the head tilt servo up so his head is straight up Sleep(2000) # pause 2 seconds Set(D19,on) # turn on the eye lights ControlCommand("Voice Lights", ScriptStart) SayWait(Quesstor is online) ControlCommand("Voice Lights", ScriptStop) PWM(D15,0) Sleep(1000) ControlCommand("Voice Lights", ScriptStart) SayWait(How may I be of service) ControlCommand("Voice Lights", ScriptStop) PWM(D15,0)
Here is the shut down script: (I found out you can have more than one statement in a Say or SayWait line. and also that you don't need the quote marks
)
ControlCommand("Voice Lights", ScriptStart) SayWait(Goodbye) (Don't forget to charge my batteries) ControlCommand("Voice Lights", ScriptStop) PWM(D15,0) ServoSpeed(D2,4) #slows down tilt servo speed Servo(D1,50) # rotate head pan servo to front and center position Sleep(2000) # give 2 sec delay Servo(D2,23) # tilt head down to sleep position Sleep(2000) # give 2 sec delay Set(D19,off) # turn off eye lights ControlCommand("Connection", Disconnect0) # disconnect EZ-B
I know the code probably looks like a mess but, I hope you will help me to clean it up.
Rex
Very cool , it doesn't look bad when he talks. I believe the switching transistors are all on or all off, I don't believe they operate partially. Good job
Can I ask you why you use SayWait instead of Say?