Let's Make Robots!
AttachmentSize
Edwin_the_ENTROPY_BOT_revision_8B.bas21.26 KB
Edwins_Schematics.jpg256.76 KB

(New addition at the end.)

___________________________________

When I started this, I was trying to decide what sort of robot to build, and in the process I was talking to some new people about how to make a simple robot. One commented that he would like to make a Start Here robot, but the ultrasonic sensors were much cheaper than the (Sharp) infrared sensors, but he was not sure if you could use an ultrasonic sensor to make a Start Here Robot (SHR).

I found a link to a robot using a PING sensor, but somewhere along the line I decided to make an SHR myself, using a "ping"-type of sensor. Specifically, I am using the very cheapest one I could find (the SR04) to show the new people that there is no reason you have to pay fifty or a hundred dollars or euros for a sensor in order to get one that works.

The cheapest I find currently are no longer the ones from Polida in China @ $2.99; I found some from a company called Chip_Partner.  Their HC-SR04 sensors cost $1.50 US plus $0.92 US shipping to the United States. I have not yet purchased anything from that company, so I cannot vouch for their honesty. I have purchased from Polida and they are fine.

For framework for the robot, I took a couple old CDs and glued them together with contact adhesive and a piece of paperboard / cardboard between to cut down the brittleness and give a strong platform to build on.

I saw a 2 servo (2 degree of freedom) bracket complete with a pair of (9g) servos for ~$7.50 and decided to get one of those also.

The normal Start Here robot uses a single servo to sweep the head back and forth. With this new bracket adding up-down control, I will be able to direct the robot's "vision" in different directions and add a whole new dimension to his perception.

**Do not worry about the following maths if you have not yet had this in school. Just take it for granted that it will work, and skip down to the next picture.**

_________________________________________________________________________________________________________

If the robot scans back and forth and locates an object in a certain direction, he can look up to see how tall it may be. [Since he already got the distance to the object (horizontal or X-axis) and he can determine the distance away of the top of the object (hypoteneuse of the triangle), he can then determine the height (vertical or Y-axis). Since "in a right triangle, the square of the measure of the hypotenuse equals the sum of the squares of the measures of the two sides" [a2 + b2 = c2] We know the hypotenuse (c) and one of the two sides (a) or (b). Rewriting the equation we get: b2 = c2 -a2    and then    b =  √(c2 -a2).  Now our PICAXE μ-Controller can square numbers and add them together (within limits), but it does not take a true square root of that result. [ What it does is a simple lookup table of square roots.]  If we wanted it to perform this calculation, one easy way might be to store a list of roots and squares and let it do a look-up to get the height value (b) that we want.

Rather than worry about such calculations, how this up-down scanning might actually be useful is much simpler. The robot looks up the object and finds the top, then drops its "gaze" down slightly. If the object is a human, then it will appear to the human that the robot is staring at him and could help simulate an emotional response.

*[ Quick Quiz: I mentioned taking square roots above. I would be interested to know how many others know how to do so longhand?  ---for those of you who are products of the debilitated US school system, do I need to use smaller words? (ha ha) Anyway, how do you take square root longhand? --and NO I do not mean using a calculator. I mean the "pencil and paper" method. ]

____________________________________________________________________________________________

Here is the 2 DoF (Degree-of-Freedom) servo bracket as the instructions show how to put it together:

After assembling it, I found two things.

     [1] it does work in that configuration.

     [2] it seemed a wee bit "top-heavy". I noticed that the bottom servo was holding not only the weight of the brackets, the other servo as well as whatever load it would be carrying.

I figured out that if the bottom servo were relocated to the inside of the bracket, that would take the extra load off the servo. Now it only has to move the load, but not itself, the bracket or the other servo.

After cutting out a slot that fit the servo, I positioned the servo in the new slot in the bracket frame and used contact adhesive to hold it in place. That Goop adhesive is pretty strong stuff.

All right, that looks pretty good, so now I'll work on to the robot's frame.

For that, I glue two CDs together to make the frame and placed the two gearmotors onto this CD platform.

Following that, I mounted the bumpar switches as well.

 

Now I wanted to mount the servo/bracket assembly on the base as well. In order to carry as much extra weight as possible, and because the bottom bracket already had a couple screw heads sticking out of it,

I decided not to simply mount the servo bracket with adhesive but rather to use machine-screws and nuts to hold it to the base.

Now for the head. I looked around for ideas for what to do to make a head rather than use just the sensor by itself, when I saw an empty snuff can and had an idea. As you see in the next picture, I removed the label and the stamped metal lid. I thought of just taking some heavy construction paper and gluing it over the lid until I saw a piece of thin plywood laying near my toolbox. You could use a coping saw or scroll saw to cut out the wood, but since I have a small lathe, I used that. I had to drill a hole in the middle to mount the wood on the lathe, so that would end up hidden by adding an LED for the nose. That would make it look all right, so that is what I did.

I turned it on the lathe, making a step along the edge so the lid would fit in perfectly. If you simply cut it to fit, you could use more of the adhesive to hold it in place, but don't glue it until you have all the wires the way you want them.

Here I was exploring how he would look with a little enhancement. These old CO2 cylanders are nicely shaped and will look cool on the robot even if they don't really do anything. If I do not add a cover over the outside of the robot, I may use them for that reason. After all, part of making a robot is making it look nice to you, so you as the builder get to decide how it should look.

Okay, he has the two wheels that were made to fit the gearmotors I bought, but he either needs to be a balancing robot or I need a third wheel or caster. The casters cost a few dollars, so I think I can make one myself. The small steel ball bearing fits perfectly inside the piece of iron pipe (seen in the top photo), but then I see another thing that will work. I spotted an old piece of copper pipe that was soldered into a fitting. The glass marble rolled into the tubing, but stopped at the ridge on the fitting. Cool. That is what I will use.

I pressed down spots around the edge of the tubing so the glass ball could not come back out and my homemade rear wheel caster was ready..

 

Sitting around the Robot Garage, waiting for his new tires.

I could have, but did not polish it up by turning it on the lathe. Instead, since it would be underneath and not seen easily, I simply left it somewhat rough and attached it to the bottom of the robot as a caster.

This shows where I am in his construction as of Thursday, 26th of April, 2012.

The next steps in construction are:

 ■ make and mount a bumper that extends clear across including the wheels

 ■ attach bumper to the bumper switches (using either solder or glue)

 ■ mount battery pack. I will use 4 rechargeables to give ~5 volts.

 ■ make a circuit board with the microcontroller chip and the motor drivers on it

 ■ mount that, and hook up all wiring.

I have some L293D chips that make good drivers. I also have some Darlington chips such as come with the picaxe project board which could also be used. Alternately, I have a third option of making driver circuits out of transistors, of which I have literally hundreds, since I buy them in packs of 100 for between $2 and $4 depending on the type of transistor. I also have sockets on hand to fit any of the IC chips (including 28 pin sockets for the "brain" chip).

 ■ Once I have those steps finished, the physical part will be done and I can program the brain chip by writing the programming on my computer

 ■ and burning it to the microcontroller chip.

 

See you soon....   ('soon' being a relative term.)                             :-) 

_____________________________________________________________________________________________________

UPDATE: 05 May 2012 --

The little guy was in the "Robot Garage" having his motors and drive train inspected (and hooked up to the breadboarded electronics).

He was able to run the motors using a test mode of his program (which bypassed the head turning and distance measurements).

His motors went forward, backward, spun left and spun right on command. While his neck muscles (servos) and his eyes (ultrasonic sensor) were not hooked up yet, it was a functional proof of function for the processor, motor driver(s) and motors. I used the driver circuitry I drew in the top picture on http://letsmakerobots.com/node/32462 placing 10 KΩ resistors in the transistor circuits. The motor enables and the forward/reverse worked as engineered and so is proof that the engineering function on that page works as planned, also.

That is all the update for now. Going to be away/busy today, so no more progress expected till tomorrow.

_____________________________________________________________________________________________________

UPDATE: 07MAY2012 --

Tried a couple time to upload a new video to YouTube for this. Finally have it ready to go. If it's not obvious, I put it on top and the older one about the heart is after.  He is still not fully operational; just sitting here in the "Robot Garage (the small space between my keyboard and trackball "mouse").  This is showing that the motors and head/neck servos are functional.

I have actually only picked a few subroutines at random to show his potential. The ultrasonics are not working yet, so I slipped a "return" command in at the beginning of the "Ultra" subroutine (short for ultrasonic). Because a lot of his movement will relate to what he sees near him, I just made a different "main" routine and did gosubs to subs to do forward, reverse, backup-right, back-left, turn his head different directions side to side and tilting forwards.

_____________________________________________________________________________________________________

 UPDATE: 09MAY2012, late it's almost midnight so nearly the 10th of May.

Added some to his programming, added a bumper stuck to the bumper switches with adhesive. Also his ultrasonic sensor is hooked up. I added a couple high intensity white LEDs for headlights, but they are not hooked back to the PICAXE as yet. His nose light is hooked up and I've been using it as a test indicator to tell me what part of the programming he's working in at the time.

_____________________________________________________________________________________________________

UPDATE: 13MAY2012

I have decided on a name for this little fellow. From now on, he will be Edwin. I have named him after astronomer Edwin Hubble, the first man to prove there were galaxies beyond the Milky Way, and discovered the quality of "Red Shift", known as Hubble's Law).

I have much of his programming finished. I am also working on a mouth utilizing ignoblegnome's suggestion of LEDs.

_____________________________________________________________________________________________________

UPDATE: 15MAY2012

Added a copy of Edwin's schematics for inspection or download.  Here is an onscreen version thereof.

 

_____________________________________________________________________________________________________

 UPDATE: 17MAY2012

Just added a couple notes. (weight, cpu, etc.)

_____________________________________________________________________________________________________

UPDATE: 18MAY2012 In lieu of other changes to his face, Edwin now has what I call the "Good grief." look (from Charlie Brown of the Peanuts comic strip.)  Maybe a bit puzzled, but altogether non-committal.

At this time, I will also tell the "secret" part of this project.  Upon advice from the **FAMOUS** Erin, (the) RobotGrrl, this robot will be an "Entropy Bot".

What does that mean, you may ask?  Well, my interpretation is that he needed a lot of randomness built into his programming. In partial answer, here are the top lines of his program.

__________________________________________________________

; Function/Filename: A Different sort of *Start Here* Robot with Ping /ULTRAsonics
; Written by: Dan M
;=***************************************************='
;
; How is a StartHere not a StartHere?
; --only through differences in his program.
;
; A robot is the sum of his programming and where he takes it, so--
; Directly from suggestions made by Erin, RobotGrrl, this robot will be an:
;
;  *********   ENTROPY 'BOT   *********
;
;     Many of his moves will be "random" --except when he realizes
;     he is going to hit something, --and decides he doesn't want to.
;
#picaxe 28X2
'           Version History
'#revision 1 -initial motor tests
'#revision 2 -added servo testing added more subroutines
'#revision 3 -refined subs, added bumpers
'#revision 4 -functions all passed testing.(Nukes added)
'#revision 5 - introduced random behavior
#revision 6 '- remove extra wait-states used in testing.

low 4 : low 7 'Makes sure the motors are initially turned OFF at power-up
;**************************** Set Variables *****************************
;     -------------------ENTROPY-------------------
Symbol RndSeed = w9    ; Random seed is 16 bit stored in b18 & b19 (w9)
Symbol Rnd8Bit = b18     ; 8-bit partial random seed

;     -------------------BUMPERS-------------------
Symbol LeftBumper = b.0  ; INPUT
Symbol RightBumper = b.1 ; INPUT
Symbol Nose = c.7   ; OUTPUT -send flashes to his nose (LED)

'setint OR %00000011,%00000011, B ; bumper interrupts are NOT fully enabled /will OR work with B?
;************************************************************************.
; -----------------PING-SENSOR-----------------
Symbol SendPing = c.0  ; OUTPUT (Trigger) Define output pin for Trigger pulse.
Symbol GetEcho = c.1  ; INPUT (Echo) Analog pin is not needed.
; -------------------SERVO---------------------
; noSymbol, // b0 & b1 to be (always) available as temporary variables (globally throughout program)
Symbol NodHead = b.2  ; OUTPUT Defines output pin for head-Up-Down servo.
Symbol TurnHead = b.3  ; OUTPUT Defines output pin for head-turning servo.
Symbol Left45 = 220      ; this value puts his head at about 45° Left.
Symbol Right45 = 100    ; this value puts his head at about 45° Right.
Symbol Center = 160  ; Center of travel for right/left servo
Symbol UdCenter = 150  ; Center of travel for up/down servo
Symbol TiltForeLimit = 190   ; do not tip forward past this value.
Symbol TiltBackLimit = 110  ; do not tip back past this value.
Symbol Side2side = b14  ; Current side to side Head position.                                  w7
Symbol TurnGoal = b16  ; Where you want to turn the head to. /using HEADTURN     w8
Symbol UpDown = b15  ; Current up and down Head position.                                   w7
Symbol TiltGoal = b17  ; Where you want to tip the head to. /using HEADTILT            w8
Symbol PreLoad = 25536  ; to use preLoad pulse repetition of 10ms, set to '45536'

Symbol LeftStore = w4    ; Store distance measured to the Left in      b8 & b9
Symbol MidStore = w5    ; Store distance measured in the Center    b10 & b11
Symbol RightStore = w6  ; Store distance measured to the Right in  b12 & b13
; -------------------MOTORS--------------------
Symbol RightEnable = b.4 ; OUTPUT Enable Right motor /turn On or Off.
Symbol RightMotorDir = b.5 ; OUTPUT Right Motor Foreward or Backward.
Symbol LeftMotorDir = b.6 ; OUTPUT Left Motor Foreward or Backward.
Symbol LeftEnable = b.7  ; OUTPUT Enable Left motor /turn On or Off.
 ;------------------DISTANCE-------------------
Symbol RawRange = w1  ; analog sensor distance (from a.0).   b2 & b3
Symbol Range = w2   ; Temp range variable (for my benefit).   b4 & b5
Symbol RangeInches = w3 ; Again, distance is converted to inches for my own benefit.

_____________________________________________________________________________________________________

UPDATE: 24MAY2012 -- I am adding yet another video of the robot on the lift, but I can announce that I have his programming about completed, and in lieu of further fixes and revisions, I will add a copy of the program for download. It is 1217 bytes in uploaded form. which with plenty of comments in BASIC language form is just a bit over 500 lines of code.

( Oh, I might say, sorry about the poor video quality, but this was recorded on my Kodak shirt-pocket camera which is not in the same league as the Canon, but hopefully it is good enough for now.)

I still have to finish the control board with the picaxe chip and motor drivers, so he is thus far still tied to the breadboard.

One last thing for now. I received the nickel-titantium "memory wire" which I thought of using to control some sort of mouth, other than the drawn-on one.  However, I have not used it before, so I will need to play with it some to figure the best way using it to control a mouth. In theory, you put the wire into its "permanent" shape and heat it to nearly red hot to lock that shape in. Then you can put it into a different shape and when a light heat, such as not quite boiling water, or an electrical current (about 200 mA for this guage of wire) is applied, it will try to return to the last "memory" shape. Perhaps twisting it into a coiled spring for its permanent shape will work, but as I say, I will have to try it to see if it will work well enough to bother with.

_____________________________________________________________________________________________________

 

UPDATE: 27MAY2012 -- Just updated the copy of Edwin's programming for download. 1475 bytes in program but still needs some patches... (like how to avoid falling when he comes to the top of a stairs or edge of a drop-off).

_____________________________________________________________________________________________________

 

UPDATE: 18JUN2012 -- Latest update of Edwin's programming.  He seems to be "fully functional" now.

I figured out that the glitches he was having only occured when his batteries got too low, so the remedy is to keep his batteries charged. [Schrödinger has solar cells for his batteries, but Edwin has not.]

_____________________________________________________________________________________________________

 

UPDATE: 21JUN2012 -- Latest update of Edwin's schematic.  I believe I have the connections corrected in the drawing to reflect how Edwin is wired. I moved a few inputs and outputs around from the original sketch and never updated the schematic until now. You see the extra resistors in the sketch; I did actually put those on the board, so I can tie other things to a particular port lead without bothering with extra resistors. I might have labeler those "Reserved for future" but didn't. They are not really needed for those port connections at present. If you were building a similar circuit, remember that these extra resistors are just that, –extra. They are not needed in his current configuration. I considered I might add to Edwin later. (Yes, I have time on my hands and plenty of resistors laying around. <grins> )

_____________________________________________________________________________________________________

UPDATE 06JUL2012 – Added a couple snapshots of Edwin's brain-board.  Just to show that everyone makes mistakes, (even me), I had wired the servos to the wrong pins. On the breadboard and in the programming, I used B.2 and B.3 for the two servos, but when I made the board, I wired them to C-pins instead of B-pins 2 and 3. I later fixed this, but here are the pictures, anyway. Everything else was correct:

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
TheBenjaneer's picture
Nice build. Funny when I (re)named my console app and started work on my 'bot I didn't think anyone else was using Edwin as a robot name.. Google must not have indexed this project yet :S I had no clue. Lol. Anyways. I like it the head is very clever looking. I love it when a few relatively simple parts can be formed into something so expressive looking. :D it looks great. Almost reminds me of a puppet. Kinda Pinocchio like. :P hopefully his 'nose' doesn't grow as he drives around. Big plus for the cheap and recycled? (probably at least the cardboard if not the cd's) parts.
Dan M's picture

Not a problem at all. There can be more than one Edwin, just as there are a multitude of Dan's, –even several right here on LMR.

Very few are the names that could be unique.  I just try to avoid using "famous" ones... like Robbie, R2D2 or Wall-E, just to avoid confusion if nothing else.

As to his nose, rather than 'grows', it 'glows' instead. Aye, I intentionally used recycleable pieces-parts like the CDs and a piece of cereal-box cardboard and a strong, rubbery glue to help take away some of the brittleness.  I have quite a stack of old CD's/DVD's to use for construction material. It is strong, but brittle in its CD state.

 

TheBenjaneer's picture

The bit about the names about sums up how i feel. I don't really want to build a 'wall-e' unless its just a fun replica.

Glows/grows.. Good play on words there. It really does have such an expressive little head for having essentially 2 actuators if you count both the rotation motor and the led. And as before, thumbs up for the parts.

I like the idea of adding some random-ness to the system though my Edwin will probably have to avoid that. Noboy wants a several pound robot driving around randomly :P

Also; just wanted to go ahead and thank you and everyone else here on lmr who has discussed My edwin with me. Its been really helpfull to have alternate thoughts and opinions while choosing the parts for the base. I really need to as much as possibly get things right the first time here (cant afford to waste the time or the money really) and its been very nice to have some knowledgeable and friendly people to discuss ideas and choices with.

Kudos on the bot and thanks again. -ben

Chowmix12's picture

I am very curious to see how the robot interacts with his environment. Can you get us a video of him running around the floor? Thanks Dan :)

Dan M's picture

I plan to add that before long. It is on my "To Do" list, –along with additions to my pages on transistors and my pages on Robot Communications. –Oh, yes, and updating my Good Books for Robotics list.

I just haven't gotten to them yet, but [as long as I am still breathing,  ]  I still have plans to add those things. Lots of things to do...

MetalmonkeeLad's picture

oh now i get it, shannon entropy, not "entropy entropy", but this is more like chaos theory rather than entropy.

Dan M's picture

Below are the dictionary definitions. The best definition I could find to apply to a robot was Thermodynamics def. #b (Statistical Mechanics definition); that it is a measure of the randomness of the thermodynamic system.  Hence, I used randomness in his program to show increased entropy.

Thermodynamics, def. #a, perhaps applies in a vague way, in that the entropy is the energy NOT available for doing work. Just by his nature, Edwin is avoiding any constructive work. <g>

In data transmission it is the information lost in a transmitted signal, and in Edwin's case, he is not transmitting much of anything (other than flashing his nose light at intervals... hmmm, that may end up random too.

In cosmology it does relate to chaos theory in that it represents the tendency for the universe (and things in it, like small robots) to attain a state of maximum homogeneity.  Well every robot out there tends towards this state.  The longer they sit, the more their batteries discharge and become homogenous in their charge. 

Finally, the tendency towards "inevitable social decline and degeneration" probably does not apply, unless I were to give him programming to run around and destroy things and kill people. That part of entropy I will pass on ---at least at this time.

 [But NOTICE the thermonuclear bombs he is carrying.  <grins> I think those would contribute to decline and degeneration...]

__________________________________________________

en·tro·py

/ˈɛntrəpi/ Show Spelled[en-truh-pee]  noun  /from the German entropie

1. Thermodynamics .
a. (on a macroscopic scale) a function of thermodynamic variables, as temperature, pressure, or composition, that is a measure of the energy that is not available for work during a thermodynamic process. A closed system evolves toward a state of maximum entropy.
b. (in statistical mechanics) a measure of the randomness of the microscopic constituents of a thermodynamic system. Symbol:  S
2. (in data transmission and information theory) a measure of the loss of information in a transmitted signal or message.
3. (in cosmology) a hypothetical tendency for the universe to attain a state of maximum homogeneity in which all matter is at a uniform temperature (heat death).
4. a doctrine of inevitable social decline and degeneration.
Chowmix12's picture

Nice work with the robot, I'm eager to see the code to learn how you programmed entropy into him.

Dan M, I must thank you, You document your work very well, I have learned a lot from you.

I have a question for you, I recently ordered a few parts off of eBay, including a HC-sro4, servo motors, and batteries. It seems you have also bought some grey batteries as did I, but they haven't arrived yet. Knowing how much of an eBay fan you are I wanted to know:

 

Are these the batteries you bought?

If so, how are they? Are they worth buying more?

Dan M's picture

Those are not the same batteries, but yours looks like a good deal. I bought some 2500 mAh batteries from the same source. I had no problems with the company, but one of the eight batteries does not keep its charge up.  Hopefully, the ones you get will work well. As I say, they are a different battery.

As I mention, my interpretation of entropy was to have him doing random things (as in chaotic) for no particular reason. For instance, if he is running into something, he tends to back away, but not always. Sometimes he will still try to push forward.

I have attached the current programming, but I expect I will make further adjustments as time goes by.

Good luck with your robot, too.

 

Maxhirez's picture
Dan, this is great. You make excellent and creative use of materials and inculcate the device with real personality. I love the naming convention, too. Keep up the good work! As to doing the "longhand" square roots, what I remember was a paper algorithm where you guessed, divided, averaged and repeated. Memorization seemed much more useful. You mention something about a "heartbeat" but only once that I saw. Is that an LED rhythm? If so, you could do worse than an ATTiny. If you already have an arduino you can use it to program the Tiny and get exactly the same results without permanently sacrificing the Arduino.