Tuesday, April 14, 2015

FRICKIN' LASER BEAMS

Goal:
To measure the diameter (colloquially, "micron count") of various fibers.

Setup:
A laser will be placed at one end of the room, aimed at the opposite wall. When a fiber is placed directly in the path of the laser beam, it will block the center of the beam, causing two light waves (separated by the width of the fiber) to interfere with each other. In other words, it will be a 1-element diffraction grating. The distance between the beats (bright spots) in the interference pattern can be used to calculate the diameter of the fiber using the equation:

d is the diameter of the fiber, m is the beat number, λ is the wavelength of the light, θ is the angle between beats, and sin is what makes life fun.
Source: en.wikipedia.org/wiki/Diffraction_grating

Experiment Log:

12:57 AM: I have disassembled a cat-toy laser pointer. In its default state, it requires the button to be held down, but I want something I can switch on/off and then leave on/off. Aluminum foil and tape seems like a good solution.

1:00 AM: I'm an idiot. "Just set a heavy object on the button, ya screwball," says my hindsight. Well, if I'd thought of that before I took it apart...

1:03 AM: Better yet, I can put a binder clip on the now-disassembled button to hold it down. Perfect! Guess taking it apart wasn't such a bad idea after all!

1:16 AM: After taping several types of fiber (angora, icelandic, and a hair from my own head) to a slice of a paper towel tube to hold them in front of the laser beam, it becomes clear that this isn't very accurate. There's probably some imperfections in the lens, or dust or something, because with no fiber, there's an interference pattern showing up. Adding a fiber does add an interference spread, but it's either not sharp enough to measure the beats, or they're so close together that they blend into a solid line.

1:26 AM: Oh damn, I had it backwards - the beats aren't too close together to measure, they're really far apart! I'd been looking at one beat and thinking it was a bunch blurred together, but there were others much, much further out! Awesome! Too bad I already rearranged furniture to get the maximum possible range.

1:33 AM: Initial data: Hair from my head has an inter-beat distance of 17 cm.

1:41 AM: Tried to take a picture of what's going on, but my camera apparently can't handle really dark scenes, because all that showed up was a red dot.

1:50 AM: Put the icelandic back in, but couldn't get a reading. It's a significantly finer fiber than the hair from my head (as is every other fiber in my stash), so the beats would be further than 17 cm apart, but I can't see anything within a meter of the red dot. Anything further away than that would probably be too faint to see anyway, so either I need to let my eyes adjust to the dark (meaning no typing this on the bright computer screen), or I need a more powerful laser (which I don't have).

2:01 AM: After giving my eyes ~5 minutes to adjust to the dark, I think I saw an inter-beat distance of 23 cm, but it was really faint and probably quite error-prone.

2:08 AM: Just realized that the laser beam is wide enough to hit both sides of the eye of a needle - it makes nifty patterns with the two sets of beats interfering with each other! Lasers are fun.

2:11 AM: Thicker things like pins make really obvious dense beats. I wonder if I could set up two perpendicular to each other to get a 2D grid?

2:16 AM: I can! It gets dim really quickly along the diagonals though. What kind of chaos would a thin blob of roving cause?

2:21 AM: Blah, it's just random speckles, nothing fancy.

2:25 AM: I pointed the laser at a bunch of glass objects and it basically bent it like a lens. Duh, that should have been obvious.

2:28 AM: Y'know what's really fun? Sweeping it back and forth really fast, so that it looks like the trail of where the laser's been pointing, instead of just a dot. The trail forms the shape of whatever it passes over. It's like I'm a robot scanning the shape of the environment to avoid obstacles.

2:30 AM: LASER ALL THE THINGS

2:32 AM: I CAN LASER THINGS THROUGH THE MIRROR

2:36 AM: my toothbrush bristles are too densely packed to be a diffraction grating... good night

Conclusion:
(written the next morning)

While measuring fiber micron from diffraction patterns is certainly possible, it probably requires more than a cat toy and a misguided attempt at doing Science Things. Also, it's more fun to just stay up late and play with lasers.

Wednesday, March 25, 2015

The Small Triambic Icosahedron, or Why My Friends Suck

Math is cool. Geometry is even cooler, because it's math that you can see and touch and make off-color jokes about. Wait, scratch that last one. That's terrible. Why would I say that.

Back to geometry though. I had accidentally discovered how to knit a tetrahedron (sans base), and wanted to make something out of a bunch of them. The first thing that came to mind was a big spiky ball, or as Wikipedia calls it, a small triambic icosahedron. I dove right in. How about several colors, so that no tetrahedron is next to another one of the same color? How many colors would I need? More importantly, how many colors would I need to make it look good?


Well, how many?

Mathematically speaking, it takes a minimum of three colors:
1d20+4 to check for traps
The green triangle can't be red or blue.


But it's ugly. There are twenty tetrahedra; three doesn't divide evenly into it, so I'd have unequal numbers of each color.

Four colors, maybe? That divides evenly into twenty, right? Well yes, but it's still ugly:
Dang, I rolled a natural 1
There are too many blue triangles.
 
At a cluster of five tetrahedra, having only four colors means that one of them will occur twice, asymmetrically.

By that criterion, I'd need five colors to do it right. But is it possible to have no two adjacent tetrahedra, and ensure that every cluster-of-five has one of every color?


Well, is it?

Yes, it is! I came up with a five-color solution that not only fits the rules mentioned above, but has some additional nifty properties as well:
I don't think this thing will ever serve a useful purpose
  • No tetrahedron has two neighbors of the same color
  • The four tetrahedra of each color are spaced as far apart from each other as possible
  • The set of a tetrahedron, its three neighbors, and the tetrahedron exactly on the opposite side from it, contains all five colors
What's especially cool is that I wasn't trying to get those extra properties, they just happened. Mathemagically. I was super psyched to show my knitting friends all these emergent mathematical properties that I didn't even realize existed until after I'd finished the project!


Well then.

They think it looks like a ball of nipples. The first thing they said about it was, "It's a nipple ball!" Nothing I say or do can convince them otherwise. My desperate appeals to the mathematical beauty of symmetry groups and set theory fall on deaf ears. But the worst part?

The worst part is when I realize they're right.

It looks like nipples. It looks like fuzzy, colorful, triangular, shiny metallic nipples. It looks like there was an error on the assembly line that made robotic stripper outfits. What was once a triumph of the elegant beauty of pure mathematical form is now a boob joke. And nothing can ever change that.

Jerks.

Tuesday, March 24, 2015

QR Code Knitting: Becoming the printer I never realized I wanted to be

I love data formats. Always have. I was the kid who, at 12, reverse-engineered the conversation files in a computer game and turned an early-game character's dialog into my own choose-your-own-adventure game. I was the one who happily got a barcode scanner for Christmas, and figured out how to hide barcodes in hand-lettered calligraphy. Many an hour have I spent with a hex editor and the gif89a spec. Knitting a QR code was pretty much the next logical step.

Or was it?

You see, my cell phone was made in 1764. Instead of text messages, it sends telegrams in morse code. Its camera has a seeing-eye dog that is also blind. A full battery lasts 6 minutes, 29 seconds. No way is it gonna know what to do with a QR code. It would be completely useless to me. (Have fun figuring out whether I'm referring to the QR code or the phone.) But I didn't care - my mind was made up. I had to do it.


Gauge and Resolution

You know how a swatch 20 stitches wide by 20 rows long isn't square? That's a problem. You know how a knit stitch doesn't have crisp, straight edges? I'm starting to worry... You know how with fair-isle colorwork, patterns actually look like something, so you can easily tell if you've messed up? Gulp.

The first problem I tackled was gauge, testing this yarn on different needle sizes. As I went to progressively smaller and smaller needles, my gauge got closer and closer to square. It's a DK weight, so by the time I got to size 1s, I decided I could block out any remaining rectangularity. (Spoiler alert: it worked!)

Next, I decided to make each pixel in four stitches, a 2x2 square. This has quite a few advantages. Firstly, it gives them well-defined edges. The pixels actually look like little squares, instead of some amorphous blob. Secondly, it makes the purl rows mindlessly easy. I knit across following the chart, but on the way back, I literally just copy. If a stitch is white, I purl in white. If it's black, I purl in black. Ah, sweet, sweet laziness. Thirdly, it makes every continuous run of a color an even number of stitches long. Does that even matter? Yes, yes it does, and here's why:


Float Wrangling

I.
Hate.
Floats.

If they're too long, they become ugly, floppy little gauge-wreckers. If they're too short, the fabric has puckers and lumps and just generally looks like the surface of a giant fuzzy raisin. Even when they're exactly the right length, they take every chance they get to snag on things. Floats can go crawl in a hole and die.

"But," you ask, "What does this have to do with even numbers of stitches?"

As it turns out, everything. You see, knowing that floats are Evil Death Squiggles, I keep them under lock and key, far away from proper, well-mannered folk. With each stitch, I bring the working color around to the other side of the floating color. This traps the float against the forming fabric, both ensuring correct length and preventing it from rampaging through the countryside. However, it also changes the order I'm holding the yarns in. Having an even number of stitches means that after every pixel, the yarns are back in the same order they started!


Actually Knitting the Damn Thing

This was a really enjoyable knit, though not in the usual way. Sure, it was a small project, and who doesn't love instant gratification, but that's not it. Okay, so it was in a yarn I really like, but I barely noticed that aspect. Maybe the geeky theme was its big appeal? Wrong again.

What I really liked (and this is going to sound insane) was that knitting it made me feel like a printer. As in, the machine you hook up to your computer when you want to curse at a tiny screen that says "toner low". When I was knitting this, I was following a chart, a chart that had no meaning to me, a chart that made no sense but that I knew was right. It was immersive. I got into a rhythm, lost track of time, and before I knew it, I was binding off. And it felt perfect... almost.


The True Meaning of Fear

Would it work? The question made me cringe. I tried not to think about it, partly because I couldn't test it myself, and partly because everything had been going so well throughout the entire project. Every problem I had encountered, I solved with the sort of mathematical elegance I always strive for. The pieces of the puzzle had fallen into place like clockwork that fit like a glove. To have it fail to scan would be almost as tragic as that sentence.

I brought it with me to work the next day, knowing that one of my colleagues had a phone that could scan it. Without realizing how absurd it sounded, I asked him if he would please test the QR code I'd knitted.

"You knitted... a QR code? ...That's all kinds of awesome."

So are you, Really Chill Coworker. So are you.

And yes, it successfully scanned!

The top and bottom edges try really hard to curl in. I pinned them down to take this picture, then photoshopped out the pins.
I'm not sure how the little bit of black got onto the border. (Left edge, near the bottom)