Prius Gen2 adapter board development thread

Topics concerning the Toyota and Lexus inverter drop in boards
RetroZero
Posts: 746
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 345 times
Been thanked: 44 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

Thanks for that. 👍
RetroZero
Posts: 746
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 345 times
Been thanked: 44 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

Has anyone had problems with pinswap functions?
No matter what I select in the interface, the pwm and phase currents stay in the same order when I am using Foc firmware 4.87R after confirming offsets and phase orders in Sine firmware.
RetroZero
Posts: 746
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 345 times
Been thanked: 44 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

ZooKeeper wrote: Mon Aug 31, 2020 6:25 pm
RetroZero wrote: Mon Aug 31, 2020 5:42 pm Any chance of putting up a picture of MG2 resolver wiring diagram please?
Thanks for the pinout. After like 5 hours of checking and re checking, I connected up MG2 as per MG1 resolver pinouts. It's exactly the same locations, just different colours.
But my angle swings between 60 and 120 degrees.
If I take the same connector and fit it back to MG1 resolver, I get 0-360 degees. WTF ?

That's why I asked for pinouts. To be sure.
Does MG2 then have more pole pairs when compared to Mg1?

EDIT - went to validate different angles between Mg1 and Mg2. Plugged into Mg2 and without any changes, I now have 0-360 degrees. Happy with that, but would like to understand why?

Back to jiggling motor and pinswaps (when connecting original PWM cabling)
User avatar
johu
Site Admin
Posts: 5821
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 162 times
Been thanked: 1044 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by johu »

RetroZero wrote: Tue Sep 01, 2020 6:45 am Has anyone had problems with pinswap functions?
No matter what I select in the interface, the pwm and phase currents stay in the same order when I am using Foc firmware 4.87R after confirming offsets and phase orders in Sine firmware.
The right combination for Prius cannot be selected. You have to type "set pinswap 5" in the custom command.
You won't see any change when plotting current, just FOC will come alive.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
RetroZero
Posts: 746
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 345 times
Been thanked: 44 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

So pinswap is an internal modification for the logic? It's to adapt the adapter board to motor/ inverter combination?
I put in pinswap 5, but I have jiggling motor and 25 amps drawing on 12volt supply.
With same settings running MG1 motor, I had closed loop and 1,5 amps.
Want to get this right before applying higher voltage ⚡.
User avatar
ZooKeeper
Posts: 507
Joined: Mon Mar 30, 2020 10:23 pm
Location: USA

Re: Prius Gen2 adapter board development thread

Post by ZooKeeper »

RetroZero wrote: Tue Sep 01, 2020 11:44 am So pinswap is an internal modification for the logic? It's to adapt the adapter board to motor/ inverter combination?
Yes, you are effectively aligning the software to the hardware.
I put in pinswap 5, but I have jiggling motor and 25 amps drawing on 12volt supply.
From my testing experience, that suggests the phase wires are swapped around.
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
RetroZero
Posts: 746
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 345 times
Been thanked: 44 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

I'll go back to running MG1 again with pinswap 5 and then try Mg2. Could the fact the 2 motor/generators turn in opposite directions (power split device) that Mg2 should be in reverse?
User avatar
ZooKeeper
Posts: 507
Joined: Mon Mar 30, 2020 10:23 pm
Location: USA

Re: Prius Gen2 adapter board development thread

Post by ZooKeeper »

Question... Why can the MGR achieve nearly 7000 RPM in manual mode and only 3k on the pedal? I checked the pot values and it reaches the potmax value I set, but no more rpm past about 1/2 pedal travel and 1/3 the amps of that in manual mode (7 vs 22).

What am I missing here????
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Prius Gen2 adapter board development thread

Post by Isaac96 »

What's your fmax? Maybe manual mode ignores that?
RetroZero
Posts: 746
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 345 times
Been thanked: 44 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

johu wrote: Tue Sep 01, 2020 11:13 am
RetroZero wrote: Tue Sep 01, 2020 6:45 am Has anyone had problems with pinswap functions?
No matter what I select in the interface, the pwm and phase currents stay in the same order when I am using Foc firmware 4.87R after confirming offsets and phase orders in Sine firmware.
The right combination for Prius cannot be selected. You have to type "set pinswap 5" in the custom command.
You won't see any change when plotting current, just FOC will come alive.
I got both Mg1 and Mg2 motors to spin in Manual mode.
Went to Foc and got Mg1 to spin smoothly. Since wiring of the resolvers is the same in terms of pin locations in the connectors, I connected first to Mg1 resolver - nice 0-360, Mg2 is all over the place - (one moment it picks up 0-360, next it stays at 270 degrees etc... Damaged resolver on MG2 then? Has anyone had issues with MG2 resolvers?
arber333
Posts: 3266
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by arber333 »

RetroZero wrote: Wed Sep 02, 2020 11:37 am
johu wrote: Tue Sep 01, 2020 11:13 am
RetroZero wrote: Tue Sep 01, 2020 6:45 am Has anyone had problems with pinswap functions?
No matter what I select in the interface, the pwm and phase currents stay in the same order when I am using Foc firmware 4.87R after confirming offsets and phase orders in Sine firmware.
The right combination for Prius cannot be selected. You have to type "set pinswap 5" in the custom command.
You won't see any change when plotting current, just FOC will come alive.
I got both Mg1 and Mg2 motors to spin in Manual mode.
Went to Foc and got Mg1 to spin smoothly. Since wiring of the resolvers is the same in terms of pin locations in the connectors, I connected first to Mg1 resolver - nice 0-360, Mg2 is all over the place - (one moment it picks up 0-360, next it stays at 270 degrees etc... Damaged resolver on MG2 then? Has anyone had issues with MG2 resolvers?
I think MG1, MG2 resolvers are not same pole count. There was discussion here somewhere about 1:2 ratio?
User avatar
ZooKeeper
Posts: 507
Joined: Mon Mar 30, 2020 10:23 pm
Location: USA

Re: Prius Gen2 adapter board development thread

Post by ZooKeeper »

Isaac96 wrote: Wed Sep 02, 2020 3:03 am What's your fmax?
Yup, thanks! MGR spins up as expected w/fmax = 400
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
RetroZero
Posts: 746
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 345 times
Been thanked: 44 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

arber333 wrote: Wed Sep 02, 2020 12:30 pm
RetroZero wrote: Wed Sep 02, 2020 11:37 am
johu wrote: Tue Sep 01, 2020 11:13 am
The right combination for Prius cannot be selected. You have to type "set pinswap 5" in the custom command.
You won't see any change when plotting current, just FOC will come alive.
I got both Mg1 and Mg2 motors to spin in Manual mode.
Went to Foc and got Mg1 to spin smoothly. Since wiring of the resolvers is the same in terms of pin locations in the connectors, I connected first to Mg1 resolver - nice 0-360, Mg2 is all over the place - (one moment it picks up 0-360, next it stays at 270 degrees etc... Damaged resolver on MG2 then? Has anyone had issues with MG2 resolvers?
I think MG1, MG2 resolvers are not same pole count. There was discussion here somewhere about 1:2 ratio?
EDIT - instead of adding another comment thread....the next day,
Took Damiens Parameters of MG2 on Gen 3 Inverter, and changed mine to his values. Thanks ;) . Still jiggling motor & 30 Amps
Changed "syncoffs" over several hours - no difference.
Re checked MG1 resolver in plot values when turning by hand - OK
Re connected and checked MG2 - only 0-360 "pulses", even without turning motor manually.
Went back to re-check resolver connector of MG2 as per Zookeeper picture - ;) Thanks. Seems I mucked it up big time (even though MG1 outputs nice graph - go figure that out). So, nice progressive graph 0-360 degrees. Finally :)
BUT, still jiggling motor and 30 Amps draw.
Then I noticed Damiens values for "pinswap 4".....Ok, there's a difference between Gen2 and Gen3 inverters, but hey, 3 days of jiggling, must try something.
Tried all variations of "pinswap" - no difference - Noting that in "pinswap 5" mode, the value selected shows "None", I selected Sin/Cos. Still jiggling motor :x
Went back to selecting "None" in pinswap, AND motor spins up ! How,What,I am stumped. Happy to have MG2 in closed loop, but not on the parameters of the rest of you..
Checked Il1 and Il2 - only Il1 has plausible value. Selected "pinswap Currents 12" - now I have 2 currents (but don't know if they are in the good order, but there are 2)

The short of it so far is : Syncoffs 11500, Polepairs 4, Respolepairs 2, Pinswap 0, then Pinswap Currents12....????
I have throttle, but at a fixed speed only. Will delve into that later....
User avatar
johu
Site Admin
Posts: 5821
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 162 times
Been thanked: 1044 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by johu »

Sometimes it just seems to work. With wrong pinswap you won't see consistent results. You can try swapping sin/cos by typing "set pinswap 7". And again, the listbox function does not really work with pinswap! Yes it displays "None" but it isn't none!
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
RetroZero
Posts: 746
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 345 times
Been thanked: 44 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

So if I wanted to check the phase outputs order of inverter in relation to adapter board, I would remove 2 inputs into the board and see the resulting pwm that remains?
Like the part where we confirm phases and currents in Sine "mode" before pinswap?
I pretty much understand pinswap now, and why we could have 'none' displayed, but it is different in reality, cause there is no drop down selection in menu.
I would like to confirm everything lines up before going to give it more voltage "cause it is working".. 😁 Respect to Mr Volts and Mr Amps, and of course Mr Japanese IGBT 😉
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 Gen2 adapter board development thread

Post by Jack Bauer »

If people just use the wiring diagram on the wiki and pinswap 5 it just works. I have confirmed that as part of making the tuning video. The problem here is too many unknowns. I have tried to explain this and have failed so I'm just not going to bother anymore.
I'm going to need a hacksaw
User avatar
imwoody36
Posts: 91
Joined: Fri May 01, 2020 2:20 pm
Location: Scottsburg Indiana
Contact:

Re: Prius Gen2 adapter board development thread

Post by imwoody36 »

still lurking
the priustoric boatcar guy
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Prius Gen2 adapter board development thread

Post by Kevin Sharpe »

imwoody36 wrote: Fri Sep 04, 2020 12:26 pmstill lurking
Not sure what this means :?

if you're having problems have you followed Damien's instructions?
Jack Bauer wrote: Fri Sep 04, 2020 7:44 am use the wiring diagram on the wiki and pinswap 5
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
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Prius Gen2 adapter board development thread

Post by Kevin Sharpe »

"gen2 transaxle with gen2 inverter and #openinverter vcu running with full throttle control"

https://twitter.com/EvBmw/status/1301471950930313216
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
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 Gen2 adapter board development thread

Post by Jack Bauer »

Anyone experiencing problems running motors in reverse after successful tuning please set fwkp to 0 and try again. Johannes and I are working on this problem. A full tuning and tutorial video can be expected in about a week.
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 5821
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 162 times
Been thanked: 1044 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by johu »

So I have looked into a bit. Basically both the q-controller and the field-weakening-controller try to hit a q setpoint. So if the q controller alone does not manage, because the inverter ran out of voltage, the fw-controller will step in and command more negative d-voltage to weaken the rotor field. So far so good.
Now I did some simple "case studies":
q-setpoint is 100A but achieved q-current is only 95A -> fw-controller will command -100 * (100 - 95) = -500A extra d-current (capped by 100*throtmax/2). Looking good.
Next up
q-setpoint is -100A but achieved q-current is only -95A -> fw-controller will command -100 * (-100 - (-95)) = +500A extra d-current (capped by 0)
So on negative q setpoints (that is in reverse accel or forward regen) the FW controller won't have any effect because its results are positive and capped at 0. So its result is always 0.

I thought about running the FW controller on absolute values. I.e. it would receive an always positive setpoint and always positive feedback, But then around 0 it wouldn't be able to distinguish in which direction the feedback deviates. Will have to dwell on this a little longer.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5821
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 162 times
Been thanked: 1044 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by johu »

Alright, I think I found the solution. I just vary the sign of the field weakening controller gain with direction.

So now:
Commanding -100A forward regen but getting -105A -> too much regen, field needs WEAKENING -> -100*(-100-(-105)) = -500A extra id
Commanding -100A reverse accel but getting -95A -> too little accel, field needs WEAKENING -> +100*(-100-(-95)) = -500A extra id
Commanding 100A reverse regen but getting 105A -> too much regen, field needs WEAKENING -> +100*(100-105) = -500A extra id

It works fine in Touran, please someone try with Toyota.
Attachments
stm32-foc.zip
(67.67 KiB) Downloaded 57 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 Gen2 adapter board development thread

Post by Jack Bauer »

Will give this a try in about 30 mins and report back. Assume i put fwkp back at -100?
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 5821
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 162 times
Been thanked: 1044 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by johu »

Yes
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 Gen2 adapter board development thread

Post by Jack Bauer »

Both gen 2 and gen 3 systems now working perfectly in both directions with regen on new firmware.
I'm going to need a hacksaw
Post Reply