The idea was thought up by me around December. My friends were insisting on doing some innovative robotic project. So while brainstorming we came up with crazy ideas including a robot that could play the keyboard. Finally this struck and stuck.
Month: December Day: 7 Year: 2006 AD The first 'step'.
Well of course every robot requires some movement, So before we even had any idea of the entire robot we decided to experiment with a stepper motor. So we bought an old (12V 1.8 degree / step) unipolar DC stepper motor & a darlingtion IC ULN2003 from the local electronics store.
But whaddyaknow! The motor was a dud. So the next day we had to go and get it replaced. Now we had the second motor and it worked fine while testing. But then there was the code to write for various modes and directions of operations. This took me a few hours
The sites that really helped me were: Stepper Motor Controller Connection Diagrams
and another site which isn't working anymore :( .
Well in the end testing the code and buying enough batteries to power the motor took a few more days and then all was well.
Here's the small stepper motor library code with the c++ test file. Of course its for linux only :D, if you want one for windows mail me and we'll probably do it. If we update the code anytime we will post it here.
libstep version 1.0
P.S We later got a higher torque stepper motor the same week.
Month: December Day: 11 - 18 Year: 2006 AD The formulation of what it can do.
Initially we had all sorts of plans for the project. This included moving targets, multiple backgrounds, etc. However as we actually started the project we realized that there wouldn't be enough time. So we cut out things until it was easy enough but still (hopefully) impressive enough for a final year project.
Month: Jan Day: Unknown (during the 1st week) Year: 2007 AD Fiddling with images
Around this time We had my first review at college to confirm the project. Our guide was very supportive of our idea and we had little problem convincing the reviewing committee that this was truly innovative.
In this period we experimented with images and ways of recognizing them. The first thing was object position recognition using a bit of DSP and ANN. Details will be released once the project is over.
Month: Jan Day:8-20 Year: 2007 AD The big BREAK!
Sorry contrary to what you might expect, there wasn't any big break through. Instead all project activity was suspended due to the fact that there was an important exam coming up on Feb 11th. So it was literally a big break -from work.
Month:Jan Day:21 Year: 2007 AD Two see or not two see
At this time we realized that stereoscopic vision would be quite a complex procedure (A colleague of mine was working on it as a project), so we decided to use one camera but still be able to measure the approx distance of the object. However this was a fundamental problem because we had to relate distance with the apparent size of the object. For this we had to realize why the apparent image seemed smaller as an object moves away. Our team worked on this problem but came to no conclusion. However a few hours later we realized that the apparent object can only seem smaller if it was being projected onto an image plane which was bounded by the steradians subtended at the eye/camera by the object. we thought the image plane was nothing but the focal length. The crude image illustrates the effect:
Fig.1 Shows how object Y is projected as Y`
Hence x` is the focal plane, y is pre-measured (in this scenario), and y` is the pixel measurement of any object dimension (i.e either along the x-axis or y-axis) Therefore by similar triangles we can solve for x which is the depth.
x = y * (x`/y`)
We tested this idea and guess what, it works! Now there are many errors in the estimated distance esp if the object moves futher away from the camera because even a single pixel error measurement from the image can cause great changes in the measured distance.
But for now its sufficient.
Month:Feb Day:11-15 Year: 2007 AD SOLID mechanics
Things were falling into place but we felt that if the robot was completed the problems which really required attention would reveal themselves to us. Hence we drafted many versions of the robot and settled on one good idea:
Fig.2 Shows a rough idea of the robot.
The idea is to have a strong stepper motor to give horizontal torque to a tray consisting of another smaller stepper-motor, a camera and a counter-weight. Now the smaller stepper motor will control the vertical position of the camera and the counterweight is to balance the gravitational force on the tray. We also decided for now that a laser pointer will be attached above the camera instead of a gun for simplicity.
Month:Feb Day:16-20 Year: 2007 AD Lights,CAMERA,action
At last we got the camera! A decent one with decent clarity and decently priced. But we was almost ripped off at a store where he was selling it at 38.88% more than that of other stores. So always, always check with 3 or 4 stores before buying anything from these electronics bazaars. Next step is to get a nice white background probably a good wall or chart paper and then start object-image recognition.Most probably tommorrow.
Month:Feb Day:23 Year: 2007 AD Surfing the wavelets
Earlier, though not previously mentioned, we had used wavelets to reduce the size of the images that the neural network required to process. But this had to be done manually using matlab. This was an irritating process as matlab was relatively slow(but easy), as well as the requirement to run matlab everytime we needed to test new images. Therefore we decided to get a C/C++ version instead. With the time left in hand, writing our own was out of the question, so while searching for the various libraries, we decided on libwavelets. Note that we had earlier even considered GSL, but for many reasons this seemed more appropriate. And so we did it. And the outcome was successful. A fully working DWT program!
P.S As I felt posting the code wasn't necessary, I haven't. But If you require it, let me know and I will.
Month:Feb Day:24-28 Year: 2007 AD Shape sifter!
At last, on completion of the above, we were able to use the compressed data from the DWT using debauchie's 4, for image/shape recognition. The neural network library was written by one of us (R.G Shivakeshavan) and another person (Adithya Rajan) a long time ago. It can be obtained from here libsyntactic.Needless to say, the neural network was able to differentiate between the different images!
Month:Mar Day:1-4 Year: 2007 AD Motor-Hell-aaah!
Please bear with us , but this post will probably be the biggest of all posts till now. This is because it covers the doings of the entire month. The month was hectic, hellish, not a day was spent in leisure(Not an entire day atleast). There were many causes(all related to the motor) and we shall list them one by one.
First the design we showed earlier under Solid Mechanics, was modified a litle and given for fabrication. However the guy taking care of it wasn't in any hurry and so we got the final product pretty late.
Once we received it, we eagerly set it up using the setup from this site. . We had previously tested the stepper motors using this circuit and everything was fine. So no one can blame us for expecting the final product to work fine. However to our shock and dismay, we just heard the stepper motors struggling without any actual movement.
We hit the roof. The first thing that crossed our minds was that the gear and shaft weren't fitting properly and so, was slipping. So we called up our fabricator and demanded that he look into it. He was hesitant to take the blame but agreed.We were to meet him the day after.
He never showed up. He called later to say how busy he was and to show it to him the next day. But working on a hunch we re-examined the faulting contraption and realised nothing was slipping. In fact it couldn't. It was snug and fit. The problem lay totally on the fact that the load was too high. Happy on learning this, we decided to boost up the current (as we were still supplying way below the rated current), only to blow our first darlington array IC (ULN2003) . It seemed that the max o/p current rating was 500mA and we were feeding it abt 2A!
So we searched for another option and found it in the UCN5804. Only later did we realsise that the use of the UCN 5804 was already given, albeit a little lower down in this site.
All the same we connected and tested and the result was satisfactory.
A few days later we decided to combine the controlling of the 2 motors, under a single program and made the suitable arrangements after purchasing another UCN5804. However when we tested it, it failed utterly and completely. First we thought it was due to a mixup in the power supply terminals one of us had accidentally given, and so after many failed attempts came to believe that the IC's were blown. So the next day feeling sick and worried, we bought yet another UCN5804. It cost us about INR 500 apiece($10).
But on using the new IC there was no difference. The problem was elsewhere! We were relieved(because we hadn't blown the IC's), and also upset at the strange behaviour. So after 2 hours of probing, testing and searching, the device suddenly started to work. We were delighted and frustrated the same time. Delighted because it was working, frustrated because we didn't realise what the problem was. All the same we called it a day.
Month:Mar Day:5-30 Year: 2007 AD The red laser marks the spot
Today we decided to take a break, but one of our guys(Shiva) and his friend(Adithya) decided to surprise us. They cut open a laser pointer and did some soldering and managed to make it computer controlled! Hats off to them!.
P.S: The motors acted up again, but this time the cause was finally identified. It was due to the poor quality 5V batteries. So hopefully with some replacements, all should be fine tomorrow.
Month:Mar Day:31 Year: 2007 AD Done and done!
At last the overall project has been made to work. No random movements and worries, because now we have a proper battery eliminator to take care of the power supply for the stepper motor's and we used diode to ground between the 9v supplies for the IC's to isolate the grounds. At last it works!
We also created some formulas to adjust the amount of turning required for the focussing of camera on the target. Also the laser
is activated to point at the target. It almost works, but is somethimes off by a few centimeters.
As a bonus we also , recorded some words and numbers in a sensuous female voice, and played it back during targetting and distance estimation to provide a professional presentation. We also did a 3d model for the structure. Here it is as a movie:
Month:Apr Day:31 Year: 2007 AD Results!
Guess what! This project won the highest marks in the department! Hurray!
Atlast our efforts and hardwork were appreciated. What a semester!
And here is a picture of the final product ;) !
Month:Jun Day:15 Year: 2007 AD
Page last modified on: Sat Jun 15 21:20:12 IST 2007 by sk7