Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Topics concerning the Toyota and Lexus inverter drop in boards
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by geduxaz »

Hi.
Setup: Prius Gen2 inverter, Prius Gen2 MG2.
When tuning FOC i find two spots where i can get motor spinning.
Only one of those spots gets me moving forward and backwards.
But that spot gives me forward on reverse and reverse on forward.
How do i get directions swapped?
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: Need help with FOC tuning

Post by m.art.y »

Change any two of the phase wires over. You'll have to find syncoffs value once again though
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning

Post by geduxaz »

Cant change because it is original inverter<>mg2 wiring...
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning

Post by geduxaz »

Is forward/reverse algorithms the same? Can i drive car forward when reverse is selected?
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: Need help with FOC tuning

Post by m.art.y »

I had the same problem and as far as I have tested they are not the same and driving forward when reverse is selected is not a good idea. Another option would be to invert resolver/encoder wiring with a special command can't remember what it is though
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Need help with FOC tuning

Post by johu »

It's normal to find two offset. Just use the one that gives you the correct direction
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning

Post by geduxaz »

johu wrote: Sun Jan 23, 2022 7:22 pm It's normal to find two offset. Just use the one that gives you the correct direction
Thanks! I will try again if those offsets are identical, but directions swiched.
It looked that second one could not get me going well forward or backwards...
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: Need help with FOC tuning

Post by RetroZero »

I posted my parameters in the Adapter board thread if that helps.
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning

Post by geduxaz »

m.art.y wrote: Sat Jan 22, 2022 5:48 pm I had the same problem and as far as I have tested they are not the same and driving forward when reverse is selected is not a good idea. Another option would be to invert resolver/encoder wiring with a special command can't remember what it is though
i dont think you can change direction by doing anything to resolver. its job is to provide rotor position.
i tried to change phase wires of the motor, i didnt get any spin if i change phase wires. i think it is not possible as it is 8 pole motor.
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: Need help with FOC tuning

Post by m.art.y »

I'm pretty sure mine was also 8 pole motor. If you change phase wires you also have to find new syncoffs as the old one will no longer work. Mine wasn't a resolver but an ecoder and there is a command to invert the encoder wiring without physically unsoldering the wires, not sure if that would aslo work with a resolver. Also are you sure you got your resolver wiring right? Only one in 4 chance to get it right.
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning

Post by geduxaz »

m.art.y wrote: Sat Jan 29, 2022 9:22 pm I'm pretty sure mine was also 8 pole motor. If you change phase wires you also have to find new syncoffs as the old one will no longer work. Mine wasn't a resolver but an ecoder and there is a command to invert the encoder wiring without physically unsoldering the wires, not sure if that would aslo work with a resolver. Also are you sure you got your resolver wiring right? Only one in 4 chance to get it right.
My resolver is connected by pinout diagrams.

Also one more strange thing. Do i need to feel resistance in manual run and turning motor by hand?
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Need help with FOC tuning

Post by johu »

geduxaz wrote: Sun Jan 30, 2022 7:47 am My resolver is connected by pinout diagrams.

Also one more strange thing. Do i need to feel resistance in manual run and turning motor by hand?
When commanding no current? Then no, no resistance beyond the usual cogging.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning

Post by geduxaz »

When manual run and no manualid/manualiq i get resistance when turning motor example to plot angle. If i turn the inverter off- no resistance.

Found a way to reproduce this resistance.
1. Everything is off- no Resistance
2. Start Inverter Manual mode, HV ON- no Resistance
3. make manualid - 10a and later make it back to 0. Resistance is present.
4. Halt inverter- resistance present.
5. Turn HV off- resistance present.
6. Turn 12V off to inverter- no resistance.

Resolver is disconnected when tried this sequence.
But maybe it is normal behaviour?
Also i tried different resolver combinations. Next weekend will try to solve the puzzle again :)
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Need help with FOC tuning

Post by johu »

Hmm, Gen2 has bottom IGBTs closed as soon as MSDN signal is pulled to 12V. So shorting out motor leads. Just makes me wonder why it doesn't resist in phase 2 of your sequence?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: Need help with FOC tuning

Post by RetroZero »

Do you have Mg1 wired up as well by any chance to your inverter? If so remove it (and isolate the hv wires) whilst testing.
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning

Post by geduxaz »

RetroZero wrote: Mon Jan 31, 2022 8:43 pm Do you have Mg1 wired up as well by any chance to your inverter? If so remove it (and isolate the hv wires) whilst testing.
Hi. No, MG1 is not connected. next weekend i will make more photos. it might be also the inverters or motors fault. They were from different cars and from junkyard...
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by geduxaz »

So does anyone have working (ridable) example of gen2 inverter + gen2 mg2? In air i can go and setup the syncofs (during the tests i go to up to 130A in manualid), but when trying to move i get almost no power. If i choose other syncofs i can drive the car but then i have directions swapped. It is much easier to test it with wheels in air and it looks it is working great, but on the ground (with load) it is different case.
User avatar
ZooKeeper
Posts: 507
Joined: Mon Mar 30, 2020 10:23 pm
Location: USA

Re: Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by ZooKeeper »

The video Damien published with Johannes needs to be followed exactly if one hopes to get the FOC settings correct, starting with the resolver wiring checks. I had similar problems, all of my own doing from a lack of understanding and the video confirmed just how far off my thinking was :O

The Gen2 Prius inverter and "motors" are engineered to work together, the VCU is only assuming the role of the Toyota ECM by processing inputs to the desired inverter outputs.

Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by geduxaz »

I watched the video many times. Maybe i am too dumb to understand, but there is no clear explanation how does angle look on wrong resolver pinout and how the correct angle plot looks.
I trust prius manual for resolver pinout. Is that a wrong way to connect it?
Attachments
Is it good?
Is it good?
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by johu »

That does not seem to be the problem then. I used the same pinout as you posted.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by geduxaz »

johu wrote: Fri Feb 04, 2022 9:38 am That does not seem to be the problem then. I used the same pinout as you posted.
during the manual wheel turn by hand there is very short moment when angle starts jumping from 0 to 360 and back to 0. maybe it is a resolver fault?
In picture it is thick line. If i stop motor there the angle is changing 0-360-0 indefinitaly.

Also... Shouldnt the angle be rising not falling when wheels are spinning in forward direction?

I am going to the car (100km) this evening and will have there 1 day. It is still too cold to work long with it. Need to do as many test as possible to get it working or else it is gonna burn :) !
Attachments
Thick line is 0-360-0 many times
Thick line is 0-360-0 many times
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by johu »

geduxaz wrote: Fri Feb 04, 2022 10:48 am during the manual wheel turn by hand there is very short moment when angle starts jumping from 0 to 360 and back to 0. maybe it is a resolver fault?
In picture it is thick line. If i stop motor there the angle is changing 0-360-0 indefinitaly.

Also... Shouldnt the angle be rising not falling when wheels are spinning in forward direction?

I am going to the car (100km) this evening and will have there 1 day. It is still too cold to work long with it. Need to do as many test as possivble to get it working or else it is gonna burn :) !
That explains why it wants to go backwards. You can now indeed try setting pinswap to 7 (this time I mean it). It swaps resolver sin/cos. See if that makes it go 0-360 instead. But then it might not move at all. Maybe just accept that you need to select reverse to go forward. Will check this once I get this far.

hovering 0-360-0 is normal. There is like 0.5-1° jitter typically and if that happens to be at the turnaround point, that's what happens
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by m.art.y »

I had exact same problem and this is what I was suggesting in the other thread too just couldn't remember the exact comand 'pinswap'. From my experience when I chose reverse but drove forward the performance was not the same - it was obvious that in reverse (actual forward) the car drove better but maybe that could have been adjusted somehow I don't know. And mine was a gen3 prius inverter with a different motor with a sin/cos chip. I changed the phase wires over and fixed the problem (had to find new syncoffs).
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by geduxaz »

I tried pinswap 7 and motor did not spin.
Tried to swap two phases and motor did not spin. Maybe it is because there is many phase pairs. Swapping phase would help if motor had only 3 windings. Maybe i need to swap some exact phase wires?
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: Need help with FOC tuning (prius gen2 inv+ gen2 MG2)

Post by m.art.y »

When you changed phase wires did you also go through the procedure again to find a new syncoffs value? When you change phase wires motor will not spin until you find new syncoffs.
Post Reply