004: Very first hacks  [magic pin]

One significant factor in my decision to buy a Prius was finding the people
who had already done so and had sort of became evangelists about it in the
process.  Various communities on the internet had already greatly boosted my
own confidence about going this route in the first place -- in particular,
the gung-ho enthusiasm pouring out from folks while writing up their own
experiences with adding extra batteries and EV-mode switches and CANbus-aware
gauge sets.  Now, it was my turn.  I had found the Prius_Technical_Stuff
yahoogroup to be the most useful and responsive community for my questions
and comments to date, and despite their 4-year prior perspective stemming
from the earliest "Classic Prius" days [about which I really only had the
smallest inkling so far] the people there seemed open to any new viewpoints
or data and ready to gently correct misconceptions.  And from these folks I
had already learned a lot about the control systems.

I spent some of a day just tooling around and exploring parameters, such as
creep speeds in forward or reverse, or how long I could slowly golf-cart
around a parking lot before discharging the batteries down into "two-pink-bars"
territory.  Already I was understanding how the probability of running the
engine is heavily based on battery state of charge [SOC] vs. how much power
is requested at the go-pedal, and figured that one day I'd have some way
of viewing the thresholds.  But what I really wanted to experience first-hand
that day was the magic "EV mode", even temporarily.  Armed with a couple of
alligator clips and bits of "telco" wire, I began carefully removing the
necessary pieces of the dash to reach the ECUs and touch something to the
the magic "H14-27" pin in the hybrid controller.

The dash and other interior parts have a slightly cheezy feel -- very lightly
constructed plastic panels that basically clip on.  But these parts aren't
designed to undergo high stress; they're just covers.  This is one of numerous
ways Toyota could keep the car's curb weight down to 2900 pounds, and most
of the plastics used all over the car are environmentally-friendly and
recycleable.  Almost like they were thinking that when you're done with the
car, you toss it in the recycle bin -- not quite that simple, but the idea is
low environmental impact in general and Toyota clearly put a lot of thought
into that.  While the interior is functional and well-designed and large when
necessary, one should not expect to throw big hunks of rusty iron pipe around
in the back and not have it show some bruises.  It's not a pickup truck.

So with a bit of trepidation I pulled at the vent-panels, using a sort of
straight-arm body position, angled in a way that would limit my motion once
they came off.  The idea was to not break off any little plastic tabs!
But it was soon clear to me that the parts are designed to be freely
popped in and out as needed.  And there up under the right-hand end of the
dash was a big tangle of wires and connectors -- the main brains of the whole
operation.  Just like the "evbutton" PDF showed, in fact.  I located the
right connector and managed to snake my pre-grounded piece of telco wire into
the appropriate hole ... far enough ... BEEP!  the screen changed back to
the "energy display", meaning I had successfully invoked electric-only mode!

I un-contorted myself and got back in the saddle to test it.  Scooted off up
the industrial-park road fairly briskly, with no sound other than the tires
and that subtle inverter whine ... ahh!  This didn't last long, of course, as
I climbed a low hill and the battery state rapidly ran back down toward two
pink bars again.  The fateful little three beeps sounded as EV self-canceled
and the engine came back on.  But at least I now knew how it works, and what
it feels like.  I played with it a little more that afternoon and decided
that it was something I'd want readily available, regardless of how often I'd
actually end up using it.  I already understood that trying to go as far
as possible in electric mode is *less* efficient than using the engine
intelligently, but as many people point out, sometimes EV mode also just has
high cool-factor.  Making a more permanent hookup for this would require
finding the appropriate connector lug to insert in the plastic ECU plug block,
since even though the ECU itself has a pin at that position, the hole in the
mating harness connector is unpopulated.  Having read that the pins that some
people "harvest" out of the directional-switch connector are really not quite
the right thing for the ECU connectors, I wanted to find something a little
more correct.

And I eventually did.  EV switch version 0.1 was a dismal, clumsy hack,
that would very soon be redone differently, but it was enough to warrant
constructing my first Prius-mods web page:
which doesn't go into too much detail about how it's done, since that
is already well-documented elsewhere; I just had a slightly different
quick-n-dirty approach on where to install the switch and wiring.  And
frankly, trying to work on any of this with an inch of cold, muddy water
right under the doors in the driveway was *not* particularly pleasant.
There had been a lot of snow the week or two before, and I had carved out
just enough room to park two cars.  Now that it had gotten a bit warmer
everything was a total *swamp*.  But at least I had an accessible EV switch,
for some value of it, even though I had to reach over and open the glove box
for it.  Mind you, all this was about two days after taking ownership, so I
figured I was on a pretty good hack schedule already.  And my copy of the
wiring diagram was just bristling with further possibilities.

At this point the OBDII diagnostic widget for the laptop had also arrived,
and I spent a little while fooling with that.  Where the Prius does really
good battery management, by contrast I already had a prime example of *bad*
battery-management endemic to so many other consumer devices sitting up in
the shop -- the old laptop pack that had long since given up the ghost, which
I had carefully cracked open to see what exactly was in there.  Trying to
resuscitate the old cells was futile, partially because Li-ion is a squirrely
chemistry to begin with and according to numerous reviews and stories on the
net, IBM had really screwed up the management electronics in this particular
model.  I decided to salvage what I could and wired a 12V cigarette-lighter
plug up to the contacts in the empty shell, to run the laptop directly off
the car battery.  Works fine, even when the car's DC/DC converter brings
the aux bus up to 14 volts, since the laptop internally regulates down from
the pack voltage for all of its power needs anyways.  The more voltage you
feed it, in fact, the less current it draws.  Anyway, I didn't need to run
an AC power cable out to the car to mess with diagnostics, also implying
that I could drive around with this.

Of course the first few tries at getting the OBDII stuff working were a
dismal failure, because the user interface for obd-2.com "vehicle explorer"
has to be one of THE most ill-documented, obfuscated, and downright illiterate
packages out there.  Remember, this is the one whose Windows install procedure
is "explode the zip file into a directory and run OBD2.EXE", with no funny
DLLs, registry turds, or hidden files salted around the system.  Great on
paper, but now it was turning out that this guy Alex Peper, as brilliant
he may be in the auto diagnostics field, has some serious issues in the
human-interaction department.  To shorten the interim story somewhat, after
going back and forth with him a few times via email I wound up having to
change a bunch of settings before being able to meaningfully connect to the
car and see any data at all.  Interface timeouts, having to click various
buttons *twice* to assert them, data with hidden relationships between
different display "tabs" within the program, many requests that just plain
didn't work or oscillated wildly between two values... you name it, this
thing was a mess.  Alex's inordinately terse emailed advice was to click
various things with no evident relationship to what I was trying to do.  And
he rudely blew off my offer to contribute improvements to the documentation.
I managed to get it to log just enough stuff during a few runs to have good
data to report back to the techie group, but it was a real headache making
sure it was anything close to valid.  Oh, and of course despite the claim of
understanding "toyota hybrid", the package had no clue whatsoever of any
manufacturer-specific parameters for the '04 and up Prius.  So all I had at
that point was a fairly expensive generic OBDII scantool that I couldn't
really trust was giving me correct data.

So much for my high-tech plastic fork.  This one appeared to have most of its
points broken off.  But updated versions of the software were supposed to come
out every month or two, so I figured I'd wait a while for Mr. Peper to get
his act together and incorporate all the newer Prius-specific stuff which it
didn't even make a pretense of understanding yet.  I suppose that if the
engine threw any generic codes, I'd still be able to read them, and being
able to log things like throttle position and coolant temp were still useful.
In the meantime, I expected to depend much more upon a voltmeter and
oscilloscope instead.

I kept playing and observing and discovering.  The "hill-holding" feature
related to the "creep" in D or R turned out to be very strong resistance
to letting the large motor/generator [called MG2] spin the wrong way.  Thus,
drifting slowly in one direction and selecting the shifter to go in the other
produces a *large* torque pulse to immediately halt the car and begin trying
to creep in the correct direction.  Another interesting side-effect comes from
how creep interacts with the trailing-link rear suspension geometry -- setting
the parking brake and then rocking between D and R produces this really
entertaining rear-end bucking action.  Who needs a low-rider??  And I already
had a good feel for dropping gently into Neutral when arriving at a stop, and
eliminating that coming-to-rest kickback just like I could with a clutch --
even with the somewhat funky braking transition from regen to physical.
Going back into Drive would "thunk" a little bit, but not nearly as much as
a typical automatic transmission.  I figured that long-term, there would be
no problem adapting long-term to this car's driveline quirks.

The weather was becoming warm enough for the car windows to be at least
partially open, but even with that it was very difficult to determine
not only when the engine was running, but how fast.  The car desperately
wants a tachometer, no doubt about it!  The engine is quiet and the run/stop
transitions are often so smooth, it's hard to tell over ambient noise what it
is doing.  So clearly, it was going to be all about *instrumentation* from
the git-go.  Some time much later in the summer I pulled down a bunch of the
old Prius_Technical_Stuff yahoogroup archives, and was somewhat gratified
to realize that what I already thought would be the two most essential
instruments -- a tach and a battery-current meter -- were also the two
things that the first "classic" owners back in 2000 found themselves really
wanting too.  From the time I had already spent with my nose buried in the
electrical diagram, these things seemed quite within the realm of possibility
without even having to talk to the car's computers.  The first round of
instrumentation would fairly certainly be analog, because that's what I had
the parts and general understanding to do -- perhaps not the most "pure"
route to take, but workable and with the side benefit of getting direct
readings on things.

I continued studying the ECU wiring over there on the right.  The car didn't
have the right-hand vent covers or either glove box in place for about three
weeks after I got it, because I was always diving in there to find another
lead to tap and explore.  It turned out that an ordinary small paper-clip,
straightened out, is the perfect diamter to slide into the connector shell
next to the pin of interest and lodge in there by friction, firmly touching
the side of the wiring lug.  A test clip could then bring the signal out to
be accessible to a voltmeter, scope, or even a particularly amusing device
I call a "listener widget".  This is nothing more than one of those
piezo-disk style noisemakers, with a series resistor to avoid presenting
the speaker's high-capacitance load across the signal being measured.
But when that widget got connected to NEO, the reconditioned output from
the crankshaft-revs sensor, I could hear a really amusing little whine
when the engine was running.  The crankshaft reluctor has 34 teeth around
it, so at 1000 rpm or more that makes a fairly high and very hearable
frequency.  So with NEO tapped to the listener, I sort of had a tach --
that was only usable with nobody else in the car, because the little
whining noise would probably drive anyone else totally nuts.

Thus, I did *not* have an engine-run indicator for the following weekend's
road-trip, when the s.o. and I piled in and headed off to NJ for a convention.
Nonetheless, the ride down was very pleasant, with an average mpg of just
about 50 by the time we got there.  At this point I didn't know nearly enough
to apply any particular techniques on the road; I was "just driving it" but
in my usual careful, no-sudden-moves predictable fashion.  That in itself is
good for more mpg right up front, and Prius or no Prius, I just wish I could
teach all those buttheads that they're really *not* that important and aren't
justified in thinking they're in *that* much of a hurry to zip up to the
next red light and then sit there sucking truck fumes while their brakes
desperately try to cool down.

The best comment from a bit of parking lot show-n-tell at that convention
was from a colleague who looked at the half-ripped-apart dash and said, "This
*is* a new car, right??"