Page 12 of 37
Re: Prius Gen2 adapter board development thread
Posted: Thu Jul 16, 2020 8:18 pm
by konstantin8818
johu wrote: ↑Thu Jul 16, 2020 8:09 pm
No we are on a gen2 here. The lower channels remain unused, the power stage creates its own deadtime. Leave it at 0 or it will distort your waveform.
I believe this is exactly what happened when I (watched Damien's videos with blown capacitors) set a 130 deadtime. Inverter started to behave strange and become sluggish.
Re: Prius Gen2 adapter board development thread
Posted: Thu Jul 16, 2020 8:43 pm
by SciroccoEV
To try and make this clear for the hard of thinking.
Three PWM lines control ALL SIX transistors.
The transistors are driven as complimentary pairs, so the dead time control can only be done internally in the intelligent power module.
Re: Prius Gen2 adapter board development thread
Posted: Thu Jul 16, 2020 9:21 pm
by arber333
SciroccoEV wrote: ↑Thu Jul 16, 2020 8:43 pm
To try and make this clear for the hard of thinking.
Three PWM lines control ALL SIX transistors.
The transistors are driven as complimentary pairs, so the dead time control can only be done internally in the intelligent power module.
Ah so it is IPM with internal drivers. Our 1 2 3 pwm channels only provide signal 1 or 0 to each pair for MG1. Then 4 5 6 are floating? Couldnt we use them to drive MG2 in parallel? Back to mad scientist with me...
Re: Prius Gen2 adapter board development thread
Posted: Thu Jul 16, 2020 10:13 pm
by imwoody36
greetings everyone,
Ive a question about resolver connections.
I believe these are the colors and signals for the gen2 prius MG1 resolver( and if anybody has MG2 connections I can easily find the colors by the attached photo)
black GRF = exc a
white grfg=gnd
red GSN=ENC A
green GSNG= SIN a
Yellow GCs= ENC B
Brown Gcsg= cos a
and I believe the pin mapping JOHU provided shows
pin1 is ENC_B would be yellow
Pin2 is S1S4 would be ??
pin3 is ENC_A would be red
Pin4 is R1 ( exit a?) would be black
Pin 5 is Resolver 2 would be ??
so 6 wires and 5 connection points
my question is this , where does cos A belong and where does Sin A belong?
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 5:22 am
by RetroZero
I found some info whilst trolling threads. Will start documenting this stuff soon.
AFIK, looking at the back of the connector to both MG1 and Mg2,
PIN 1 - MRF = PIN 6 - EXITATION (adapter board)
PIN 2 - MSN = PIN 3 - ENC A
PIN 3 - MCS = PIN 1 - ENC B
PIN 4 - MRFG = PIN 2 - S1/S4 GROUND
PIN 5 - MSNG = PIN 4 - R1
PIN 6 - MCSG = PIN 5 - R2
Hope that helps, and hope I got it right.
Edit, looking at your diagram, this is for MG1 only
Edit, looking closer at where I found this info, it's from an RX400H....
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 5:47 am
by RetroZero
deleted - incorrect pinout
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 7:56 am
by johu
imwoody36 wrote: ↑Thu Jul 16, 2020 10:13 pm
black GRF = exc a
white grfg=gnd
red GSN=ENC A
green GSNG= SIN a
Yellow GCs= ENC B
Brown Gcsg= cos a
and I believe the pin mapping JOHU provided shows
pin1 is ENC_B would be yellow
Pin2 is S1S4 would be ??
pin3 is ENC_A would be red
Pin4 is R1 ( exit a?) would be black
Pin 5 is Resolver 2 would be ??
so 6 wires and 5 connection points
my question is this , where does cos A belong and where does Sin A belong?
GRF -> R1 (Pin 4)
GRFG -> R2 (Pin 5)
GSNG and GCSG -> S1S4 (Pin 2)
GSN -> S2 (Pin 3)
GCS -> S3 (Pin 1)
Maybe I'm mistaken about the last two but thats what the pinswap parameter is for (if not moving, set to 2)
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 11:35 am
by RetroZero
Thanks Johu. 2 out of 6 for me. I'll go hide in a corner now.
I wonder how screwed up my throttle is now

Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 11:48 am
by arber333
RetroZero wrote: ↑Fri Jul 17, 2020 5:47 am
Throttle pedal from gen 2 prius:
Pin 1 - VCP2 = PIN 6 - 5V
PIN 2 - EP2 = PIN19 - GRND
PIN 3 - VPA2 = PIN 8 THROTTLE 2
PIN 4 - VCPA = PIN 6 - 5V
PIN 5 - EPA = PIN PIN 19 - GRND
PIN 6 - VPA = PIN 7 - THROTTLE 1
Again, good if someone with experience with this could validate.
See here the pin positions:
viewtopic.php?f=9&t=335#p3772
You probably have the 2gen pedal with wider pins. I used one in mazda
https://mazdamx3ev.wordpress.com/2016/02/12/pedal/
Pin 1 is the
lowest pin on connector when pedal is installed.
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 12:01 pm
by RetroZero
Thanks Arber, seems I got that one right

Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 5:13 pm
by ZooKeeper
Update...
I was having troubles maintaining a WiFi connection to the HICU, found three things: 1) Low supply voltage (<11.5vdc) seems to cause lost signal, 2) with multiple WiFi signals, the computer kept switching between them (I "forgot" all the others, which helped) and 3) Having a dedicated device WiFi (iPad in my case) made life much simpler.
Also used the 5v ref for the Gen2 Prius pedal, but to keep POTMAX <5000, I had to use a 200 ohm resistor on the 5v supply. Obviously that is not the best option because additional 5V loads will change the circuit voltage. When I get the MGR spinning smoothly and am ready to really validate every circuit, I will move the resistor to the signal side.
I used the "AUTO" + Refresh option to watch "POT" in the Spot_Values area and found idle = 777 & WOT = 4011 with very good consistency. So I set POTMIN = 780 and POTMAX = 3975. This should ensure the dead pedal = idle and fully depressed is 100% throttle.
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 5:36 pm
by TheSilverBuick
What is the resistance range of the pedal? I will likely be using a simple potentiometer with a lever on my ATV, but need to pick one with an appropriate Ohm range (0-5k, 0-10k, etc). I tried googling it, but just get the voltage range, but do not know the amps to calculate the ohms.
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 5:40 pm
by ZooKeeper
TheSilverBuick wrote: ↑Fri Jul 17, 2020 5:36 pm
What is the resistance range of the pedal? I will likely be using a simple potentiometer with a lever on my ATV, but need to pick one with an appropriate Ohm range (0-5k, 0-10k, etc). I tried googling it, but just get the voltage range, but do not know the amps to calculate the ohms.
Most "modern" Throttle Pedals are of the Hall Effect type, no resistance measurement, they are Vin >> Vout based on position.
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 5:49 pm
by TheSilverBuick
Hmm, that would explain the troubleshooting specs being read in voltage and not resistance. I was hoping to use a shaft potentiometer with a lever, but if I have to rig up a system to use an automotive TPS, I'll figure something out. Thanks!
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 5:54 pm
by ZooKeeper
Any resistor will cause a voltage change, but how much depends on both the specific pot resistance and the input impedance of the controller combined (V = IR).
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 7:05 pm
by imwoody36
okay thanks for the support, but I dont think pin6 is to be used for the resolver as it is labled 5v output.
instead I think
pin 1 = yellow ( enc b)
pin 2= green and brown ( sin a and cos a)
pin 3= red ( enc a)
pin 4 = black r1
pin 5 = white r2
does anybody disagree?
my assumption is that the image I found matches the toyota resolver
Re: Prius Gen2 adapter board development thread
Posted: Fri Jul 17, 2020 7:43 pm
by ZooKeeper
Since that is the only 5V on the VCU, it will have to serve as the "VRef" for all the attached sensors except motor temp.
Re: Prius Gen2 adapter board development thread
Posted: Sat Jul 18, 2020 2:44 pm
by ZooKeeper
Ran into a few snags to be worked out.
1) I double, triple and quadruple checked my MGR / Q211 resolver connections and I see no signal at all from it in the interface. Next step is to perform voltage measurements on the lines. Polepair settings were tried from 1 thru 8, but I will do some more testing.
2) Motor (MGR/Q211) will not spin smoothly, just jiggles. I tried many of the parameters published, no solution yet, but today this is project # only
3) It appears that when I change "snsm" it affects "snshs" and vice-versa, the closest I can get to rational number is if both are set to "Leaf". Even then, they are off by 50*C or more. Is there something in the coding I can alter to add an offset value, remembering that I am NOT a programmer ???
The Throttle is all set though, although I am unable to get more than 3325 counts of resolution, it seems to be smooth and linear

Re: Prius Gen2 adapter board development thread
Posted: Sat Jul 18, 2020 6:47 pm
by ZooKeeper
I removed this post as it does not really belong in this thread.
Re: Prius Gen2 adapter board development thread
Posted: Sat Jul 18, 2020 8:08 pm
by imwoody36
zookeeper, it looks like your setting for encoder mode is not set to resolver.
( you are ahead of me .. at least you have lights)
is your motor a toyota and is the resolver factory?
Re: Prius Gen2 adapter board development thread
Posted: Sat Jul 18, 2020 8:09 pm
by LRBen
Looks like you pushed a few too many Amps through those small wires.
I have hooked up my old 3 phase lathe motor but can't seem to get it running. Using the same settings as I was for the delta light test.
When running fslipspnt at 8Hz or higher there is nothing noticeable happening and the motor will spin freely by hand. However at very low settings like 0.3 and 1 there is a noticeable resistance to turning the motor by hand in time with the pulses and the pulses will stop the motor from turning.
I've tried switch phases wires around and the outcome is always the same.
Re: Prius Gen2 adapter board development thread
Posted: Sat Jul 18, 2020 10:00 pm
by ZooKeeper
imwoody36 wrote: ↑Sat Jul 18, 2020 8:08 pm
zookeeper, it looks like your setting for encoder mode is not set to resolver.
( you are ahead of me .. at least you have lights)
is your motor a toyota and is the resolver factory?
Complete stock and set to resolver.
I ran into another issue after working to install the DC and precherge relays.... The pre-charge would drop out after a few seconds, turned out that the small "197" bulb I was using to confirm bus voltage was pulling more amps than the PC resistor could supply. Remove indicator = fixed, both PC and DC relays behave as expected.
Re: Prius Gen2 adapter board development thread
Posted: Sun Jul 19, 2020 12:07 am
by ZooKeeper
Now with FOC and having followed the "Using FOC Software" instructions, I get zero output on any of the three phases and I don't hear any PWM being applied (although I have mild tinnitus...). Any ideas?
The GREAT news is that now the Resolver works perfectly w/FOC 4.87.R and I can even count revolutions and seems to match published gearing almost exactly

Re: Prius Gen2 adapter board development thread
Posted: Sun Jul 19, 2020 8:37 am
by johu
ZooKeeper wrote: ↑Sun Jul 19, 2020 12:07 am
Now with FOC and having followed the "Using FOC Software" instructions, I get zero output on any of the three phases and I don't hear any PWM being applied (although I have mild tinnitus...). Any ideas?
The GREAT news is that now the Resolver works perfectly w/FOC 4.87.R and I can even count revolutions and seems to match published gearing almost exactly
Great the resolver works.
Run mode or Manual mode? Is dir=forward? Either by setting dirmode=AlwaysForward or applying 12V to forward pin. All derating parameters set up in a way so they don't derate? (Shouldn't matter in manual mode however)
Re: Prius Gen2 adapter board development thread
Posted: Sun Jul 19, 2020 3:44 pm
by ZooKeeper
Yes, same as I had with Sine, but no movement.
I did notice something odd after loading the current SIN.bin file for testing, every time I try and enter 8 for fslipspnt & 75% for ampnom, it reverts to 1 and 10%, almost like it is dividing by 10 and rounding??? Every time I refresh, they do the same. I found 4.85.R is normal for these params.
Wondering if the inverter is ok after the minor short yesterday. Although I cannot see how that would be possible to damage it A 40V with 20ga wires and a power supply limited to <100A.