16 February 2015

Was Y2K Really a Problem?

The simple answer is yes.  I personally fixed dozens of instances of it.  Most of them were trivial and would have been at worst an annoyance, but they were real, and a few would have been of real consequence.  Particularly serious was that the Microsoft BASIC string parser defaulted to years beginning with 19xx and was used in lots of user and database interactions, including pretty much anything related to OLE.  I fixed a bunch of these issues during my brief time in the BASIC team in the mid '90s, and lots of other people did too.  MS-DOS prior to 5.0 had the bug.  The only 5 inch floppy drive I still have is on a machine running MS-DOS 4.0, and I have to lie to it about the date in order to read such a floppy. 

The scariest bug I know about is that apparently a bunch of spy satellites were not working properly for several days immediately following 31 Dec 1999.  DoD kept quiet about this for several months, until they were sure they'd gotten it fixed.

I was pretty worried about infrastructure problems: computer controlled water supply, banking, traffic controls, etc.  I set aside a reserve of cash, charcoal and camp stove fuel, and about 20 gallons of drinking water, just in case.  Fortunately, none of this was necessary...but Jan 1 turned out to be a fairly nice day here and I had a nice barbeque...  Lots of people had fixed lots of bugs.  For example, I heard about a hydroelectric project that had experimented with their fix in June, lying to the dam controls about the date and watching what happened as the date clicked over.

Not sure if my (then) new car with a lot of computer controls would work, I used my old car to drive to my friend's place for a new years party.  It had no computers aboard at all.  But on the trip home, I crossed the 520 bridge at about 1AM.  The bridge was open, and was for a long time.  So I got out and walked to the drawspan.  The workman there said it was scheduled maintenance, nothing to worry about.  Yeah, right.  Middle of the night on New Years Day.   I am confident that this was in fact a Y2K bug but you won't get anyone in DoT to admit it.

No really bad things happened on Y2K day, but that was because there'd been a LOT of worrying.

Here's a list of problems that one group studying this found.  Unfortunately, the "official" page they reference has gone away.  One estimate was that $100B was spent fixing instances of it.  I suspect this is high...I worked on Y2K problems off and on for several years...If you imagine that I spent the entire time working on Y2K, you'd get an accounting of several hundred $K, but that misstates it.  Over several years, I spent much less than a month cumulative time.  But tens of thousands of programmers did something similar.

Take the example of the hydroelectric dam.  The programmer involved needs to do whatever software changes are deemed necessary, and test them to the limit of their ability without actually affecting the water system.  Lets say 5 man days.  Then they need to staff up the whole facility so if something bad happens, they can manually override, almost no matter what it is. Once everybody is ready, they install the new software, lie to it about the date, and watch what happens as the date ticks over.  Probably a dozen people for a day, or perhaps more if something goes wrong the first time.  we're up to almost 20 man days.  Repeat this tens of thousands of times for thousands of different types of installations, all around the world.

Yes, Y2K was a problem.  One which was dealt with almost adequately. 

13 February 2015

Electric Car Chargers

Electric cars have finally crossed the line from being futuristic possibilities, through hybrids that exploit some of the benefits of electric power but still burn petroleum, to fully electric vehicles.  Tesla and Nissan are the big trendsetters, but now pretty much all the carmakers are on board.

Charging an electric car presents some special problems, mainly stemming from the fact that moving the mass of a car (and passengers) requires quite a bit of energy. Gasoline (and its relatives) have tremendously high energy density.  The breakthrough that's made electric cars finally feasible is the lithium ion battery, which is both smaller and lighter than it's predecessors.  But it still takes much longer to charge a battery than it does to fill a tank with gasoline.

Broadly speaking, there are three types of charger that have evolved, which go by the name "Level 1", "Level 2" and "Level 3".   The first two are not really chargers, but EVSEs "Electric Vehicle Service Equipment".  They just pass the power unchanged, with the addition of some safety equipment.  The charger is on the car.  A level 1 EVSE uses one phase, line voltage power.   In the US, this means 120V, 15 or 12A.   The SAE definition is that a level 1 EVSE is single phase and not capable of charging at faster than 1920W.  A level 2 EVSE is 2 phase, 208 to 240V and may go at up to 80 amps, but very few of them actually do that.  This is a theoretical peak of 19200W, but very few go higher than 7800.   "Level 3" is not defined, but in practice, it's anything that goes higher than 19200W.

The standard EVSE system is SAE J1772, which defines a 5 conductor connector, which has two power conductors, a ground, a "pilot" and a "proximity" conductor.  The latter are used for safety signaling.  The "pilot" carries a 12V 1KHz square wave which is used to detect continuity, and the "proximity" signals to the car that it's plugged in, and blocks the vehicle from being driven until it's disconnected.   Power is just passed through on the three power and ground conductors, but a relay opens the circuit unless pilot and proximity are deemed valid.  The idea is to make it impossible to charge a car with a kludged up power cord, just the sort of thing that might start fires, and to reinforce it, they tell you not to use extension cords when you buy the car. Virtually all electric and plug-in hybrid cars support J1772, although a few, such as Tesla S, require an adapter.  (Tesla exploits their incompatibility to use the same conductors for their "supercharger" level 3 scheme.)

The electric code also requires that lines being heavily loaded for more than half an hour only carry 80% of their design capacity.  This is also to prevent fire--heat builds up gradually, and your charger is likely running while you're sleeping.  This is the reason that a charger wired for 15 amps is only allowed to draw 12, 50 amps only allowed 40, and so forth. 

Level 3 chargers typically use special power arrangements to draw more than 80 amps.  Generally they are called DC chargers but that oversimplifies what they're doing.  They require smart electronics and high power connectors--generally beyond the capacity of home chargers The three main protocols are the still evolving J1772 level 3, the CHAdeMO, and the Tesla Supercharger.   The first two require a very special connector, while the Tesla uses the same connector as level 1 and 2.  (this is the main reason Tesla went its own way rather than allowing J1772 to plug in directly).  BMW and Nissan tried to negotiate a license to use the system during summer 2014, but BMW recently announced that it's building its own network of level 3 chargers using the J1772 "combo" connector, which is a kludge involving a J1772 and a separate, higher capacity connector in the same plug.