Tuesday, August 24, 2010

AM Algorithm Machine

08-04-2010, 01:37 AM
AM Algorithm Machine
A Tiny Tester for Developing Parallel Algorithms
You can use this tiny tester, built from Parallax parts, for developing parallel algorithms and running tests for much larger machines (including large Propeller based parallel cluster machines under design and construction). It's a real time saver! The tester is an upgrade and a spin-off of the Minuscule BASIC Stamp Super Computing Machine. This is a tiny algorithm machine, simple to build, easy to use. The field of parallel clustering computing is relatively new to hobbyists. Developing techniques and methods is an important aspect of cluster computing to gain the greatest rewards and benefits from not only paralleled space but multiprocessors as well.

Features 
  • Operates in five BUS modes
  • Serial & Parallel options
  • Includes WIDE BUS
  • Handles up to 200 step code
  • Programs in PBASIC
  • Very small footprint
  • Builds with Parallax BASIC Stamp 1 Project Boards #27110
  • Speakers & LEDs for output
  • Twin 9-volt battery operated

SCHEMATIC

Use the above schematic to build the tester, then program it with parallel algorithms to test various interfaces and parallel configs. Provisions are made for converting between single wire, full duplex, and data buss interfaces.
_____________________

Overview
It doesn't matter if you're using stamps or props, parallel techniques work cross platform. Here's a chance to use a language that's been proven over time and develop routines for new parallel machines. The addition of the upgraded interface bus allows for trying out several hardware configurations such a one wire, serial full duplex, and data bus.

Criteria
The AM is currently being used with the UltraSpark 40 Supermicrocontroller Parallel Computing Machine and satisfies several conditions for testing the new series.

Interface
This versatile machine operates in four modes, which can be wired as single mode A, single mode B, or dual modes A & B, or simply C mode. Operate the AM using a single wire and serial PBASIC code commands or program the machine using the seven parallel port bits.

A - Single Wire Serial P0
B - Parallel Bus P3, P4, P5, P6, P7
A + B Dual BUS, as seen above
C - Parallel Bus Only P0, P3. P4, P5, P6, P7


Code and Parallel Algorithms
It is left up to the user to derive various parallel algorithms in PBASIC
code. However, as code becomes available, it can be posted in this thread. The 1st proposal is a split function task for n processors. In this example, one program is written that supplants itself into n processors and auto determines the work share for each processor. Time passes and the work conclusion is collected and concluded. It is ok to create a separate collection program.

10-12-2010, 07:15 AM  Update 10.12.2010 NAME ESTABLISHED
This update includes the name AM - Algorithm Machine. This is a tiny minimal two core machine capable of quickly running tests on simple parallel algorithms. The second advantage of the machine is that it introduces a new wide bus for experimentation.

10-12-2010, 07:20 PM  Update 10.13.10 REVISED SCHEMATIC
Revised Draft Schematic Posted

10-13-2010, 08:56 AM  INTRODUCING WIDE BUS

A - Single Wire Serial P0
B - Parallel Bus P3, P4, P5, P6, P7
A + B Dual BUS, as seen above
C - Parallel Bus Only P0, P3. P4, P5, P6, P7
D - P0 - P7


Regarding bus modes. For a D mode, WIDE BUS, remove the LEDs and Peizo speakers to gain a parallel eight bit BYTE bus data array using pins P0- P7. Connect, P0 to P0, P1 to P1, P2 to P2 up to P7 to P7, confirming a protection resistor (220 ohm) across each port.

10-13-2010, 08:57 AM  BS1 PROJECT BOARD SCHEMATIC
BASIC Stamp 1 Project Board Schematic - Use for Wiring the AM

Schematics may be difficult to find these days. Use this BS1 Project Board schematic when wiring two boards together to create the AM project. The 93LC56 chip is an EEPROM with 256 bytes size or 1/4th K. This holds up to 100 instructions. The microcontroller is a Microchip PIC16C56A running at 4MHz. This gives about 2,000 IPS Instructions Per Second. The serial PC interface runs at 4,800 BAUD for programming and debug. Power can be within the range of 6 to 15 volts.

Source / Sink Current per I/O.................. 20 mA / 25 mA
Source / Sink Current (device) ................ 40 mA / 50 mA
Power Consumption................................ 7 mA running (no loads); 5 mA Sleep (Rev B). On Rev B boards the power LED remains illuminated when the BASIC Stamp is in sleep mode

10-13-2010, 08:57 AM  PROGRAMMING COMMANDS
BRANCH Branch to address specified by offset
BUTTON Monitor & manage button input; branch if button in target state
DEBUG Send variables and/or messages to PC for viewing
EEPROM Store user data in available EEPROM space
END Terminate program and enter low-power mode until reset
FOR...NEXT Create numerically controlled loop
GOSUB Unconditional branch to a subroutine
GOTO Unconditional branch to program address
HIGH Make pin an output high
IF...THEN Compare and conditionally branch to program address
INPUT Make pin an input
LET Optional designator for assignments
LOOKDOWN Search table; if found set output variable to target location
LOOKUP Set output variable to table data specified by offset
LOW Make pin output low
NAP Enter low-power mode for short period
OUTPUT Make pin an output
PAUSE Suspend program for 1 to 65,535 milliseconds
POT Read a 5 – 50 K variable resistance and scale result
PULSIN Measure width of an input pulse
PULSOUT Output timed pulse by inverting pin for some time
PWM Output analog level (requires external RC network for filtering)
RANDOM Generate a pseudo-random number
READ Read byte from EEPROM location
RETURN Return from a subroutine
REVERSE Reverse pin state; make input if output, output if input
SERIN Receive serial data, 300 – 2400 baud, N81 format
SEROUT Transmit serial data, 300 – 2400 baud, N81 format
SLEEP Enter low-power mode for 1 – 65,535 seconds
SOUND Generate tone or white noise
TOGGLE Make pin an output and toggle current state
WRITE Write byte to EEPROM location

10-13-2010, 10:28 AM  MORE PHOTOS 
This view of AM - Algorithm Machine, shows a nearly cubical shape, wired in WIDE BUS mode. The solderless breadboard is used only on the top board. Wiring is made with the pin connectors. The bread- board is used for adding the Peizo speaker and LED outputs in other modes.

10-14-2010, 05:33 AM  AM Algorithm Machine BS1-IC Experiment
Instead of using two Stamp 1 Project Boards, this experiment uses a BS1-IC in SIP form. A BS1 module (Parallax part number BS1-IC) plugs into the solderless breadboard on one Stamp 1 Project Board and extends its buss connections directly to the board. The following features result.

    * Significantly Smaller
    * Improves Wiring Efficiency
    * Better Visibility
    * Maintains both Peizo & LED Outputs
    * Requires Only One Battery for Field Use
    * Rewiring is faster

BASIC Stamp 1 Module


BS1 Project Board
Boards setup before wiring.
Setup uses a Revision B Project Board and Revision C BS1-IC. The Project Board programs with a serial to USB converter, and has a choice of battery or power supply operation. Note, the on/off switch at lower right in the photo is especially handy for recycling power.


Schematic for rev. c was not found, however, the pinout of BS1-IC Rev. B can also be used for wiring Rev. C.

Note, this experiment is provided for pure academics. In actuality, to program the add-on BS1-IC SIP, add a small three pin programming port and a Parallax Serial Converter, then connect to the PC.

Friday, August 6, 2010

Beginning

08.06.2010 12:44 AM, Code 1-1  In the beginning, how would you fill a Big Brain?

If you had a big brain for your robot, what would you put in it?
I think some similarity to a human brain is good, for example, put in vision processing, memory, and a robot autonomic nervous system. Ok, your turn, fill the brain..

 
Use an extremely large array of sensors similar to that of the human nervous system. Consciousness. The only limit is your imagination. Education. Impressive sensors. Move around and manipulate the world. Keep the brain "out of trouble." That is, keep it from running into things, running off drops or down stairs. Keep itself powered, recharging by returning to a recharging station or battery changing station when needed or keeping itself in light where it could receive recharging through solar panels. It might also include calling out for help with some sort of trouble alarm. Basic robot safety (protecting itself) would be a first priority. Aim for the most basic brain functions first. Give it a model of human intelligence. 

Keep out of trouble, self preservation, maintain itself, protect others, know its environment, and ponder its existence in the Universe, an autonomic nervous system so it can react automatically to many things without much thinking (hot, cold, light, dark, hunger, full, touch, smell, noise, tilt, terrain, wind, hurt..) another place in the brain could determine what is right and wrong. For example, it is wrong to walk inside the house on the white carpet with muddy feet. It is wrong to feed the cat with fish from the aquarium. This list could be endless. The brain will need to prioritize. 

How about a personality section. It can be sarcastic, optimistic, pessimistic, logical like Mr. Spock, wild and crazy as Steve Martin might say, timid and shy, bold and brave to explore strange new worlds seek out new life and boldly go where... The important thing about the personality brain lobe is that it must develop its own personality based on its experiences. Will a good robot follow the law like a mindless cretin or will it have the ability to interpret the law within reason and circumstance.. Which leads into the next section of the brain, which would be a philosophical center and the ability to interpret various philosophies. 

A section in the brain for fuzzy logic, to interpret results in a less rigid fashion, to have the ability to average things, and approximate the information collected. Rather than draw a philosophically incorrect conclusion, the result could be inconclusive, especially when there is no yes or no solution. The gray water section could include interpretation of vision, and other sensory elements and include sets of general algorithms to apply across the board. 

Another brain section called, "Shoot from the hip." In life it becomes necessary to make snap decisions and judgments, in quick situations where and when there is limited or no time to think. For example, a baseball flying at your head and you would want to duck in a particular direction, a baby crawled onto the coming trains tracks you would grab it in the most efficient manner to save it, your information is at home and you must immediately summarize it to pass through the security gate, should you buy red or blue and the person behind you is telling you to hurry up, etc. This is not to be confused with instinctive reactions which also can be programmed in another part of the brain. 

An emotional center in the brain is needed when interacting with humans, otherwise the robot will be very boring.. This can include heightened interest in certain topic, lack of interest in others, robust behaviors for interesting activities..

Thinking should be accessible in some way by output. In SEED, it displayed thoughts on a debug screen. However, in the bigger brain we're designing, it additionally will have motor functions which can move a robot in various ways. Human thinking does not always have visible results but if you can peek into a dream it can be very interesting. On the original Star Trek series, in the early episodes, the ships computer said, "Working," so you knew it was thinking.

Let's say thousands of people were developing common apps and posting each on the net. The brain would access the open door by doorknob routine, and have access to millions of other routines. The intelligence "brain" decides which routine is needed and the robot performs the action to grasp the specific knob/lever/handle and opens the door.