Work related posts have been moved.

9 November, 2010

My work and computing related posts are now at

If you have come here from a work-related perspective (computing, semweb, bioinformatics, math). Perhaps you could go there right now and not read the gory personal stuff here.

Use the wordpress rss mechanism to follow categories:

Follow Paul Murray on Quora


Machine

23 March, 2015

The Device is complete.

Oh, there are issues. Most particularly, I damaged a part with excessive heat, but the part that was damaged was part of my hand-held controller – for the particular function needed, I am content to use the probe mounted onto the brain itself.

There is no special reason to suppose the device will fail to perform its function. I fully expect that I shall be shielded from the annoying light from the streetlamp outside all night, and that at dawn my new domestic servant shall open the blinds for me.

(PS: Mad! Mad! They called me mad! I’ll show them who’s mad, the brutes, the ignorant philistines – what do they know of science etc etc. Grandfather Freemont might have dared the Bravarian torches and pitchforks – I am a little more circumspect.)


Machine

21 March, 2015

Progress. I have successfully moved the interface onto its own board, which shortens the lines needed to attach the interface to the motor.

I have also found sources of Coulombic fluid separate for the mind and the matter – 6v and 9v respectively. The 9v supply, I suspect, will not suffice to operate the device when it is attached to its load: if has force, but not capacity.

Best of all, I found a purveyor of parts for model flying machines, who had a part that would fit the 3mm shaft of my motor. Now I shall be able to attach it to its load without difficulty.

I enclose a moving photolithograph (the wonders of technology!) of the device thus far in operation.

— ADDENDUM —

I have rebuilt the gearing. The result is simpler and more compact, which is usually the way. Just now I tested the device against the load it is intended to move. The coulombic nine-volt source is not sufficent for the task. Using my bulkier source, it moved the load handsomely, and above all reasonably quietly.

I shall restore to the brain its previous intelligence. Then I shall investigate adding its eye. Finally, I shall need to think carefully with respect to the logic behind its mind, and perhaps organise a somehat more robust control device. At present, it is controlled by switches mounted into its skull. They are tiny and prone to come loose – something a shade more robust would serve better.

Exciting times, although I must give some few hours to another task needing to be done.


Machine

18 March, 2015

As I mentioned previously, the subtle currents of the mind cannot animate the gross matter of the body directly: an intermediary is needed. The mind – physically – exists as a gas, or perhaps smoke confined within the brain. The currents of thought are breezes blowing though the brain, moderated and manipulated by its – shall we say – shape. And as the subtle currents of the mind cannot animate the gross motions of the body, should the situation be reversed, the brain will be overwhelmed and the mind will escape it, leaving a mere husk, an empty shell.

While not obvious to the eye, nevertheless this catastrophe may be detected by the nose, as the smoke that is the substance of mind has a characteristic odour.

Which brings me to my latest experiments.

I had grown impatient with the device to move the limbs – it was noisy, it shook and howled. The motive power for it required far too much Coulombic Fluid. Although I have a source of such, it is bulky and I did not want to use it for the final installation. The motive heart spun at a furious rate, requiring mechanical reducing, and lacked a way to delicately control it. I attempted to grant my machine a kinesthetic sense, but the shaking of the whole device rendered these organs worthless: they could not distinguish between the motion of the shaft and the overall vibration.

I was aware, of course, of a different kind of motive power – a “stepper” which, rather than merely spinning, could be made to advance forwards in fine steps (one forty-eighth of a revolution, in fact). I had avoided these, as the other motors (‘motor': that which provides motive power) were far simpler. Additionally, these “steeper motors” required a mind/body barrier.

But I had needed a barrier anyway when working with the simpler motor, so it was much of a muchness. And although the stepper is more complex, the mathematics of it were by no means beyond me. It was the correct tool for the task at hand, and I simply felt up to the challenge. And so, once more to the graveyard, coin in hand, for the purchase of a stepper motor and a darlington array chip.

First, the mind! I made use of a certain well-known library for such problems, the one that the italian gentlemen who manufacture my mechanical brain supply. I desired to see what manipulations it would attempt to perform on the motor, and so I attached to the brain certain devices (light-emitting diodes, or LEDs) that glow in the presence of motion in the electrical fluid, and which are sensitive enough to do so in response to the subtle currents of the mind.

Observing the behaviour of the brain, and consulting with the excellent information with which the motor came supplied, I determined how to instruct the mind to operate the motor.

At which point it came time to attempt to use the mind/body mechanism, the “darlington array”. I reasoned that to start with, rather than using the powerful currents that animate the body, I could use the potential of the brain – five voltaic units – as its output, as I merely wanted to see that the damn thing worked at all. I moved the taps that were connected to the LEDs to the array, and put the LEDs on the output of the array.

And all was as it should be! When I directed the mind to move its limb, the LEDs illuminated in correct sequence.

Now it is usual, when LEDs are used, to equip them with a prophylactic whose function is to resist an excess flow of Coulombic Fluid. Such a prophylactic reduces the brightness of the LEDs, but not by a great amount. However, I had disdained this, principally because it is rather fiddly to install the devices – my eyes and fingers are not so precise as they once were. As the darlington array was connected to a mere five volts, this was not an issue.

But the whole point of the array is that it can manage a far greater voltage. That it whole point of it. And so I connected the array to the full unmoderated nine volts of input potential. Within seconds, the LEDs flickered and went dark, and I smelled the smoke. Something had died.

But as you have gathered, I had merely fried the LEDs. One of them still worked, although barely, and was illuminating and darkening in the correct sequence, and so I saw immediately that the brain was uninjured. On the whole, a cheap and instructive lesson.

After this, I connected the motor to the mind via the array (the motor must not be connected directly to the mind under any circumstances due to the phenomenon of back-EMF), and the brain controlled it quite handsomely. I commanded it to spin the motor forward and back by one revolution pausing for one second in between, and the motor accurately turned by a revolution and returned precisely to its starting point. Formidable!

And so matters stand. I believe the motor is quite a bit stronger than the previous ones, which rely on rotational speed. Thus, I shall be able to remove quite a bit of the gearing from The Machine. I suspect I could connect the motor directly to its destined load, but I have been to quite a bit of trouble to source the “Meccano” and damn it – I intend to use it irrespective of whether it is actually necessary.

Further developments anon.


Machine

13 March, 2015

I have a moment to work on the machine, as the steam pipes that supply my place of employment with power have temporarily been interrupted.

I have succeeded in ordering the brain to move the arm back and forth. My machine moves more smoothly in one direction than in the other – it seems that it is destined to be an awkward, misshapen thing. But it shall serve my purpose, or be destroyed.

Now I must consider the details of what thoughts this brain is to think. I wish to be able to move the arm back and forth on command, and to have the brain move the arm itself when the event occurs.

Of particular importance is that the arm must not move too far, lest it damage the device it is attached to. I believe I need to equip it with the following:

  • An arming switch. When the device is armed, then at the event it will move the arm to its extremity.
  • A pair of buttons, for moving the arm forth and back. Perhaps I may be able to have the brain recognise a press-and-hold to differ from a swift double press.
  • A way to inform the device that the current position of the arm is an extremity that it must not move beyond. Perhaps the pair of buttons may serve this purpose: a switch shall indicate that the pair of buttons is to be treated as an order to move the arm; or that they are to be treated as a setting of the arm’s limits.
  • If the buttons can distinguish between a press-and-hold and a double-press, then a press of both buttons will suffice to indicate where the arm is to be moved to at the occurrence of the event.

In order to make any of this occur, I must first equip the machine with a kinesthetic sense – some way to know where the arm is. I shall resort to a lodestone and magnetic switch located on the middle shaft. The brain shall be prodded as the switch activates in the presence of the lodestone. (Will it interpret this prodding as “pain”? Perhaps. Its suffering is unimportant to me, or to science.)

But how will it know whether the count is to be increased or decreased? There are two ways. Two magnetic switches may be used, slightly offset. But a simpler method is for the counter neurons to be aware of the motor neurons.

So. Two switches, two buttons, and the magnetic switch. And perhaps a temporary switch whose task it is to simulate the occurence of the event to which the creat- the machine shall respond.

volatile byte increment = 0;
volatile int position = 0;

int positionA = 0;
int positionB = 0;
int sunrisePosition = 0;

void reed_switch_interrupt() {
  position += increment;
}

void start_up() {
  increment = 1;
  // start the motor
}

void start_down() {
  increment = -1;
  // start the motor
}

void stop() {
  // stop the motor
  increment = 0;
}

void motorTo(int moveTo) {
  long stop_time = now() + 10000; // 10 sec

  if(moveTo > position) {
     start_up();
     while(now()<stop_time && position<moveTo) {
       sleep(100);
     }
  }
  else if(moveTo < position) {
     start_down();
     while(now()moveTo) {
       sleep(100);
     }
  }

  stop();
}

loop() {
  if(need_to_handle_sunrise()) {
    handle_sunrise();
  }
  if(either_button_pressed()) {
    handle_button_press();
  }
  sleep(250);
}

handle_sunrise() {
  moveTo(sunrisePosition);
}

handle_button_press() {
  // ok. watch A||B. if it goes low during the .5 seconds, note the fact
  // after the .5 seconds is done, look at the state of the buttons.
  // this means that a double click is a click then a click-hold

  sleep(25); // debounce

  boolean doubleClick = false;

  long tt = now() + 500;

  while(now() < tt) {
    doubleClick = doubleClick || !either_button_pressed();
  }

  if(!either_button_pressed()) return; // meh.

  if(set_switch_setting()) {
    if(both_buttons_pressed()) {
      sunrise_position = position;
    }
    else if(button_a_pressed()) {
      positionA = position
    }
    else if(button_b_pressed()) {
      positionB = position
    }
  }
  else {
    if(both_buttons_pressed()) {
      motorTo(sunrisePosition);
    }
    else if(button_a_pressed()) {
      if(double_click) {
        motorTo(positionA);
      }
      else {
        start_up();
        while(button_a_pressed()) sleep(10); // maybe put a timer in here, too
        stop();
        positionA = position;
      }
    }
    else if(button_b_pressed()) {
      if(double_click) {
        motorTo(positionB);
      }
      else {
        start_down();
        while(button_b_pressed()) sleep(10); // maybe put a timer in here, too
        stop();
        positionB = position;
      }
    }
  }
}


Machine

11 March, 2015

I have purchased parts for the Device (Curse it! Why must I part with good money for this! Is it not the 19th century? When, oh when will they install turnstiles on the cemeteries?)

Nevertheless, it has been worth the expense. Now, the heart drives the limbs without difficulty, even with as little as one and one-half voltaic units of electrical Fluid. The final arm turns with enough force that I must give some thought to the possibility that the Device may injure the fitment it is destined to drive. My landlord has been a reasonable soul, and I do not wish to annoy him.

Next, I shall attempt to connect the brain to the body. A difficult matter, as the currents of the mind cannot directly excite the gross matter of the body. I have, again, been to some expense to purchase an H-Bridge. Its principles are simple enough, and although I desired to build such an assembly from more basic components (the better to understand them), the cemetery had been picked clean of the necessary.

If I can succeed in commanding the brain to move the limb forward and back, then I shall have made good progress.

The headaches continue unabated, but I grow accustomed to them. The spots in my vision are no more than a nuisance.


Machine

10 March, 2015

Work on The Device proceeds slowly, in fits and starts. I begin to connect together its limbs and sinews out of scraps of brass and other materials. Its heart I also have, but fear that it may not be sufficient for the task.

I must give it nerves, or rather: one nerve, and one eye. Then, God forgive me, I shall give it a brain.

My lodgings have acquired an odd odour – not entirely unpleasant, and I see movement in the corner of my eye.


Out with the old, in with the new!

5 March, 2015

I am so fickle.

Still painting this Dwarven Forge terrain, but I have been inspired by the Make, Hack, Void Arduino workshop. I intend, finally, to deal with the vexing question of my bedroom window blinds.

I’ll program up the Arduino to open them once it gets light – or maybe just on a timer.

Now, in order to do this I need to hook a motor onto the twisty rod thingo. Obviously, there are several options, and all of them involve cobbling together some sort of actual real-world mechanical device.

So I just got on Gumtree and bought a dusty, rusty, but mercifully spider-free old metal toolbox half-full of mechano.

Remember that stuff? God, what a time-warp. None of your flimsy bits of plastic here, or moulded pieces good for making one and only one model – No sir! I’m talking gears, pulleys, shafts, plates, straps, and tiny goddamn annoying actual nuts and bolts. It’s like going back to the days when boys were boys and men were racist and measured their penises in inches, the way God intended. Back to the days when your could buy your kid a chemistry set with shit in it that definitely could kill him. (Leave him alone, Ethyl: he’s got to learn).

Most importantly of all, I have a worm and gear. The Ardunino comes with a tiny 5V servo motor, which is great, but it’s not likely to want to drive the twisty blind thingo. A gear train that reduces by, well, a lot is just the ticket. And this lump of mechanno, although plastic, has a robust feel to it.

Between painting the Dwarven Forge, fooling with Arduino and Mechanno, playing Eyes of the Ten for three days straight this long weekend and blogging, God – I don’t know how I find time for it all.

Shout out to all the married guys going furniture shopping this weekend.


Follow

Get every new post delivered to your Inbox.

Join 48 other followers