Austin, Texas

I spent four days in Austin, Texas, at NIWeek. On the plane down from Chicago I met some friendly Austin locals who made a (long!) list of things for me to do and see. With the conference taking up most time, and the hot weather, which made walking around town a warm experience, I only managed three things on the list: The Texas State Capitol, the Texas State Museum, and the Congress avenue bats (oh, and Amy's ice cream at the airport!).

The Texas State Capitol building is - as any Texan will quickly point out to you - slightly taller than the US Capitol in Washington DC.

Inside you are greeted by two of the fathers of Texas: Sam Houston and Stephen F Austin (above). The excellent free tour gives an insight into the history of Texas, a state which has been under Mexican, Spanish, and French rule, a republic of its own, and finally from 1845 a part of the USA.

The Lone Star of Texas inside the Capitol dome.

A machine used to punch holes in checks.

The senate meets in this room, recently restored to its original look. They're pretty effective at law-making, since they only meet for 140 days every two years.

Senators sit at these nice desks – over 100 years old. No electronic voting here...

The Texas State Museum does not allow photography, so no pics from there. They have three floors of exhibits with the varied and interesting history of Texas. They also had a temporary space exhibition with some big rocket engines on display in addition to text, pictures and videos from NASA missions.

Then on to the bats! They live under the Congress avenue bridge, and come out just after sunset. Above sunset over town lake as viewed from the bridge.

The bats attract a lot of tourists and on-lookers, both on the bridge and under it.

Some more people waiting for the bats to come out. The photo looks much brighter than it actually was (photo taken sometime around 20:45 I think).

I had never photographed flying bats before, so the results were varied. First I thought I would stand under the bridge and shoot the black bats against the dark-blue sky. Well without flash that didn't work at all. Even at F/1.8 aperture and ISO3200 the exposure time is much too long to stop movement. With good eyes and a bit of imagination you can maybe see some bats in the above picture.

It works much better with flash! Shutter speeds of 1/50 or 1/100 nicely stops motion, and focusing was the only problem. I shot everything using manual focus since auto-focus didn't work. I forgot the camera in ISO3200 mode and fixed aperture of F/1.8, which might not have been the ideal settings with flash...

Here's another one from under the bridge.

From the top of the bridge you get closer to the bats, but that also means that the manual focusing gets a lot more sensitive.

This is perhaps the best one of them all. I had a 4 Gb card in the camera and shot over 100 bat pictures, but a lot of them were de-focused, had motion blur or something else wrong with them. If someone has more experience with this type of photography, please do comment below!

These are all with the ‘plastic fantastic’ Canon EF 50/1.8 II, the only lens I travelled with since I wanted to save some weight. Excellent sharpness and coulor at times, but a bit long for some shots. My EF 17-40/F4L would have been more versatile, but also heavier and perhaps not as good for the night photos… Maybe I need a shorter prime-lens too?

NIWeek went well. NI showed some cool new products and technologies. I definitely now need a multi-core machine for the new LabVIEW 8.5 which supports multi-threading! It's really a company that wants to listen to its customers and actively improve products. Also, the paper I co-authored for the NIWeek Paper Contest got selected as one of nine Category Winners - so that was good.

Drop-Cutter in C# - v2

I think I've found the problems with my C# drop-cutter algorithm. The first bug was a trivial one where in the edge-test the rotation of the segment-under-test was messed up. The second one was not the facet-test itself but incorrect surface normal data. There's something going on that makes pre-calculated surface normal data not 'stick' correctly to the triangle object for later use. So here I'm re-calculating the normal data again just before the facet test.

The next step is to speed up things with a smarter kd-tree based search for which triangles are under the cutter. I've added bounding-boxes to the Cutter and Triangle classes. Running the above example the DropCutter function is called a total of 4735000 times, and of those only less than 5%, or 236539 to be exact, are useful calls, i.e. the triangle bounding box intersects the cutter bounding box, which means there's a chance that we are contacting the cutter against the triangle. The idea with the kd-tree then is to pre-search for triangles under the cutter to make less of those (supposedly expensive) redundant calls to DropCutter.

On my T5600 processor machine the above example runs in about 5 seconds. (1894 triangles, about 4.7 Million calls to DropCutter of which ca 240k calculate something). I've made a list of useful CAM-related things to work on: CAMToDo.

Dah-Lih EMC2 conversion

Stuart Stevenson wrote about his Dah-Lih EMC2 conversion on the emc-mailinglist, and has allowed me to publish these pictures of his mill. I've scaled the pictures to 1024 pixels wide - click the picture to see it in high-resolution.

Machine after conversion.

Machine before conversion. Pendant has original CRT and buttons.

Control electronics. Jon Elson's PPMC cards at the top.

Relays and transformers.

The new control. The computer is a Gateway Profile 3.

There is a MagicTouch touch screen mounted in front of the computer.

Back side of control. The computer is connected to the PPMC cards by the parallel port only. Jog-wheel and buttons are wired directly to PPMC. The network cable goes to a Linksys WET11 bridge mounted on the back panel.

On SNR in single molecule experiments

ResearchBlogging.org

Wallin, A.E., Salmi, A., Tuma, R. (2007). Step Length Measurement--Theory and Simulation for Tethered Bead Constant-Force Single Molecule Assay. Biophysical Journal, 93(3), 795-805. DOI: 10.1529/biophysj.106.097915

A lot of single molecule experiments are carried out in the configuration shown above. The idea is to mechanically probe a bio-molecule (such as DNA or RNA) or find out how an enzyme (such as RNAP) or a molecular motor (e.g. viral packaging motor) works. You either optically or magnetically trap a microsphere (the round thing with diameter d), which allows you to move it around, measure its position very accurately, and measure the forces acting on the sphere. The sphere is a big thing, usually 500 to 1000 nm in diameter, so it's easily visible in the microscope (the molecules themselves are not visible unless you label them with fluorescent tags).

Then you ask a biochemist in your lab to bind some useful stuff to the sphere. I've illustrated a hypothetical experiment where a molecular motor (MM, grey blob) is bound to the sample chamber wall, and the bead is tethered to the motor via a Worm-Like Chain (WLC, thick wavy line, a common model for polymers such as DNA/RNA).

The problem is that these things are tiny! People want to measure single steps for molecular motors, which can be as short as 0.3 nm. At the same time biological things also live at close to room temperature, so both the molecules and the microsphere are affected by random collisions from the solvent molecules.

Now the question is how small steps or changes in the WLC length are really measurable? It's a bit like going on a walk with your dog: imagine a very flexible string between the dog and yourself. Now if you pull only weakly on the string you can't expect to feel very much of the individual steps the dog takes, you just follow along smoothly while keeping the force approximately constant. If you really want to feel the individual steps you would use a stiffer string and pull much harder on it(but the dog would not like that...). Previous work such as that by Gittes and Schmidt and Moffitt et al. pretty much agrees that the Signal-to-Noise-Ratio (SNR) should look something like this:

where you've used a force to stretch out the WLC (of length L) to an extension xe, the steps you are trying to detect are of size DeltaL, and the stiffness of the WLC is K. In the square root we have gamma (Stokes drag coefficient on the bead), Boltzmann's constant kb, temperature T, and f_lp the measurement bandwidth.

What do we need to do to get a high SNR (and thus measure short steps accurately) ? Use a large force (that increases xe and K), use small beads (that decreases gamma), cool down the lab (decrease T, but not so much so that your biology dies!), and measure slow moving stuff (low f_lp). But this formula is not so practical to use. You need to work out the extension xe yourself and also estimate the stiffness K somehow. I couldn't find anyone who had addressed how this works for common tethers such as DNA and RNA.

My (small) contribution to these thoughts is mainly working out how the SNR really depends on the properties of the WLC and the pulling force. I did a bit of simple theoretical analysis and showed with a Monte-Carlo simulation that the theoretical prediction is about right. This results in SNR 'maps' in parameter space that hopefully can guide experiments. For example if you suspect that your enzyme has a certain step length and you know your tether properties you can use the map or an approximate formula to work out the force you need to have a chance of measuring individual steps.

Drop-Cutter in C#

I've now ported my Matlab work on Drop-Cutter to C#. It can load an ASCII STL file and then run the drop cutter algorithm. Not trying to take too much on in the beginning, here's an example of the output with only two triangles as input 🙂 not quite there yet! (who can spot what's wrong?)

I'll do some nicer demos when I've found the problem. The algorithm runs significantly faster in C# compared to Matlab - and this is without a kd-tree or bucket strategy for finding triangles under the cutter. I've also watched and read some tutorials on threading (threading wrt. to computers, not machining!). This is an algorithm that should scale well on modern multi-core processors (have a few worker-threads running drop-cutter on different regions of the model).

An STL Tux

Together with another Anders (from Sweden) I've worked a little bit on some C# code for rendering stuff in OpenGL. The idea is to put together a basic framework where CAD/CAM ideas and algorithms can be tested. Above one of the first useful screenshots where I've rendered an STL file with about 22k triangles.

The code needs to be cleaned up and made all object-oriented and nice, but after that it should not be hard to test the Drop-Cutter algorithm and generate some raster-finish paths.

I've also been reading a 2004 paper by Yau et al. which explains the drop-cutter algorithm for an APT tool. I'm not very interested in the tapered cutters - but that can be added later if needed. What's more interesting in the paper is a kd-tree approach for finding out which triangles are under the 'shadow' of the cutter.

The idea is that it's not necessary to test against all triangles, only those that are under the cutter. Since the circular cutter and the triangles are differently shaped, Yau et al. start by approximating both cutter and triangles with rectangles. So they generate rectangular bounding boxes around each triangle and also around the cutter. The task then is for a given position of the cutter to find which bounding-boxes(triangles) intersect it. I understand this is a variant of what's called an orthogonal range search in computer science.

If anyone with a good understanding of kd-trees and/or range-searching is willing to help with a C# implementation I'd be glad to send over the Yau et al. pdf!

FIN-43 finally sailing!

After fitting the sheeting-bridge for the mainsheet and drilling some holes in the booms for the sheet-hooks I was finally able to test sail the new IOM I have been building! It's going to be numbered FIN-43, but I haven't had time for details like sail-numbers or measurement bands yet. You might also notice that I'm missing the bow-bumper. The paint-job is 'Scharmer-style' for the moment...

The main worry with a new boat, besides obvious things like the rudder and sheeting systems working,  is usually water tightness. I observed something like half a table-spoon of water after maybe 20min of sailing in varying no1 rig breeze. The lid probably needs sealing, and a coat or two of paint should seal any microscopic pin-holes left in the hull laminate.

Balance on the beat was surprisingly good, only minor adjustments of the mast position should be necessary to find a good trim. Now I need to put in a lot of practice hours against other boats and in varying conditions to iron out any minor problems and find a good basic trim with all rigs. In addition to the national ranking series we still have two Scandinavian events that should provide some good sailing before the Marseille Worlds in October...

Drop cutter might work!

Here's the first indication that my drop cutter algorithms(vertex, facet, edge) might work! I'm dropping down a toroidal cutter C(0.5, 0.125) towards a model consisting of a half-sphere sitting on a plane. The CL points are in magenta with cyan lines between them. 382 triangles in total. The code has no optimizations, so at each x,y position we check against all triangles.

Here's another one with about 1800 triangles, and with the points more densely sampled in the Y-direction. (click for slightly higher resolution version)

These still pictures are not nearly as convincing as a moving animation - so I will have to do that next with a more complex model. Stay tuned...