Thursday, April 13, 2006

PWM'd!!!

ok so "pulse width modulation" doesn't quite mean pwn, but its close enough.

so, i just boned up on my PIC programming, lets lay it down here, in summary.

my PIC has ADCs built into each pin. ADC means analog to digital converter, meaning i can have analog info, such as a varying resistance coming from a bend sensor or potentiometer, be stored into a word in my PIC, ie the amount of voltage supplied to the pin is translated to a 10bit register (number, for the sake of simple analogies).

PWM, or pulse width modulation, is a way of "producing" (see: faking) an analog output. Since the PIC can only do "digital" out (ie 5v/on or 0v/off), by sending out pulses of voltage(5v) at regular intervals, and varying the width of the pulses (ie the width meaning how long its on/off, remember those sine waves from back in the day? like that, the width being how long that sinewave is.)

This all makes my job of using analog input to analog output very easy. The downside? the basic assembler tutorial i just read didn't have any of this stuff in it, i had to put it together on my own reading other peoples code and labs for different projects. Ah well, hopefully i'll find someone who can help me program my particular PIC for just this type of analog to analog control.

servo's are little motors with built in gearing and a potentiometer, so you can control their position! My original idea didn't incorporate a PIC, but rather thought i could just do a "dumb" circuit that would just do such a simple operation directly, without all the circuitry in the middle. One would think that, right? if one got a set of pot's and servo's that worked on the same voltage->angle equation, then why get a microcontroller? I dunno.

Except that it opens me up to further possibilities down the line, for instance, to double the size of the robot hand, i would need larger, therefor probably different, servos. So the microcontroller is like a universal translator, taking in any info and sending out any info how i want it. So once i get used to this, it should be possible for me to tweak the input and output bits.

Of course, the overall project here is to be able to control hands much larger (or if necessary) smaller than my own. Giant robot arms, anyone? wee! Of course, once this project takes off, it should be possible to mimic entire body movements with similar technology (basically just the quality changing, as opposed to the general principle). I've gone over this before, i believe.

Anywho, so this is all coming along nicely. Now to just order those bend sensors, and some microservos, and get some legos. Whew! i blew too much $$$ at that strip club, but i still think it was worth it. OK two different worlds all connected to the same wallet. Siiigh, priorities, right? And i wanted to take my cousins out for a good time, they deserved it! So well spent indeed!

in all honesty the strip club thing won't be happening anytime soon, i've got my money all well planned out: send floridians money and care package, other robot stuff, tickets and plane ticket for Bonnaroo, and that bout covers it.


...

In other news, the forearm machine at my gym tops out at 200lbs, and my grip is at 190 for reps!! lol yay! perhaps after maxing out gets real easy i can perhaps pop open the number 3? i should go find the #2 and see if its along with the machine at the gym....

oh yeah, went to the AFC yesterday. Pretty interesting, i think i'll be fine after some more cardio conditioning. One thing that REALLY turned me off and got my COINTELPRO gears spinning was the rather patriotic attitude. I mean, there is a base here, but a full colorgaurd ensemble for the opening, along with a threeman singing group blaring "god bless america" and the national anthem, and the announcer making some rather baudy statements (we killed 80,000 of those sons of bitches over there!) i mean, it was like everyone out there was proud we were in iraq and of the war etc. I only stood up so as to blend in, i'd rather not have had a group of drunken rednecks assault me for being "unamerican". I was there to study the fighters, not infurirate jingoistic sheep. I guess thats just what happens when you goto to any event lately? i wouldn't know, this is the first time i've been to an invent in lord knows how long. Wacky, as Johnny the homicidal maniac wouldn't say, wacky.

goodnite!

1 comment:

Anonymous said...

this post and the one above it were quite enjoyable to read... lol

good stuff, sir