Fhotibot


First video showing an integrationtest of the drive software.

Chapters
1. Meaning of Life
2. Let's start making
3. Let's continue making
4. Let's learn some microphone theory
5. Prepare the head
6. First throwback: Head rotation
7. Turn the robot on and off
8. The Software: State Machine
9. Driver and Track Drive Software Made
10. Track Drive Software Integrationtest (new)
Introduction
Looking around for a base for my next robot diy project I found an old Polaroid from the eighties. It was waiting for me hidden underneath a thick layer of cables in a box in a local thrift store.
I know that there is plenty of those Polaroids out there but no one has filmmaterial for them anymore. They got quite useless. So having this in mind there is nothing in the way to hack this device an make a robot out of it. The next day I found a Kingston twin lens reflex camera in another thrift store. Very light plastic. Good for a moving robot head. So the idea of a photo robot got momentum and some engineering time.
1. Meaning of Life
Fhotibot's meaning of life shall be, that he wanders around and takes pictures. To make shure the pictures have a slight chance of showing something interesting the Fhotibot shall have some strategy. The first strategy to find something interesting is to follow noise and get there. Find where it is loud. Then take pictures.
Fhotibot will live and work in our apartment. He has to deal with wooden floors, doorsteps between the rooms and children playing with it. Children means it has to be robust. Doorsteps for the Fhotibot means tracks.
To tackle the given strategy Fhotibot shall have some tactics:
  1. It can move autonomously and avoid obstacles.
  2. It can determine where the noise is and go there.
  3. It can take pictures from where it thinks is important.
Fhotibot shall have some tools.
  1. First it shall be able to measure distance close (1-3cm), mean (4 - 80cm) and long (80 - 500cm). 
  2. Second shall be able detect and measure noise/sound. 
  3. Then it must be able to command motors and servos.
  4. Further it must have a camera to take pictures.

2. Let's start making!
Here the two cameras for the motor body and head.

Arduino Uno, Arduino Sensor Shield V4.0 and Adafruit Motor/Stepper/Servo Shield. All three stacked fit into the shaft of the Polariod.

Sketch of the actors and (planned) sensors.

Each part gets breadboarded, tested and integrated into the controlling.
Unfortunately the proximity sensor has a different plug standard so I cut an adapter. Now I have nice little adapters to connect the sensor to the sensor shield.
All actors are ready now and smoke tested.

It turned out that the Solarbotics G3 224:1 ( http://www.solarbotics.com/products/gm3/ ) fit (almost) nicely into the Polaroid. They get embedded into the Polaroid. So I cut out as much as needed that the wheel can be positionized as nessesary.
Gearmotors embedded. Now the freerunning wheels must be added and the whole system calibrated.
Now the camera enters slowly into it's second life. Since I want to keep the cameras as original as possible only a few things get cut away like this little channel through the viewfinder.


Now it is time for the first system tests...
Tracks on - first challange solved
But there is still a lot todo. The head, sensors, software and the camera. Maybe I can use an old mobilephone as Fotibot's cam. We'll see.

3. Let's continue making
Since Fotibot is energized by battery I integrated two battery packs in the base of the robot.


As battery pack I use a part from an old remote control. It is flat and takes six AA batteries. That is what is enough for the gearmotors. The battery pack is extended with a hinge-joint. The hinge helps me to extend the robot with more frontsensors if nessesary. Just lift it up and insert. Some +/- cables wired.

Now the battery packs and motors get final integration. By the way: The Polaroid is Made in the UK. Have not seen this for a while.

Here the battery pack is lifted upwards. I think I have to insert some more axis at the bottom.

It is time for an integration test of the hacked battery pack and motors again.
All good. Nice.

The Arduino and the two shields match perfectly into the shaft of the camera. Battery packs closed. One 9v battery directly behind it for the Arduino.

Energy in - second challenge solved
Using old parts to make something new is fun.
4. Let's learn some microphone theory
Since Fotibot shall find where it is loud it needs some sound detection and ability to spacial locate the source. The shown book contains knowledge about that and some code that samples the analog input and calculates an average so that the input signals are useful.

After a while I had calibrated the sound sensor and could detect very little to loud noise. Green lamp off - no signal. Green lamp on - sound detected.

So I tried to connect a regular microphone... but since the signal was so low the Arduino detected nothing. So I continued studying theory about amplification...

Instead of soldering my own multi-stage amplifyer I thought maybe take it with a mic from an old tape recorder.

Well should I take this one? Maybe not. Fotibot needs minimum two microphones, maybe even three.

I think I have a look at eBay.. maybe there is some matching mic and amplifyer for a good price for the Fotibot.
Sound detected - third challenge solved
Next challenge is the head assembly. A robust rotateable assembly.
5. Time to prepare the head
The head must be rotateable and hold tight to the body. I thought best to use the existing lens shaft as a mount for the head and the former exposure adjust knob (small black) as the rotateable unit.

As an option there is a wheel from the old tape recorder.

To use the exposure knob with a servo or stepper motor I had to clear the area, grind a space for the servo connection into a wheel from the tape recorder, reduce friction with oil in the knob and prepare the servo.

Removing the head parts gave me that insight from above. The motor driver with the Arduino in the shaft of the Polaroid.

The orange track wheels got painted rough black... the orange did not fit into the mood board of Fotibot..

After a while I got some help from a young maker.

6. First throwback: Head rotation
The initial idea was to use the exposure knob as the rotation driver. I tried a micro servo but the rotation of 180 degrees is not enough to rotate the big lens wheel. Then I tried the continuous servo... but this beast is not precise enough. Precision is needed since the angle of the head is used for path calculation. Last I tried the little stepper motor. Good results. But the motor is not strong enough to move this small-knob-to-big-knob pre existing gear on top of the Polaroid. So I need to elaborate on this topic more and maybe say good-bye to the small-knob-to-big-knob gear and to mount the big knob (the camera lense) direct to a servo.

7. Turn the robot on and off
To turn the Fhotibot on and off I now know how to embed this into the camera. I hack the top two knobs using small knobs from the Arduino starter kit. Two slide knobs: one for the microcontroller (9V), one for the motors (12V). Both have to be on or off at the same time.

8. The Software: State Machine
After all this cutting, grinding and exploring the robot's body it is time to start with the software. Tired of all these if(..){..}else{..} and switch(..){case:...} code it was time to leave procedural programming and move on to state machine programming. This computation model fits perfect to what the Fhotibot is intended to do.
The CIP Tool is my prefered choice here since it is very lightweight tool based on a well engineered theory and: it generates C and C++ code. The C code (have not tried the C++ code yet) can be run on the Arduino. Straight forward. The sensor values are streamed into the state machine where the motor behavior changes to the defined state.
Here two images from the current simple motor behavior.


9. Driver and Track Drive Software Made
Supported by team fellows during coffee breaks I continued to develop the automation software. Straight forward design I'd say. Using CIP the control- and drive software-components are modeled as a reactive system with state machines. The system is then exported to plain old C and imported into the Arduino IDE. The connector code from the system to the arduino-loop and the sensors is handcrafted.

This control makes the Fhotibot go forward as long the path is clear. When attention needed the Fhotibot (for now) turns to the leftside. It does that until the path is clear and it goes forward again. In danger the robot goes backward and tries a three point turn to the right.

The drive coorinates the two motors and knows when the two motors must be stopped, back- and forwarded to make the robot move in the desired direction. Their knowledge is very track specific.

To test the software some LEDs had to act as motors. On the Arduino the software does what we have seen in the state machines above.

Yet Another Challenge Solved - The Drive.
Shure the drive is of a simple nature. But it is on a solid technology base modeled with the comprehensive meta-model of CIP. So its a small step for mankind but a giant leap for me.
10. Track Drive Software Integrationtest (new)
Here is a first video of an integrationtest of the track drive software. It works all fine.
http://www.youtube.com/watch?v=SEJqkLGNPug
You can find the source code here: https://github.com/mnemonia/robotix/tree/master/Robots/Fhotibot
Software, Proximity Sensors and Gearmotors integrated - Challenge Solved.
After solving the using C++ code from C the Adafruit Motor C++ Library could be connected to the drive software and the LEDs were replaced by the real gearmotors. So from now on the Fhotibot can avoid obstacles. Field open for the next challenge.

I'll keep updating this robot page until the project is finished...
Happy coding, Nils

Appendix A: Studied resources
http://www.ladyada.net/make/mshield/use.html
http://bildr.org/2011/03/various-proximity-sensors-arduino/
http://www.societyofrobots.com/sensors_sharpirrange.shtml
http://lists.freeculture.org/pipermail/list/2010-April/000899.html
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1295766321
http://www.techmoan.com/blog/2011/12/25/christmas-presents-the-80816-camera.html
http://www.picaxe.com/docs/picaxe_sound.pdf
http://www.actifsource.com/cip_tool/
http://letsmakerobots.com/node/1512
http://letsmakerobots.com/node/28278

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ahollis70's picture
Wow. What an awesome post sir! Looking forward to your progress. Keep up the stellar work.
I appreciate the way you chose to engineer around your design. In most robots I see, and in the one robot I've built, people tend to design around the engineering, so that design becomes an afterthought. Your photographic storyline is very well done too - I like the processing you have done with these. Thanks for sharing this.

For once this is function follows form instead the other way around. You're right. Thank you for this thought.
Having a tough goal and and initially nothing more than a brain, a bit of waste and a handful of tools and from there explore, elaborate, reengineer and engineer makes a lot of fun.
And integrating all into some abnormal body like the Polaroid camera gives a strong limitation factor that leaks into many aspects of making. This limitation challenges a lot of ideas one has and one must find adequate solutions. That is even more fun.
Pictures are made with my iPhone.

A robot that "gives you something back" is always the best kind. By "give something back", I mean; You set it to work, and it produces someting .. that you did not make - by itself, based on suroundings and what happened to it.
Great, looking forward to more :)

Thank you Frits for this comment. This robot gives pictures back. Pictures that may surprise or make us laugh. So the robot can participate in our life a bit. And whenever the Fotibot appears there will be some form of interaction... let's say the children start to make funny things because they know that pictures are taken and that the pictures will be showed somewhere at home and seen by us parents or friends. That is interaction mixed with your "give something back" what makes this robot interesting.
But there is still a lot to do until all this abilities are teached to the robot. Interesting challenges are ahead.
MetalmonkeeLad's picture

Oh yes. Pictomatix and Fhotibot share the same bloodline. Thanks for this link. Had a glimpse on Pictomatix just now. Would be interesting how Oddbot hacked the camera.
MetalmonkeeLad's picture

Super 8 would match the age where the camera origins from. I take this as an idea for a new robot project. In the thrift store there are many old super 8 cams that would make a nice robot body. But I would not use old analog technology but something like this:
It looks like your having fun.. keep it up...
Very nice Arty presentation..
I have been searching for the Meaning of Life too.. glad your bot has found it..  As it involves finding sound, I was interested in how you will achieve this.. 2 mics + trig perhaps?
My actors take smoke breaks... glad your actors passed the test :)

No comments:

Post a Comment