MiniEric robot
| Attachment | Size |
|---|---|
| MiniEric.txt | 311.01 KB |
| ScanMap.txt | 10.24 KB |
| MotorController.txt | 15.37 KB |
| WInterrupts.c | 6.43 KB |
| TTSzip.txt | 16.74 KB |
| SpeechControllerzip.txt | 5.9 KB |
| R-Dev-Ino.zip | 24.13 KB |
This is my latest robot, still work in progress. It will take a while until it gets finished, as I want to make it more and more complex. I intend to add every functionality I can to this robot. But here is the description:
MiniEric was born because I needed a multipurpose test platform to develop code for my big butler robot (Eric). I wanted a small replica of the big robot, incorporating almost all features, like: object retrieval, interaction with humans, mapping, object recognition, text to speech, self charging, eventually voice recognition (simple commands), ability to compete in several types of robotic competitions (line, maze, fire...). Some of the features are implemented, some are on the way. I am a weak coder so I am slowly testing out bits of code, getting ideas from people on the net (I already got some from you guys, thanks a lot!). I am using the Arduino platform, the brain being a Roboduino board. I am using all pins on it so I'll have to hook up a Duemilanove over the I2C and downgrade the Roboduino as a servo controller. For the moment I am using a self made dual DC motor controller over the UART (I didn't get the I2C slave working yet) using a Tiny2313 and a SN754410 to drive a couple of Faulhaber motors with built in encoders. The robot has 8 servos: one for waist, 2 for shoulders, 2 for arms, 2 for pan/tilt head and one for a scanning sensor. On the head it has a Ping)) sensor, a thermopile array and will have an AVRcam. The sensor mounted on the scanner is a GP2D120 and is used for wall following or object retrieval. The arms can move independent (to point or wave) or together as a claw (to pick up objects). On the tip of the arms it has some suction cups that I want to attach to FSR to sense when the object is grabbed (but I could steal the ASF idea...). The robot has a 2x16 serial LCD (custom made) that I should upgrade with a graphic LCD for mapping purposes. The robot has some programmed moves (stored in the EEPROM) and is able to play a small tune or beeps. Did I mention that I hooked up an IR sensor and I can teach the robot new moves with the TV remote? The process is not so easy, but it beats the PC control method.
I have decided to add a few pictures to highlight the building process of this robot. I started CAD-ing it with Google Sketchup, then cut the parts from a poplar board I bought from Home Depot (it took me one afternoon to make and mount most of the parts) and used a piece of automotive (big) hose clamp to fabricate the servo brackets. I have used small wood screws (you can find them only at the hardware store in packs with tiny hinges for small jewelry boxes) but I had to drill small holes in advance so the wood would not crack. At first, I have used servos for driving, but they are too noisy for my ears, I hated it when it was running all over avoiding objects. So instead of installing a quadrature encoder, a small H-bridge and a ATtiny microcontroller inside the servo's box, I decided to get geared motors with built in encoders -> the Faulhaber motors from Electronic Goldmine. Over time, the robot has suffered many small mods and I guess it will happen again with the arms, as I am not happy with the current design. I need to re-shape them, perhaps ad one more micro servo per arm for an elbow bend or for a hand... Here are some early pictures:


I Hope you'll like it!
UPDATE: (Nov. 14th)
I have redesigned the robot's head and added 2 long range Sharp IR sensors mounted at 90deg from each other and 45deg from head axis. I also added the AVRcam and a LED bar to act as a mouth when the robot will speak. I will use a tiny to drive the LEDs using a AtoD pin to determine the voltage on the speaker, I've seen it done somewhere some time ago. I have added a color Nokia LCD to my motor controller board. I wanted to make the robot scan using the head pan servo and send through I2C the LCD commands, but it didn't work. So, I had to move over to the motor controller board the servo and the Ping sensor for testing purposes and I finally had proper results. The color on the LCD are still crap (for some reason this LCD is hard to set up properly) but I can display the distance and draw the pixels on the screen. Another weird thing, it seems that the Ping sensor's max distance is 102-103 cm, but I didn't had time to see why. After I got the scan properly displayed I have eliminated all the delays in my code and to my surprise, it scans madly fast! Then I made it scan left to right and right to left, with a second delay between directions, to be able to see the map on the screen. You can see the result in the video. I also attached the code and the NokiaLCD.lib in the zip file (change the extension from txt to zip). I had to use the SoftwareServo lib because the original Servo lib causes problems with the display. Enjoy!
Nov. 17th. Another update:
I have finally received the new R-Dev-Ino boards I've designed for the robot that will split all the functions over 4 or 5 modules. I'm using I2C for communications and I have to say I'm pleased how well that works. At the end of this week the robot will be ready for FireFighting and all that will remain will be to complete the mapping code and the vision code. Hmm, actually there are more things to do afterwards...
Nov. 27th.
After the Fire Fighting competition my next challenge is Mapping. But until then, I want to make Speech work. So far it's not intelligible, but I think I can tweak it a bit. It doesn't have to be perfect, but at least a bit better. Then I'm making the LED mouth work for a much realistic feel. When the new Nokia color LCD shield is here I'm going to continue my mapping efforts.
So here's a new video demonstrating the Voice and Speech.
Update: Dec. 31st 2009.
I have attached the code for the Speech controller that uses a Mega328 with Arduino bootloader installed, on one of my R-Dev-Ino modules. You need to download the SpeechControllerzip.txt file and TTSzip.txt library, rename the files to replace the extension from .txt to .zip, unzip and copy the library in the proper place and the SpeechController code where ever you keep Arduino sketches.
Update: Jan. 30th 2010.
I've decided to change the two HXT900 servos from my robot's neck and I got some Turnigy TGY-S3101S mini servos, a bit bigger and a bit stronger. After taking the robot apart half way to remove a body part that I needed to cut to fit the new servo, bend in weird ways the servo bracket to fit the new lenght I managed to get it all back together and it was ready for the test. I loaded the ScanMap code on the micro and my jaw dropped in awe!!! The head moved perfectly, jitter free, 180 perfect degrees and SILENT like it was some sort of a stealth robot... I poked the head to tilt it, came back smoothly, with no extra oscillations... OMG!
I also took sensor measurements every 5cm from 20cm to 250cm and had Excel come out with a new equation, so my Sharp sensors measurements went right over the Ping sensor measurements and perfectly one over the other (I have 2 Sharp sensors at 90 degrees to each other, so the measurements overlap for the middle portion). Great Gods of Robots! I am now ready to start the mapping stuff!



@ Sun, 2009-12-06 07:33
One of the more awesome robots here!
One of the more awesome robots here! Very impressive. Was bummed to hear you weren't able to compete in the fire-fighting contest. Especially when you have put so much time and work into MiniEric. In any case, your effort is not wasted. Many here I think have noticed what a great robot this one is. Next year you will certainly have MiniEric ready to fight fires!
Thanks for telling us about the VR chip. The ideas are already churning here... :-) Now I just need the time!
@ Sun, 2009-12-06 16:28
MiniEric went through a
MiniEric went through a major make up the week before the contest, including height reducing wheel replacing, paint job, I replaced all electronics boards and I had to make the sprayer work. All low level functions had to be adjusted, nothing worked properly anymore. So I spent too much time fixing and debugging low level functions than working on the contest specific functions. And it's still not the way I want it to move. Now I'm taking a small break, just lurk the forums and answer questions, prepare an article about MiniEric on Circuit Cellar magazine (digital version) that is going to be published soon. I'm also waiting for a new color LCD so I can continue the mapping efforts.
I'm going to make a tutorial about the voice recognition and speech for SoR pretty soon, so there will be more in depth information on this subject.
Thanks for your comments guys! Keep them coming, give me more ideas how to improve this robot.
@ Sat, 2009-12-05 23:29
PC Platform
@ Sun, 2009-12-06 16:09
Thanks for the idea, but I'm
Thanks for the idea, but I'm not a computer programmer and I had a hard time trying to do something too advanced for my capabilities in my butler robot Eric. You can see this robot here: http://seriousrobotics.wordpress.com/eric-the-butler-robot/
I have decided to make MiniEric to get better at microcontroller programming to be able to do all the low level functions for the big robot then move the Navigation and A.I. to the PC. And of course, a smaller robot allows me to participate to different competitions too. So, when I'm done with MiniEric, I'll get back on re-building the big robot, since I had to give up some parts when I moved to Canada.
An important construction improvement was done in MiniEric, the possibility to bend to grab object from the floor and then lift them up (I want Eric to be able to put them on a regular table or counter top). I am also considering making Eric like a Segway, but this is just a wishful thought at the moment. A preliminary experiment was done with this robot: http://seriousrobotics.wordpress.com/2008/12/22/balancing-roboduino/ but I could not make it drive around because some limitations of the system. An accelerometer and gyro are necessary to make a real balancer. But I'll experiment more latter, perhaps make MiniEric balance.
@ Tue, 2009-12-01 10:35
i think so
@ Mon, 2009-11-30 14:19
Thanks for the comments
Thanks for the comments guys!
Yes, MiniEric was already voice activated when I was doing the Fire Fighting tests. At the competition, I could not use the voice command because of too much background noise. There was a FIRST competition with live amplified sound effects and music in another part of the Great Hall. The voice command works as you train it, some people had it done with the TV in the background and it worked. I did it in silence, I have problems if there is noise around me.
About the VRbot chip you can read an article in the last issue of Robot Magazine. The guy used it on his Robonova, as this chip was designed for that robot, but as you can see, it works on any robot that has a serial port (I'm using software bit-bang on 2 digital pins, as this was the sample code I got directly from Tigal). The "bridge" mode did not work for me, so I had to use some wires to connect the chip to the Basic FTDI board I'm using for programming my boards. This way I could train it perfectly.
I am not sure what you say about the "miniEric bow" command, as I don't have one, I was just undecided for a moment what command I should say and when I said "move" it already came out to the main "say trigger" mode. There are 2 indicators that the robot is listening for commands, a beep and a red LED shining. Also the LCD prints "say trigger" or "say command" and then it displays what command he understood. If not, it will jump back to "say trigger".
The Speech library is almost ready, I am waiting for some input from the original developer, as I have asked him if any improvements could be made. As soon as I have it completely done, I'll attach the code for my Speech Controller module, that includes monitoring the VR chip and speaking.
@ Mon, 2009-11-30 09:12
cool voice activation.
The voice activation controlling was cool but in the video it doesn’t reply to the command “mini Eric bow”. What was the problem? And was it already voice activated in the ‘fire test’ video?
@ Sat, 2009-11-28 20:31
WOW!
MiniEric is looking better and more advanced every time I check. Now with AVRCam and VR chip. And I see you got the speech synthesizer working too. Though it doesn't sound that good yet. It should be possible to improve it I think.
Anyway keep up the good work :)
@ Sat, 2009-11-28 22:51
Thanks!Yeah, the speech
Thanks!
Yeah, the speech code gave me some headaches but I managed to make it work with a little help. It needs some improvements, I'll see what I can do, but even if the speech is not perfectly intelligible I know what he wants to say so I can understand it. It's like small kids, parents would know what they say, but outsiders would always have trouble understanding what they're saying.
It will take a while until I'll use the AVRcam. I have a Arduino compatible library for it and I made some attempts to use it, but I had poor lighting and that creates problems. In this apartment where I currently live there is plenty of light, be it day or night so I hope I won't have so many problems.
I've been asked on SoR to make a tutorial about the VR and Speech so I'll do it over the next weeks and link it here. Perhaps I'll enter it in the 5th tutorial contest to win an Axon II, who knows...
@ Sun, 2009-11-29 22:19
Speech is an awesome
@ Sat, 2009-11-28 23:30
Hehe
I guess we all feel that our bots are like our kids, and I imagine even more so with an advanced, and might I add cute one like MiniEric. However it should be possible to get some intelligible speech out of it. I recall playing with a speech synth as a kid on my Commodore 64. It didn't have much more resources available than an Atmega328.
On the other hand image processing takes up quite a lot of resources. Some years ago I was playing around with some image processing with my webcam. It was quite heavy even on a PC, so I'm not sure what you intend to do with it, given the limited resources available in your current setup?
@ Sat, 2009-11-28 23:56
AVRcam does the image
AVRcam does the image processing on board, same like CMUcam. You set up to 8 colors for it to track, then you just give it commands like "track color 3" and it will return x,y coordinates (2 sets, opposite corners) of surrounding boxes for each object that has that color. Then it's your turn to decide which box is the object of your interest and what to do with it.
If you have only one box returned, your task is easy enough to calculate the coordinates for the center of mass and give commands to move the head to center the box (object) in the image. Then you can read the angle for the servos and decide which way to turn the robot. The Ping sensor can measure the distance to the object when it is centered in the image, so the robot will know how far needs to travel.
Basically, thats it. Color blob tracking. Good enough for starters. Also line following capable.
@ Fri, 2009-11-27 18:48
Voice Command and Speech update.
@ Sat, 2009-11-28 04:09
Very nice work with the
Very nice work with the onboard voice recognition. Not many people have got it done without a PC interface.
Do you have more information or links about the VR and synthesis chips? I couldn`t understand what they were called properly, your accent is very interesting.
@ Sat, 2009-11-28 15:28
Thanks!The VR chip is this
Thanks!
The VR chip is this one: http://www.tigal.com/1770 it has a Demo for Arduino. I have adapted the code from their demo to work on my robot.
The Speech chip is actually a C code developed by Webbot from SoR as a speech synthesizer. I have adapted that code (with a bit of help from Arduino forum) to work in Arduino and added it to my Arduino module that takes care of the VR chip. I had to use a mega328 because the code got over 14k that is available in a mega168. Without the bootloader, it will fit in mega168, since it's almost 15k. Webbot told me that if I generate the phonemes from text, then play a bit with the parameters I can improve the way the text it's spoken. I'll try to do that and see how's going. Since my robot speaks stored text, he also said it's better to store that text in phonemes and not in actual text. Faster response and better speech quality.
The benefit of using a dedicated Speech module is that it can be on voice recognition at all times while the robot can do what ever it needs to do. I can stop it's actions anytime I want and give him different commands. The Speech module on my robot is mainly an I2C Master device, but, depending on the situation, it can become a Slave device.
Here is the original C code: http://www.societyofrobots.com/member_tutorials/node/211
Oh, and my accent is Romanian.
@ Wed, 2009-11-25 11:55
Very nice
Looks even better now and fire fighting works realy nice. Bravo !
As for Fire Fighting competition, better luck next time. I see you as a perfectionist and I'm sure those candles will have no chance next time ;)
@ Wed, 2009-11-25 15:10
Thanks! I'm sure in a year
@ Mon, 2009-11-23 16:38
How I almost competed in Fire Fighting
Last week and weekend I worked hard on MiniEric to prepare him for Fire Fighting. I had to make him shorter to fit the height limitations, I gave him a paint job, changed the electronics, sensors, managed to render the Nokia color LCD worthless... Oh well, lots of work and frustrations. So many things to do and so little time left to the competition. I have tried to adapt Mike Ferguson's code for his Crater robot but couldn't figure out some of the logic and it wasn't working on my bot. Trying to make the robot run in a straight line and turn precisely 90 degrees I made a list of commands that would take him over the entire course node by node. Of course, nothing was precise enough and after going through half of the course, the robot would hit the walls. I have tried adding sensor measurements, but one Sharp sensor failed to work entirely, the other one was giving me odd measurements and the Ping sensor was too high (read too close to the top of the walls) to be reliable. It works in a real house, just not in the Fire Fighting prop. If I tilt it, I can read the distance to the front wall, but can't use it for side walls at an angle, the measurements are completely weird. So, I ended up with a sensorless robot. But he was able to detect the candle flame using the Thermopile Array sensor and the spraying mechanism worked fine. So I went to the competition just to talk with the people there and show my robot for fun. After the competition started, I saw a robot that was just running from wall to wall not knowing where it was, eventually by luck it would find the candle and try to put out the flame using a fan. It just hit me. It doesn't have to be a perfect bot to compete, I can do it with simple commands and once in a room look for the candle and put it out! I can do that! So I rushed to my laptop, changed the code, did a small test right there on the floor and headed to the officials to enter him in the competition. But it was too late, the competition was already half way through... I did some more tests between rounds directly on the course and managed to get close to the candle but the sprayer couldn't put it out for some reason. Of course, at home it works! Spooky candle they use, hard to get it blown off even with the fan.
Al in all, it was a good day, talked with the experts, met Mike Ferguson, saw his Izzy bot doing pretty well, talked with Jon Highlands, saw his super powerful robots (first and second place in Mini Sumo experts division). I came home and did more tests and this time I got the robot doing it almost perfect. Took a video to show you how it was supposed to work at the competition (well, without the small nudge).
@ Sat, 2009-10-31 21:30
this robot.the
@ Thu, 2009-10-29 23:49
how much did thiscost to fix
@ Fri, 2009-10-30 13:39
I really don't get your
@ Thu, 2009-10-29 19:13
This little guy is so well
@ Wed, 2009-10-28 07:00
The robot can now scan for
@ Mon, 2009-10-05 16:30
Nice work - impressed by learn mode
Nice Robot, (-: though i thought for one moment he has going to test gravity :-) - nice control - Phew..
Just a thought for you..... try angle-ing the front bottom sensor towards the floor ie so it permanently picks up a signal (focused say 10cms on the floor) - this way when it goes towards a fall-off or cliff the signal will be lost (infinity) and you can do auto stop.This does not interfere with the object detect ...... see "Puff" and you will see a similar idea in action.
Wow the learn control is impressive - code-ing it must have been quite a challenge.
Look forward to further updates.....
@ Tue, 2009-10-06 13:24
The robot will most likely
The robot will most likely never encounter cliffs in my home, as I live in a rented apartment. If this possibility will arise in the future, I'll do something about it at that time. Right now I'm focusing on more important matters, like driving in a straight line, turning precisely a certain number of degrees, figure out the necessary commands to work with the motor controller. As soon as I get the color display, I will add the display to the motor controller MCU and after I'm happy with the configuration I'll order another motor controller board from BatchPCB. I have 2 boards that I designed before I tested them and I'm not happy with the result, so this time I'll do it the proper way, test and then design the board. I'll add bumper connectors (be it contact or non contact bumpers) cause sometimes the robot is too busy in it's own behavior that it doesn't pay attention to the surroundings.
So I'm trying to design the hardware layout as a multi MCU configuration, where the master MCU will have a few important sensors connected to it and the slave MCUs will control the actuators and the related sensors. As I said, I am working on the motor controller slave board at the moment, then I will remove the servos from the master board and build a servo controller board. All communications will be through I2C interface. I chose Arduino platform and everything I'll build will have compatible boards. I might use ready made shields if necessary.
I am looking for a way to do the decisional layer of the robot. Should I use a state machine, fuzzy logic, or something else? I mean the robot should have some behaviors that would kick in at different moments depending on what it's happening around him or what command it receives. Some behaviors would trigger others so I need a way to prioritize that. Any thoughts about this?
@ Sun, 2009-10-04 14:01
Very nive robot you have
Very nive robot you have here!! :) Keep it going ;)
What do you mean when you say you are a weak programmer?? :P
@ Mon, 2009-10-05 04:48
Thanks for
Thanks for encouragement!
I've always built nice and mechanically functional robots, but I never was happy with the programs I managed to write. I've seen robots built by people that didn't look great or didn't had too much functionality but still they were doing so well in their actions, meaning good programming skills were used for their programs. I am trying to get there, but for me it's a long process, as I don't have the time I would like to learn good programming skills the right way, I'm more likely improvising, building upon other people's bits of code I put together and try to adapt it to my needs. I guess I'll get there sometime, this being one of the main purposes of this robot, to learn the programming part. That's why I want to incorporate in this robot every function possible, pushing my limits further and further...
@ Mon, 2009-10-05 16:32
to be a weak programmer is
@ Thu, 2009-10-01 13:43
The waist servo is a
@ Thu, 2009-10-01 12:24
waist servos?
those second arm servos, the ones near the base, I assume they are strong enough to lift the arms? Are they Hi-torque?
@ Sat, 2009-09-26 21:13
Peizoelectric Force Gauge
@ Sat, 2009-09-26 16:51
Nice! I like your idea
@ Sat, 2009-09-26 14:54
OK, I have used the Ping))
OK, I have used the Ping)) sensor to trigger the object release and the Sharp sensor to trigger the object pick up. Also the Ping)) sensor is used to trigger the wave and melody. I want to make it play a song and make dance moves, but I need to separate the tasks on 2 microcontrollers.
The suction cups have a hole in the center and a tiny push button inside to detect the object, but they are too stiff and the pressure is not strong enough to trigger them. I chose the suction cups so I can pick up the ball easier. I want to try a force sensitive sensor or a piece of anti static foam I saw on this site somewhere. But right now that is on the side line.
Anything else?
@ Sat, 2009-09-26 14:38
Great work! I agree with
Great work! I agree with e-square12... so many questions!
Here's a couple to start.
Really tremendous work. Keep it up!
@ Sat, 2009-09-26 14:32
Wow! I'm glad you like it!
Wow! I'm glad you like it! :D
I have joined LMR long time ago, but because of some glitch in the matrix I never got the confirmation email and I could not log in. I got pissed and forgot about it, but yesterday I saw a post on Arduino Forum about LoMoR and this time when I clicked on the Forgot password button I finally got the link and re-set my password. Good to be here at last...
So, I have written about this robot and others (mostly Lego robots) on my blog here: [url]http://seriousrobotics.wordpress.com[/url] There is the remote control version of the code in Arduino there, all in one sketch. Since then I have the code split in libraries and tabs. I will attach the current version in a zip file, together with the necessary libraries.
Right now I am working on the motor controller, based on tiny2313. I wanted to be able to program it in Arduino, but the flash is too small for the code to fit, so I have redesigned it with tiny861. This brings another incompatibility with Arduino problem, it has different timer settings and I couldn't figure out how to make the proper adjustments yet. I hope I won't have to make another board with a mega8... (that was so simple from the start... but no, I'm too stubborn to give up...) So, I have the motor controller programmed in BASCOM-AVR, but working on the UART instead of the desired I2C (to make an I2C slave device you have to buy the commercial library for bascom, dohh). I should get over my stubborness and program it in AVR Studio like everyone does and set the damn USI to work, throw a PID function in there with variable target, setpoint, error and k settings to be able to use it for regulating speed, direction, distance by sending the proper I2C command. Oh boy, lots of work and I am still not comfortable writing it down. Sigh...
On the "brain" I need to focus on the FireFighting code so I can participate at CNRG in November. That's why I got the thermopile array and it works nicely to detect the candle light and people (btw, I want to program the robot to play fetch with my 3yrs daughter after I get this to work). So now I have to find a way to navigate the model house by following a node map and the walls. And a way to put out the candle - oh, no blowing fan, has to use a fire estinguisher of some sorts since it has hands, right? I'll either use a mist spray or a small bicycle CO2 tire inflator, not decided yet which one will be cooler... and easier to st up.
A problem that I have with this robot is the jerkiness of the servos. They use the SoftwareServo lib and I have to make sure I issue the refresh command as often as possible which is a pain. I have tried to use the new Servo lib based on Timer1 interrupts, but it is very sensitive to the other commands that use interrupts or they are time consuming, like serial, I2C, delay, pulsein, analog, so I had to get back to the software version. I liked that the servos were rock solid, so I guess I can use it to make a nice servo controller.
Oh well, I should get back to work, it's a nice Saturday morning and I hope I'll get a chance to finish something this weekend!
Cheers!
@ Sat, 2009-09-26 13:47
This Bot is really nice! I
@ Sat, 2009-09-26 12:40
Cool
@ Sat, 2009-09-26 10:17
Looking good! Anybody else
Looking good! Anybody else see a miniature Johnny 5? :D Just need some tracks, and some uber lasers, and you'll be on your way to controlling the world!
I'm anxious to see some of your other designs. :)
@ Sat, 2009-09-26 10:00
Finally a Robot that acts like one
@ Sat, 2009-09-26 08:39
That is really well made and
@ Sat, 2009-09-26 08:34
Weak coder...???
Are you crazy?????!!!!!!!!!!!!!! This is amazing!
So many questions...where do I start?