Prius Gen2 adapter board development thread

Topics concerning the Toyota and Lexus inverter drop in boards
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: Prius Gen2 adapter board development thread

Post by johu »

Yes, you got that alright. So PB12 or both ends of R50 should be solidly at 5V.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Prius Gen2 adapter board development thread

Post by tom3141 »

johu wrote: Fri Dec 25, 2020 8:28 pm Yes, you got that alright. So PB12 or both ends of R50 should be solidly at 5V.
Sorry, I’m not quite following what you mean by this. Are you suggesting that I check that PB12/R50 is at 5V when I have 12v applied to pin 27?

With it set up as I described in my last post I’m still getting over current errors even though din_ocur never changes from a value of 1 according to the web interface.
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Prius Gen2 adapter board development thread

Post by tom3141 »

I've checked the voltage at R50 and it is solid at 5.4V. It doesn't change when I get an overcurrent error. This is measured with a multimeter not a scope so I can't check if there are any sudden drops/spikes but I assume that this should drop to 0 if there's an overcurrent error and stay there until reset.

I'm very confused! There's a possibility that I have noise (some of the signal cables are too long and not shielded) or parameters wrong (I have syncofs close but it may not be fine tuned because I kept getting overcurrent errors when tuning this in manual mode too). However it doesn't explain how I can still be getting overcurrent errors with MFIV disconnected.

Any ideas? Any help is much appreciated!

Thanks,

Tom
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Prius Gen2 adapter board development thread

Post by tom3141 »

I've done some more testing this afternoon.

I decided to eliminate as much of the car's 12v system as possible and go back to how I was running it on the bench so I used a power supply and bypassed the DC-DC and 12v battery. Still have the same problem, as soon as there is any kind of load on the motor I get an overcurrent trip.

I then decided to investigate the MFIV line further. At the prius side it is permanently at 6.75V. The interesting discovery was that if I removed the 12v from pin 27 of the VCU then I get a DESAT error not the OVERCURRENT error that I'm having a problem with.

It seems to me that there must be some other signal/bit of code that is triggering the overcurrent trip. I've looked through the forums and documentation but struggling to find out exactly how the overcurrent works with the FOC/Prius hardware.
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: Prius Gen2 adapter board development thread

Post by johu »

I'm surprised at even does anything with pin 27 not pulled up.
So the main trigger for all faults is TIM1_BKIN aka PB12. On Prius hardware that is expected high when all is well, which you've verified.
When it goes low, the firmware will sample various inputs and post an according error message. On Prius there is only DESAT but when it finds that pin high at the instant that PB12 is low it will fall back to OVERCURRENT instead.
Hmm. what is the value of hwver?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Prius Gen2 adapter board development thread

Post by tom3141 »

With pin 27 not pulled up, it let me start the inverter (I heard the main contactor click) but it then immediately tripped.

hwver is Prius and I’m using 4.96.R-foc firmware
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Prius Gen2 adapter board development thread

Post by tom3141 »

Good news today!

I decided to have a look over the wiring and shorten some of the signal cables that were too long. In the process of doing this I noticed that I had a wire going directly from GINV to pin 32 of the VCU that was not also connected to the car body ground. I tied these two to ground and it has almost completely fixed the issue. I think the wiring diagram on the wiki slightly confused me with this so we should probably clarify this to make it clearer.

I have still had a very occasional overcurrent trip which is odd but it is now driveable. The parameters need some work but it doesn’t feel far off. :-)
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: Prius Gen2 adapter board development thread

Post by johu »

Oh yes, that would be a problem ;)
Congratulations!
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

tom3141 wrote: Tue Dec 29, 2020 3:48 pm I decided to have a look over the wiring and shorten some of the signal cables that were too long. In the process of doing this I noticed that I had a wire going directly from GINV to pin 32 of the VCU that was not also connected to the car body ground. I tied these two to ground and it has almost completely fixed the issue. I think the wiring diagram on the wiki slightly confused me with this so we should probably clarify this to make it clearer.
The diagram was intended for only the inverter and VCU, as vehicle wiring varies GREATLY. If it would help clarify I can make that change however.
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Prius Gen2 adapter board development thread

Post by tom3141 »

ZooKeeper wrote: Wed Dec 30, 2020 2:56 pm The diagram was intended for only the inverter and VCU, as vehicle wiring varies GREATLY. If it would help clarify I can make that change however.
Yes, the diagram isn’t really wrong, I just hadn’t thought it through properly. I’ve added a sentence to the wiki below the diagram.
vin
Posts: 54
Joined: Mon Oct 26, 2020 3:05 am
Been thanked: 3 times

Re: Prius Gen2 adapter board development thread

Post by vin »

johu wrote: Mon Dec 28, 2020 4:03 pm I'm surprised at even does anything with pin 27 not pulled up.
So the main trigger for all faults is TIM1_BKIN aka PB12. On Prius hardware that is expected high when all is well, which you've verified.
When it goes low, the firmware will sample various inputs and post an according error message. On Prius there is only DESAT but when it finds that pin high at the instant that PB12 is low it will fall back to OVERCURRENT instead.
Hmm. what is the value of hwver?
Hi John

So I've managed to pull up pin 27 which has definitely helped. However I've using the REVERSE direction on VCU due to the orientation of my motor in the car. It appears to be giving me a very harsh jerk if i decelerate to sharply as if the regen is too sharp however I have regen set to 0. Should forward and reverse operate the same? How can I get to motor to cruse to a more gentle stop rather than such a sharp stop?
pablo
Posts: 2
Joined: Sun Jun 21, 2020 4:28 pm

Re: Prius Gen2 adapter board development thread

Post by pablo »

hello :D , dunce here. i have no idea what im doing wrong , i cant even get the vcu to power up and blink the little lights, i did the inverter side pin 25 to 12v. i followed the forum v1.2 wiring diagram i listened to the damien and hubner foc tunning video i read the Info Prius Package.pdf . i have the fillament lamp in series. i sacrificed the family goat. I NEEEEEEEEEEEEED HELP -_- sry im a dummy. also, no smoke no burning. inverter buzzez when i switch the 12v to ON but the VCU is inactive. ive read the old wiki, ive spent about 3 month trying to cath up in the discussion thread so i beg, can someone please teach me like im a 5 year old who just knows v=ir. i dont know too many abbreviations i get that ENCa is the cosine signal for the resolver or something but thats after i get it to turn on. and connect to wifi. :( ill make a video of how i installed it for others to learn from what ive read so far. and show my confusion
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: Prius Gen2 adapter board development thread

Post by johu »

To get help show us exactly what you wired up, best with labeled wires like "12V" and "GND"
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

pablo wrote: Wed Jan 06, 2021 11:15 pm ....no smoke no burning. inverter buzzez when i switch the 12v to ON
That is very good!
ive read the old wiki, ive spent about 3 month trying to cath up in the discussion thread so i beg, can someone please teach me like im a 5 year old who just knows v=ir. i dont know too many abbreviations i get that ENCa is the cosine signal for the resolver or something but thats after i get it to turn on. and connect to wifi. :( ill make a video of how i installed it for others to learn from what ive read so far. and show my confusion
Do you have the Prius Gen2 VCU from the Openinverter webshop? If so, just supply +12v & ground (VCU pins 20 & 19 respectively) and see if you get a flashing light on the physical board. Flashing = good :D

I attached a photo of where you *should* see the LED flashing merrily.
Attachments
VCU
VCU
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
User avatar
steveknox
Posts: 85
Joined: Mon Mar 11, 2019 9:36 am
Location: Bormley, UK
Has thanked: 15 times
Been thanked: 5 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by steveknox »

Hi, can anyone please tell me what the part number is for the right-angled connector for the olimex wifi module?
User avatar
steveknox
Posts: 85
Joined: Mon Mar 11, 2019 9:36 am
Location: Bormley, UK
Has thanked: 15 times
Been thanked: 5 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by steveknox »

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 »

We have a tuned motor! I've been at this for a couple hours every weekend recently having not touched it since about August, working through the FOC tuning video. The main problem I had was the resolver polarity. Got that right on the third combination out of four and it all went smoothly from there.

My Syncoff was 65000 on an Outlander motor. At 0 I was already in that dip, so it took a bit of going back and forth to figure out which side of the dip I was in. Wasn't too far off though. Throttle response is pretty nice now. I did try to upload the parameters to the database but I only downloaded a snapshot file. So I'll get a proper file tomorrow to upload. Hopefully it should help other people catch up quicker.

Thank you Damien and Johannes for the FOC tuning video! Would never have gotten this far without that.



The parameters from the snapshot file for those who might find it useful:
{
"curkp": 64,
"curki": 20000,
"curkifrqgain": 50,
"fwkp": -100,
"dmargin": -2000,
"syncofs": 65000,
"polepairs": 5,
"respolepairs": 5,
"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.75,
"udcofs": 327,
"udclim": 540,
"snshs": 0,
"pinswap": 5,
"bmslimhigh": 50,
"bmslimlow": -1,
"udcmin": 0,
"udcmax": 520,
"idcmax": 5000,
"idcmin": -5000,
"tmphsmax": 150,
"tmpmmax": 300,
"throtmax": 100,
"throtmin": 0,
"chargemode": 0,
"chargecur": 0,
"chargekp": 80,
"chargeki": 10,
"chargeflt": 8,
"chargepwmin": 0,
"chargepwmax": 90,
"potmin": 1400,
"potmax": 4095,
"pot2min": 4095,
"pot2max": 4095,
"potmode": 0,
"throtramp": 0.37,
"throtramprpm": 3500,
"throtcur": 1,
"brknompedal": 0,
"regenramp": 100,
"brknom": 30,
"brkmax": -30,
"brkcruise": -30,
"brkrampstr": 10,
"brkout": -50,
"idlespeed": 2000,
"idlethrotlim": 0,
"idlemode": 3,
"speedkp": 0.25,
"speedflt": 5,
"cruisemode": 0,
"udcsw": 0,
"udcswbuck": 540,
"tripmode": 0,
"pwmfunc": 0,
"pwmgain": 100,
"pwmofs": 0,
"canspeed": 1,
"canperiod": 0,
"manualiq": 0,
"manualid": 0
}
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: Prius Gen2 adapter board development thread

Post by johu »

Very cool! So like on the Leaf motor they have made an effort to align the resolver with the magnets so you barely need any offset (65000 is like -2.5° offset)
If you download the latest index.html and index.js you can submit to the database right from the web interface.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

Just refreshed myself with the parameter database video. I'll update those files tomorrow and give it a go.
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 »

Parameters added. Hopefully should be of some use to others.
User avatar
steveknox
Posts: 85
Joined: Mon Mar 11, 2019 9:36 am
Location: Bormley, UK
Has thanked: 15 times
Been thanked: 5 times
Contact:

Re: Prius Gen2 adapter board development thread

Post by steveknox »

Hi, can anyone confirm the part numbers for the two molex connectors?
Bram
Posts: 26
Joined: Sun Jun 21, 2020 12:27 pm
Location: Netherlands

Re: Prius Gen2 adapter board development thread

Post by Bram »

Hi Guys, Its been a while, but I need your help.
I've mounted my outlander motor to the gearbox and fitted it into my car (VW Polo mk1)
last days I'm testing the motor and inverter, watched hours on video's and found my (i believe) the correct "syncofs".
but now mounted, with wheels off the ground, the motor rarely start out of itself, it always needs a tiny push on the wheel before spinning.
while spinning I can make him spin slowly and super fast with out weird noise, very smooth. (with manualid 0.1 - manaualiq 5.0)

but it doesn't start itself (in manual nor closed loop) , I hear the inverter make noise, but wheels doesn't spin.
while making the noise I don't see a battery drain (0 amp) either.
What do i need to do?

below my parameters
{
"curkp": 64,
"curki": 20000,
"curkifrqgain": 50,
"fwkp": -100,
"dmargin": -2000,
"syncofs": 61600,
"polepairs": 5,
"respolepairs": 5,
"encmode": 4,
"fmax": 200,
"numimp": 60,
"dirchrpm": 100,
"dirmode": 0,
"snsm": 12,
"pwmfrq": 1,
"pwmpol": 0,
"deadtime": 0,
"ocurlim": 200,
"il1gain": 3.15,
"il2gain": 3.15,
"udcgain": 3.75,
"udcofs": 325,
"udclim": 540,
"snshs": 0,
"pinswap": 5,
"bmslimhigh": 50,
"bmslimlow": -1,
"udcmin": 6,
"udcmax": 220,
"idcmax": 150,
"idcmin": -50,
"tmphsmax": 85,
"tmpmmax": 300,
"throtmax": 100,
"throtmin": -100,
"chargemode": 0,
"chargecur": 0,
"chargekp": 80,
"chargeki": 10,
"chargeflt": 8,
"chargemax": 90,
"potmin": 0,
"potmax": 4095,
"pot2min": 4095,
"pot2max": 4095,
"potmode": 0,
"throtramp": 0.28,
"throtramprpm": 3500,
"throtcur": 1,
"brknompedal": -50,
"regenramp": 100,
"brknom": 30,
"brkmax": -30,
"brkcruise": -30,
"brkrampstr": 10,
"brkhistr": 1000,
"brkhistp": 1000,
"brkout": -50,
"idlespeed": 0,
"idlethrotlim": 50,
"idlemode": 0,
"speedkp": 0.25,
"speedflt": 5,
"cruisemode": 0,
"udcsw": 0,
"udcswbuck": 0,
"tripmode": 0,
"pwmfunc": 0,
"pwmgain": 100,
"pwmofs": 0,
"canspeed": 1,
"canperiod": 0,
"manualiq": 0,
"manualid": 0
}
Bram
Posts: 26
Joined: Sun Jun 21, 2020 12:27 pm
Location: Netherlands

Re: Prius Gen2 adapter board development thread

Post by Bram »

forgot to mention, I'm running 4.87.R-foc
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: Prius Gen2 adapter board development thread

Post by johu »

Try increasing "throtcur". Maximum current will be throtcur*100. So currently you only allow 100A but even with that the car should move. Hmm. Well try it. potmin and potmax look suspiciously like defaults, have you calibrated throttle?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Bram
Posts: 26
Joined: Sun Jun 21, 2020 12:27 pm
Location: Netherlands

Re: Prius Gen2 adapter board development thread

Post by Bram »

Thanks, will give a try with a higher "throtcur" like a 2 or even 5?
Do i need to increase the "idcmax" accordingly ? from a 150 to an 300A?
About the throttle, i still use a pot
Post Reply