Tinkertrons: Make Artificial Neurons For Robots

Written by: admin@makezilla

Tinkertrons are an attempt to make a cross between a circuit board and a bread board--a kind of universal circuit. These plug and play circuits are designed to be easily assembled and interfaced like tinker toys. They are designed to be easy to rearrange and interconnect. Any Tinkertron can communicate with any other Tinkertron in several ways and the interface allows for parallel processing.

The goal is to create a crude approximation of living neurons and to discover a neural network that is more effective than standard circuits and the standard programming used to control robots.

Pic 2 shows the first real world test of a soft robot arm that is controlled by robot neurons. To see a video and instructable on the robot you can go here:http://www.instructables.com/id/Soft-Robots-Make-An-Artificial-Muscle-Arm-And-Gri/

Step 1: Tinkertron Neural Network

Step 1 pic shows a diagram of the Tinkertron neural network. The illustration was made using an excellent free program called Scheme-It. Available from Digi-Key: http://www.digikey.com/schemeit

The Tinkertron schematics were also made with this program.

Robot Neurons
Robot neurons can communicate with each other by serial or I2C protocols. They each have infrared LED's which can signal their status to the programmer or to other neurons with receivers. They also have any available input/output pins connected to header sockets which can be used to directly connect to any other neurons with 24 gauge wire.

Types of Neurons
At this point there are three main types of Tinkertron neurons:

1. Sensor neurons that interface with different sensors such as switches, compasses, infrared sensors, etc.

2. Master neurons that poll sensors, decide on responses and tell the actuator neurons what sequences of outputs to activate.

3. Activator neurons are all different. Each is designed to activate a stepper motor, regular motor, servo, LED's, or other device. They receive serial commands and do whatever the master neurons tell them to.

Additional Circuits
Each neuron has four header sockets at a diagonal that are used to program the Picaxe processors. Additional circuits such as memory, display, infrared receivers, or others, can be attached here.

Step 2: How they Work

Research into neurons has gone on for decades and so far no one as been able to reverse engineer the circuit of a neuron. No one knows exactly how neurons communicate with each other or how the neural networks in living things work. There are an abundance of theories and prototypes, but no one has a working model that works as well as real neurons.

Another way to research it, is to try and emulate as many of the known qualities of neurons and use existing micro-controllers to try and discover neural networks that work in the real world. That is what I am attempting.

Tinkertrons are designed to be easily connected and reconfigured in any combination to create refined circuits that roughly emulate animal neurons. When connected together, they transfer power and two lines of serial communication through the header sockets on four sides and top and bottom. They also each have infrared transmitters that allow them to communicate with the outside world or any neuron in the local vicinity. A visible Led also communicates that there is power and that the micro-controller and program loop is working.

Picaxe micro-controllers were chosen for the robot neurons because they are small, inexpensive, and easy to program. They also require a bare minimum of additional parts to be fully functional.

This instructable is mainly about the architecture of Tinkertrons and the robot neural network. After I build a robot that is controlled by Tinkertrons, I will try and publish the working code for it.

Step 3: Materials

.1" Machined pin sockets and headers from Mouser: http://www.mouser.com/

Picaxe micro-controllers from Phanderson: http://www.phanderson.com/picaxe/
The best price in the US for Picaxe

Resistors,diodes, and LED's and 30 gauge magnet wire from Mouser:http://www.mouser.com/

SOLDER-ABLE PERF BOARD, LINE PATTERN from Allelectronics:http://www.allelectronics.com/make-a-store/item/ECS-4/SOLDERABLE-PERF-BOARD-LINE-PATTERN/1.html

Step 4: Sensor Neurons For Robots

Sensor Neurons are designed to interface with different sensors such as switches, compasses, infrared sensors, etc. They work by constantly checking a sensor or sensors and recording the sensor value in a variable. When it receives a serial or other command from the master controller, the sensor neuron gives the value to the master.

I used fiberglass perf board with a pre-etched line pattern to make quick permanent circuit boards. Details on this method can be found here:http://www.instructables.com/id/Picaxe-Projects-1-Making-Fast-Printed-Circuit-Mo/

Step 5: Sensor Neuron Schematic

The schematic was quickly made using a free, very easy to use program called Scheme-It. Available from Digi-Key: http://www.digikey.com/schemeit

Its only drawback is that you have to be online to load it or save a file.

Step 6: Master Neurons for Robots

Master neurons poll all of the sensor neurons, determine the importance of what is sensed and then decide on responses. They then tell the actuator neurons what sequences of outputs to activate.

Master Neuron Code
The actual code of a master neuron depends on the robot  that is being controlled. My first real world use is using tinkertrons to control an air muscle robot controller. For details on how to make the controller, see here:http://www.instructables.com/id/Air-Muscles-Make-an-Artificial-Muscle-Robot-Contr/

Here is the code used in the master neuron of the air muscle robot controller that controls two activator neurons:

'20m2 master neuron

b1=1
pause 100
serout c.0,t4800,(1,11)  'open intake
pause 40
serout c.0,t4800,(1,11)  'open intake
pause 40
serout c.1,t2400,(170,9,$0C,127) 'clock m1 24-127, 84-2/3 speed
pause 100

loop1:
low c.7
'    debug b1

irin [1000,loop1],b.5, b6

if b6 = 0 then send1 'button1=0
if b6 = 1 then send2
if b6 = 2 then send3
if b6 = 3 then send4
if b6 = 4 then send5
if b6 = 5 then send6
if b6 = 6 then send7
if b6 = 7 then send8
if b6 = 8 then send9
if b6 = 9 then send10
if b6 = 59 then send11  '(-)
if b6 = 11 then send12  'enter
if b6 = 14 then send13  'guide
if b6 = 21 then send14  'power

if b6 = 16 then send16   'ch+
if b6 = 17 then send17   'ch-
if b6 = 116 then send116  'back
if b6 = 117 then send117  'forw
if b6 = 52 then send52   'left
if b6 = 51 then send51   'right
if b6 = 18 then seq1     'arm down
if b6 = 19 then seq1rev     'reverse arm down

goto loop1


send1:  
'serout c.0,t4800,(1,13) 'guide
'pause 40
serout c.0,t4800,(1,1) 'send 1 byte with 1, as qualifier
pause 40
goto loop1

send2:  
serout c.0,t4800,(1,2)
pause 40
goto loop1

send3:  
serout c.0,t4800,(1,3)
pause 40
goto loop1

send4:  
serout c.0,t4800,(1,4)
pause 40
goto loop1

send5:  
serout c.0,t4800,(1,5)
pause 40
goto loop1

send6:  
serout c.0,t4800,(1,6)
pause 40
goto loop1

send7:  
serout c.0,t4800,(1,7)
pause 40
goto loop1

send8:  
serout c.0,t4800,(1,8)
pause 40
goto loop1

send9:  
serout c.0,t4800,(1,9)
pause 40
goto loop1

send10:  
serout c.0,t4800,(1,10)
pause 40
goto loop1

send11:   '(-)
serout c.0,t4800,(1,11)
pause 40
goto loop1

send12:   'enter
serout c.0,t4800,(1,12)
pause 40
goto loop1

send13:   'guide
serout c.0,t4800,(1,13)
pause 40
goto loop1

send14:   'power send 21
serout c.0,t4800,(1,21) 'send 21
pause 40
goto loop1

send16:   '
serout c.0,t4800,(1,16)
pause 40
goto loop1

send17:   '
serout c.0,t4800,(1,17)
pause 40
goto loop1

send116:   '
serout c.0,t4800,(1,116)
pause 40
goto loop1

send117:   '
serout c.0,t4800,(1,117)
pause 40
goto loop1

send52:   '
serout c.0,t4800,(1,52)
pause 40
goto loop1

send51:   '
serout c.0,t4800,(1,51)
pause 40
goto loop1

seq1:   '
serout c.0,t4800,(1,18)
pause 40
goto loop1

seq1rev:   '
serout c.0,t4800,(1,19)
pause 40
goto loop1

Step 7: Master Neuron Schematic

A 20M2 or 20X2 Picaxe micro-controller is used for the master neuron.

Step 8: Actuator Neurons for Robots

Actuator Neurons receive serial communication or direct pin communication from the master neurons. They then directly activate motor, servos, LED's or other actuators or displays. Or, they can also control motor drivers, servo drivers, or other driver circuits.
They can vary in size and shape depending on the circuitry required.

The actual code of an actuator neuron depends on the robot  that is being controlled. My first real world use is using tinkertrons to control an air muscle robot controller. For details on how to make the controller, see here:http://www.instructables.com/id/Air-Muscles-Make-an-Artificial-Muscle-Robot-Contr/

Here is the code used in the two activator neurons of the air muscle robot controller that controls 11 air muscles. They are parallel processing:

'18x activator neuron one
low 1
low 2
low 3
low 7
low 6
low 5
low 4

loop1:
'serin 0,t4800, b1
serin 0,t4800,(1),b1 'receive 1 byte after receiving 1
pause 30
'debug b1
if b1 = 1 then act1
if b1 = 2 then act2
if b1 = 3 then act3
if b1 = 4 then act4
if b1 = 5 then act5
if b1 = 6 then act6
if b1 = 7 then act7

if b1 = 16 then pressurev1v2
if b1 = 17 then vacv1v2
if b1 = 116 then back
if b1 = 117 then forw
if b1 = 52 then left
if b1 = 51 then right
if b1 = 18 then seq1 'arm down
if b1 = 19 then seq1rev 'reverse arm down

goto loop1


act1:     'v1
high 1
pause 20
low 1
goto loop1

act2:    'v2
high 2
pause 20
low 2
goto loop1

act3:
high 3
pause 20
low 3
goto loop1

act4:
high 7
pause 20
low 7
goto loop1

act5:
high 6
pause 20
low 6
goto loop1

act6:
high 5
pause 20
low 5
goto loop1

act7:
high 4
pause 20
low 4
goto loop1

pressurev1v2:    'ch+
high 1     'v1 arm down
high 2      'v2
pause 800
low 1
pause 1500
low 2
high 1
high 2
pause 700
low 1
low 2
pause 60
high 4      'v7
pause 1440
low 4
pause 20
'goto loop1
pause 1600  'close gripper

high 1   'v1 up arm
high 2   'v2
pause 2200
low 1
low 2
            'arm left
high 5     'v6
pause 1200
low 5
            'arm down
high 1   'v1
high 2   'v2
pause 800
low 1
low 2
goto loop1

vacv1v2:   'vac   ch-
pause 3000
high 1   'v1  vac valves
high 2   'v2
high 6   'v5
high 5   'v6
high 3
high 7
pause 3500
low 1
low 2
low 6
low 5
low 3
low 7
pause 20
high 4   'v7
pause 3000
low 4
high 1    'release vac inline
high 2
high 4
high 6
high 5
pause 2000
low 1
low 2
low 4
low 6
low 5
high 3
high 7
pause 1000
low 3
low 7
goto loop1

back:
high 1
pause 2000
low 1
goto loop1

forw:
high 3
high 4
pause 1000
low 3
low 4
goto loop1

left:
high 1
high 3
pause 20
low 1
low 3
goto loop1

right:
high 2
high 4
pause 20
low 2
low 4
goto loop1

seq1:  
      'close gripper
pause 1600
goto loop1

seq1rev:  ' open gripper 
pause 3000
goto loop1



'18x activator neuron two
low 1
low 2
low 3
low 7
low 6
low 5
low 4

loop1:
'serin 0,t4800, b1
serin 0,t4800,(1),b1 'receive 1 byte after receiving 1
pause 30
'debug b1

if b1 = 1 then act13
if b1 = 2 then act13
if b1 = 3 then act13
if b1 = 4 then act13
if b1 = 5 then act13
if b1 = 6 then act13
if b1 = 7 then act13

if b1 = 8 then act8
if b1 = 9 then act9
if b1 = 10 then act10
if b1 = 11 then act11
if b1 = 12 then act12
if b1 = 13 then act13
if b1 = 14 then act14
if b1 = 16 then pressurev1v2
if b1 = 17 then vacv1v2

      if b1 = 116 then g1000
if b1 = 117 then g1000
if b1 = 52 then act13
if b1 = 51 then act13
if b1 = 18 then seq1  'arm down
      if b1 = 19 then seq1rev 'reverse arm down
      if b1 = 21 then powervac5
     
goto loop1

act8:
high 1
high 5
pause 20
low 1
low 5
goto loop1

act9:
high 2
high 5
pause 20
low 2
low 5
goto loop1

act10:
high 3
high 5
pause 20
low 3
low 5
goto loop1

act11:  'v11 intake
high 7
goto loop1

act12:
high 6
high 5
pause 20
low 6
low 5
goto loop1

act13:
high 5
pause 20
low 5
goto loop1

act14:   'stop
high 4
pause 5000
low 4
goto loop1

powervac5:   'power vac 5 sec
low 7     'up arm    intake off
high 6
pause 5000
high 7
low 6
goto loop1

pressurev1v2:     'ch+
high 5     'arm down
pause 3160

high 1     'v8
pause 1200
low 1
pause 200
'goto loop1

high 2    'close gripper
pause 1000
low 2
high 3     'grip
pause 600
low 3
low 5
low 7     'up arm    intake off
high 6    'vac in
high 1  'v8
pause 20
low 1
pause 2200    '2800
high 7
low 6
low 1
         'arm left
low 7     'intake off
high 6    'vac in
high 1  'v8
pause 1200
high 7
low 6
low 1
       'arm down
high 5  'press
pause 800
low 5
goto loop1

vacv1v2:    'ch-
low 7     'intake off
high 6    'vac in

high 2   'open gripper
pause 1500
high 3   'grip
pause 1500
high 1  'v8
pause 3520

pause 3000
low 6
high 7
low 1

high 4   'release vac inline
high 2
high 3
high 1
pause 2000
low 4
low 2
low 3
low 1
pause 1000
goto loop1

g1000:
low 7
high 6
pause 2000
high 7
low 6
goto loop1

seq1:
high 5
high 2    'close gripper
pause 1500
low 2
high 3     'grip
pause 600
low 3
low 5
goto loop1

seq1rev:
          'open gripper
low 7     'intake off
high 6    'vac in

high 2   'open gripper
pause 1500
high 3   'grip
pause 1500
low 2
low 3
high 7
low 6
goto loop1

 

 

Step 9: Other Possibilities

Circuits That Fit Curved Surfaces
The step 8 pic shows how 24 gauge wires can be used to join Tinkertrons so that they can fill odd volumes or curved surfaces.

Making Smaller Neurons
Much smaller neurons can be created using surface mount technology. I built these in a larger size to make them faster and easier to make. I can also more easily redesign the circuits as I experiment with them.

Leave a Reply