Showing posts with label BEAM robotics. Show all posts
Showing posts with label BEAM robotics. Show all posts

Friday, December 14, 2012

A bit on IC chips, and a Dragon Headbot

At first in my self teaching of electronics.. I was completely unfamiliar of the IC chips available at Radio Shack, as well as Fry's Electronics, Willie's Electronics, and other stores in my home town. I knew the 555 timer ship was some sort of universally versatile little gizmo.. but had no idea how to wire it up. Similarly, when I read the package of "Octal inverter" I thought it was some sort of code generating chip for computers... something that used some sort of 8-bit (octo) ASCII code or something else completely over my head.

The Junkbots, Bugbots, Bots on wheels Book helped me out immensely! While I still at this time struggle to get a 555 timer to do what I want (I want it to do a short millisecond pulse of power each time I push a button.. but NOT stay on for the length of time it takes my slow Human speed finger to let go of it which is apparently hundreds of milliseconds even at my fastest), now I am an avid fan of the octal inverter. Lets talk about it a bit.
This is one of my favorite chips. Its SO useful! It can do so many things; from powering a motor that can reverse its power automatically, to switching things on and off, to other BEAM robotics related stuff like "Neural Nets" of a limited degree. Lets explain how.

Notice on the sketch there are up arrows and down arrows at the pin points. These are "data channels" symbols, which is a fancy way to say "either 1 or 0 goes in here or out here"; 1 being 5v, 0 being 0 volts. So yes, doing one to an input causes the connected output to do something as well, and they are in pairs 8 pairs, thus Octo.

Its called an Inverter because what it does is outputs the opposite of what was its input was! So you input in 5v, it puts out 0. You link one output to its neighboring input, and you can see more complicated things going on: 5V to channel 1= 0 volts at output, that 0 v gets sent to input of channel 2, it sends 5v at its output. Thus; a motor controller! Have one channel power 1 wire, another power the other wire, simply link them together, and one provides power, the other ground.. all from a single input of 5v (triggered by anything-- mechanical switch, etc)

Whats really neat is how it reverses... put 0 volts at the wire going to channel one, and now the wire that was power is ground, and the other channel is power!! and the motor is running the opposite direction.  Neat, huh? with just 1 wire and a jumper, you now have the equivalent of a DPDT relay wired to do the same thing... only there are 3 more pairs on the chip!

One thing to note though, is that the power output of these channels is not very high. Its more for data that driving motors, and this one in particuar is not a style designed for high milliamp loads (all that is locally available though). So, to make it a motor controller, you have to "gang up" multiple channels in parallel to have enough "push" to actually get it to go. To make the Headbot from the Junkbots book, it uses 3 pairs tied together to drive the motor, and the last pair as the "brains"

Remember how I said the more advanced robotics techniques can make these inverters "neurons"? This is how; take two linked together channels, and you have a loop of alternating on-off states. Wired directly, the voltage just zips back and forth too fast to mean anything... but add a resistor/capacitor to each side, and now there is a controlled delay (the time it takes the capacitor to fill up: stop hogging all the power, for the 5v to actually reach the input). Have each RC group of different values, and the two neurons can cycle like "bip-beeeep-bip-beeeep". How to make this into a 2 neuron  bug brain is rather ingenious: have the resistor of the RC groups be variable to external stimuli.. like a photo resistor that changes its resistance with light levels! NOW, if wired this way, the "beeep" will be "no light" cycle time, the "bip" will be "light hitting this one". Cross wire them so the left sensor makes the motor spin to the right, and what do you have?

A Headbot, that tracks LIGHT! it will scan left right left right, but time between the scan directions differing so that it drifts more and more towards a light. Then, when both sensors are full of light its just a rapid "bipbipbipbipbipbipbipbipbip" cycle, that keeps the eyes pointed at the light source. Move the light, and the head turns to track it. Wire the motor the other way, and now the headbot avoids light! Shift a light nearby it, it will flinch and look for the darkest spot (wear a black t-shirt, and it may be staring at you!). A brain. Of sorts.

Check out my Headbot, since we're talking about them:
This little critter is called, roughly "The blue Eyed Dragon. It uses a solarbotics geared motor, mounted in its wheel as a base, and all of the "brains" are literally in the head. It behaves with surprising amount of behavior for something so simple, as seen in a video below.

Here you can better see why its called Blue eyed, and a Dragon. heh. I was in kind of an odd mood late at night when I finished this, and I noticed the InstaMorph holding the underside of the chip all nice and stable (don't want those jumpers bending and touching each other), once trimmed, looked a bit like an alligator/dragon head. so I went with it when it came time to place all the parts.  ...My only regret is putting the power switch in such an awkward spot.
Anyways, video time. I uploaded this on Youtube as well, as I plan to add some notations as it is acting up a bit.
I like how he can spot lights from across the room (the dim light was my computer monitor), and gets a little squeal going on when really close to the light (The motor is still cycling left/right very rapidly when it looks like its staring.. and the squeal is the motor oscillating at audible frequencies)
 
So, back to IC chips. The Octal inverter is the one I tinker around with most, as the 555 timer, even after reading up on a bit, is still a bit beyond my current level of understanding- in order to get it to actually behave like a timer. Another chip I tried out was the Audio Amp- which can also power a motor, or even a pair of motors dynamically- alternating the amounts of power to each motor as it tries to "equalize" the signal as it varies with the photoelectronic eyes. This is how the "Herbie" bots chase a light around on Youtube. But I cant really claim to understand how the amp does this.. at this time.
 
One of the IC chips I want to get to mess around with is a Clock.. or Shift Register type of chip. These are like the inverter, but cascade down the list of channels whenever something happens. I'll admit I mostly want this chip just so I can make my own knight rider Kitt light bar... or a cylon scanner... no really- a scanner- an array or LED's light up cylon like, sweeping left and right, and another array of light sensors watch for reflections, to know when something is too close... either to avoid it, ram it, or reach out and shove it away... that kind of thing.
 
Well, I'm apparently off into daydream land now, so lets end this before I gt TOO loopy.

Friday, November 30, 2012

ELECTRONICS: Self taught beginnings.

I admit that the spinners I had built off of the solar engine instructions in the Junkbots... book were built off of instructions, and I really had little Idea of even how the solar engines worked at that point. so, I got a bit serious on discovering things on my own, so that I would know about them without trying to remember lessons learned by rote, or comprehend the paragraphs I just read on things I didnt fully understand yet- that was why I wanted hands-on personal experience.

So, where to begin? Transistors. I knew there were two basic types. NPN and PNP, each with varying performances and attributes, that could be looked up on datasheets online. But I had no need for trivia. I knew most things I build would be low voltage, trickle charged, or running off of a 9volt at most.

So, I set up my little power supply, set it to 3V, and placed an NPN transistor in the center, and put 3 jumper wires inline with the 3 rows the prongs were stuck into. I kind of figured that N stood for Negative, and P for Positive, so I tried putting + to the P part (middle pin), Then an LED to one pin to power, to ground, then the other side, until I got to a point where the darn thing switched the LED on and off with me pulling the middle pin out. I eventually figured out that the two side pins were basically like NO (Normally open) contacts on a relay (which I understood as an electrician), with the middle pin being the "coil". With that figured out I now knew that transistors were tiny little switches.
This is a re creation of my eventual "Eureka!" moment, of getting the transistor(lost between the jumper prongs) to "do its thing"
















Doing a little more "exploring and trying everything" I found out that the NPN transistor didnt really matter which way the current flowed through the ends (collector and base), and it was basically a "conductor". What was odd in my "try everything" was that with power to the base, and either side having the LED, the light would still come on... without anything on the other prong. I didnt know what to do with this little tidbit of knowledge (still cant think of any reason to), but the point is that now I DO know it, and its a part of my experience, not just something I read. So its with me now.

Next I looked into the "amplification" factor of transistors; how a weak change in the Base makes a BIG change in the mainline power flowing through the ends. Trying to keep robotics in mind, I used a photoresistor to drive a small motor at different speeds with different light levels. It didnt work very well by itself. The resistance was just too high for the 5V to push through the resistor AND drive the little motor. So I tried the photresistor as a variable current into the base of an NPN, to see if this "amplification" thing would do what I thought. It didnt. The resistor varied the current to the base, but this only resulted in an on, or off state to the motor, which did in fact drive now, just all the time, using the transistor as a pathway for the power.

It was time to do some thinking. I had read up in a "beginning electronics" book about "voltage dividers" and knew a bit about the ohms law theory of it all (electrician, remember); about how the voltage drops were divided up evenly along the different loads in a series circuit.  This gave me a little lightbulb moment: "maybe I dont adjust the current to the base, but rather the VOLTAGE!" I eagerly put the photoresistor from power to base, like it was before, only now added a 1k ohm resistor from that base to ground.. this should vary the voltage to the base as the resistance of the photresistor changes between its 10k ohm and 2k ohm range. It worked GREAT!

After making a system that worked, I then went on to make something to keep my interest going: I made a Robot Eye.
Point of note: it was built to look like an eye- with "neuron" blob solder joints, to tangled optic nerve wires- on PURPOSE. :) It is really as simple as a photoresistor, a NPN transistor, a 1k ohm resistor, and 3 color coded wires: Red= + voltage, Green= Ground, Black= Motor power lead.







Having a purpose to strive for made all the puzzling out less tedious. I now had an Eye that could vary the speed of a wheeled motor. Cross connect the eyes to the opposite motors, and the eye facing the light would make the opposite wheel go faster, making it follow/chase a light around.  THAT is the far off goal that keeps me at it!

Oh, how about a video of the Eye driving a wheel?

So yeah, progress was made rather quickly with simple level electronics aimed at doing something "neat". That wheel/geared motor, by the way, used to be a TrekBot.
http://www.mydeskpets.com/trekbot/
These are found at RadioShack, and are pretty much mass produced BEAM bots all in themselves. I bought a couple of these, played with them the prerequisite amount, then promptly tore them apart for parts, and a rather cool hubless wheel design.

I asked the People at DeskPets if it was ok to "hack" their toys, in order to make other things with them, and that I was intereted in making some of them into BEAM photovores instead of remote control. They replied that it was perfectly fine, they love BEAM hacking too, and even gave me the pinouts of the tiny chip inside that drives the H-bridges to fwd or reverse the wheels!!! That was above and beyond what I expected, those guys are awesome! and make some pretty cool gizmos, as well.

The SkitterBot, TrekBot, and TankBot are my favorite. I have bought (and frankenstein monster'ed) many of them over the months.

Thursday, November 29, 2012


SPINNERS.

This is a good representation of my slow but steady improvement in making basic BEAM bots that dont do too much... just spin.

Lets start off with my old Symet, built from the Book instructions (Junkbots, etc). WOW what a klunker!!:
That is a 1/4" grid graphpaper, so you can see just how HUGE-UH this thing was. its actually kinda silly looking nowadays. The thing was, I couldnt find any low voltage 4700 Caps (like the one in the transistor testor) at the time, and used all I could get: 10volt ones. I know now they are simply MUCH too heavy to make a solar powered thing that actually uh.. does anything.

Above it is the qeue cards I started making for myself, little reminders on circuit designs of stuff I may come back to later and need a quick reminder on what goes where.

The motor is a pancake motor I got from a Cassette walkman from the 80s/90s- I did what the Book reccomended, and asked my coworokers if they had any old walkmen tapedecks laying around that they didnt want anymore.. and BOY did they start coming in! I got like 5 of them to tear apart for the rather excellent motors to be had within (this one ran on 1.7 volts, drawing only 35mA- with some pretty good torque, by way of example). The Solar cell is one of several I mail ordered from Solarbotics. These poor cells are having a hard living, but they are resin encased, so, except for the printed circuitry tabs tearing away, theyre pretty much indestructable.  BTW: that little cell, measuring 37x33mm.. is a 6 volt, ~50ma (!!!)
This side view shows how it is supposed to work- the pulley (smeared in dried school glue for better grip) sits at an angle, propped up on the edge of the Capacitors, just barely not dragging the case on the ground. What this does is when the motor turns on, say, clockwise, like this the symet will slide towards me, until it runs into something, tips anoter way, and now the turning wheel will send it skitting in some other direction. Pretty cool, but all my klunky old thing can do is twitch. (and UGH the lousy cold welds on the casing!!!)

But anyway, that is the first I ever built.

Next is one from a failed experiment. I call it "1Wing":
This one has the smaller 4700 cap, and a different solar engine than the first Symet (that was a flashing LED solar engine). This one is a fancier 1381c solar engine, using a special voltage trigger chip- one of those transistor looking things crammed in between the capacitor prongs. That little black blob with the red diode is indeed the entire engine.
This is "1Wing" because it was supposed to be one side of a pair- in an attempt to make a Photovore that didnt actually have any eyes, yet still tracked towards a light due to the solar engine getting the most light firing more often, turning the bot to it (by running the opposite side motor). The blind photovore failed as a prototype, because for some reason one wing worked extra well, the other maybe 1/3 as well... meaning it didnt do what I wanted it to do. bummer.
 
But I kept the good solar engine, put the motor on its own wing, and made it a sort of spinner. This was my forst working solar engine that actually... worked.
 The cell is actually one of the big ones, cut down the center, where the two arrays of cells inside the resin are separated. I realized that the 6V was really just 2 3v ones wired in series, so that actually meant I could make 2 cells out of one!
 
Heres a rather boring video of it doing something... but what makes me grin is that "look Ma, no batteries!", and it really is running off of the desklight.
Yeah.. I warned you it wasnt very exciting, dont worry, the rest are much more active, as I DID get better at making these things.
 
 
So what was next... OH my "little engine that could":
Remember that the grid is 1/4" squares, so thats why its called "little". It uses another cell from Solarbotics, a 22x24mm one, (3v, ~20mA), a tiny pager vibrator motor, and uses the solar engine printed on the back of the card, seen in the next pic.
Kinda messy with the Hot Glue holding it all together. But you may wonder what the point was. This little engine was the end result of me tweaking this and that to take this cell, that Cap, that motor, and make the Best Darn Engine I could out of it, squeaking the most performance out of the limited power trickling in from the daylight. I tweaked mostly just the weight of the chassis, the arrangement of the "wheel" (a glob of tacky hotglue), and the timer capacitor (tan thing) that controls how long the voltage trigger stay "triggered". This is a fine line- between either draining the Cap completely and a slow recharge of the Cap, or a too rapid drain, getting not much motor activity and leaving a full Cap all the time. So you see, even with such few components, something as simple as a timing Cap can make ALL the difference!
 
 
Heres a video showing the best performance I was able to get: the lightest possible setup, the most direct wheel to ground drive, the best "power curve" of pulses:

 Yeah.. pretty Active.. if I do say so myself, running under a 100watt desklight. But why is it the "Little Engine THAT COULD"?
 
Because it could "turn over"!! The charge/discharge cycle, if given enough light, could cycle in between the time it takes for the motor to coast to a stop.. so... it runs continuously!
This is a big deal for me, because its important to know that the cell, with its trickle of current, could NEVER direct drive the motor on its own, directly. But with a Solar engine, and a millisecond short cycletime of pulses, it could in fact do the job!
 
 
Now that just warms my Heart. This little gizmo, about the size of a quarter, would run nonstop everyday until the end of time, or until a breakdown happens (so take THAT Zombie apocalypse! LOL). Maybe I will have it encased in a plexiglass domed display case on my tombstone for all the world to marvel at... too much? ah well, the inner geek in me got carried away.
 
But next lets see what a SERIOUS solar powered spinner can do: This one is bought from Solarbotics, and is called a "Battle Symmet" from an Instructables article(http://www.instructables.com/id/Solar-Powered-Battle-Symet-BEAM-Style/), and comes in a "solder it yourself" kit bag of parts. Lets see... linky:  http://www.solarbotics.com/product/60010/
When I saw this parts list, the somewhat BEAM educated geek in me went OOoooH! over some of the parts: a coreless induction pager motor, a .33F (thats like 330,000uf) SuperCapacitor, some wheels that fit on paperclips, etc... I went a little overboard, and bought like 6 of them.
So, if you clicked the linkys above, you know what its supposed to basically look like. I modified mine a bit, 1 for looks, and one for performance (of a sort):
 

I think mine looks meaner, more sleek, more well, just geektastic I guess. I built 3 of them, to battle it out in a slighly bowl shaped styrofoam plate, and kept track of which one was the "champion" by either being most active, hammering the other battle bot around more, or even BREAKING the other bot with a nasty tangle. The losers got disassembled for parts for other things, and the winner got some finishing touches, and a permanent place in my "cool stuff" tacklebox.
In addition to the blade "weapons" on the ring (these are the striking edges, afterall), what makes this little demon a bit more custom is the little scratch you see to the left of the motor, in the printed circuit strip along the left side. If you look closely, you can see tiny green wires in an X cross connecting the corners. What this means is that the two 3v cell arrays in the panel are wired in paralell now, no longer series. So instead of a 6v,~40mA, its theoretically a 3v, ~80mA... that doesnt work so well in less than optimal light (that was the drawback, but I figure all battle arenas will be lit... right?)
So, looking back at ol' 1Wing in its sedately pulsed spins around and around... how does one with some serious performance BEAM components do in comparison? The supercap (the blue chrome thing.. TINY for so much power) takes a bit of time to build up a charge... but when the voltage trigger sets it loose... well, lets just watch:
Pretty much awesome.
 
Thats it for my spinner Phase of learning (oh! I made a rear view mirror spinner, in my truck! details on that later.), but now we come to a bit of sad part of this Hobby and Learning experience. After eagerly absorbing all I can on BEAM robotics, technology, tricks, and events, and many many internet searches for more, more MORE... I noticed something unfortunate... most BEAM related websites havent been updated since roughly 2002!! Meaning the world has apparently "lost interest" YahooAnswers on this subject informed me that the age of discreet electronic components was giving way to integrated components, leaving little things like the voltage trigger in its transistor package a thing of the past- consumer elctronics simply dont have them inside anymore. Nor are these things called "cassette tape players" that need high efficiency motors around anymore.
 
So, bummer. My mean little blade hammer Battle has no one to battle. The timed dragrace solaroller I was designing has no events to compete in.  So these Gizmo's are ultimately just for my own personal "giggle factor". But so be it! Giggle, I Shall! and keep on building!
 
After this slightly disheartening discovery, my focus drifted a bit... but to other neat things. Like Arduino. More on that later as well, because that has some great robotics aspects as well.
 
 

Tuesday, November 27, 2012

BEAM Robotics. The recently discovered thing that has grabbed ahold of my interest and obsessions of late. Its a simple electronics thing, that also meant it was a good way for me to begin self teaching myself hobby electronics- something I was always interested in learning.

BEAM Robotics is simple. No Computers, controllers, or any of that. And what really appealed to me was that you can make little desktop robots that skitter, race around, roll, flip, etc...  and get this- out of  VCRs and old Cassette Walkmen, Printers, DVD players, etc! Those electronics of old, of which I had several gathering dust, have some really excellent DC motors in them, and even if the device itself is broken, the goodies inside are often just fine! I really like the idea of taking stuff apart (things I do anyway) for materials, putting those parts to use in something completely different, doing so with electronics (that I was interested in as a hobby), and getting little robot critters out of the bargain (Sweet!)

*sigh* It all started with this Book at the local Borders bookstore: "Junkbots, Bugbots, and Bots on wheels"
http://www.solarbotics.com/product/jbb/
...that stopped me dead in my tracks while walking through the bookstore (on my shortcut way to the theater) and compelled me to buy it right then and there. I read through it that night, and was instantly HOOKED.

I started looking through my local Radio Shacks for some of the more exotic components, and found that not much to be found, so, Going online I found this really cool site (which you've already been to if you clicked the above link), that catered to just this sort of geek-ery. Solarbotics.com.

http://www.solarbotics.com/

I'm a little embarrassed at how much money THEY got from me, but when the fedex box arrived, I tore into it like a kid at Christmas. Now I had a bunch of solar cells, motors, IC chips, transistors, etc etc. And promptly got right to work!

This was a few months ago, so these next few posts will be me "catching up" and "showing off" :)