30 April 2009

H1N1 theory of operation

This is a translation wikipedia sources on flu mechanisms. My attempt at being a science writer.


The virus is covered with sticky parts ("HA") which recognize certain sugars that your cells have on their outside surface. (Pigs etc have them too.) When the sticky parts recognize the sugar they change shape and harpoon your cell. This causes your cell to form a cavity around the virus because the virus is sticking to the cell membrane. Think tennis ball rolling on a sheet of velcro.

Some extra machinery the virus carried with it (M2) causes the virus jacket to fragment once insde. Then the virus's now-bared RNA codes are moved into the cell's nucleus by the cell.

In the nucleus the RNA are copied, and some are sent out of the nucleus to be turned into proteins. Some of the proteins go back to the nucleus, pick up the viral RNA and package it. The packages head out again, this time attracted by additional machinery (NEP etc) to a spot on the inside of the cell's membrane where other proteins are waiting. They all get assembled into a ready virus, and one final viral machine, "NA", cuts the sugars that might be holding the new virus (studded with HA after all) back.

Pretty clever, how it brings all those tools for each step, and of course how it exploits cellular machinery to move around the cell. Yet reassembles. And how it keeps its harpoon sheathed until it tastes that sugar that means prey.

A finely tuned mission-impossible subversion of an enemy factory. Conducted by nano drones.




Note that flu drugs work by interfering with NA.

Note that the flu A genetic code is RNA which is more succeptible to copying errors than DNA. Faster evolution.

Kids toys

For some time now, sound cards have been standard on PCs and the CPU has been quite capable of realtime audio processing. As a result, there are several free oscilloscope and spectral analyzer programs out there. Scopes used to be hundreds of dollars and spectral analyzers were very specialized large pieces of dedicated equiptment.

In fact, there are chips like the AD5933 which perform spectral analysis (analog network analyzer functions) in hardware, out to hundreds of kilohertz. But for kids eg learning about music, sound physics, or electronics, its amazing that they have this opportunity.

Software Safety Mechanisms

* Watchdogs
* Timeouts on dangerous states
* Stack overflow checks
* Firmware CRC boot/background computation
* Persistant data (eg calib params in flash) CRCs
* Analog switch (resistance error band)
* Integration of measurements
* Reliable, error-detecting communications protocols
* Safe scripting control
* Crypto -authenticate, integrity check
* Handshaking (multistep) protocols enabling dangerous states

* Self calibrating measurements
* Error detection on measurements
* Alarm strategy

* Single point failure tolerance
* Elec. isolation
* No energized human-accessible pins (UL)

29 April 2009

Inductors

An inductor is something that wants to keep something flowing. A coil of wire with current flowing through it generates a magnetic field, and it opposes any change in the current. A paddlewheel in a stream has inertia, and opposes any change in the current.

If the current changes, an inductor produces a voltage. If the current changes, the water can build up or form a trough at the paddlewheel.




At my most recent project we used very low RF, below the AM band, and the inductors were sometimes huge doughnuts of ferrite. Literally the size of doughnuts. Since most digital (and modern analog) boards use very tiny capacitors and resistors, and generally only a few tiny inductors or transformers for power-conversion reasons, this was unusual to me.




If you drag a magnet through the sands of certain beaches around here, you can collect magnetic iron oxide, ie magnetite. It looks like you're pulling a black sea urchin from the sand! In bulk form this is lodestone. You can mix it with epoxy and cast your own inductor cores. Or you can grind it in a coffee grinder and mix with aluminum powder (3:1 Fe2O3 to Al) and make thermite. Or you can use it to "draw" on the beach, without polluting. And you can teach kids about mining and geology in questioning how the deposits got there and got separated.




So if a paddle wheel is an inductor, what is a transformer in this hydraulic analogy? It is a pair of paddlewheels, in different streams, connected by a belt or gears.

But this doesn't work that well as an analogy since a transformer only passes alternating current. A better physical analogy would couple the height of the water at the upstream side of the paddlewheel to drive another paddlewheel in another stream. Then only alternating flows in the first current would couple the two paddlewheels. Because a steady stream in the first paddlewheel would generate no buildup of water to drive the other wheel.

Here's a crude schematic:



Of course, in a real transformer, the coupling is via (changing) magnetic flux and Maxwell's laws of electrodynamics.




BTW this post assumes you're aware of the more obvious parts of the hydraulic model of electricity, with Ohm's law, balloons as capacitors, pumps as voltage sources, etc. If you don't know what I'm talking about this will be worse than confusing.




(Later)
There are problems with this model. The coupling between the paddle wheels needs to work only if there's change in the flow. Magnetic fields in the aether. Something involving ripples in a pool, generated by varying flow, which are picked up by another circuit, to drive flow in that. More complicated than a simple gear or belt transmission as illustrated.

Safety and Software

There are different degrees of badness. You can hurt 1 person, or hurt many people. In a medical device, you can typically only hurt 1 or 2 persons (patient and doctor) at a time. In an airplane or reactor, you can hurt many at once.

Medical devices handle single-point failures ---one thing can go wrong and the device is still safe. It may not work, but it has to fail safe. Of course, for some things and circumstances, not working (availability) can be hazardous.

To some extent there's an analogy between safe programming and legal contracts. You try to predict and handle and exceptions in an intentional way. You might have severability ---where other parts keep functioning if one part craps out--- and watchdog timers ---where functions must be executed in a certain time span. You need to define correct behavior from observables as much as possible.

This makes the game more interesting.

Running jokes at work

At the defibrillator maker, we joked that if the device didn't work, the patient was dead already...

and that if we shocked into the wrong (ie healthy) waveform, which could cause the heart to fibrillate, we could just shock again into the waveform we had just produced..




At the disk place we joked about users caring where their data went..




At the electronic design place we joked about just needing more capacitance, or a bigger inductor (the idea being that brute forcing a noise problem is simple).
And jest back and forth about whether something was a hardware or software problem. E.g., forgetting to plug something in was a hardware problem.




These may not be as amusing to you as they were to me at the time. YMMV.

How does matter think?

So how does someone who gets interested in human and machine vision (AI) end up working with hardware? I'm fascinated by, "How does matter think?" and this has led to studying neuroscience and electronic circuit design. How do (neural, electrical) circuits compute? What is computation? What is thought?