Mountains

Mountains

Monday, October 31, 2011

Cotton Candy

The girly has this stuff on a stick:


I can tell you one thing: it's not cotton candy.





My Love/Hate Relationship with Video Games

Computer games are fun. They have evolved from intellectual curiosities and simple challenges, to demonstrations of technology, to incredibly complex challenges and works of art. They are incredibly gripping, more so than television. Their is an entire subculture devoted to the creation, curation, adoration, and analysis of them. You know things are deep when there are intricate discussions of the Starcraft II metagame, and the feminist themes contained within the Portal series.

Television feeds the part of you brain that wants easy amusement. Video games walk a different line, encouraging you to take little challanges, then rewarding you somehow with loot, victory screens, intrigueing text, and other things. You can work with other people in cohesive teams and achieve something. Video games can hit buttons in the Monkey that Hollywood will never be able to reach.

The problem I have is that in playing video games, you never actually achieve something. The obsession, time, and energy that is invested does not form much in terms of intellectual or other capital. It's fun and interestings, maybe even deep, but at the end of the day, you're wasting your life and fiddling while Rome burns. Cancer will not be cured on the World of Warcraft battlefield. The resources you harvest will have no real economic value. Video games are simple simulacrums for the realities and challenges that surround.

I sometimes find myself wondering if I'm wasting my life and redirect the time spent on those diversions into doing, creating, something else.  Photos. Electronics circuits. Code. Bread. Beer. Something. I can't help thinking about the big things that could be done.

That said, I'm going to go play Starcraft.

Sunday, October 30, 2011

DC from AC... Without a transformer...

I recently started a project at work that uses momentary push button switches to activate a device. The switches I ordered came with 5V status LEDs built in. Being one to not let capability go to waste, I wondered if I could light the LED to signal the device was on. The major problem was that the rest of the system is based on 120V AC, while the LED needs only 3-5V DC. The project did not warrant the purchase of an expensive transformer.

I began to wonder if there was some other way to light an LED with 120V AC. Unfortunately, one cannot simply place a large resistor inline with a diode bridge and call victory. The amount of energy dissipated would be quite substantial.

I turned to the internet for answers. There's lot of interesting circuits out there. Some of them really good, others, not so much.

http://www.qsl.net/: Scroll down a bit
Forum Discussion: nbuska's circuit


A common theme in the circuits for low current DC from AC is to leverage the charge-discharge characteristics of a capacitor across the AC power supply to step the voltage down. This is an impedance property of a capacitor called reactance.

The impedance of a capacitor is given by Xc=(2πfC)-1 .
Where C is the capacitance of the capacitor in farads, f is the AC frequency (in hertz), and Xc is the impedance of the capacitor in ohms.

Using Ohm's law for the reactance (E=IXc), a voltage of 120V (from the AC input), 10 mA current for the LED, we get a reactance of about 12 kOhm. Solving the impedance-capacitance relationship, we get C of 0.221 μF.

I built a breadboard test circuit using a 1.8 kOhm resistor (R1; to control capacitor inrush and avoid blowing a fuse or a circuit breaker), a 0.221 μF capacitor (C1), some 1N4004 diodes (L1; for the diode bridge), and the LED in question.
To my surprise, it worked without releasing smoke. It was kind of creepy to see the circuit attached to AC without a transformer.


I used a variac to slowly ramp the voltage with the hope I could quickly turn the power off if something bad started happening (sparks, smoke...).

Testing across the LED leads showed a voltage of 2-4 volts (depending on the LED used).

Having successfully prototyped the circuit, I then transferred the components to a soldered breadboard to be incorporated into the final device. It was essentially cost-free as the components were all on the shelf, so no new purchases were needed.



This circuit is so fascinating that I ended up wondering if there was a deeper way to look at it. Instead of using the impedance relationship, another approach is to explicitly look at the charge/discharge characteristics of the RC circuit when connected to an AC input. This system can be broken into two modes:

Charging: When the input voltage (Vin) is greater than voltage of the capacitor (Vc).
Discharging: When Vin is less than voltage of the Vc.

Charging:
In a DC circuit, the Vc at a given time (t) is given as:
Vc=Vin*(1-e-t/RC)

Since an AC input is increasing during the charging part of the cycle, Vin is some function of t [that is: Vin(t)]. To obtain Vc, we need to break t into many small steps and numerically integrate in order to determine Vc:

Vc=(Vin(t)-Vc')/t*(1-e-t/RC)

Where Vc' is Vc at the previous time step.

Likewise, the charge on the capacitor from a DC input can be determined from:
 qc=CVin*(1-e-t/RC)

substituting for an AC input, we get
qc=C(Vin-Vc')*(1-e-t/RC)+qc'

where qc' is the charge accumulated at the previous time step.

 Discharging: 
After the input voltage drops below Vc, the capacitor starts to discharge. In order to effectively model the system, the continuously dropping voltage across the circuit must be accounted for.

To solve the system in the discharge scenario, the qc must be determined first, as Vc .
 The charge of a capacitor acting across a resistance without a bias voltage is:
qt=q0*(e-t/RC)

Since the voltage is constantly dropping in the AC circuit, the apparent charge on the capacitor increases even as it is discharging.
qt=(qt'-VcC)(e-t/RC)

where qt' is the charge on the capacitor at the previous time step.

The voltage of a capacitor discharging across a resistance as a function of time is:
Vc=-qc*(e-t/RC)

To account for the changing input bias from the decreasing AC voltage, we substitute in the expression for qc from above:
Vc=-(qt'-VcC)/RC*(e-t/RC)

Summation:
When this is all put together and solved with time steps (t) of 1 μs (to avoid integration errors), a resistance of 3220 Ohms (sum of the LED, inrush resistor, and diode resistances, and the capacitance discussed above), we get the following result: 


Now we have a much clearer view of how the system works than the impedance relationships provide. The capacitor voltage trails the input voltage from the line very closely, so the measured voltage of the circuit is very low, just a few volts, thus not destroying the LED. The measured voltage stays positive in this case because of the diode bridge. I mathematically modeled this by taking the absolute value of the difference between voltages. Notice that the measured voltage is 0 when the AC voltage has just crossed it's apex and is equal to the capacitor voltage, so it effectively out of phase by 180 degrees. Also note that the capacitor is nearly fully charged by the input.


My original design notes. Much less clear...


Zonet, Zonet, where art thou Zonet?

I have a somewhat old Zonet 802.11g PCI card that I moved to a different machine. I discovered that the links to drivers at http://zonetusa.net/ do not work. It appears that they all driver downloads link to:
http://zonetusa.net/media/import/ttp://zonetusa.com/file/product/d/D00000167_86.zip

Which is clearly a broken URL, and there is no obvious way to fix it or browse the site's directory structure.

However, a bit more googling revealed that they have a second website:
http://www.info.zonetusa.net

Which does have working drivers. I also made sure to save the downloaded driver somewhere so I won't be left to the wiles of some flaky vendor for software support.

Friday, October 28, 2011

Volvo 740 B230 Timing Belt Change: Photos!


Something freaking amazing came for me:


It's so-wonderful, isn't it?

I'm glad you find it as so-wonderful as I do.

What you're looking at is an ipdusa t5385 crankshaft pully holder. It's the magic wand of 4-cylinder Volvo timing belt replacement. I ordered it back in May, back when I was still single, imagining a future warm June summer day where I would change the timing belt while my (then predicted)wife brought me cold beer and cookies. Shortly after I place the order, I got email saying it was back-ordered until August. I adjusted my fantasies accordingly. That is until august came and an update from ipd noted that delivery would be in september.

So, I ended up changing the timing belt on a crisp autumn day while my (real) wife raked leaves and I was chilled by the wind.

The tool holds the crankshaft while you apply 165 ft-lbs using your favorite freaking huge wrench using that 24mm socket you bought to remove the obscenely large Volvo oil plug. This gets around numerous tricks suggested by others on the internet (stuffing rope into a cylinder, bracing the pulley with a fat screwdriver, using an impact wrench, or as my father would later suggest, putting it in 5th and bracing the rear wheels.). It makes the job something of a breeze. There are a lot of steps involved, but it's all easy, and you don't get covered in oil. It took about 4 hours, but I wasn't hurrying.

There is several great guides to doing this around the internet.

(http://www.stepbystepvolvo.com/)
(http://www.swedishbricks.net/)

I don't need to parrot how I did it. I did want to post a few pictures and discuss engine performance because that information is hard to find.

 The front of the engine with the upper timing belt cover removed and the mark on the camshaft gear visible and aligned with the mark on the back of the cover.

 Crankshaft pulley holder installed on the tensioner stud.

 The pulley removed, timing belt fully exposed. Note the nut left on the tensioner to keep it from getting free.

 Cam gear alignment close up photo.

 Tensioner and spring removed from the engine. There is a lot of force behind the spring! With the retaining pin removed, it expands about an inch beyond the end of the shaft. I put the new tensioner in a clamp (laterally, by clamping the cylindrical bearing) to keep it from scooting around, and then used body weight to compress the spring and shaft while i used the free hand to put the retaining pin back in.

The old timing belt looked good. I almost thought that it had been replaced before I got the car

The teeth weren't chipped and the ridges were all visible. When I removed it, I noticed that it was loose enough that one could have pulled it off the engine with little effort (e.g. without compressing the tensioner). The new belt, in contrast, required very careful treatment: the slack had to be ironed out and all the teeth worked into the gears. The old belt was clearly a smidge longer than the new one.

As long as I have owned the car (almost a year! Gasp!) it has hunted a little bit at idle (+/- 100 rpm, very noticeable on the needle, but probably would pass emissions), and the delivery of power has not been smooth, particularly when decelerating against the engine. With the new belt installed, this issue is now completely gone and the engine is very smooth. That small amount of slack was probably translating into timing variability.

Total cost of project: $80 ($30 for the belt and $50 for the tool).
Estimate from the shop: $700

Weekend laying on the cold hard ground while my dog sniffed my neither regions: priceless.

Camping At Cave Mountain Lake


The wife and I have often remarked that we used to go camping and go on all these amazing adventures, but life turned into chaos (recession, Ph. D., wedding, moving, new jobs...) one day, and we've had serious trouble leaving town for a weekend. For something like 3 years. We finally found a 3 day weekend we both shared, circled it on the calender, and made it happen.

I want to emphasize that last point, as after 3 years and as many moves, it was extremely challenging to locate gear and remember exactly what equipment and selection of vittles to take. We also had to figure out where to go, again, since we've moved three times and had little clue where to start. We're on the east coast... it's not like there's vast amounts of public land to work with here.

Originally, we considered some locations in western Maryland and West Virginia, but the weather prediction showed it to be very wet, so we made a last minute change to central Virginia, along the James, where it was not slated to rain for the entire weekend.

Packrat and I rarely had trouble fitting everything we needed into the ChevOldsmoBuiac. A long weekend worth of food, caving, and camping gear could fit nicely in the back of the car. You know, without effort to minimize the amount of airspace in the trunk. In contrast, getting everything for just camping for the weekend seemed unusually hard. Sure, we were taking a larger tent and bigger pots and pans, but that's peanuts compared to a large pile of caving gear.

Then, I realized: we have a dog. The backseat was occupied by a big hairly smelly oaf, not my sleeping bag. Dogs don't stack up on end like people, and so a single one uses most of the backseat, and they don't stack with other things vertically, so packing is limited to the floor space, and the tiny portion of the seat the dog isn't flopped on. I suppose I'll have to consider that in the future, and cram more carefully.



The sky throughout the day.





Roasting marshmallow. Fortunately, there was some wood left at the site by previous campers, though it was a little damp. Getting it lit was hard... since we were in an established camping area, it was not possible to resort to foraging for low hanging dry limbs like they teach you in survival classes.

The trees were just barely turning. One of my favorite times of year, because the forest looks like stained glass.









We grabbed deadfall that was laying across the trail after our hike to kindle our next fire. We had much less trouble getting that started, though we completely burned both arm loads of wood.


Tuesday, October 25, 2011

When I stick my right elbow in my left ear, i shock the dog.

I was having trouble driving a Darlington transistor using my DAQ board. I had wired a simple LED test circuit, but things just weren't working. It turns out, I had completely screwed up the polarities by confusing the conductor direction on the bread board. The LED would light when I touched the negative lead to the positive post.

"What have you done?" I wondered, "What have you done?"

Tiny bit of advice...

If are thinking about creating a startup, make sure your product doesn't compete with apple.

Or facebook.

Or google.

Make something that people don't need but suddenly want. Or take something so mundane at rework it so it achieves a new level of existence from what it once was.

Things will go way better if you don't re-invent the wheel.

Tuesday, October 18, 2011

I used to think horns should be disconnected in order to pass safety inspection in NOVA. Now, i think they should be re-connected to the brake light switch.

Sunday, October 16, 2011

Whistle While You Work

I've been hiding from the internet, and perhaps everything else, for upwards of a week, as I was preparing for a scientific conference, at a scientific conference, then camping after my return.

As I have written in other media, Minneapolis is not a small town. It's big and happening.

The town does bear marks of the recession. The downtown is quite gorgeous, but there are many unemployed people and many shuttered businesses. Things have been better, but they could also be a lot worse.

Taking a camera with me to lunch and dinner gave me an opportunity to study the city between meetings. While I think I missed having the time to really, deeply, explore that I normally get wandering around for hours without a schedule, things panned out, and I have some neat images to remember the trip.

One thing that really struck me is how many underground and overground walkways there are. You know winter is tough when people think it's worthwhile to heat and enclose paths between buildings. I am pretty sure it's entirely possible to walk from the Minneapolis convention center to the Hiawatha light rail station without being able to see sky when looking up. That's more than a mile of uninterrupted passage.

Winter hasn't struck yet. If anything, it was warmer there than DC is right now. The trees are all turning, and the taxi drivers all swear it will snow next week, though I am suspicious about their timing. What comes out of the sky still feels like autumn.

I stepped off a bus a half mile from the hotel, just in time for the clouds to unzip and unleash a torrent that soaked me before I could get my nylon shelled fleece on, then soaked through that just to remind me what real rain gear is. The skywalks were not an easy distance away, so I had to dodge between awnings to get back to my hotel. I nearly asked the doorman for a towel.

If you are a fan of Genuine motorscooters and motorcycles, Minneapolis is hive of activity. Lots of 50 cc bikes and a few 125 and 150s. I even found a Stella hanging out by the theater.

Awesome.