Prius Gen 3 Dual Motor Logic Board Support Thread

Topics concerning the Toyota and Lexus inverter drop in boards
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by johu »

zilion wrote: Wed Feb 10, 2021 3:41 pm example: Why you have to connect wireless interface independently?
You may like this: viewtopic.php?f=5&t=1166
zilion wrote: Wed Feb 10, 2021 3:41 pmexample: Why there are used two types of micro-controllers? You can do all with STM32.
Indeed, maybe even enough pins left on the "slave" (whats the new word for this?) STM32 to have it handle the buck/boost
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by mdrobnak »

johu wrote: Wed Feb 10, 2021 4:26 pm Indeed, maybe even enough pins left on the "slave" (whats the new word for this?) STM32 to have it handle the buck/boost
I tend to use primary and secondary. Or maybe main and ancillary.

-Matt
User avatar
zilion
Posts: 58
Joined: Tue Feb 02, 2021 7:50 am
Location: Poland

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by zilion »

Johannes, I like your way of thinking, but I don't like this modules and idea of serving http on chip, because you will always need some computer-like machine to view and analyze this data. Now it's like a printer :D

So my idea is to connect BT device and write editor on specific system (Win/Linux/Android and maybe Mac). BT will work as a wireless UART.

And no, there are not enough pins left to reduce to two STM's.

Well, I will create new topic with my modifications and progress.
I smell lithium in the air. It's not lithium, it's glycolium.
User avatar
zilion
Posts: 58
Joined: Tue Feb 02, 2021 7:50 am
Location: Poland

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by zilion »

Someone can explain to me what is the purpose of this RC elements in Resolver Exciter. Or point me to a topic where it was discussed/explained?

It's seams to be copied over and over, but I don't understand why :)
Thx.
Attachments
Resolver_exciter_RC_elements.jpg
I smell lithium in the air. It's not lithium, it's glycolium.
User avatar
zilion
Posts: 58
Joined: Tue Feb 02, 2021 7:50 am
Location: Poland

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by zilion »

I will answer to myself with this: https://www.youtube.com/watch?v=g3xFK8xJOHU
It's hard to find this on this forum. Maybe it was on the old one.
I smell lithium in the air. It's not lithium, it's glycolium.
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 Gen 3 Dual Motor Logic Board Support Thread

Post by Jack Bauer »

Its a 3 stage RC filter to convert square wave from the stm32 to sine wave for resolver excitation.
I'm going to need a hacksaw
User avatar
Abricosvw
Posts: 8
Joined: Sun Dec 13, 2020 2:06 am

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by Abricosvw »

hi
i am trying to setup the second motor (MG1 out put) resolver is not connected yet
motor generator gm eAssist hybrid
mqdefault.jpg
mqdefault.jpg (9.7 KiB) Viewed 6915 times
101_IND_All_Chevy_white.jpg


as I understand it, the software should recognize itself MG1,MG2 ...
but I have ( hwver REV2 ) in MG1 maybe that's why everything conflicts and does not want to work ???


the settings of CANl bus do not want to be saved


I will be grateful for any advice or direction!!!
thanks
Yahha777
Posts: 52
Joined: Wed Feb 27, 2019 7:03 am
Location: Belorussia. Borisov
Has thanked: 15 times
Been thanked: 1 time
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by Yahha777 »

I experimented with two Leaf inverters with Johannes boards version 3. On the Main inverter (let's call it MG2) an asynchronous motor is connected, on the second inverter (let it be MG1) the Leaf EM57 motor. Everything worked. MG1 starts to rotate from the beginning of the accelerator stroke, and the asynchronous device starts to rotate from about half of the pedal stroke. I suppose this will be solved by adjusting the parameters of the acceleration pedal. In your situation, you probably need a speed feedback - a resolver. The parameters of the "Testing" inverter settings, as far as I know, are used with the "sine" firmware and - in manual mode with the "Start inverter in manual mode" button. (I really never used it)
Thomas
Posts: 1
Joined: Sun Dec 27, 2020 2:33 am

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by Thomas »

Abricosvw wrote: Tue Mar 09, 2021 3:00 am hi
i am trying to setup the second motor (MG1 out put) resolver is not connected yet
motor generator gm eAssist hybrid
mqdefault.jpg
101_IND_All_Chevy_white.jpg


as I understand it, the software should recognize itself MG1,MG2 ...
but I have ( hwver REV2 ) in MG1 maybe that's why everything conflicts and does not want to work ???


the settings of CANl bus do not want to be saved


I will be grateful for any advice or direction!!!
thanks
The software can recognize MG1 and MG2

MG2 = Prius

If you look in hwinit.cpp
PrtScr.png
The program identifies "Mg2/Prius" by checking if output GPIOB, GPIO5 is floating. I had to remove R18 and C9 to get it floating.
I do not know how Damien and others have done.

Johannes has disabled the possibility for the program to identify Mg1 in ver 4.97R. Try an earlier version.
"Removed Prius MG1 detection, wasn't reliable"
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by johu »

Just saw this. MG1 detection won't help, it was meant for something else and is now superseded.
Without resolver the motor won't do much but you can try to spin in manual mode: https://openinverter.org/wiki/Schematic ... _the_motor

CAN problem: only 8 items per message can be mapped, maybe you exceeded that? It will display an according message above parameters when you press TX and all slots are used.
It seems like you pressed TX many times. There is no duplication detection, so maybe you mapped the same data twice.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
canuck
Posts: 5
Joined: Thu Jan 14, 2021 7:33 pm

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by canuck »

A bit more of a high-level inquiry here. I would like to simplify a dual motor board design in order to optimize board space as I am looking into a hardware solution for handling my resolver signals (and will be needing the real-estate as I hope to keep it one-sided). The hardware solution will also help with safety (in my case) as I am relatively new to the automotive code guidelines/requirements.

What are the main reasons for running two MCU's for handling MG1 & MG2 independently?

From my perspective it looks to make the design more modular, and perhaps simplifies the hardware layout a bit. Other potential reasons could include (looking for input on these ideas):
- redundancy (one could potentially hack some controls into each MCU to support board functionality in case the other chip fails)
- timing constraints?
- cost, potentially, pending what MCU's are selected

There are plenty of beefier MCU's out there that have no problem handling the I/O's required to run both MG's, and consolidating the code to one MCU looks to be an attractive option to save board space and simplify my code. I imagine there are other reasons out there for the dual MCU approach?
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by Isaac96 »

The separate MCU's allow a few different things.
-As you noted, redundancy is good, though hopefully not necessary.
-Separate functionality - one can be a charger while the other runs motor (though that could theoretically be done on one chip)

But I'm willing to bet that Damien didn't want to port the code; it's just way easier to throw two chips on.
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by johu »

Yes we thought about this but this is the simplest option. You can run the same software as on the single-MCU boards. And since the board is pretty large anyway there's no point to optimizing board space.
And like Isaac points out you can run arbitrary software on each. Like one could run FOC software while the other runs stm32-island to generate a 1-phase AC voltage. With one MCU every permutation would result in a new software.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
canuck
Posts: 5
Joined: Thu Jan 14, 2021 7:33 pm

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by canuck »

Thank you guys for the input!

The single MCU approach looks like a good solution for a specific application. I am going to go with the dual MCU approach to allow for multi-functional use of the MG's. The goal is to have an automotive-rated board to rule them all:
- hardware-configurable via BOM-change
- parallel drive/independent drive capable (one or the other)
- physical board sizing/hardware options to allow for use in both Auris/Yaris inverters or Prius inverters
- modular firmware to suit the requirements/capabilities of the inverter used (i.e. BOM A + Firmware B = Parallel Drive Yaris Inverter)

Someday I may pursue a single MCU solution, but after consideration the dual approach would work much better for development and implementation.
User avatar
zilion
Posts: 58
Joined: Tue Feb 02, 2021 7:50 am
Location: Poland

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by zilion »

I have a problem with TDA2822 IC used in resolver circuit. It's warms a little till 11V (40mA), but above 11V it burns instantly.
First, I thought that it's shorted, but it behaves this same only connected to power.
It supposed to take up to 15V, but it's not :D

I know that my batch from Ali is defective, but I wonder if some of you experienced similar behavior.
I smell lithium in the air. It's not lithium, it's glycolium.
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by johu »

Moved the ESP32 question: viewtopic.php?p=26161
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Gigas
Posts: 86
Joined: Mon Nov 09, 2020 6:30 pm

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by Gigas »

Just curious is there a wire diagram PDF like the one for the lexus G450H?
What was I doing?
User avatar
zilion
Posts: 58
Joined: Tue Feb 02, 2021 7:50 am
Location: Poland

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by zilion »

zilion wrote: Tue Apr 13, 2021 6:02 pm I have a problem with TDA2822 IC used in resolver circuit. It's warms a little till 11V (40mA), but above 11V it burns instantly.
I've found the problem. It was two resistors R141 and R146 at the output that were 10K instead of 10 ohm.
tda2822.jpg
Especially they were at the output it was the last place for me to look.
I'm not wise enough to explain this, why it took so much power to burn IC, but maybe someone is?
I smell lithium in the air. It's not lithium, it's glycolium.
User avatar
zilion
Posts: 58
Joined: Tue Feb 02, 2021 7:50 am
Location: Poland

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by zilion »

Johannes, I'm trying to understand your code for resolver, and it seams, that you drive excitation at 8Hz frequency.
Probably I'm wrong, but to me it seams so.
resolv_freq.jpg
johu wrote:
I smell lithium in the air. It's not lithium, it's glycolium.
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by johu »

The code you pasted just shows the timer initialization. The timer is used to sample the resolver feedback exactly 40us after generating an edge on PD2. The actual excitation is just generated by toggling PD2 on every PWM interrupt. PWM interrupts occur at 8.8 kHz regardless the actual PWM frequency. So the resulting excitation frequency is 4.4 kHz.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
chrskly
Posts: 145
Joined: Fri Feb 21, 2020 5:04 pm
Location: Dublin, Ireland
Has thanked: 39 times
Been thanked: 28 times
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by chrskly »

Posted this in my project thread, but posting here to get input from a wider audience.

I'm seeing an issue where my main contactor is not closing. I have UDCSW set to zero. The precharge contactor closes. No errors in the web interface. It seems like the inverter thinks it's closing the main contactor.

The main contactor definitely works. If I manually ground it, it closes OK.

Tracing back from the precharge and main contactor lines, I see there are two test pads near the MG2 STM32F for these. I'm seeing 3.5V on the precharge line OK, but only 0.2V on the main contactor line. Could I have a bad STM32F? Is there something else I should test?
main-contactor-issue.png
User avatar
chrskly
Posts: 145
Joined: Fri Feb 21, 2020 5:04 pm
Location: Dublin, Ireland
Has thanked: 39 times
Been thanked: 28 times
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by chrskly »

chrskly wrote: Sun May 23, 2021 7:53 pm Posted this in my project thread, but posting here to get input from a wider audience.

I'm seeing an issue where my main contactor is not closing. I have UDCSW set to zero. The precharge contactor closes. No errors in the web interface. It seems like the inverter thinks it's closing the main contactor.

The main contactor definitely works. If I manually ground it, it closes OK.

Tracing back from the precharge and main contactor lines, I see there are two test pads near the MG2 STM32F for these. I'm seeing 3.5V on the precharge line OK, but only 0.2V on the main contactor line. Could I have a bad STM32F? Is there something else I should test?

main-contactor-issue.png
Anyone have any ideas or suggestions here? Am I being dense? Is there something else I should be trying?
User avatar
zilion
Posts: 58
Joined: Tue Feb 02, 2021 7:50 am
Location: Poland

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by zilion »

chrskly wrote: Tue Jun 01, 2021 4:58 pm Anyone have any ideas or suggestions here? Am I being dense? Is there something else I should be trying?

Look at the 2nd pin of MG2 IC for some solder joints -it could be shorted there.
This line could be shorted by IC1. If it's still down, then desolder this IC1 and then check MG2_DCSW_OUT_2 line if it goes up.
I smell lithium in the air. It's not lithium, it's glycolium.
User avatar
chrskly
Posts: 145
Joined: Fri Feb 21, 2020 5:04 pm
Location: Dublin, Ireland
Has thanked: 39 times
Been thanked: 28 times
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by chrskly »

zilion wrote: Tue Jun 08, 2021 5:18 am
chrskly wrote: Tue Jun 01, 2021 4:58 pm Anyone have any ideas or suggestions here? Am I being dense? Is there something else I should be trying?

Look at the 2nd pin of MG2 IC for some solder joints -it could be shorted there.
This line could be shorted by IC1. If it's still down, then desolder this IC1 and then check MG2_DCSW_OUT_2 line if it goes up.
Hey @zillion, thanks for the suggestions.

I removed IC1 again, powered up, made sure there were no errors in the web UI (like precharge errors) and then measured the voltage at pin 2. Still 0.2V :(

I had a look with my magnifying goggles and a USB microscope to try and check for any bridging or wonky solder joints. It all looks OK to me.
stm32f-close-up.png
IMG_6601.jpeg
I also took my tiniest screwdriver and ran it between the pins to clear anything that might be there. Still no good.

So, I'm kind of stumped.
User avatar
celeron55
Posts: 774
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 27 times
Been thanked: 110 times
Contact:

Re: Prius Gen 3 Dual Motor Logic Board Support Thread

Post by celeron55 »

chrskly wrote: Sun May 23, 2021 7:53 pm I'm seeing an issue where my main contactor is not closing. I have UDCSW set to zero. The precharge contactor closes. No errors in the web interface. It seems like the inverter thinks it's closing the main contactor.
How are you starting the inverter? Are you using the start input or manual mode?
Locked