Prius Gen3 Inverter Hacking

Topics concerning the Toyota and Lexus inverter drop in boards
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Toyota / Lexus useful bits

Post by Dilbert »

Ok I’ve made up a logger to capture the data, will be the weekend before I can connect it up.

Interesting the avr usart supports sync mode, so we could drive one of these from an arduino. I used a Leonardo for the logger, so I have the usb to push the data to a PC nice and fast. It can decode the gs450 data coming from the due correctly so should work on the car.
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: Toyota / Lexus useful bits

Post by Jack Bauer »

Great news. Will be very interesting to see.
I'm going to need a hacksaw
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Toyota / Lexus useful bits

Post by Dilbert »

I got the logger onto the car this evening, kinda hard to back probe the connectors on the inverter. I found that if i cut down some arduino stacking headers i could connect to both the + and the - line, so i done that for the clock, TX and RX pins.

I'm still processing the data, but the good news it looks like the Auris/Prius variants also TX 100 bytes of data back to the hybrid control unit. I've run a script on the data and all the checksums look good. I will dig a little deeper into this tomorrow, but so far so good. I've gathered quite a bit of data, but have just included the first few lines here.

I will look at the data going into the inverter now.
Attachments
inverter tx data 9_1_2020.txt
(2.37 KiB) Downloaded 160 times
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: Toyota / Lexus useful bits

Post by Jack Bauer »

Fantastic work. This could end up as the gs450h for front wheel drive systems.
I'm going to need a hacksaw
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Toyota / Lexus useful bits

Post by Dilbert »

I tried looking at the RX data going to the inverter, it does seem to repeat, but I haven't been able to make sense of it. I think in the dark I might have flipped the CAN+ and CAN- lines, hence I haven't been able to decode it and verify the checksums for the Rx data.

I'm happy with the Tx data captured, from my brief look some aspects might be slightly different to the GS450 data packet, but it needs further work.

What i plan to do is pop out the glove box as see is it easier to connect at the hybrid ECU end of that cable. I can then connect in my CAT5 cable/plug so can i do some proper logging.

I'm debating putting an AND gate into my logger so i can AND the RX lines from the CAN transceivers to log both sides of the conversation at the same time. I could probably do it with two diodes and a pull-up resistor also.
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Toyota / Lexus useful bits

Post by Dilbert »

I ended up running a nice long CAT5 cable into the house so i could look at the data coming off the car in comfort. I also got my logic analiser out of storage. Both proved to be quite useful.

HTM data = 100 bytes (not 80)
MTH data = 120 bytes (not 100) (atleast 30 bytes near the end are all zero's)

HTM always starts with 001E
MTH always starts with 000C

The frames are overlapped, see attached capture from the scope.

I've saved the raw capture from the analyser as a wfm file, does anyone know good software to read this format? i believe it is an old tek format?
Attachments
inverter tx (orange mth) data 12-1-2020.txt
(260.3 KiB) Downloaded 112 times
inverter rx (blue htm) data 9_1_2020.txt
(2.37 KiB) Downloaded 111 times
start byte.png
start byte.png (3.99 KiB) Viewed 3887 times
inverter comms.png
inverter comms.png (3.66 KiB) Viewed 3887 times
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: Toyota / Lexus useful bits

Post by Jack Bauer »

Very interesting. I'll see if I can rig up a Gen 3 prius inverter and transaxle on the bench. Might be useful for finding things like motor rpm and direction etc. If it behaves like the lexus and doesnt care about bus voltages etc then this could be a big game changer.
I'm going to need a hacksaw
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Toyota / Lexus useful bits

Post by Dilbert »

I've transfered the data into excel and started looking at trying to decode it.

It is interesting that both frames are +20 bytes from the lexus design. My next step will be to log both sides of the data when the vehicle is moving in EV mode, then compare it to the baseline data.

Yes if you could hook up one on the bench, you could turn MG1 and MG2 by hand and extract some of the values that way, from the MTH data frame. I guess you could inject in the HTM frame i've grabbed from mine and see the inverter give back a MTH frame. I need to get the REQ signal also logged, so far i've been able to decode the data without this signal, but if we are going to re-produce it we should know the timing.
Attachments
inverter tx (orange mth) data 12-1-2020.csv
(389.91 KiB) Downloaded 101 times
inverter rx (blue htm) data 9_1_2020.csv
(3.54 KiB) Downloaded 114 times
User avatar
Aquinax
Posts: 23
Joined: Mon Apr 22, 2019 6:16 am
Location: 59.410446,56.776937

Re: Prius Gen3 Inverter Hacking

Post by Aquinax »

martii wrote: Sun Jan 05, 2020 9:42 pm It looks like Damien is too busy to update github at the moment :(
I don’t understand anything, the repositories increased from 34x to 37x, but I do not see new ones ...
User avatar
Mouse
Posts: 138
Joined: Wed Sep 25, 2019 8:17 am
Location: Wales
Been thanked: 7 times
Contact:

Re: Prius Gen3 Inverter Hacking

Post by Mouse »

Aquinax wrote: Mon Jan 13, 2020 8:28 pm I do not see new ones ...
Maybe it's there but not publicly visible at the moment?
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Prius Gen3 Inverter Hacking

Post by Kevin Sharpe »

Mouse wrote: Mon Jan 13, 2020 8:42 pm
Aquinax wrote: Mon Jan 13, 2020 8:28 pm I do not see new ones ...
Maybe it's there but not publicly visible at the moment?
different thread (here) but the answer is the same I'm sure...
Jack Bauer wrote: Fri Jan 10, 2020 2:39 pm Yes all will be shared once the boards are received and tested.
What would be the point in releasing completely untested board designs to GitHub when in the next week or so we'll know whether the new designs work?
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
User avatar
Aquinax
Posts: 23
Joined: Mon Apr 22, 2019 6:16 am
Location: 59.410446,56.776937

Re: Prius Gen3 Inverter Hacking

Post by Aquinax »

Aquinax wrote: Sat Apr 27, 2019 1:10 pm Image
I hope the solution not only of my alternative problem will be in the repo
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Toyota / Lexus useful bits

Post by Dilbert »

Captured some data moving back and forth on MG2 only. So far i've only managed to pull the DC bus voltage out of the MTH frame, as it seems to be in the same position as the lexus one.
Attachments
mth drive split.xlsx
(7.14 MiB) Downloaded 141 times
htm drive split.xlsx
(5.44 MiB) Downloaded 137 times
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Prius Gen3 Inverter Hacking

Post by arber333 »

Yes i also just redrilled my board, there is enough space under the current sensors to fit the boards.
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: Prius Gen3 Inverter Hacking

Post by Jack Bauer »

For those desperately scouring github for the new designs (which by the way must include the JLC bom and cpl files I'm told) and contacting me in every conceivable way since the last video here is an idea. If I've been stupid enough to opensource everything I've done with electric vehicles over the last decade what makes you think I'd stop now? Let's imagine the scenario where I did release all the files straight away. JLC would be happy campers as everyone and his dog would be uploading gerbers and placing orders. Fast forward 10 days or so and to my horror I realise I made an error on the board!!!! Not exactly unprecedented I might add. All those wounded souls who might have to cut a track or swap out an smd part would be on here screaming for me to be strung up from the nearest fast charger. Not a pritty picture is it?

Soooo why not let me do these things with my money and time and effort so you don't have to?Then you can safely ignore the bloated prices on my webshop and place your own orders. Sound ok? BTW the boards shipped from JLC yesterday so won't be long now.
I'm going to need a hacksaw
User avatar
Aquinax
Posts: 23
Joined: Mon Apr 22, 2019 6:16 am
Location: 59.410446,56.776937

Re: Prius Gen3 Inverter Hacking

Post by Aquinax »

Yeah but how do I know that you didn’t get rolled up, already got prototypes and are not in a hurry with implementation? ;)
I think everyone is unbearable and cant wait
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Prius Gen3 Inverter Hacking

Post by Kevin Sharpe »

Aquinax wrote: Tue Jan 14, 2020 8:21 am I think everyone is unbearable and cant wait
Isn't that the truth ;)
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Toyota / Lexus useful bits

Post by Dilbert »

I wrote some excel macros to help extract and plot the data. I think that the MG2 torque is in the same position as the lexus GS450, which is good news. The graph below shows the car going forward and back in the driveway very slowly.

Does the toque value of 300 seem in the right ball park?

I think there's a couple of rows of bad data in my log file, hence there are a few glitches.
Attachments
MG2.PNG
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Prius Gen3 Inverter Hacking

Post by Dilbert »

I was wondering to people think this would be a better thread to document the reverse engineering of the Gen3 Prius / Auris Inverter? We could get a mod to move over the posts from the other thread.
MattsAwesomeStuff
Posts: 874
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 280 times
Been thanked: 165 times

Re: Prius Gen3 Inverter Hacking

Post by MattsAwesomeStuff »

Dilbert wrote: Tue Jan 14, 2020 4:55 pm I was wondering to people think this would be a better thread to document the reverse engineering of the Gen3 Prius / Auris Inverter? We could get a mod to move over the posts from the other thread.
Yeah, the "Toyota Useful Bits" thread is more about what to salvage or plan to salvage off of a junker. This thread seems more suitable to be posting datalogs of CAN sniffing like you're up to.
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: Toyota / Lexus useful bits

Post by Jack Bauer »

Yeah 300 for slow moving would be about right. I'll see if I can migrate these posts over to the hacking thread.
I'm going to need a hacksaw
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: Prius Gen3 Inverter Hacking

Post by Jack Bauer »

I think the move worked.
I'm going to need a hacksaw
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Prius Gen3 Inverter Hacking

Post by Dilbert »

Yes, that worked perfectly thanks.

I'm starting to wonder why they need to send down so many bytes to control 2 motors. I can see with the frame coming back they probably got carried away with debug data. I will capture an engine start cycle to see if MG1 torque is in the same place.

It's also interesting that one data frame doesn't complete fully before the other one starts coming back out. We might have to consider using interrupts for the incoming data, so nothing gets lost. It also means we might not know if we are communicating properly until we have everything set up on the bench.

I'm planning to source a gen 3 prius/auris inverter and connect it up to the transaxle I have.
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: Prius Gen3 Inverter Hacking

Post by Jack Bauer »

First batch of prototypes have arrived from JLCPCB. Initial observation is that this is top tier board building. As good as anything I have ever seen in my career and better than anything local who have charged a hell of a lot more.

I'd like to appeal for some calm in relation to the whole JLC build. I won't be responding to anymore "DAMIEN! WHEN ARE YOU RELEASING THE JLC BOM AND PLACEMENT FILES!" type of emails or messages on here or otherwise. The boards will be tested. Errors if found corrected. Webshop and github will then be updated and videos made. The vast majority of people are great and appreciate the effort involved but some seem to think I'm their personal design engineer. Newsflash! I'm not.

Now in relation to the webshop we'll be making a few changes. There will be three tiers of board available to buy :

1) Board direct from JLC as I receive them with listed smt placed, unprogrammed and untested. This will replace the bare boards currently on sale.
2) Board direct from JLC as I receive them with listed smt placed, programmed but untested. This gets around the need for programming the micros.
3) Board with all components both listed smt and non listed smt and through hole placed, programmed and tested.
Attachments
2020-01-17 15.00.48.jpg
2020-01-17 15.00.54.jpg
2020-01-17 14.50.48.jpg
I'm going to need a hacksaw
User avatar
Aquinax
Posts: 23
Joined: Mon Apr 22, 2019 6:16 am
Location: 59.410446,56.776937

Re: Prius Gen3 Inverter Hacking

Post by Aquinax »

Damn, I want it.shut up and take my money! How much by the way?

* I was drunk and excited
Post Reply