Prius Gen2 Adapter Board for CHARGING
Re: Prius Gen2 Adapter Board for CHARGING
OK thanks I think there is something wrong with the inverter as it will go into run mode and boost mode but not buck mode. I have ordered another inverter so will try again when I get this one. I bought the first one in a unknown condition and I have not been able to get the 12v dc to dc side working. Will post again once I have retested with the new inverter.
-
- Posts: 561
- Joined: Thu Jul 04, 2019 6:35 pm
- Location: Somerset, UK
- Has thanked: 75 times
- Been thanked: 212 times
Re: Prius Gen2 Adapter Board for CHARGING
I'm just about to start to look into the practical side of charging on my project now and I have been looking over this thread again. I just had a question about the power factor that you mentioned there. What are your thoughts on using this as a daily charger for a car given the power factor? Would the power factor affect performance enough that it might be better to use say the Eltek 3kw chargers that seem to be pretty cheap second hand?
-
- Posts: 561
- Joined: Thu Jul 04, 2019 6:35 pm
- Location: Somerset, UK
- Has thanked: 75 times
- Been thanked: 212 times
Re: Prius Gen2 Adapter Board for CHARGING
Ok I've been reading through the wikis, posts and watching the relevent youtube videos on repeat today. Ended up with what I think is a overview of the charging process. It looks like one or two things have changed over time.
Is this an accurate overview of the current state of charging with the gen 2 inverter?
Relevant Parameters
Process
Is this an accurate overview of the current state of charging with the gen 2 inverter?
Relevant Parameters
- Charge mode:Buck
- Chargecur: 1.5
- Chargekp 20
- Chargeki: 10
- Chargeflt 2 dig
- Charge pwmmin: 10 (Change this to get equivalent to min battery voltage.)
- udcswbuck: x (HV bus voltage at which point Ground signal is used to control AC and HV battery relays)
- CSDN (pin 29 on inverter)
Shuts down high and low IGBTs when fed 12v, via 470R
When CSDN is HIGH both IGBTs are OFF. - CPWM(pin 31 on control board, 13 on inverter)
Enables charge mode when fed 12v via 470R
When CPWM is HIGH, the LOW side IGBT is on(shorts out battery), when CPWM is LOW the HIGH side IGBT is on. - Forward and reverse (11 and 12 on control board)
Both must be high to enable charging - DCSW switch(15 in control board)
Controls DC relay switch.
- 240v AC plugs into two MG1 phases, with a precharge resistor always on.
Relay controlled by DCSW pin connected to ground side of relay signal wires. - HV Battery connected with precharge resistor
Relay controlled from DCSW pin connect to ground side of relay wires. - CPWM to 12v via 470R resistor.
- CSDN pin to 12v via 470R resistor. Ground side connected to DCSW pin.
CSDN pin also tied to DCSW signal pin.
Process
- Fwd and reverse signals high, relays open
- CPWM and CSDN pulled high.
- Connect AC input voltage with precharge
- DCSW will then close relays and pull down CSDN pin to activate charging.
- Activate buck on charger. By manual web interface or does just having FWD and Reverse high activate this?
- To stop, can change chargecur to 0 or switch off inverter power.
-
- Posts: 561
- Joined: Thu Jul 04, 2019 6:35 pm
- Location: Somerset, UK
- Has thanked: 75 times
- Been thanked: 212 times
Re: Prius Gen2 Adapter Board for CHARGING
One further question I have regarding the DCSW pin and relays. So from what I understand the DCSW switch can be used to close the AC relay once the HV bus is up to voltage. But the DCSW is also used to close the battery side contactors. So I thought this might cause some issues if the precharge on one side was done before the other.
However now I think about it, the HV bus should be common to both MG1 input and the battery inputs. So it isn't a question of precharging each side, it's just about charging up the HV bus. Is that right or have I got the wrong end of the stick?
I'm just trying to source some AC relays for my own setup. Is there a part number for that Leaf board you used for AC precharge and relays?
However now I think about it, the HV bus should be common to both MG1 input and the battery inputs. So it isn't a question of precharging each side, it's just about charging up the HV bus. Is that right or have I got the wrong end of the stick?
I'm just trying to source some AC relays for my own setup. Is there a part number for that Leaf board you used for AC precharge and relays?
- johu
- Site Admin
- Posts: 6619
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 343 times
- Been thanked: 1485 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
Forgot to comment on that one. Very good you wrote it up.
Yes CPWM should only be pulled high when you actually intend to charge, likewise CSDN. That way the upper IGBT stays closed and allows regen current to exit the inverter.
When charge mode is set to buck the inverter precharges to "udcswbuck" instead.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 561
- Joined: Thu Jul 04, 2019 6:35 pm
- Location: Somerset, UK
- Has thanked: 75 times
- Been thanked: 212 times
Re: Prius Gen2 Adapter Board for CHARGING
Thanks for confirming that. That makes sense. I have updated my post and added the section to the wiki.
Ah I see, So I am guessing there that the udcswbuck would be for when the AC is connected to MG1 and that voltage would be higher than the battery voltage. So the HV bus needs to precharge to that higher voltage?
- johu
- Site Admin
- Posts: 6619
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 343 times
- Been thanked: 1485 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
Yes exactly.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 561
- Joined: Thu Jul 04, 2019 6:35 pm
- Location: Somerset, UK
- Has thanked: 75 times
- Been thanked: 212 times
-
- Posts: 861
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 514 times
- Been thanked: 49 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
Question not too dumb (I think)...
Does Mg1 motor need to be disconnected from circuit before using the Charge function? Basically, if I were to run both Mg1 and Mg2, I would need to make a HV Contactor box for seperating Mg1 motor before charging?
Does Mg1 motor need to be disconnected from circuit before using the Charge function? Basically, if I were to run both Mg1 and Mg2, I would need to make a HV Contactor box for seperating Mg1 motor before charging?
- johu
- Site Admin
- Posts: 6619
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 343 times
- Been thanked: 1485 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
Yes, grid 400V AC into the motor is not good
(probably just trips your house fuse)

Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- NiHaoMike
- Posts: 68
- Joined: Mon Dec 02, 2019 4:11 am
- Location: Austin, TX
- Been thanked: 2 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
Might be interesting to explore the idea of using MG1 as an inductor for charging, just like the Renault Zoe. Easy way is to add a bridge rectifier with the output connected between phase B (since phases A and C have current sensors) and HV ground.
My first solar power system helped Naomi Wu, now I want to do even more with DIY solar.
-
- Posts: 861
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 514 times
- Been thanked: 49 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
I am looking for firstly, a short term solution, to recharge my prius battery for testing purposes. So if MG1 is not in use, I can hard wire in the current solution.
However, I will be running dual motors in the end, so it looks like an external charger will be better suited, since bridge rectifiers will set off alarm bells with my TUV equivalent regulations here.. Another Inverter is too much waste I feel.
However, I will be running dual motors in the end, so it looks like an external charger will be better suited, since bridge rectifiers will set off alarm bells with my TUV equivalent regulations here.. Another Inverter is too much waste I feel.
Re: Prius Gen2 Adapter Board for CHARGING
I ran into a strange issue while testing charge mode.
When using 24V from a powersupply everything seems to work OK.
However, things didn't quite work when I switched to 110VAC:
A few seconds after plugging in the 110VAC (U and W on MG1, 30Ohm precharge resistor always on) the AC contactor closes (udcswbuck set to 160V)
However, the board reports a DESAT error and I see 160VDC on the HV battery bus and 0VDC on the DC bus.
I have nothing plugged into the HV battery bus, since I want to charge a 12V lead acid battery (for testing) so 160VDC wouldn't be great.
As soon as I unplug the 110VAC from MG1 the DESAT error is gone.
Any idea where that DESAT error is coming from?
When using 24V from a powersupply everything seems to work OK.
However, things didn't quite work when I switched to 110VAC:
A few seconds after plugging in the 110VAC (U and W on MG1, 30Ohm precharge resistor always on) the AC contactor closes (udcswbuck set to 160V)
However, the board reports a DESAT error and I see 160VDC on the HV battery bus and 0VDC on the DC bus.
I have nothing plugged into the HV battery bus, since I want to charge a 12V lead acid battery (for testing) so 160VDC wouldn't be great.
As soon as I unplug the 110VAC from MG1 the DESAT error is gone.
Any idea where that DESAT error is coming from?
- johu
- Site Admin
- Posts: 6619
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 343 times
- Been thanked: 1485 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
What are your charger parameters? Did you measure the two voltages with a meter? The board itself can only measure one of them.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Re: Prius Gen2 Adapter Board for CHARGING
Yes, measured with meter on copper bus bars.
Charger Params:
Charge mode:Buck
Chargecur: 2
Chargekp 20
Chargeki: 10
Chargeflt 2 dig
pwmmin: 7
pwmmax: 9
udcswbuck: 155
Charger Params:
Charge mode:Buck
Chargecur: 2
Chargekp 20
Chargeki: 10
Chargeflt 2 dig
pwmmin: 7
pwmmax: 9
udcswbuck: 155
Re: Prius Gen2 Adapter Board for CHARGING
quick update: So the DESAT error was due to the 12V supply drooping when the contactor closed. Replaced it with a solid 12VDC supply and no more errors.
I see 164.8VDC on the DC bus and 164.2V on the HV battery side.
pwmmin is set to 7.18, pwmmax to 9.0.
I was expecting the regulation to only happen within the min-max window (11.8VDC and 14.8VDC), even without a load/battery attached. I changed the pwmmin and pwmmax values but they seem to have no effect on the HV battery bus voltage. What pin has the PWM signal that's used to control the charging voltage?
parameters attached.
firmware 5.06.R-foc
I see 164.8VDC on the DC bus and 164.2V on the HV battery side.
pwmmin is set to 7.18, pwmmax to 9.0.
I was expecting the regulation to only happen within the min-max window (11.8VDC and 14.8VDC), even without a load/battery attached. I changed the pwmmin and pwmmax values but they seem to have no effect on the HV battery bus voltage. What pin has the PWM signal that's used to control the charging voltage?
parameters attached.
firmware 5.06.R-foc
- Attachments
-
- 110VAC_12VDC_charging_20210917.json
- (1.33 KiB) Downloaded 251 times
- johu
- Site Admin
- Posts: 6619
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 343 times
- Been thanked: 1485 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
Try loading the output with a cooker element or something.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Re: Prius Gen2 Adapter Board for CHARGING
Is CPWM supposed to stay pulled high with 470ohm at all times when charging?
-
- Posts: 561
- Joined: Thu Jul 04, 2019 6:35 pm
- Location: Somerset, UK
- Has thanked: 75 times
- Been thanked: 212 times
Re: Prius Gen2 Adapter Board for CHARGING
My bad, I had the wrong pin pulled up high. My HV battery bus voltage is now within the expected window. The charging current however is not where I'd expect it to be. I set it to 1A and saw 2.5A output. Set it to 5A and 10A and also got 2.5A both times. When increasing pwmmax to 10 and max charging current at 10A I saw it spike to 30A and then settle at 26A. All currents were measured with a clamp meter on the HV battery bus cable going to the 12V lead acid battery.
- johu
- Site Admin
- Posts: 6619
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 343 times
- Been thanked: 1485 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
Yes in buck mode chargecur (well, rather unintuitively) refers to the INPUT current as that's where the current sensors are located.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Re: Prius Gen2 Adapter Board for CHARGING
That is actually good for my application to avoid overloading the weak US circuits! I never considered installing an element on the battery side to test charging, I will do it!

Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
"Talent is equally distributed but opportunity is not." - Leila Janah
Re: Prius Gen2 Adapter Board for CHARGING
Got it.
Just to recap:
When in charge mode the PI loop regulates the pwm duty cycle within pwmin and pwmax which changes HV battery voltage to achieve set charging current (on AC input).
There is no upper current limit for the input, right?(in case the PI loop freaks out due to poor tuning)
Is there a way of approximating the DC charging current on the battery side based on the other known parameters?
Just to recap:
When in charge mode the PI loop regulates the pwm duty cycle within pwmin and pwmax which changes HV battery voltage to achieve set charging current (on AC input).
There is no upper current limit for the input, right?(in case the PI loop freaks out due to poor tuning)
Is there a way of approximating the DC charging current on the battery side based on the other known parameters?
Re: Prius Gen2 Adapter Board for CHARGING
Watts in ~= Watts Out???
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
"Talent is equally distributed but opportunity is not." - Leila Janah
- johu
- Site Admin
- Posts: 6619
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 343 times
- Been thanked: 1485 times
- Contact:
Re: Prius Gen2 Adapter Board for CHARGING
Yes recap is correct. There is a hardware limit implemented in the Prius hardware, therefor there is no further (configurable) current limit on the control board itself.
Yes that would be possible, for display purposes at least.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9