[FIRST DRIVE] Toyota Prius gen2 plug and play

Tell us about the project you do with the open inverter
turnip73
Posts: 34
Joined: Wed Dec 26, 2018 1:38 pm
Location: Greystones Ireland
Has thanked: 11 times
Been thanked: 14 times

Re: [FIRST DRIVE] Toyota Prius gen2 plug and play

Post by turnip73 »

hmm...
So while testing my updated stm32-car code, I've realized that the Toyota hybrid control ecu is not sending the can bus information I'm expecting because the ecu/car is not in ready mode.
I knew I would have to deal with this eventually but seems that time is now...
That leads me to two options:-
A) Spoof the inputs to the Toyota hybrid control ecu
B) Implement the functionality from the Toyota hybrid control ecu needed in stm32-car.

Spoof the inputs to the Toyota hybrid control ecu
1) resolver/inverter
2) contactor/precharge charge voltages
3) Toyota BMS

Implement the functionality from the Toyota hybrid control ecu needed in stm32-car.
1) shift leaver
2) key authentication
3) A/C control
4) All the other stuff I don't know I need yet...

I'll start with spoofing resolver/inverter. I've had a go at this in the past, but not successful
see [viewtopic.php?p=44241#p44241]. To trick the Toyota hybrid control ecu to stay in ready mode and drive, it has to get feed back from current sensors and/or resolver.
I've seen in [ Latula EV test his SDU card using a signal generator

I think my options are
I) By any chance is the Toyota hybrid control ecu sending any information over CAN that Open Inverter ecu can use as resolver information to drive the motor
II) Can Open Inverter ecu hw/sw be modified to use the resolver information generated by the Toyota hybrid control ecu
III) Update Open Inverter ecu to create spoof resolver information for the Toyota hybrid control ecu

Attached Toyota resolver information
Attachments
resolver2.GIF
turnip73
Posts: 34
Joined: Wed Dec 26, 2018 1:38 pm
Location: Greystones Ireland
Has thanked: 11 times
Been thanked: 14 times

Re: [FIRST DRIVE] Toyota Prius gen2 plug and play

Post by turnip73 »

I) By any chance is the Toyota hybrid control ecu sending any information over CAN that Open Inverter ecu can use as resolver information to drive the motor
no

OK, so this is the plan...
First attempt:
Use external excitation from Toyota VH ecu in OI
IO excitation is 9v peek to peek and 4.4 kHz
IOResolverExciter3_01.png
Toyota excitation is 20v peek to peek 10 kHz.
ToyotaResoverExciter.png
Plan is:-
HW:
1) Get Toyota excitation and resolver output down to ~3v peek to peek.
2) Get Toyota excitation in to stm32 (can I use "START" PB6/TIM4_CH1 see [https://github.com/jsphuebner/inverter- ... 2-v1.0.pdf])

SW:
1) Set OI excitation to 10 kHz (can this be done?)
2) Get Toyota excitation edge
2) Compare Toyota and OI excitation edge and add/subtract to resolverSampleDelay [https://github.com/jsphuebner/stm32-sin ... ncoder.cpp]?

20231120 updates removed OI resolver pico scope output (this was old data not OI resolver), both resolver output are kHz.
20231121 got an OI resolver pico scope output confirmed 9v peek to peek
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: [FIRST DRIVE] Toyota Prius gen2 plug and play

Post by Ev8 »

Wow I would imagine trying to keep the oem hv ecu happy while driving with the inverter controlled by OI would be a massive task possibly requiring generating appropriate current and motor position signals possibly proportional to the pwm of the phase driver outputs from the hv ecu, I suspect a fixed set of values would cause errors,

I’m starting to think that taking over contactor contol ect and cutting the hv ecu out of the equation is going to be an easier route,

On a separate note, I’d really appreciate a capture of the a/c comms,
turnip73
Posts: 34
Joined: Wed Dec 26, 2018 1:38 pm
Location: Greystones Ireland
Has thanked: 11 times
Been thanked: 14 times

Re: [FIRST DRIVE] Toyota Prius gen2 plug and play

Post by turnip73 »

Ev8 wrote: Sat Nov 18, 2023 8:24 am Wow I would imagine trying to keep the oem hv ecu happy while driving with the inverter controlled by OI would be a massive task possibly requiring generating appropriate current and motor position signals possibly proportional to the pwm of the phase driver outputs from the hv ecu, I suspect a fixed set of values would cause errors,

I’m starting to think that taking over contactor contol ect and cutting the hv ecu out of the equation is going to be an easier route,

On a separate note, I’d really appreciate a capture of the a/c comms,
See my options/resoing in post above. Car runs and drives with the hv ecu out of the equation but I ran into probelms to integrate OI with rest of car when not in ready mode e.g hv ecu happy. In the past I've been able to run OI sin software open loop with oem hv ecu connected.

Re a/c comms I hope to try johu's idea to use the a/c as changer unmodifed (maybe making sure the gates are permanently low achieves the same)
johu wrote: Tue Sep 05, 2023 7:30 am Yes much agreed. I modded the inverter and controller quite heavily to be able to charge reliably. Of course a controller can't take all of that away but it can be facilitated.

Mods for single phase boost charging:
- Swapped input and output of the buck/boost stage
- Removed 4 IGBTs of the A/C inverter and replaced them with a bridge rectifier (maybe making sure the gates are permanently low achieves the same)
- Fitted a current sensor to the cable going from said A/C inverter into the input of the boost converter to be able to measure charge current
- Disabling that current sensor with a relay while NOT charging
- Connected GSDN to the DC switch signal


It's the Hilux of inverters, virtually invincible unless I start mucking around with it ;)
turnip73
Posts: 34
Joined: Wed Dec 26, 2018 1:38 pm
Location: Greystones Ireland
Has thanked: 11 times
Been thanked: 14 times

Re: [FIRST DRIVE] Toyota Prius gen2 plug and play

Post by turnip73 »

turnip73 wrote: Fri Nov 17, 2023 9:10 pm 1) Set OI excitation to 10 kHz (can this be done?)
No luck so far changing the OI resolver excitation frequency.
If I comment out line:
https://github.com/jsphuebner/stm32-sin ... r.cpp#L471

Code: Select all

      gpio_set_mode(NORTH_EXC_PORT, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, NORTH_EXC_PIN);
there is no resolver excitation.
My assumption was that the interrupt frequency that sets the resolver excitation frequency was set some where above in the InitResolverMode function but I haven't figure it out yet.
User avatar
johu
Site Admin
Posts: 5790
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 times
Contact:

Re: [FIRST DRIVE] Toyota Prius gen2 plug and play

Post by johu »

Changing the excitation frequency is hard as it is indeed half the interrupt frequency of 8.8 kHz.
Not sure what you're trying to achieve on a higher level but if you want only excitation disabled you can switch to SinCos mode
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
turnip73
Posts: 34
Joined: Wed Dec 26, 2018 1:38 pm
Location: Greystones Ireland
Has thanked: 11 times
Been thanked: 14 times

Re: [FIRST DRIVE] Toyota Prius gen2 plug and play

Post by turnip73 »

johu wrote: Sat Dec 09, 2023 10:26 pm Not sure what you're trying to achieve on a higher level but if you want only excitation disabled you can switch to SinCos mode
I want to use an external resolver exciter from the Toyota HV ECU so both Toyota HV ECU and OI can use the resolver.
Post Reply