Toyota Prius Gen 2 Inverter Controller

Topics concerning the Toyota and Lexus inverter drop in boards
Post Reply
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Toyota Prius Gen 2 Inverter Controller

Post by arber333 »

Jack Bauer wrote: Wed Jan 22, 2020 7:40 am Just where does this stop? I designed a board to run the Gen 2 inverter. It's through hole for easy soldering. It uses a cheap bluepill board for the mcu. I built it. I tested it. I made video of it running. I uploaded the complete design to Github. I sell the bare boards almost at cost. A programmed bluepill and wifi are available from Johannes. Youtube is full of videos about how to use an st-link to program a bluepill. If the community can't get behind something as simple as this and make it work there is nothing more that I can do. Sure, I could make an SMD version and get JLC to build it. But why does it always have to be me? This stuff is not rocket science. Don't have the skills to do that? Go on Fiverr and pay a guy 50 bucks : https://www.fiverr.com/

I really am losing the will to continue at this...
I am sorry JB i didnt mean to imply your design is not good. I have tested ONE Bluepill chip directly on its pins and i couldnt get Wifi to work with D1. I too have limited time and i am used to a certain way of testing, so i didnt pursue it further. It is just my way of helping people not to loose faith in DIY.
Like you i dont want to get hung on something that was already figured before... have to test the limits, go beyond where no one has gone before.... 8-). Well maybe Toyota engineers have been there before. Bang! :twisted: LOS!
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by MattsAwesomeStuff »

Jack Bauer wrote: Wed Jan 22, 2020 7:40 amIf the community can't get behind something as simple as this and make it work there is nothing more that I can do. Sure, I could make an SMD version and get JLC to build it. But why does it always have to be me?
It doesn't. And it shouldn't.

That's exactly why I've never messaged you or complained about you. Because you've done more than enough. I wouldn't even have started this without the work you did. I would've abandoned using an AC motor and gone looking for an old DC one.

It's why I've never called out anyone else specific either. I'm not entitled to anyone's help. It was made clear at the start, this is not a finished product, this is not an easy project.

I am attempting to set a good example by contributing as much as I can, in the ways that I can. I have spare time and effort, but lack competence.
This stuff is not rocket science.
Perhaps, but it is by observation, beyond my ability. I don't know why I'm currently stuck, but I'm stuck. I don't know why it's taken me a couple months to follow directions, but it has. I assure everyone I am not deliberately sabotaging my own success for pedantry's sake.

I think the people in the community who can figure this out for themselves are mostly here, and number perhaps in the dozens. And that currently excludes me. If that is the ceiling of this project's efforts, that's okay.

If I can, I aim to be part of bridging things so that a thousand people can follow lower level instructions and find it within their ability.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Toyota Prius Gen 2 Inverter Controller

Post by arber333 »

Lets be clear about something MattsAwesomeStuff, at my first unsuccessful attempts with DIY inverter i was angry at myself and at Johannes because of reversed transistor pinout and about test protocol blowing my IGBT stuff and especialy about unprotected drivers... But i realized then and there not many people have done what he and JB have done. That was some (b)leeding edge Magellan work at DIY!
So i directed my anger at learning myself to draw PCBs and made myself a protected driver board, a design which is standard for all automotive inverters. You guys who are now dealing with Toyota, Volt and Leaf stuff do not even realize how much design knowledge you are spared from because of this. And of course ton of $$$.
Be patient, like i said lots of times, DIY will save you $$$, but will balance that by time spent studiying plans and figuring out application.

My 5c...
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Toyota Prius Gen 2 Inverter Controller

Post by arber333 »

JB or others,

how are PWM outputs used on Gen2. The way it looks from schematic the HIGH side is commanded by active signal to NPN transistors pulling LOW gate signals on Prius driver board. Is that correct?
Now what happens to the LOW side signals? This means that if there is no other signal the LOW side is active all the time? Quite ingenious since that would eliminate shootthrough.

I need that info to prepare my version of Rev2 board...
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by Dilbert »

Yes that's how the GEN2 inverter works, we only need to control the 3 high side switches in the inverter. To turn on the high side switch we pull the input low, when we release the input the high side switch will turn off and the complementary low side switch will turn on automatically. The logic inside the gen2 inverter takes care of the deadband between the high and low side switches etc..

So with the GEN2 the blue pill will only output the 3 high side PWMs.
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by MattsAwesomeStuff »

arber333 wrote: Wed Jan 22, 2020 12:18 pmThat was some (b)leeding edge Magellan work at DIY! So i directed my anger at learning myself
To be clear, I'm not angry at anyone for anything. No one said "You will succeed if you do this". They said "I've put time into doing this even though I'm not using it, and it seems to work for me. You're welcome to copy it and try. I'll even sell you boards for it near cost."

Towards myself, I feel a bit like I jumped the gun and bit off a bit more than I could chew, and maybe like I picked the wrong horse considering my capabilities, but that's fine. Either way I wanted to get working on something, and if I screwed up through-hole parts I would've butchered the SMD Gen3 even more.

I think if this was 2 years ago when you were doing this, my solution would have been to not even attempt AC and try to find a DC motor instead.
You guys who are now dealing with Toyota, Volt and Leaf stuff do not even realize how much design knowledge you are spared from because of this.
I think you're probably not just right, you're right about me not being able to realize how much harder it could be.

Again, I'm not upset, I'm just stuck and I'm not sure what to try next other than just re-ordering and starting over. But the Gen3 boards with the onboard hardware to control charging seem so promising that I might end up going that way if I'm just starting over. Kiwifiat mentioned he's got some D1's on the way and he's going to be trying the Blue Pill/D1 combo just in case that's the problem, but, if that doesn't bear fruit I'm stumped.

...

Anyway, I think people have focused too much on the negative. My point on the Gen3's was... since I can't think of any way to put effort in to make my Gen2 work, and Damien just posted the availability of the Gen3s v2s, I'm going to use my spare time to try to help out with the documentation on that too. So I seeded the wiki and started asking questions that I have and that I think others would have if they ordered one.
User avatar
konstantin8818
Posts: 287
Joined: Sun Jan 19, 2020 2:33 pm
Location: Minsk, Belarus
Been thanked: 5 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by konstantin8818 »

As I'm not an elecrtinics enginer I've got few questions according to Damien's board and preprogrammed blue pill:
For prius PMSM incremental encoder is "no go". It need absolut encoder or resolver. Can this board handle absolut encoder or it is not designed for PMSM?
kiwifiat
Posts: 99
Joined: Sat Dec 22, 2018 9:39 pm
Location: Vancouver, Canada
Been thanked: 10 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by kiwifiat »

MattsAwesomeStuff wrote: Thu Jan 23, 2020 2:44 am
Kiwifiat mentioned he's got some D1's on the way and he's going to be trying the Blue Pill/D1 combo just in case that's the problem, but, if that doesn't bear fruit I'm stumped.
Ok , so my WeMos D1 mini's turned up yesterday and today I had a go at installing both the Huebner web interface and Dima's version. First I flashed a bluepill with https://github.com/jsphuebner/stm32-sin ... 32_foc.hex and a cheap STLink.

Greeted with a flashing green heartbeat from the onboard led I connected a usb -> ttl adapter to the bluepill using this image as a guide:

download/file.php?id=950&mode=view

Having confirmed that I was able to communicate with the bulepill via a serial console I then proceeded to setup the Arduino IDE for use with ESP8266's using Arber's guide earlier in this thread. After flashing the sketch and web data to the D1 mini I was able to connect to the open wifi and the set the access point name to openinverter and set a password. The next step was wiring the serial connections between the bluepill and the D1 mini, again per the posted image from the "Johannes in a Blue Pill" thread. Reconnecting to the D1 mini using the SSID and password I was able to point my web browser to 192.168.4.1 and Johannes web page appears and is fully functional.

Next I tried Dima's web interface using the esptool.py method and the bin file from Dima's github labled for the wemos board. Although the tool reported flashing both the sketch and the spiffs I could not see any wifi instance show up on my computer so that was a fail. Not to be defeated I then tried using the over the air tool espota.py which again reported success but sadly no wifi to connect to. As a last ditch effort I tried again using the bin file ment for the Olimex board and that worked. I have no idea why the wemos bin file doesn't work, possibly I have the memory allocation set wrong as a hangover from the arduino ide configuration. Possibly Dima could chime in?

In any case the bluepill and wemos d1 is a working solution and Damien's Gen2 board and the last bluepill firmware with resolver support will run a PMSM provided you breadboard together the resolver circuitry as Johannes did in one of his YouTube videos. I would suggest using the circuitry from the latest version of openinverter but it is pretty simple and should not represent much of a challenge to an electronics hobbyist.

So a few questions for Matt:
Do you have a heartbeat on your bluepill?
Do you have a common earth between the D1 mini and the Bluepill?
How are you powering both devices?
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Toyota Prius Gen 2 Inverter Controller

Post by arber333 »

Well thank you sir!
I focused so much on wifi gizmo that I forgot to check the Linux interface. So you get info from wifi interface? How about if you provide 3v to brake pin and other active input pins? Change of state you can see in the interface if you refresh.

Tnx
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by MattsAwesomeStuff »

kiwifiat wrote: Sat Jan 25, 2020 2:05 amSo a few questions for Matt:
Do you have a heartbeat on your bluepill?
What are we defining as a heartbeat?

When I connect 12v and GND to my power supply, I get a red and a green light that stay on. If I hit the reset button the blue pill, the green light turns off while I'm pushing the button.
Do you have a common earth between the D1 mini and the Bluepill?
I believe so.

I have used the UART terminals on the Control Board where Johannes' wifi board normally plugs in. I'm using GND, 3.3v, RX, and TX. So, if the D1 is getting it's power from the Control Board, yes.

When I tap the reset button on the D1, a blue led blips on the D1.

I can connect to the wifi and load the web interface, but it doesn't show any parameters like I see on other people's screenshots. So the D1 is presumably working.
How are you powering both devices?
I'm powering the control board via a variable bench supply. I'm giving it 13.8v as a lead-acid battery would have. The D1 gets 3.3v power from the pins typically connected to the Olimex wifi board.

...

Other than being powered, I can't tell that the Blue Pill is in any way operational. I do not have a UART-anything other than the D1 which I connect to over wifi.

You mention you connected via serial and it responded to commands. Are there any commands that can indicate to me that it received them?

Thanks for your help.
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1025 times
Contact:

Re: Toyota Prius Gen 2 Inverter Controller

Post by johu »

One LED (typically green) has to flash in 100ms cycles. Before that isn't happening no need to go further. Re-check your flash procedure.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
SciroccoEV
Posts: 369
Joined: Thu Oct 10, 2019 1:50 pm
Location: Luton UK
Been thanked: 15 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by SciroccoEV »

My Blue Pill arrived with 'blinky' code already on it, so perhaps a double blink to show the code is running?

I apparently had no problems using a generic STLink clone to flash the code, but it's still sitting on a breadboard waiting for me to hook up an interface to see if the code is actually running.
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by MattsAwesomeStuff »

johu wrote: Sat Jan 25, 2020 3:41 pm One LED (typically green) has to flash in 100ms cycles. Before that isn't happening no need to go further. Re-check your flash procedure.
When I plug in my Blue Pill to the ST-LInk, it also has both lights stay on.

I just ran ST-LINK on it again, this is what it shows:

Image

However, both LEDs are on solid, ditto from when I remove it from ST-LINK and power the Prius Control Board from 12v. No changes.
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1025 times
Contact:

Re: Toyota Prius Gen 2 Inverter Controller

Post by johu »

Can you scroll up? Did you flash stm32_loader.hex
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Toyota Prius Gen 2 Inverter Controller

Post by arber333 »

johu wrote: Sat Jan 25, 2020 7:12 pm Can you scroll up? Did you flash stm32_loader.hex
Yeah..... i forgot to stress that in the instructions. With STlink utility you use hex files to programm the chip. Sorry.
You can use .bin files with phone utility though.

A
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by MattsAwesomeStuff »

johu wrote: Sat Jan 25, 2020 7:12 pm Can you scroll up? Did you flash stm32_loader.hex
Me?

No.

I followed these instructions (up until he starts doing his own stuff with what he flashed):



And then I looked through this folder:

https://github.com/jsphuebner/stm32-sin ... ag/v4.64.R

And the only thing I downloaded and flashed was the STM32_sine.hex file.

...

Did I skip steps?
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 Prius Gen 2 Inverter Controller

Post by Jack Bauer »

Here is an excerpt of a guide I made some years back on programming the Tesla boards. Its a bit dated but might clear the air. If not I'll make a video tomorrow.

Firstly, you will need an STLink USB programmer like this one :
https://www.aliexpress.com/item/FREE-SH ... STM8STM32-
STLINK-simulator-download-programming-With-Cover/1810358353.html?
And you will need the free STLink software :
http://www.st.com/en/development-tools/st-link-v2.html
Download and install the USB driver first :
http://www.st.com/content/st_com/en/pro ... menttools/
stm32-software-development-tools/stm32-utilities/stsw-link009.html
Then the STLink programming utility :
http://www.st.com/content/st_com/en/pro ... menttools/
stm32-software-development-tools/stm32-programmers/stsw-link004.html
Connect the stlink dongle to the jtag header with 4 leads. +3v3 , GND, SWCLK and
SWDAT.
...and plug the usb into your PC.
Open the STLink programming utility and click the “Connect to the Target” Icon.
Click binary file and load stm32_loader.hex Program this with the "Skip Erase Flash" box
unticked .
Now load stm32_sine_.hex with the "Skip Erase Flash" box ticked.
The LED should start flashing after the program has finished loading and away you go.
I'm going to need a hacksaw
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by MattsAwesomeStuff »

Click binary file and load stm32_loader.hex Program this with the "Skip Erase Flash" box
unticked .
It appears I did miss a step this whole time.

I didn't find a STM32_loader.hex program. Who wrote/where do I get that?
Stephen Darbey
Posts: 76
Joined: Tue Jan 15, 2019 10:49 pm
Location: Ireland
Been thanked: 2 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by Stephen Darbey »

Finding this thread very informative and interesting, so much on friday was passing a scrappy I frequent and called in. Foe some reason I see these places as most people see libraries. Yes, you guessed it. He had a Gen2 not in the least pricey. Will check to see if there are any pcbs on evbmw.
Should this work out, and I see no reason why not, it will be the cheapest of all set ups.
I just gave myself another project.

Apart from increasing my knowledge what can possibly go wrong ?
Attachments
20200125_160247.jpg
20200125_160315.jpg
SDev
Alexstarex
Posts: 28
Joined: Mon Jan 13, 2020 1:53 pm
Location: Russia

Re: Toyota Prius Gen 2 Inverter Controller

Post by Alexstarex »

in the picture is 1st generation. Need an inverter 2 generation
User avatar
SciroccoEV
Posts: 369
Joined: Thu Oct 10, 2019 1:50 pm
Location: Luton UK
Been thanked: 15 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by SciroccoEV »

I was under the impression that anything bearing the 'Hybrid Synergy Drive' badge was Gen-2.
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by MattsAwesomeStuff »

AH HA!

Great success!

For those following along at home, if you go to the Downloads here: https://openinverter.org/docs/index.htm ... ds,14.html

And go to the Boot Loader folder, you can find the STM32_Loader.hex file.

Flash that first, then flash the STM32_sine.hex next.

Of note, Damien's exact instructions didn't work for me. He says when you do the second programming file, the sine wave file, to select the "Skip Erase Flash" box, but if I did that it gave me errors. It seems to have worked with it left unticked both times.

I'm now getting pages and pages of parameters on the landing page. Hurray!

...

Tangential issue: Did I miss instructions, or are they not there to follow?

I.E. If I'm just dumb, carry on. If the instructions aren't there to find, can I help write them or make them more accessible?

...

Next up, umm, I guess back to trying to get a motor spinning. Yay!
User avatar
sfk
Posts: 289
Joined: Mon Jan 14, 2019 8:29 pm
Location: Wellington, NZ
Has thanked: 2 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by sfk »

You have a lot of perseverance. Keep it up 👍
-< Mazda Eunos JC Cosmo rotary -> EV conversion w/ Lexus GS450H gear >-
Igor
Posts: 32
Joined: Wed Jul 17, 2019 5:55 am
Location: Wellington, NZ
Has thanked: 6 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by Igor »

👍
kiwifiat
Posts: 99
Joined: Sat Dec 22, 2018 9:39 pm
Location: Vancouver, Canada
Been thanked: 10 times

Re: Toyota Prius Gen 2 Inverter Controller

Post by kiwifiat »

MattsAwesomeStuff wrote: Sat Jan 25, 2020 11:15 am Other than being powered, I can't tell that the Blue Pill is in any way operational. I do not have a UART-anything other than the D1 which I connect to over wifi.

You mention you connected via serial and it responded to commands. Are there any commands that can indicate to me that it received them?

Thanks for your help.
Glad you got it working.

As you have discovered when the firmware is correctly flashed the onboard led flashes on and off at 100ms intervals. Once you get to that point you can test the serial communications using the "get" and "set" commands as outlined in the "Parameter" section of the main openinverter.org page or https://openinverter.org/wiki/Schematic ... structions using a USB -> TTL adaptor making sure you set the communications parameters correctly to 115200 8N2, note the 2 stop bits. It is possible to use the D1 mini as a serial console via the arduino IDE but I guess if all goes as it should it is an unnecessary step.
Post Reply