Honda IMA inverter hacking.

Introduction and miscellaneous that we haven't created categories for, yet
Post Reply
User avatar
Mouse
Posts: 138
Joined: Wed Sep 25, 2019 8:17 am
Location: Wales
Been thanked: 7 times
Contact:

Honda IMA inverter hacking.

Post by Mouse »

(Not sure if I should post this here or in the hardware section)

I've got a Honda IMA inverter and planning on using it on a small motorbike project.
The actual IGBT connections and current sensor data are well documented by Tom and Chaz over on diyelectriccar.com
https://www.diyelectriccar.com/threads/ ... ma.163650/
And summarised in this document.
Honda_IMA_Rev_Eng.pdf
(1.78 MiB) Downloaded 199 times
However I noticed there is an unexplored optio-isolated data link going from the high voltage to low voltage control logic. After hooking up a scope then a logic analyser for some investigation spotted it was asynchronous serial signal. 8 Bit data, Parity bit, 50000 Baudrate.
P3020643s.JPG
P3070666.JPG
A really helpful thing is that the bus voltage is separately controllable so I could very easily identify which two pairs of bytes were responsible for them by attaching a variable PSU and winding it up and down.
This is the output from a cheap 24MHz 8CH Saleae clone logic analyser (£7 from China) and some open source software, PulseView which decoded the serial data and gave a guessed baudrate once I had selected a suitable sampling frequency.
0-0V.png
0.0V on the main power bus, Bytes 7 & 8 both zero.
25-0V.png
25.0V on the main power bus, Bytes 7 & 8 both both reading accordingly.

Some quick arduino code later and I was able to workout the scaling factor and display IGBT1 and IGBT2 as true voltages (no voltage signal from IGBT3) Oddly IGBT2 voltage output is numerically 20% lower than IGBT1. I have no idea why it should be like this other than maybe some sort of error or fault checking feature.

The screen cap shows the 16 byte data packet with one (or two) start bytes 13 data bytes and one checksum byte followed by the extracted voltages and recalculated checksum.
datacapture.png
I also recreated the checksum which will eventually be used to discard any false readings generated such as at power up and power down.

I then identified heatsink or IGBT temperature bytes in a similar manner by blasting the heatsink with a hot air gun and observing which bytes were changing. Once identified I put the whole thing in the freezer at -10C and let it warm up to room temperature and then heated with the heat gun to 60C whist monitoring the temperature bytes and actual heatsink temperature with a thermocouple. This allowed me to workout a scaling and offset factor.
imatemp.png
The relationship between data bytes and real values are

Code: Select all

V_IGBT2 = (bytes[7] * 8 + bytes[8]) / 4.095;
V_IGBT1 = (bytes[5] * 8 + bytes[6]) / 3.089; // 20% LOWER than IGBT1
temp = -((bytes[11] * 8 + bytes[12])- 631) * 0.6414; 
My terrible arduino test code

Code: Select all

#include <SoftwareSerial.h> 
SoftwareSerial mySerial(2, 3); // RX, TX
int incomingByte = 0;  
long timest = micros();
int bytes[16];
int checksum = 0;
int bytecount = 0;
float V_IGBT2 = 0;
float V_IGBT1 = 0;
float temp = 0;
void setup() {
  Serial.begin(115200);
  while (!Serial) {
  }
  Serial.println("IMA Internal Serial Monitor");
  mySerial.begin(50000);
  for (int n = 0; n < 16;n++){
    bytes[n] = 0;
  }
  timest = micros();
}

void loop() {
  if (mySerial.available() && bytecount != -1){
    timest = micros();
    incomingByte = mySerial.read();
    bytes[bytecount] = incomingByte;
    if (bytecount != -1 && bytecount != 15){
      checksum += incomingByte;
    }
    bytecount ++;
    Serial.print(incomingByte, HEX);
    Serial.print(" ");
  }
  
  
  if ((micros() - timest) > 3000){  //Think of a better way of detecting the end of the frame
                                    //Default to error if not a frame & checksum
                                    // 1] Count bits then checksum check
                                    // 2] Fail if over XX Miliseconds without incoming byte or frame end. 
    Serial.print("   IGBT2=");
    V_IGBT2 = (bytes[7] * 8 + bytes[8]) / 4.095;
    Serial.print(V_IGBT2);
    Serial.print("V  IGBT1=");
    V_IGBT1 = (bytes[5] * 8 + bytes[6]) / 3.089; // 20% LOWER than IGBT1
    Serial.print(V_IGBT1);
    Serial.print("V ");
    temp = -((bytes[11] * 8 + bytes[12])- 631) * 0.6414; 
    Serial.print(temp);
    Serial.print("C ");
    Serial.print(" CHK=");
    checksum = 0xFF & checksum;             //Truncate to 8 bits.
    Serial.print(0xFF - checksum + 1, HEX); //Why is +1 needed here. 
    Serial.println();
    bytecount = 0;
    checksum = 0;
    timest = micros();
  }
}
I have identified 6 of the 13 data bytes but the rest of them are a mystery to me.

The idea is to somehow get these numbers into the open inverter firmware rather than make my own isolated voltage measurement or temperature measurement using a small microprocessor as a bridge.
I'm not sure if the open inverter hardware can accept serial readings for voltage or temperature so I plan on using a small micro to covert these readings back into an analogue 0-3.3V signal so the stock firmware and more importantly any future updates are compatible with this installation with zero faffing about when that time comes.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Honda IMA inverter hacking.

Post by Jack Bauer »

Very nice work:)
I'm going to need a hacksaw
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Honda IMA inverter hacking.

Post by mjc506 »

Good stuff :) Slightly different to the Gen1 then.

Rather than converting from analog to digital to digital to analog to digital... why not send the data from your micro via CAN? Although you are right, setting udc and temphs over CAN does need a small firmware edit at present. udc and temphs and fix.
User avatar
Mouse
Posts: 138
Joined: Wed Sep 25, 2019 8:17 am
Location: Wales
Been thanked: 7 times
Contact:

Re: Honda IMA inverter hacking.

Post by Mouse »

Jack Bauer wrote: Mon Mar 15, 2021 6:33 pm Very nice work:)
Thank you :)

Yea, there's much more going on in it than the Gen1 plus the Capacitors and Current sensors are built in making it easier to mount on a motorcycle and then attempt to make weather proof.
mjc506 wrote: Mon Mar 15, 2021 7:20 pm Rather than converting from analog to digital to digital to analog to digital... why not send the data from your micro via CAN? Although you are right, setting udc and temphs over CAN does need a small firmware edit at present. udc and temphs and fix.
My GIT fu isn't that good but that looks like a good direction to go in. And that's not too much extra code to add / remove.
Could a change like that be made optional from the menu page or typed commands? and officially rolled into the next iteration of JHuebner's firmware as an optional input? I guess this might also make it easier to communicate with a BMS system which might be of interest to other builders.
I'd be much more interested in working from the original code because what I want to avoid is having to manually do the same edit each time JHuebner releases a new version of the firmware so I can keep up with the latest code.

There are two TJA1040 CAN transceivers and nice filters + protection (TDK ZJY5101 + Zener diodes) on the main board but it might not be worth the effort of hijacking them on such a densely populated double sided multilayer board.
P3150777.JPG
My end goal is to knock up a mini PCB with the bare essential features suitable for a motorbike / small vehicle that will be small enough to be stuck on top of the main PCB, patched into the IGBTs + auxiliary points + the serial signal and then the main capacitor replaced for compactness. One advantage for making it small would be powering it from the motherboard 5V supply plus the weird voltage rails for the Toyota current sensors are not needed freeing up a lot of board space used on the existing Toyota drop-in boards for power regulation and conversion.
User avatar
johu
Site Admin
Posts: 5685
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 154 times
Been thanked: 960 times
Contact:

Re: Honda IMA inverter hacking.

Post by johu »

USART4 RX might be available on PC11. "Might be" because I'm never sure which chip variant contains which peripherals.
On V3 mainboard this is connected to the ULN2003 so you'd have to break that connection to use it as an input instead.

Then patch the software to continously read UART4 in the "while(1)" loop in main. Unfortunately it is not connected to DMA.

EDIT:
I will sooner or later add more inverter dependent code anyway, in forms of reading the SPI ADC of the BMW i3 inverter. While at it I could add the variant of reading udc/tmphs from various sources: CAN, SPI, USART. Might just make it a selection on the "tmphs" dropdown.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Honda IMA inverter hacking.

Post by mjc506 »

Making it a drop down option would be nice, I need to study how the CANio works :) (if data is received over CAN, use it; else read from adc). Bah, another item on the to-do list :)

Or using the UART - that'd remove the need for the external micro entirely! Although perhaps too far from 'universal' to get into the 'official' code.
User avatar
Mouse
Posts: 138
Joined: Wed Sep 25, 2019 8:17 am
Location: Wales
Been thanked: 7 times
Contact:

Re: Honda IMA inverter hacking.

Post by Mouse »

johu wrote: Mon Mar 15, 2021 9:02 pm USART4 RX might be available on PC11. .....

EDIT:
I will sooner or later add more inverter dependent code anyway, in forms of reading the SPI ADC of the BMW i3 inverter. While at it I could add the variant of reading udc/tmphs from various sources: CAN, SPI, USART. Might just make it a selection on the "tmphs" dropdown.
That's really encouraging. Thanks for considering it.

A drop down menu option for generic serial or CAN input would be a useful feature for those making oddball systems.

mjc506 wrote: Tue Mar 16, 2021 12:19 am I need to study how the CANio works :)
I've been putting that off but I think the day has come to cross that bridge.
slociviccoupe
Posts: 33
Joined: Fri Mar 25, 2022 10:29 pm

Re: Honda IMA inverter hacking.

Post by slociviccoupe »

Just a thought. You do know the honda civic hybrid gen 1 has a dumb igbt. Feed it 5v logic signals on the phase high and low inputs. And it has a serial output for temp and few other things.
The 05-07 accord hybrid igbt is the same as just feed 5vdc to the phase inputs.
The accord hybrid has the largest ima motor and possibly asuming the ignt would be larger as well.
slociviccoupe
Posts: 33
Joined: Fri Mar 25, 2022 10:29 pm

Re: Honda IMA inverter hacking.

Post by slociviccoupe »

I would be interested in seing a mini main board hooked to a honda ima igbt and use the honda current sensors and the honda resolver to be able to control a honda ima motor. Would save me a lot of work trying to get a gen 3 prius inverter to run the honda ima motor.
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Honda IMA inverter hacking.

Post by mjc506 »

It'll even take 3.3v inputs :-) I've got a main board (the larger one) running a gen1 ima inverter quite happily. I need to get back onto that actually... too many projects!
slociviccoupe
Posts: 33
Joined: Fri Mar 25, 2022 10:29 pm

Re: Honda IMA inverter hacking.

Post by slociviccoupe »

What motor and care to share. I have a few of my own projects.
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Honda IMA inverter hacking.

Post by mjc506 »

viewtopic.php?f=11&t=1398 read and weep haha
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: Honda IMA inverter hacking.

Post by Romale »

I decided to run the Honda inverter together with the version 3 board. it is planned to control the prius gen2 md1 motor on a light car and a voltage of 130 volts. Do you think I should start a new topic or continue this one?
evil neodymium :twisted:
Post Reply