Prius Gen2 adapter board development thread

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

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

So, been checking different parameter threads. From what I understand, parameter value "throtcur" = number of amps at the motor (delivered via pwm phases).
So value 1 means @100% throttle, I will have 100 amps. That would explain lack of power with 225v battery pack = 20Kw.
I'll attempt "throtcur" 2 and report back.
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

Fell onto a reply from @mjc506 in the Gen2 Inverter Controller thread in April. I found the info clear and well formulated - Thanks.

I went about calibrating 'udcofs' parameter first.
1. power up inverter without HV connected - Udc reads 330v = this is your 'udcofs' value (udc offset) as there is 0vdc on the HV bus at present.
2. power up with 13vdc on HV bus - udc reads 313vcd
3. devide udc reading (313v) by 13vdc
4. set 'udcgain' to 3.5 (played around with the value slightly toget close tomeasured value from multimeter)
5. udc reports 13vdc, and 202vdc when my HV is connected (pretty close to multimeter reading on the HV bus).

Set 'throtcur' to 2 and 'ocurlim' to 250(A), and went for a drive - very little difference, and ran out of battery power after 100m.
I seem to trip the overcurrent too.
Next, I will attempt calibrating il1 and il2 - even if they are pretty close to real value, I would like to perform the test to make sure.

I had no problems besides lack of power, however since setting these few values, there seems to be extra regen, jittering at low speed and battery didn't last long.
So back to the drawing board and more parameter thread browsing.
I'll recharge my Prius pack too.
Attachments
07.07.22_parameters-throtcur=2,_udcgain modified-lack of power.json
(1.42 KiB) Downloaded 82 times
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Prius Gen2 adapter board development thread

Post by Ev8 »

Fmax 200 is pretty low certainly going to limit your top end if your not voltage limited,

Throttle ramp very aggressive probably causing your over current trips, most people are running 1 or less

As above for regen ramp

Lower these both and you’ll cure a lot of stuttering

Idcmin looks like you’re allowing up to 5000 amps of regen! I know the motor wouldn’t make that but for testing in set at -100

As I mentioned before I’ve had more predictable drive lowering syncadv to 6

Double check syncof tuning and maybe test drive some other points in the dead zone, I found less unwanted regen at 11950 which is past the middle of the dead zone, different transaxle I know but remember this is all experimental!
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Prius Gen2 adapter board development thread

Post by Ev8 »

I would set ocurlim to something like 500 while testing so the software doesn’t derate you, Toyota engineers did their job very well the inverter will trip and shut down if you have a real over current you can tune within hardware limits
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Prius Gen2 adapter board development thread

Post by Ev8 »

Actually ocurlim sounds like your running old software recent releases are better on jitter.

Also just noticed deadtime is 63. Gen2 inverter needs to be 0
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

Thanks for having a look. Lots you picked up on, and clears a few things. I'll recheck I'm on latest software and double check those dead time settings. I didn't even go there since I know the Gen 2 must not be played with. It's supposedly set by default in parameters. Thanks again, hope to report back soon 😉
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Prius Gen2 adapter board development thread

Post by Ev8 »

Certainly all the firmware I’ve been using detects the board as Prius gen2 and doesn’t give you a deadtime option, so yours must be pre that addition, definitely update
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

Just checking now, I'm running 5.158R-foc. Latest update I think. Going to go back a little into deadtime. I vaguely remember issues around the difference between Gen2 and gen3.
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

Found Matt's response at the beginning of thread. Gen2 deadtime cannot be set/altered, Toyota does it on its own no matter what you select. I'll look into the other values you highlighted 👍
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Prius Gen2 adapter board development thread

Post by Ev8 »

johu wrote: Thu Jun 18, 2020 4:29 pm
RetroZero wrote: Thu Jun 18, 2020 2:41 pm Hi theJohannes. The 2 pin power connector you are talking about is the "famous" additional 2 pin white 12V inverter power connector you were looking for?
Yes. I have now pulled the pins from it and put them into a screw terminal. The offers on the internet may or may not come with pins so I didn't bother.

Now, I fully wired up the inverter to the 12-pole connector with the following results
  • Getting good linear DC voltage reading with udcofs=327 and udcgain=3.78
  • The current sensors have different gain, the gain of MG2 current sensors is 3.18 and that of the MG1 sensors 6.37. Must somehow be solved in software. Until then the charge input current set point must be doubled.
  • I seem to have a faulty buck/boost module. It sings really load when CSDN=12V and the CPWM signal never goes to 15V like the inverter PWM channels. Or am I missing something?
So I couldn't complete my mission to test the battery charging feature. Anyone have a left over buck/boost module (without inductor)? Yes I could just buy another inverter but my space is limited so I'd rather avoid it.

EDIT: whats the temperature curve for the heatsink sensor, anyone got that?

Digging back in this thread I found this info indicating the mg1 current sensors have different gains, can anyone confirm this before I dig out a spare inverter and do some testing? Is this actually difference in the inverter or a difference caused by the 2 difference inputs info the op amp circuit on the controller board,

The reason I ask is I’m using 2 control boards 1 for mg1 and 1 for mg2 ( both use the board inputs/outputs for mg2,)
If the difference is in the inverter then I need to adjust the gain of the mg1 controller, if the gain difference is due to board design then I don’t,

I’m thinking the difference may be in the inverter as with a gain of 3.18 on the mg1 controller I am logging phase currents of 250amps with low torque output and only 30amps draw at the battery!
eee291
Posts: 20
Joined: Sat Feb 01, 2020 4:09 pm
Location: Austria bgld

Re: Prius Gen2 adapter board development thread

Post by eee291 »

In a video by johu where he is testing the buck charging via the mg1 power stage he mentions that it has double the gain.
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Prius Gen2 adapter board development thread

Post by Ev8 »

I found the video, confirms I need to double the gain on mg1, nice I could see some extra power!
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

How's the power factor? I'm iether flat lining around 2500rpm or Overcurrent limited as I press the gas pedal.
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Prius Gen2 adapter board development thread

Post by Ev8 »

Ok I’ve adjusted the gain on mg1 and running a throcur of 2.2 with a ramp of 2.5
Mg2 running throcur 3.5 and ramp of 2.5

battery in 80s and battery current peaks at about 280 amps and quickly drops off as revs climb, I fully believe this is a lack of voltage issue, field weakening doesn’t help in fact it introduces occasional harsh surging forward during regen as you pull up to a junction,

So options seem to be, higher voltage battery I think around 450v would be useful, rewind the stators for lower voltage, pray someone comes up with a more effective field weakening method.

Or go all madman with the 3 inverters worth of boost inductors I’ve got on the shelf, what’s the worst that could happen right!
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 »

anybody have parameters working for a toyota rav 4 rear end? its called an MGR. I have been away from the project for a year or more and when I uploaded the newest firmware I no longer have wheel movement in foc. using stock prius battery for testing at 200v. also anybody using an onboard generator? ( for the cool rat rod look, ive got a gummit surplus 10kw generator capable of 3 phase) this vehicle is destined to be just a way to move the generator to a job site
the priustoric boatcar guy
MattsAwesomeStuff
Posts: 871
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 278 times
Been thanked: 165 times

Re: Prius Gen2 adapter board development thread

Post by MattsAwesomeStuff »

imwoody36 wrote: Fri Jul 29, 2022 12:46 pmanybody have parameters working for a toyota rav 4 rear end?
Seems like hardly anyone has bothered to submit parameters.
its called an MGR. I have been away from the project for a year or more and when I uploaded the newest firmware I no longer have wheel movement in foc. using stock prius battery for testing at 200v.
From what I've seen over the last while, MGRs have been mostly abandoned. If a rear diff motor style is wanted, the Mitsubishi Outlander seems to e the better donor.

I'm not sure why the MGR wasn't working, perhaps it was a voltage issue, or an ongoing issue with field weakening working properly with the OI software. There's a few MGR threads and, far as I know all those were abandoned.

It could use its own wiki page and someone to summarize it, for sure.
LRBen
Posts: 471
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 42 times
Been thanked: 99 times

Re: Prius Gen2 adapter board development thread

Post by LRBen »

RetroZero wrote: Thu Jul 14, 2022 3:58 pm How's the power factor? I'm iether flat lining around 2500rpm or Overcurrent limited as I press the gas pedal.
I'm getting a similar flat line at 2500rpm. Although I haven't touched the parameters since doing the FOC tuning around 2 years ago with a 48v battery.
Plan to do allot more tuning in the next couple weeks.

Here are my current parameters for anyone who is interested. Running an Outlander Rear motor.

Code: Select all

{
  "curkp": 64,
  "curki": 20000,
  "curkifrqgain": 50,
  "fwkp": -100,
  "ffwstart": 200,
  "syncofs": 65000,
  "syncadv": 10,
  "polepairs": 5,
  "respolepairs": 5,
  "sincosofs": 2048,
  "encmode": 4,
  "fmax": 200,
  "numimp": 60,
  "dirchrpm": 100,
  "dirmode": 1,
  "snsm": 12,
  "pwmfrq": 2,
  "pwmpol": 0,
  "deadtime": 0,
  "ocurlim": 3000,
  "il1gain": 3.18,
  "il2gain": 3.18,
  "udcgain": 3.81,
  "udcofs": 327,
  "udclim": 540,
  "snshs": 0,
  "pinswap": 5,
  "potmin": 175,
  "potmax": 470,
  "pot2min": 4095,
  "pot2max": 4095,
  "potmode": 0,
  "throtramp": 0.37,
  "throtramprpm": 3500,
  "throtcur": 4,
  "brakeregen": 0,
  "regenramp": 100,
  "regentravel": 30,
  "offthrotregen": -30,
  "cruiseregen": -30,
  "regenrampstr": 10,
  "brklightout": -50,
  "bmslimhigh": 50,
  "bmslimlow": -1,
  "udcmin": 250,
  "udcmax": 520,
  "idcmax": 500,
  "idcmin": -5000,
  "idckp": 2,
  "idcflt": 9,
  "tmphsmax": 150,
  "tmpmmax": 300,
  "throtmax": 100,
  "throtmin": 0,
  "chargemode": 0,
  "chargecur": 15,
  "chargekp": 30,
  "chargeki": 20,
  "chargeflt": 5,
  "chargepwmin": 55,
  "chargepwmax": 77,
  "idlespeed": 2000,
  "idlethrotlim": 0,
  "idlemode": 3,
  "holdkp": -0.25,
  "speedkp": 0.25,
  "speedflt": 5,
  "cruisemode": 0,
  "udcsw": 261,
  "udcswbuck": 320,
  "tripmode": 0,
  "bootprec": 0,
  "pwmfunc": 0,
  "pwmgain": 100,
  "pwmofs": 0,
  "canspeed": 1,
  "canperiod": 0,
  "nodeid": 1,
  "manualiq": 0,
  "manualid": 0
}
LRBen
Posts: 471
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 42 times
Been thanked: 99 times

Re: Prius Gen2 adapter board development thread

Post by LRBen »

RetroZero wrote: Thu Jul 14, 2022 3:58 pm How's the power factor? I'm iether flat lining around 2500rpm or Overcurrent limited as I press the gas pedal.
Done some testing today. fmax will raise that 2500rpm flat line, might also want to move up ffwstart as well.
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by RetroZero »

Thanks, I'm getting some cooling plumbed in at the moment. Then onto Foc tuning again so that it runs in the right direction. 👍
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 »

for testing, I parked a running gen2 prius close enough to run wires for the motor and resolver into the MGR.
after reversing resolver sin and cos I was able to get forward and reverse control. but only until the oem prius operating system spun up what it thought was mg2. excessive speed and the only way to stop with the wheels off the ground was the power button.

I believe this proved my mgr is good and that the gen2 inverter is happy to run it at 200 volts. i suspect the software update I installed fixed a resolver wiring issue in firmware that I had previously fixed in hardware. I have a video if anyone wants me to post it..?
the priustoric boatcar guy
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by johu »

Yes of course post the video.
You can the MGR with a stock Prius? Or with openinverter?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

https://www.youtube.com/watch?v=ZNaQwEPomvs

mostly raw footage of a stock prius connected to a rav4 rear end with a surprise
the priustoric boatcar guy
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by johu »

Nice :) Do you reckon the Prius fires up the boost converter when reaching higher speeds?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

I believe when I stepped on the throttle it instantly calculated I was stuck on a hill and because there was no feedback from the wheel speed sensors just ramped up the current.

that is consistent with the rapid runaway that sometimes happened on the video.
I wonder how we can test for the boost converter operation? dual voltmeter measurements?

pulling the ignition fuse will force a gen 2 prius into EV mode, and I tried that. it keeps the mg1 from starting the combustion engine.
( this vid shows me doing that )
the priustoric boatcar guy
MattsAwesomeStuff
Posts: 871
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 278 times
Been thanked: 165 times

Re: Prius Gen2 adapter board development thread

Post by MattsAwesomeStuff »

imwoody36 wrote: Fri Aug 05, 2022 3:49 pmmostly raw footage of a stock prius connected to a rav4 rear end with a surprise
Sweet. I would love someday to be able to toss my forklift motor and go to an MGR!

Oh, one other thing... since you have an actual prius... if you could be so kind...

Could you scope or CAN or whatever the signals going to the Air Conditioner? I think Johannes has said if he knew what was being sent, it would be pretty easy for all of us to emulate (and, I've got a Gen2 AC I'd love to be able to use). I think in the Gen2 the inverter is onboard the main inverter somewhere, but on the Gen3 it's built into the compressor. So, I'm not sure if the signals to the inverter are what's needed, or the signals between the inverter and the compressor.
Post Reply