Prius Gen2 Adapter Board for CHARGING

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 for CHARGING

Post by RetroZero »

Gotcha
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 for CHARGING

Post by RetroZero »

Got my setup into Charge Mode finally. Time to do some charging attempts tomorrow.

Been going over this thread from start again.
It might be a good idea to split it for BUCK charging from MG1 and BOOST charging from Air Con Output

It could be confusing for people who join later. I do plan to do a Wiki thread for MG1 Charging once all is working nicely.
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 for CHARGING

Post by LRBen »

RetroZero wrote: Sat Apr 09, 2022 7:43 pm
It might be a good idea to split it for BUCK charging from MG1 and BOOST charging from Air Con Output
Probably a good idea for the wiki thread. I'll have to update the notes I made on this with the recent findings then I can throw those up as well.

This is how i have the junction box setup now. The main positive contactor connects to the HV bus, with a precharge resistor and contactor.
For charging I have a second contactor that connects to the default battery inputs, I linked this contactor to the signal for the AC contactor so they both close together and I don't have to change my setup at all.

In there is also the AC precharge resistor which is always connected, as well as the SIMP charge module with a couple small relays that ground the Teensy VCU signal wires for CP and PP on the EVSE.
PXL_20220409_150633816.jpg
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 for CHARGING

Post by RetroZero »

looking good, why is the AC precharge resistor always connected?
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 for CHARGING

Post by LRBen »

Johannes said it wouldn't hurt and I am a cheapskate trying to save buying another contactor.
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 for CHARGING

Post by RetroZero »

So I managed to test with 24v dc on Mg1 U and W to DC Bus (no load) . Changing PWMIN seems under control, 50% of 24v =12v.
I set PSDN to be pulled high on startup and go floating after 0.5sec.
Buck mode is detected too.
Now to recheck wiring, as my dcsw on HV battery is not closing.
I have the 2 sets of contactors in parallel so precharge and dcsw happens at the same time on AC and DC of inverter.
I was feeling lucky and took the risk of connecting 220vAC with PWMIN @10%, tripped house mains directly.
Time to investigate.
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 for CHARGING

Post by LRBen »

When I tripped the mains it was because when I added in the second battery contactor for charging or driving I forgot to change the code. So I was closing both contactors, shorting battery input positive and the HV bus positive.
Which could have gone worse.
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 for CHARGING

Post by RetroZero »

Change the code?
I'm running standard battery HV inputs to inverter.
I know that means I am limited to 20Kw, but that's fine for now.
So don't see the need for different code, except the update Johu posted a while back in this thread.
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 for CHARGING

Post by LRBen »

Sorry I wasn't very clear on my setup. My contactors are controlled a separate Teensy based VCU I designed and coded. It takes the inputs signals from the inverter control board and then activates the contactors based on that. The idea was that I could add in additional safeguard checks before closing the contactors.
How I have it setup there are separate outputs to control AC, battery + and precharge contactors. So when I added in the extra contactor I had to parallel the AC and the new battery + for charging contactor. So when charging I really don't want to close the normal battery + contactor which connects to the HV bus.

If you only have one connection from battery to the normal battery inputs none of this will matter. It's just the only time I have managed to trip a breaker.
I don't use the precharge contactor on the battery side though. Have you got a photo of your contactor setup?
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 for CHARGING

Post by RetroZero »

Thanks for the reply. I am busy charging 12v battery from 24v DC supply on MG1.
So far, so good...
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 for CHARGING

Post by RetroZero »

Champagne !!
Firstly, I set udcgain to 27. I had 12v battery hooked up to battery inputs, voltmeter on dcbus showing similar value, but udc in parameters showing around 50v...
Idc was around 115amps ,and il1 and il2 were around 56amps each.
Once udc was close to measured value on dcbus, il1 and il2 became more plausible values automatically (around 1amp).??

After adding battery by battery, I got to charge a 12v battery (hv battery inputs) from 84v DC input on Mg1 (7 batteries in series)
I played around with pwmin and pwmax to see their effects on bus voltage and amps.
I took the plunge and hooked up 230v ac house mains, configured for 27% charge and succeeded in charging at 80 or so volts!
No mains tripping 🎉
Will attempt charging original prius battery pack tomorrow.
Will go through wiring and schema and put it in the wiki once happy with setup.
Thanks to everyone chipping in to get this to 2 viable charging options from inverter.
More tuning and parameters to follow.
Did notice quite a spike when I turned off charge mode (removed ac plug). On second attempt, I changed pwmin to below pack voltage and then switched off. No spike.

Would pulling CSDN high and then removing the plug be a better option?
Attachments
DSC_1650.JPG
DSC_1649.JPG
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 for CHARGING

Post by RetroZero »

Connected Prius battery pack after 2 years of sitting and no charge. Pack is at 170v, so set chargepwm to 180v with amps fluctuating between 1.5 and 6 amps (using ampmeters to check).
I am using identicle parameters to LRBen, apart from chargepwmin and chargepwmax.
I noticed that udc is way out according to my multimeter - 54v in parameters and 180v on multimeter, along with il1 and il2. (I saved my parameters to flash before charging).

Am I correct in checking udc on the udcbus (terminals inside inverter where positive and negative from original battery connect to)?
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 for CHARGING

Post by LRBen »

As far as I know UDC is the High Voltage bus in the inverter, this is after the buck/boost converter so separate from the battery inputs. The battery inputs share the negative busbar. However you should notice that the positive bus bar from the battery inputs go into the converter and is not connected to the other busbar like the negative is.

So UDC should be around 320v ish when you are plugged into the mains. It's worth playing around with the other charge settings, I had to change them quite a bit when I dropped 20s on the battery side in order to get the amps up. You can adjust UDC with UDCGAIN and UDCOFS settings to match your multi meter readings once you have a known voltage in the HVbus.
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 for CHARGING

Post by RetroZero »

Thanks, I can confirm I was testing the wrong side of the converter( HV battery side).
I have set udcgain to 5 and obtain a similar value to multimeter reading (to the converter) - approx 300vdc.
I also connected the ac inputs on MG1 to V and W( looking at the inverter from the front, it's the 2 poles to the right). When charging, Il1 and Il2 alternate their values, by changing the inputs, their respective values are steady (around 37amps) - don't know if this is better or not.

Before changing the offsets of Il1 and Il2, I would like to confirm that these values are amps INTO the inverter/converter.
I can read 0.8amps ac comming in from house mains @ 220vdc (70% chargepwmin) on HV Battery outputs, but Il1 and Il2 read approximately 37amps each in Plot Values.
Idc seems to be the total of il1 and il2 - 75amps.
My 2 ampmeters read about 0.4amps dc going into the HV battery - big difference. Woulld like to understand this element more before upping the volts and therefore the amps.
In the meantime, I'll recheck the parametersposted previously in this thread.
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 154 times
Been thanked: 960 times
Contact:

Re: Prius Gen2 Adapter Board for CHARGING

Post by johu »

You can't set current sensor offset manually, it is determined at startup.
The gains are a bit odd. If you calibrate correct gain for MG2 you will find MG1 would need double that gain (which is actually a divider). You can either live with it or mess around with the input resistors which are 100k on both inputs right now.

And yes, what you're seeing is AC current into the inverter
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 for CHARGING

Post by LRBen »

I never really got much sense out of the il1 and il2 readings, I am pretty sure I calibrated for MG2 back when I first got the inverter. I use the ISA shunt for my current reading since that seems to be pretty accurate and it's already on the canbus.
I have the mains input on the two outer phase connectors of MG1. Never tested switching them around.

0.4 amps into the battery seems similar to what I was getting at the start. I had to set chargecur at 15 to get max amps going into the battery, anything over that had no effect. It will be interesting to see the difference between what is drawn from the house mains and what ends up in the battery. I just bought a plug meter so I'll find out next week when it turns up.
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 for CHARGING

Post by RetroZero »

johu wrote: Thu Apr 14, 2022 8:11 pm You can't set current sensor offset manually, it is determined at startup.
The gains are a bit odd. If you calibrate correct gain for MG2 you will find MG1 would need double that gain (which is actually a divider). You can either live with it or mess around with the input resistors which are 100k on both inputs right now.

And yes, what you're seeing is AC current into the inverter
So, what are we changing when we adjust the parameter settings for the currents?

If I can verify I have 1amp AC comming into MG1 via house mains, and around 0,7amps going to hv battery, adjust il1 & il2 gains won't change anything?
If I was to change the input resistors (in the inverter or adapter board) , then MG2 would be out of synchronisation?

I don't want to damage my inverter or board, or anything else by simply bumping up volts/amps.
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 for CHARGING

Post by RetroZero »

johu wrote: Fri Apr 01, 2022 8:51 am chargekp - proportional controller gain - how much does the controller counter-act momentary errors between desired and actual current. Mostly important if you want to quickly react to the sinusoidal shape of the grid input current.

chargeki - integral controller gain - how fast does the controller react to long term errors between desired and actual current, i.e. how fast does it ramp up charge current

chargeflt - how much is the measured current low-pass filtered before being fed into the PI-controller. Dampens down noise on the current sensor but also increases reaction time to the grid sinus
Does this mean that the higher the parameter value setting, the quicker the reaction?
I'm trying to get my setup running where I can be confident I'm not damaging anything.
It seems I have a dead short at times on powering up and would like to set ramping up as slow as possible. Changing charge values definitely has an effect. But it's guessing games, and I'm not too happy with that.
There also seems to be a large spike (>10amp) on power up. After tripping mains and powering up again, there's about 7amps and no tripping.
With current setup I'm getting about 2-3adc to battery @ 233vdc once everything is settled down.
I'm connected to a standard prius pack, nominal voltage 201v (270v max).
The missus is getting worried about all the mains tripping, me too...
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 for CHARGING

Post by RetroZero »

My current spaghetti setup
Attachments
DSC_1672.JPG
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 for CHARGING

Post by RetroZero »

I'm getting around 3amps into hv battery at the moment. That's a big step forward for me, but still tripping mains when first connecting.
@LRBen, are you switching on adapter board (allowing to select charge mode) before applying ac voltage? I might have my sequence switching too quickly and would like to fine tune.
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 for CHARGING

Post by LRBen »

My VCU waits for 3 seconds on start up before going through the charge or run loop. I'm guessing this gives the adaptor board time to wake up.
Currently if I want to charge I will power up the adaptor board alone and switch to buck mode, power off and then power on everything at the same time.

I did wonder if there was any need to turn charge mode on or off if I was driving from HV Bus and charging from the battery inputs. Could I just leave it on buck mode all the time?
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 for CHARGING

Post by RetroZero »

From what I understand, if reverse and forward are not high at the same time, buck mode cannot be selected.
I'm going to setup a delay after powering up adapter board and see how it goes.
Thanks for the reply.
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 154 times
Been thanked: 960 times
Contact:

Re: Prius Gen2 Adapter Board for CHARGING

Post by johu »

LRBen wrote: Wed Apr 20, 2022 4:19 pm I did wonder if there was any need to turn charge mode on or off if I was driving from HV Bus and charging from the battery inputs. Could I just leave it on buck mode all the time?
Yes, it only becomes active with the reverse/forward combination
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 for CHARGING

Post by LRBen »

Think I may have broken something. Went to charge the battery up a little today and it flipped the RCD and also the Earth fault breaker.

Killed my teensy VCU so I won't be doing any thing meaningful until I get that replaced. Thinking I might go for an Arduino Due next time, teensy seems a little delicate.

In the meantime I've been trying to figure out what went wrong. I've noticed that all the busbars in the inverter have continuity with each other now. So I'm guessing I might have fried my buck booster converter which is now shorting all the HV stuff.
Edit: Seems like the HV busbars are only shorting when HV bus is at voltage. Is this just the high side IGBT being on given CPWM is low?
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 for CHARGING

Post by RetroZero »

Sorry to hear that. This is what worries me with mine that trips on first start up.
Post Reply