Wednesday, February 24, 2016

Nearly another year

Hello to anyone still using an RSS reader (I suspect y'all are my only audience, due to my infrequent updates).

I've started a new project to replace the battery management system in the Honda Insight.  You, fine reader, are picking up the project in medias res; most of the work I've done up to now is available  here (nerd alert).  Project 'Linsight' is inspired by my intense fascination with the Insight, battery management, and electrons in general. 

So what am I doing? 
In short, I'm replacing the OEM ('original equipment from manufacturer') computers that control everything about the hybrid system.  Specifically, I'm replacing two computers and the entire hybrid battery. 

Why am I doing this?
The Insight was the first hybrid car sold in the USA.  In short, the technology is severely outdated, and IMO wasn't good to begin with.  Linsight's two main goals are:
-to provide an open source hardware platform to allow complete control of the hybrid electronics. 
-to allow lithium batteries to power the hybrid system.

What is Linsight's status?
I designed the hardware from December2015 to January2016, and received the revA PCBs a few weeks back.  Designing the hardware required me to completely reverse engineer over 100 signals, using spotty service manuals and folklore internet data.  I ultimately probed every single signal with an oscilloscope.  The OEM wiring harness is cut to pieces, but I don't care because I bought three more (and have kept one in pristine condition for the final install).

Hows the RevA PCB?
Mostly good.  There are a few minor hardware changes for revB.  The revA PCB won't work in an actual insight due to one particularly deceptive marketing issue in one of the microprocessor data sheets, but I can fully test out the entire system regardless.

What work is left?
A lot!  As of today, Linsight has nearly zero usable code running on its uCs, so it doesn't do anything except powerup and toggle its pins on command.  I thoroughly understand the OEM system behavior, but I've had to ramp up my knowledge a ton over the past month.  Except for 'baby' Arduino projects, Linsight is the first major microcontroller (a.k.a 'uC') project I've done in 15 years.  Saying "I'm rusty" doesn't even begin to capture how I feel; microcontrollers have advanced just as quickly as personal computers, so pretty much everything I knew back in 2000 is obsolete.  True, the C programming language hasn't changed, but the hardware and software implementations are considerably more complex (for better or for worse).

The Linsight PCB has two onboard microprocessors:
-Atmel AT32UC3C1512C (a.k.a. 'UC3C')
-Atmel Atmega64M1

The UC3C is a behemoth that runs the entire show, but has some of the worst programming documentation I've ever seen in a released product.  I wish I'd known this before I selected the UC3C, as the hardware design and documentation is actually stellar. I could write for hours on why I'll never use another Atmel 32 bit microcontroller, but that's what's on the board today, so I hope I learn to love it. 

The 64M1 is substantially simpler, as it's only used to actually spin the hybrid-electric motor.  Linsight uses a dedicated motor microcontroller because the control algorithm is time-critical.  Without a dedicated motor uC, the entire system would require tight timing requirements to ensure the motor phases were driven at precisely the correct time; with two uCs, the timing is relaxed throughout the rest of the system.

...

I've decided to resurrect electrosanity.blogspot.com in hopes that documenting my struggles proves useful to any future readers.