Page 25 of 37

Re: Prius Gen2 adapter board development thread

Posted: Mon Aug 31, 2020 8:57 pm
by RetroZero
Thanks for that. 👍

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 01, 2020 6:45 am
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.

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 01, 2020 7:40 am
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)

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 01, 2020 11:13 am
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.

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 01, 2020 11:44 am
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 ⚡.

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 01, 2020 12:22 pm
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.

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 01, 2020 1:28 pm
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?

Re: Prius Gen2 adapter board development thread

Posted: Wed Sep 02, 2020 2:30 am
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????

Re: Prius Gen2 adapter board development thread

Posted: Wed Sep 02, 2020 3:03 am
by Isaac96
What's your fmax? Maybe manual mode ignores that?

Re: Prius Gen2 adapter board development thread

Posted: Wed Sep 02, 2020 11:37 am
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?

Re: Prius Gen2 adapter board development thread

Posted: Wed Sep 02, 2020 12:30 pm
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?

Re: Prius Gen2 adapter board development thread

Posted: Wed Sep 02, 2020 2:37 pm
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

Re: Prius Gen2 adapter board development thread

Posted: Thu Sep 03, 2020 1:35 pm
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....

Re: Prius Gen2 adapter board development thread

Posted: Thu Sep 03, 2020 3:46 pm
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!

Re: Prius Gen2 adapter board development thread

Posted: Fri Sep 04, 2020 6:07 am
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 😉

Re: Prius Gen2 adapter board development thread

Posted: Fri Sep 04, 2020 7:44 am
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.

Re: Prius Gen2 adapter board development thread

Posted: Fri Sep 04, 2020 12:26 pm
by imwoody36
still lurking

Re: Prius Gen2 adapter board development thread

Posted: Fri Sep 04, 2020 12:50 pm
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

Re: Prius Gen2 adapter board development thread

Posted: Fri Sep 04, 2020 1:03 pm
by Kevin Sharpe
"gen2 transaxle with gen2 inverter and #openinverter vcu running with full throttle control"

https://twitter.com/EvBmw/status/1301471950930313216

Re: Prius Gen2 adapter board development thread

Posted: Fri Sep 04, 2020 2:52 pm
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.

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 08, 2020 8:20 am
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.

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 08, 2020 10:11 am
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.

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 08, 2020 10:15 am
by Jack Bauer
Will give this a try in about 30 mins and report back. Assume i put fwkp back at -100?

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 08, 2020 10:24 am
by johu
Yes

Re: Prius Gen2 adapter board development thread

Posted: Tue Sep 08, 2020 10:35 am
by Jack Bauer
Both gen 2 and gen 3 systems now working perfectly in both directions with regen on new firmware.