Page 1 of 2

New use case: 230V AC from a few V DC

Posted: Wed Jan 20, 2021 11:49 pm
by johu
Got some new code for you: https://github.com/jsphuebner/stm32-island

So I did the obvious: hook up a 40V battery to the Prius Gen2 DC input, run the boost converter to give us about 300V DC and then run two phases at 50 Hz to give us 230V AC. Feed all that through a filter and run your appliances on it :)

I tried:
- an 850W coffee machine - check
- a jigsaw - check
- angle grinder - check

The most drop was caused by the coffee machine, 210V but I think thats because the battery pack couldn't keep up. The DC bus is PI controlled while AC is not controlled.

Video coming soon.

This is running on a Prius Gen2 board as is. To run it on a Gen3 Prius board you'd need to wire the buck/boost converter to the STM32.
The point is obvious: you can use MG2 to run your motor and MG1 to run your power tools. Or to make coffee.

I will change to layout to have TIM4 run the boost converter and therefor have TIM1 available to also make 3-phase AC.

Re: New use case: 230V AC from a few V DC

Posted: Thu Jan 21, 2021 2:19 am
by ZooKeeper
AWESOME!

Now we have recycled Toyota gear with bi-directional power! For those of us poor saps in the 'States, I suppose we will just need to keep an eye out for the 120/240vac appliance variants ;)

Re: New use case: 230V AC from a few V DC

Posted: Thu Jan 21, 2021 8:25 am
by Jack Bauer
Should be possible to set the dc bus to about 170vdc then you get 120vac. and at 60hz of course:)

Re: New use case: 230V AC from a few V DC

Posted: Thu Jan 21, 2021 8:26 am
by Jack Bauer
Gahhh! and of course I gave away all my gen2 inverters:)

Re: New use case: 230V AC from a few V DC

Posted: Thu Jan 21, 2021 9:47 am
by Dilbert
Jack Bauer wrote: Thu Jan 21, 2021 8:26 am Gahhh! and of course I gave away all my gen2 inverters:)
I have a spare if you want one!

Re: New use case: 230V AC from a few V DC

Posted: Thu Jan 21, 2021 1:13 pm
by johu
Jack Bauer wrote: Thu Jan 21, 2021 8:26 am Gahhh! and of course I gave away all my gen2 inverters:)
Yes, they all magically turned up here :) But you can eventually pull the same trick with the Gen3.

Video rendering.

What I've learned today: don't connect more brittle electronics to it. Blew the fuse in my laptop power supply. Screwless, pita to open :roll:

So robust output filtering is a must, ya know common mode chokes and such.

Re: New use case: 230V AC from a few V DC

Posted: Thu Jan 21, 2021 3:11 pm
by ZooKeeper
Jack Bauer wrote: Thu Jan 21, 2021 8:26 am Gahhh! and of course I gave away all my gen2 inverters:)
I have one, but shipping across the pond would be more than it's worth.

Oh, a quick read of the labels suggests much of the "120v" stuff I have will run on 50 or 60 Hz :D

Re: New use case: 230V AC from a few V DC

Posted: Thu Jan 21, 2021 4:50 pm
by johu
You can set it to any frequency anyway, allowing up to 65 Hz :)

Anybody know their way around inverter filtering? I.e. making a clean sine wave from a PWM synthesized one? The Leaf input filter board only created a lot of heat when I tried to use it. And the little EMI filter wasn't much help either. Even my HP bench meter sometimes conked out just from MEASURING the output!

Re: New use case: 230V AC from a few V DC

Posted: Thu Jan 21, 2021 5:55 pm
by Jack Bauer
Yeah most emi filters will be a)useless and b)melt down when you hit them with that much fast pwm:) Need a nice slow L-C filter to remove the high freq components. Presume you are doing svpwm on the output? See page 41 here :
https://web.wpi.edu/Pubs/E-project/Avai ... _final.pdf

Re: New use case: 230V AC from a few V DC

Posted: Thu Jan 21, 2021 10:54 pm
by celeron55
A spare prius boost inductor and cap as filter? Would handle a lot of power.

EDIT: Of course, doing modified sine wave allows not using filtering. Works nice for the laptop but is a bit hard on the fridge compressor.

Re: New use case: 230V AC from a few V DC

Posted: Fri Jan 22, 2021 2:32 am
by collin80
johu wrote: Thu Jan 21, 2021 4:50 pm You can set it to any frequency anyway, allowing up to 65 Hz :)

Anybody know their way around inverter filtering? I.e. making a clean sine wave from a PWM synthesized one? The Leaf input filter board only created a lot of heat when I tried to use it. And the little EMI filter wasn't much help either. Even my HP bench meter sometimes conked out just from MEASURING the output!
Yeah, been there, gotten the T-Shirt. I too have caused meter glitches while measuring a noisy output from a test inverter. It's quite exciting. Filtering the output does seem to require a large amount of capacitance and inductance. And, joy of all joys, inductors for this use can be really big. I admit, it's kind of a black art to me. I wish I knew how to do it better.

Re: New use case: 230V AC from a few V DC

Posted: Fri Jan 22, 2021 10:01 am
by johu
celeron55 wrote: Thu Jan 21, 2021 10:54 pm A spare prius boost inductor and cap as filter? Would handle a lot of power.

EDIT: Of course, doing modified sine wave allows not using filtering. Works nice for the laptop but is a bit hard on the fridge compressor.
Prius inductor should certainly be up the job.
Modified sine wave means square wave, right? Meh.
What I do remember though is that you can actually just pulse one leg and the other one just switches on every half cycle. Then there should only be switching noise on one leg.
collin80 wrote: Fri Jan 22, 2021 2:32 am Yeah, been there, gotten the T-Shirt. I too have caused meter glitches while measuring a noisy output from a test inverter. It's quite exciting. Filtering the output does seem to require a large amount of capacitance and inductance. And, joy of all joys, inductors for this use can be really big. I admit, it's kind of a black art to me. I wish I knew how to do it better.
Yes for 1 MW solar inverters that part literally weighed a ton. For our application Prius inductor should do :)

Now, early forum release:

Re: New use case: 230V AC from a few V DC

Posted: Fri Jan 22, 2021 11:13 am
by Jack Bauer
motor run caps are ideal for this sort of thing and quite cheap

Re: New use case: 230V AC from a few V DC

Posted: Fri Jan 22, 2021 1:01 pm
by arber333
Mhm... :twisted: so if i would use "HV car battery" + "Prius gen3 inverter" + toroidal 3x common mode choke inductor + 3x foil caps = i would be able to boost 3x 400Vdc from the car?
How would i separate phases, by 120deg?

Where would i put N line at HV battery MINUS? That is actually important for household appliances. I bet we could use a 3phase toroidal transformer with 3x primary and 3x secondary wired in star.

I could use inductor like this: https://www.alibaba.com/product-detail/ ... 26452.html
Of course DIY wound :).

There is a possibility to use 3x single inductors from 10kW 3phase UPS stations if you can get your hands on them. They are Litz wire inductors usually 5kW capable each...

Re: New use case: 230V AC from a few V DC

Posted: Sat Jan 23, 2021 6:16 pm
by johu
So, as most of you already knew: more filtering - more better.

I added a twin inductor that I found in the Nissan PDM (I think it was part of the boost stage) to the output path. And a 15u cap. Also kept the EMC filter. Immediately the voltage drops from 245 V to 210V (290 V on DC bus) denoting that we are pretty close to a clean sine wave (which would be 290/sqrt(2)=205 V).

I don't have the equipment to scope it but I bravely connected my old laptop to it and it ran just fine. Also ran a 2 kW hair dryer. That pulls 55A from my poor test pack and also runs well. It does reveal one weakness: Even though the bus voltage is kept pretty much constant, the AC voltage sags quite significantly to 180V AC.

One way to cure this would be measuring the AC voltage and controlling it, another would be measuring AC current and increasing bus voltage with current draw. Advantage of the latter: no extra hardware needed.

Re: New use case: 230V AC from a few V DC

Posted: Sat Jan 23, 2021 6:21 pm
by Jack Bauer
If I'm remembering this most 230vac stuff is specced +10/-15% so dc current monitoring might just work. If we want to go doing crazy stuff like running single phase induction motors it might prove a problem I guess....

Re: New use case: 230V AC from a few V DC

Posted: Sat Jan 23, 2021 6:50 pm
by johu
I'm sure you will be the one to find this limit. Or Jon Volk :D
Of course you can set the AC voltage to 240V idle. I think my setup is also limiting performance. Boosting 40V to 300V isn't great to begin with and under load the batteries sag to 33 V. I see 1870W going in but only 1100W coming out. Just under 60% efficiency.

Re: New use case: 230V AC from a few V DC

Posted: Sat Jan 23, 2021 11:14 pm
by collin80
johu wrote: Sat Jan 23, 2021 6:50 pm I'm sure you will be the one to find this limit. Or Jon Volk :D
Of course you can set the AC voltage to 240V idle. I think my setup is also limiting performance. Boosting 40V to 300V isn't great to begin with and under load the batteries sag to 33 V. I see 1870W going in but only 1100W coming out. Just under 60% efficiency.
60% isn't that bad though. In terms of "is it production ready?" well, no. But, getting 60% and having stuff work would suggest that you're getting close. Getting to super high efficiency would require calculating the proper L/C values and none of us has done that for this task. So, 60% with "what I had laying around" sounds pretty good to me. I have every confidence that calculating the proper values would increase efficiency. It's likely it could be pushed upward to something like 85-90%. Really, I'm very interested in your results and excited to hear that it seems to have worked.

Re: New use case: 230V AC from a few V DC

Posted: Sun Jan 24, 2021 9:29 am
by johu
I think I will poke around some more. Will increase the input voltage and see what that does to efficiency.

Re: New use case: 230V AC from a few V DC

Posted: Tue Jan 26, 2021 3:18 pm
by johu
So, played a bit more. I cleaned up the wiring, most of all removed the crocodile clips.
Bottom line: the higher the load, the lower the efficiency. That is probably down to the filtering inductance being too high?
Also the higher the input voltage, the better the efficiency. Best figure was 91.8% while making 422W AC. Couldn't test the full 2 kW because then my power supply overloaded.

Re: New use case: 230V AC from a few V DC

Posted: Tue Jan 26, 2021 8:18 pm
by ZooKeeper
I had planned to use the VOLTswagen Squareback as a backup power source, now it can be a fully integrated one!

Fantastic!!!

Re: New use case: 230V AC from a few V DC

Posted: Tue Jan 26, 2021 11:58 pm
by slow67
johu wrote: Tue Jan 26, 2021 3:18 pm So, played a bit more. I cleaned up the wiring, most of all removed the crocodile clips.
Bottom line: the higher the load, the lower the efficiency. That is probably down to the filtering inductance being too high?
Also the higher the input voltage, the better the efficiency. Best figure was 91.8% while making 422W AC. Couldn't test the full 2 kW because then my power supply overloaded.
The efficiency of the boost converter should be on the ORNL website. IIRC, the highest efficiency was when it didnt boost or buck.

Re: New use case: 230V AC from a few V DC

Posted: Sat Oct 16, 2021 7:36 am
by EV_Builder
If we want a proper sinus and the math done for us, wouldn't it be an idea to just hookup a UPS without batteries?

We then need to down convert to the lead batteries voltage and turn it on...

Not as fun though right?

Re: New use case: 230V AC from a few V DC

Posted: Wed Aug 24, 2022 11:16 am
by ianhora
Hello Johannes,
Will your Prius Gen 2 controller board drive a Camry Hybrid AVV50R inverter?
Have you modified it to make 3-phase AC?
Where does one get the 3-phase neutral from (or the single phase neutral, for that matter)?
Thanks for a great set of videos.
Regards,
Ian

Re: New use case: 230V AC from a few V DC

Posted: Wed Aug 24, 2022 7:45 pm
by Peter
Wow, do Costa go through all this technology just to make a coffee, no wonder its £3 a cup :-)