Predictions of Memory

A chronolog of my attempts to climb back into the ivory tower after years spent afield.

Thursday, October 04, 2007

URBI is now working!

[3263661:start] *** **********************************************************
[3263661:start] *** URBI Language specif 1.0 - Copyright 2006-2007 Gostai SAS
[3263661:start] *** URBI Kernel version 1.0 rev.1049
[3263661:start] ***
[3263661:start] *** URBI Engine for Aibo ERS2xx/ERS7 Robots version 1.0 rev. 240
[3263661:start] *** (C) 2005-2006 Gostai SAS
[3263661:start] ***
[3263661:start] *** URBI comes with ABSOLUTELY NO WARRANTY;
[3263661:start] *** This software can be used under certain conditions;
[3263661:start] *** see LICENSE file for details.
[3263661:start] ***
[3263661:start] *** See http://www.urbiforge.com for news and updates.
[3263661:start] *** **********************************************************
[3263661:ident] *** ID: U594360000
[3263788:power] *** Battery at 62 %
cpuload();
[3269224:notag] 0.045281
headPan = 30 time:3000,
headPan = 0 speed:1.4,
headPan,
[01710837:notag] 22.450094


It turns out my AIBO needed a firmware update. Once that was done, all the problems resolved themselves. The above text from a telnet session doesn't look like much, but it represents a connection, CPU load check, and turning of the head in a protocol that allows for realtime communication using java and c++ libraries.

The first step is to write a wrapper class which checks all the motor commands sent to the libraries and caps their speed, and a (probably separate) monitor to make sure that significant force isn't being exerted without motion occurring - because unlike muscles an AIBO's joints won't repair themselves after stress begins to wear them down, and I've found reports that it's possible to tell its joints to move so quickly that they break themselves.

Once these are in place I should be able to start playing with simple neural networks without having to worry about the output accidentally damaging the AIBO. I'm thinking of modifying a self organizing map which was designed to learn the pole-balancing problem (basically given input of the angle of a simulated pole or broomstick resting unstably on a "hand" surface, they learn which forces to apply in order to keep it balanced and not let it fall over) to try and keep the AIBO standing up. It's probably not very accurate with regard to how real animals manage it, but it'll be an interesting first step with somewhat similar output to an animal standing in one place (minor shifts and adjustments occurring, rather than locking everything in position), and once I have something like that going I can add some things like the simple knee jerk (patellar) reflex, which is astonishingly simple to model, being a bifurcating arc that excites a muscle and splits off to inhibit the appropriate antagonistic muscle when it is stretched, causing them to contract and providing a slight counterbalancing force to most motions - a natural damping factor which helps pull you back into place when you start to sway in one direction or another while standing around. This is also why your knee jerks when hit with a doctor's mallet - as I understand it the tendon at your kneecap is pushed back, which stretches the quadriceps slightly and particularly stretches the tendon, where the golgi tendon organs seem to effectively measure "strech". Inferring that the muscle has moved more than it actually has, this reflex arc kicks in and stimulates them to contract, which makes your leg jump forward, since all of the force which had stretched the muscles and tendons is now gone, so the reflex acts relatively unopposed. (Until the same reflex kicks in for the antagonistic muscles, which have now been stretched by the kick)

Since the AIBO doesn't have muscles, but instead direct sensors which provide position data and calculated force (torque) data on each of its joints, my first thought is to translate these into the same sort of measurements that animal nerves have on muscle contraction and stretching due to the intrafusal fibers of the muscle spindles and and golgi tendon organs, respectively. A relative change in position can be calculated from the absolute, which can be transformed to an equivalent "muscle stretch/compression", and the amount of force being applied could be transformed into a measure of how much tension is being generated on the tendons, or visa-versa.

I'm tempted to start off with the simple model of a neuron proposed in Izhikevich's "Neural excitability, spiking, and bursting", from the International Journal of Bifurcation and Chaos, 10:1171-1266. The easiest form of this model (for modeling purposes) seems to be the one put forward by him in 2003, in "Simple Model of Spiking Neurons", from IEEE Transactions on Neural Networks, 14:1569-1070. This model is a true spiking model, and depending on the parameters can be either an integrator or a resonator. Parameter adjustments have demonstrated that it can closely mimic the dynamics of a huge variety of neurons (everything from chattering spiny stellate cells in a cortex to mesencephalic V neurons in the brainstem or the neurons of the reticular thalamic nucleus). I like the consistency that comes in being able to model diverse aspects of the central nervous system by changing parameters, rather than by changing the underlying model.

For all that adaptability, it's a fairly elegant model as well. Modeling the change in a membrane potential v and a recovery variable u, in terms of four dimensionless parameters it runs as follows:

dv = I + v^2 - u
du = a(bv - u)

if v >= 1 then v <- c, u <- u + d

(The <- sign is an arrow, indicating that the left hand term will be set to the right hand term at the next time interval, a sort of state jump)

I haven't yet tried to implement a self-organizing map with this model as the basic building block, but hopefully over this weekend I can take a crack at it. I may also need to find some data on the firing patterns of the nerves which make up the loop of the patellar reflex, so I can make sure the parameters are right. I'll update and let you know how it goes!

Labels: , , , ,

Monday, October 01, 2007

More updates

The past two months have been busy ones.

Linear Algebra went swimmingly. I love the mathematics of abstraction, and have started looking into nonlinear systems analysis and modern algebra. My professor also expressed interested in working with me later on once I've picked up more math, which is very exciting. More than anything it was wonderful to be in a room full of devoted, intelligent people who were really interested in and curious about the subject matter at hand.

Encouraged by my first class, I am now enrolled in a Human Neuroanatomy course at the FAES school at NIH. FAES may be my greatest discovery of the autumn. It apparently began as a program to conduct training for NIH employees, but it's now open to the public. It's fully accredited, cheaper than community college at just over $100 a credit, and offers amazing courses in the evenings and outside of normal work hours. Plus it's NIH, so you're being taught by some seriously knowledgeable folks, and your classmates are more often than not employed in the labs there doing cutting-edge research.

The class itself is a bit more wetware-oriented than I eventually want to focus, and it's taught from a more clinical than engineering perspective (I think I'm the only non-NIH person in the class). I'm still learning an amazing amount, though, and I'm hoping I'll end up with the right kind of baseline understanding of the jargon and quirks unique to this field that I'll be able to take in more advanced papers. Plus, in a surprise that unnerves me slightly, but mostly impresses the hell out of me, our professor announced that he had gotten permission to use some of the extra human brains for a lab section. I haven't done an exhaustive study or anything, but I'd imagine that the list of institutions that just have extra human brains laying around has got to be pretty short. I'm very lucky NIH is so close by.

In other news, my AIBO is now talking to my PS3 which is running yellow dog linux, and has RapidMind (http://www.rapidmind.net/) installed, and I'm wrestling with the URBI (http://www.urbiforge.com/) interface for remote control. It seems more bare-bones than tekkotsu, and has libraries for java so I can do some quicker prototyping before scaling things up in C/C++. There are some issue's I'm running into with the different versions of Open-R - 1.1.2 will run fine, but 1.1.5 r4 (in which URBI is written) doesn't seem to boot on my ERS-210. While those are being hashed out through trial, error, and forum posts I'm sketching out circuits to take care of simple motor reflexes and things like that. They should provide a good starting point for me to move up the "spinal cord" towards higher cortical functions.

Finally, I'm going to have to put some of this aside to finalize my applications and get them set out. They start coming due this month, so I need to get my personal statement into shape (something I generally hate doing), and wrangle my recommendations into a semblance of order.