# Using the inverter topology as a boost mode charger



## jhuebner (Apr 30, 2010)

I'm splitting this off the homebrew thread for now, as its only an experiment.

I was wondering if there is a boost topology anywhere in the motor connected to the inverter. Well there is (and I'm not the first one to find out):










So you connect you input voltage, which must be smaller than the battery voltage to B- and one of the phase legs, in this case L1.

The bottom IGBT of L2 is the boost switch, the top diode the diode of the boost converter. The motor coils make up the inductance, consisting of coil1 in parallel to coil2+coil3.
The bus capacity is the output capacitor. The current sensor senses the input current. The output current can be calculated as I_out = (1-d)*I_in.

So all IGBTs except bottom of L2 are off.

This is only a software mod, the motor doesn't need to be disconnected via a switch nor is any other additional hardware needed. Except of course a disconnect switch for the input voltage.

The result is this:









I borrowed current sensor L1 for the output current, normally that wouldn't be the case. I'm feeding the input voltage to L3.

The input voltage is 18V and I connected 6 LiFePo4 cells to the output. Then I stepped up the dutycycle from 10% to 80%. I_out reaches its maximum at d=50%. After that the input current increases linearly with the duty cycle while the output current follows the formular (1-d)*I_in. Not sure where the input current disappears. Can anyone explain that?


----------



## kennybobby (Aug 10, 2012)

Maybe the load is pulling down the input power supply and can't source the current. 

May need to add a big capacitor after the L1 coil to create a charge pump and send the boost voltage up the diode back to the output pack. The pump can be tuned (C for the coil L) to match the switching time to create a resonant pump. 

The boost current only flows during the IGBT off time so running above 50% duty cycle is the point of diminishing returns: less 'off' time plus higher load current during the 'on' time.


----------



## jhuebner (Apr 30, 2010)

kennybobby said:


> Maybe the load is pulling down the input power supply and can't source the current.
> 
> May need to add a big capacitor after the L1 coil to create a charge pump and send the boost voltage up the diode back to the output pack. The pump can be tuned (C for the coil L) to match the switching time to create a resonant pump.


Can you elaborate on that?



kennybobby said:


> The boost current only flows during the IGBT off time so running above 50% duty cycle is the point of diminishing returns: less 'off' time plus higher load current during the 'on' time.


Ok, makes perfect sense. So boost converters are never run above 50%?


----------



## jackbauer (Jan 12, 2008)

Oh now this looks like fun Time for some experiments!


----------



## jhuebner (Apr 30, 2010)

If anyone sees a buck topology hidden in there, let us know


----------



## dcb (Dec 5, 2009)

That is very useful around here (and awesome), in the land of 115v/10a everywhere to have an onboard boost option. Do you think the input AC needs much more than a rectifier? (probably, caps and precharge, etc).

I don't see a buck yet without disconnecting something, If you chop the input voltage with a seperate igbt then maybe...

edit: and since you mentioned a disconnect switch... if that can pwm and all the igbts are off, it starts to resemble a buck, but the diodes are going to bypass the coils...


----------



## dcb (Dec 5, 2009)

this is all I got for buck, if you happen to be in wye, and your pack voltage is less than line rms, you can pwm the input voltage and feed it into the common coil node (though if you are in wye chances are you need boost). You can avoid the surge by ramping up the pwm.


Looking at it, you might have a higher power boost option in wye too. Not that it is necessary.


----------



## dcb (Dec 5, 2009)

OMG 60hz sucks!!! Screwing around with wall power/spice and winding up with large capacitors/inductors just to get the power conditioned.

Maybe there is a way to apply a reverse sine pwm (adjusted for boost) to the leg and skip the bulk of this power conditioning stuff...


----------



## jackbauer (Jan 12, 2008)

Not sure I understand. A booster converter should need little by way of pfc as far as I understand due to it constantly drawing power?


----------



## dcb (Dec 5, 2009)

I think part of the problem is my naiveness and lack of ability to get ltspice to model a decent battery, or even an igbt, or an ac source that doesn't float up.

Practice practice, I will keep trying, this *might* possible too, out of phase pwming for higher frequency output. Again, really easy if wye center tapped to use all three 120 degrees apart, but the motor might want to move...










edit: couple simulations with 1 and 2 leg (180), big difference in output smoothness, from about a 1A,1ms ripple to a .1A,.5ms ripple. still having AC issues so DC source for the moment, sure the output won't be as pretty with AC though, at least not at these voltage levels.


----------



## dcb (Dec 5, 2009)

Getting better with spice and playing with an inverting buck boost, pretty well resigned to having to disconnect my delta with a large switch and adding an external igbt in order to reuse the motor as charge inductor (it's a bike, space is at a premium), watch the polarity there and common grounds  so the thinking is that you would buck when the input sine pulse is too high and boost when it is too low, and limit the current draw. No objections to having the olimex handle the pwm-ing though. Thoughts?

attached is a sweep of duty cycle, 1 second = 100% duty cycle, very linear until about %55 (buck-boost switch @ .55ms), 30v kinda on the low end of the input sine pulse. Minimum pack voltage for me is 108v, max is 184.4, 33ah, 115v AC input, looking for ~5 amps on output (need to limit input amps really, ~10 amps), motor in delta, each phase measures 1.55mh disconnected. Heck, I'll connect a delta/wye switch to the foot shifter if it will help  (yes, don't shift to wye at high speed, just like 1st gear...), would be good if it also worked with 220v and more amps when available, but 115v/10a is the ubiquitous power source here. Nominal pack is 165v so it will spend most of its time in boost on 115.

Ideally the controller would have parameters for constant current phase and constant voltage phase (and don't charge phase) and the bms would tell it which phase to use (via pin or serial port), or have it just use whole pack voltage as an option if no bms, and the user would mess with them till they (I) stop popping breakers.

edit: star/delta switch is looking kinda silly, stuck w/delta for now. I should play with high frequency high voltage mosfets at this power level to see if I can get the bulk down too, though I do like the all-in-one buck boost, one pwm signal, a lot.


----------



## dcb (Dec 5, 2009)

so back to 60hz, and my severe lack of understanding perhaps.

I figured out a reliable AC source, and am just varying r4 to hit target amps @ target volts. 

I'm not sure if this belongs in the "inverter topology" section though, but it makes sense to reuse the bus capacitors, and possibly the controller and it's pack voltage monitor (and user interface and etc). I deleted the IGBT array after confirming it didn't interact with charging since it seemed to slow simulation a bit. Just wondering if this sort of thing is in scope for a controller.

But anyway there is clearly a 120hz bump above a certain power level, for any resistance. A function of the inductance/capacitance certainly, so there is the tradeoff. The storage cap isn't getting completely discharged, so is it possible to "smooth" the battery amps/volts via software? i.e. have an average duty cycle but distributed differently (sine function)?

And is it worth it? Will it stress the input filter more (and drive costs/size for higher rms components)? Just throw larger caps/inductor at it, right?

Anyway, it looks like I'm in the ballpark for my needs. it is fairly smooth at 5A and 108v, not terribly bumpy


----------



## dcb (Dec 5, 2009)

last braindump, so here is the same sweep with a 40 ohm instead of 20, it represents a nearly fully charged battery @ ~4.5A/180V
(yes, I know that is weak on an automotive scale)

The knee has moved up to about %70 duty cycle, 350v, 8A, the AC ripple is about double. But I think it looks good down where I'm targeting (second pic approaching %32 duty cycle/320 ms). Its a fair bit smoother looking at a constant duty cycle.

In conclusion:
if you have wye, you can use the center tap for buck (with an external igbt) and the inverter for boost. I don't know how many motors make it easy to get to the center tap though. 

With delta you are gonna need another inductor and external igbt for buck, but can still boost with the inverter.

Maybe it makes sense to always have an external inductor and igbt for a non-inverting buck and switch to the inverter for higher power boost.
(need buck-boost transition phase. and the igbt needs to be able to handle full boost current), If I plug into 220 I will probably never see boost though, and it can handle way more power than I can expect from a random 115v outlet, so "it depends". Though it might also be useful for smoothing out the input voltage ac ripple, followed by interleaved boost for smoother output.

Of course I could be missing something obvious here too.


----------



## major (Apr 4, 2008)

Ya know? You could always look-see and maybe copy what ACP did. http://www.acpropulsion.com/products-reductive.html It's legal to do that if you don't sell it or profit from it  And maybe in the process you'll figure out a better/different way of doing it 

There are a couple of downsides to this approach IMO. One is that the motor and controller essentially become appliances subject to agency scrutinization by the likes of UL, CSA, etc. This, I believe was the reason ACP used double insulation on the AC-150.

Here is the circuit: 










I came across that in an old white paper from ACP on the T-zero. Hope that helps understand how they used it.


----------



## dcb (Dec 5, 2009)

yup, gotta break a motor lead to make it buck, plus interleaving boost it looks like, same conclusion (independently concluded) basically, the possiblities here are limited. Couldn't see the first attachment FYI. If you are willing to break the B+ bus apart between IGBT's you can make a nice synchronous rectifying h-bridge buck-boost too. I may give some thought to branching out the IGBTs a bit to enable something like that.

Also a 120hz smoothing algorithm might look something like 
keep a running average of the last 1/60 second of current.
look at the current now
increase or decrease (PID?) the pwm to move the current towards the average.

There may be a more predictive way too, i.e. with zero crossing detection and power demand.


----------



## dcb (Dec 5, 2009)

Sorry I lied, having too much fun learning ltspice and power electronics 

Here is a CUK inverting boost-buck, needs more storage or active AC cancellation, but the switching ripple is nice and small and triangular (less emi). Two smaller inductors might be more manigable, plus the capacitor blocks DC as a bonus, and without the storage cap it didn't surge on startup. It starts to peter out at about %33, so looking like 1/3 the dynamic pwm range, but 65536/3 is still a lot of steps, probably room for active AC correction there. 

This is my favorite so far for simplicity and adaptability and performance and cost. Battery @ 8 amps @320v on 115v ac would be popping a 20A breaker though, but you can always take it down a notch, this is just a simulation. I also need to look at efficiency of different configurations/modes and refine the components.

(I should redraw it with the coils configured on the "high" side to see how many switches it would take to use the motor coils, but I wont, or maybe I will. The additional complexity to make it happen might not be justified, unless it is)


----------



## PStechPaul (May 1, 2012)

I'm not really sure what this is trying to achieve, and some of the images are hard to see. It would be helpful to post the ASC files for LTSpice so others can perform the simulations and make changes and see what's happening. If you are trying to use the motor windings as an energy storage inductor, I think you will find that it has very poor characteristics at the higher frequencies you may be considering. There is a lot of stray capacitance, the magnetic gaps are not well defined, the magnetic material of the core is generally very lossy above 200 Hz or so, and the rotor acts somewhat like a shorted turn. 

If you really want a way to achieve voltage boost or buck from AC mains or a DC source, there are ways to accomplish this with high frequency powdered iron or ferrite magnetic components such as those used in the EMW 12 kW charger. You can get an idea of the size and cost of the components from that design, and it may be possible to use the same inductors and IGBTs for a different purpose if that's what you need. 

If your goal is to use a three phase VFD to perform the function of a charger when not being used for the motor, it may be possible, but it will most likely be much better to use something other than the motor as an inductor. I just found this thread and it looks interesting, but I need to understand a bit more about what is needed and how this proposes to accomplish that. And I'm not a magnetics expert, so I may be missing something. 

[edit] After reading about the "reductive" system, it essentially tries to minimize the cost of an on-board charger by using the existing VFD and motor windings, and it also describes using it in reverse as a grid-tied reversible storage system. It seemed to propose that as a way of testing the storage capacity of the batteries by discharging them into the grid so the power would not be wasted, but I think a good set of instrumentation on the vehicle should be able to log the SOC and SOH of the battery pack well enough. I can see Major's point about the vehicle and its electronic package being an appliance that may require agency approval. This probably applies to the DIY EVSE and chargers as well, but they probably fly under the radar unless built and sold commercially as finished units. But as soon as you make this reversible, it becomes subject to more scrutiny. The EMW products and similar units may have some possibility of backfeeding the mains from the storage batteries in the vehicle, but pretty much only in case of a defect or fault, and mostly it might only be able to dump DC into the line, where it would cause a fuse or circuit breaker to blow when inductive components saturate.


----------



## jhuebner (Apr 30, 2010)

Yes, the point when I started this thread was to use the inverter as a charger with no additional components (let aside a rectifier).

But like you say, the motor will perform poorly at kHz-ish frequencies. How poorly I don't know.

I didn't chime in on dcbs posts because he uses external components and then you can use a seperate device in the first place.


----------



## dcb (Dec 5, 2009)

As johannes started this, it is almost certainly diy power stage stuff, with as much resuse of the inverter/motor/bus caps as is practical (also considering that some converters are going to take more programming logic and I/O than others).

Since he started with a boost that doesn't require any disconnecting of the inverter (which is awesome to know), the question was is there a way to buck (presumably with as few switches as possible, i.e. 0 like boost). And the simplest answer if you have wye is use an external switch(igbt) connected to the common node. In delta you have to break a connection to turn the motor into a buck inductor (plus external switch). Again, I'm no expert, there may be a buck converter that doesn't require breaking up the bus/leads (which requires "external" equipment), I just don't see it.

But breaking a 500+ amp connection so you can charge at 10's of amps doesn't make a lot of sense, and buck capability is fairly a given, if only for prequal. So an external switch seems implied to me, unless I'm missing something. And having two answers depending on delta/wye complicates matters as well, so I've been exploring just reusing the bus caps and homebrew controller as a processor mostly, and adding a (hopefully small and inexpensive) inductor/caps/rectifier/hbridge on board. And learning a lot in the process.

I don't want to "reverse engineer" something though, especially a $10s of thousands dollar system with control over every aspect of the system. Each DIYer has different power demands and availability and power stage/motor equipment (and budget). I like to consider the guy with a 115v extension cord running out his apartment window too.

I'll post an asc once I'm happy w/it before I make something, still fiddling around myself. I'm still vacillating between breaking the bus bar/leads on charge and making better use of the onboard igbt and inductor for buck mode (which can greatly complicate things) or just adding external inductors/switch(es), leaning towards the latter after too much thought about it. I do need a charging solution in any event.


----------



## PStechPaul (May 1, 2012)

Taking a second look, it seems that it should be possible to connect a rectified and somewhat filtered voltage source from mains power to one leg of the motor, and keep the IGBTs on that leg OFF. one of the other two IGBT pairs could be controlled so that the bottom device conducts and puts current through the motor coils (which will be a parallel combination of one phase plus the other two phases in series). When the current reaches a preset limit, it would turn off, and the diode in the upper half would conduct as the inductor stored energy is released, and this will be fed to the capacitor bank and the battery pack. This process could be performed at a lower frequency so that the quality of the motor's inductance may not be an issue.

This would be very similar to the boost PFC stage of the EMW charger, and would work as long as the input voltage is less than that of the battery pack. If the pack voltage is lower, an external series IGBT could be added, and then the circuit would be similar to my current mode free-running switcher I showed in the DIY charger thread:










I show a 100 uH inductor, and switching occurs at 5-25 kHz depending on current setting and the input voltage (which is rectified and minimally filtered). With a motor inductance of 1.5 mH, the corresponding frequency should be about 15 times lower, or 300-1000 Hz, at which the motor's inductance may serve well enough.


----------



## dcb (Dec 5, 2009)

Yah boost doesn't seem like a problem though, I think interleaved is the way to go there if you can get to that phase (switch two legs 180 degrees out), but how do you do buck with the inverter with minimal external components? Every time line peak is above pack you are going to get a large surge without buck. I'm targeting 115v input as the common denominator and I'm still gonna need some bucking at the low end of charge, even if it were DC without a peak of 170v. Somehow I don't think it is a good idea to let it charge uncontrolled until the pack reaches 170V 

(I expect the controller would handle the switching FYI)










I actually goofed on this simulation, but it makes the point, with the output starting at 80v and the input at 90v, it has a significant surge through D1. Had this been an actual battery at a lower starting voltage...


----------



## PStechPaul (May 1, 2012)

The situation with line voltage surging above pack voltage can be solved with one IGBT pair and a current sensor to turn it off when the current reaches a peak value and back on when it drops to a preset minimum. This provides essentially a current source and also works to some extent as PF correction. But this won't work with your second connection to D1, and you have to open the motor internal connections to access L3 as you show. 

[oops]  I just realized that the connection is part of the motor's delta connection. You must remove one of the motor's connections and drive that with the charger.

Maybe a far-fetched stupid idea, but what about jacking up one of the drive wheels and attaching an AC motor to it and using regeneration to charge the vehicle?


----------



## dcb (Dec 5, 2009)

Lol, or a 115v dynomometer  but those are hard to carry onboard a bike.

Re: current limiter, well the pack is likely in constant current phase at lower voltages anyway, but then you have the rectified AC "valleys" to deal with, so storing energy from the peaks is useful. Maybe I'm over thinking it though, how much voltage/current ripple is ok in a battery? And if you are wanting higher power from say 220/208 the number of DIY packs that would be mostly/entirely in "buck" go up significantly.


----------



## PStechPaul (May 1, 2012)

If you can electrically isolate one phase connection to the motor, it could be used as a series inductor to store and release energy from a higher voltage. During the portion of the AC waveform that is below the pack voltage, one or two of the VFD IGBTs could be turned on to impart energy to the inductor and then release it at higher voltage into the pack. So it could function in both boost and buck mode (as well as PFC) and should be able to provide a reasonably smooth charging current. As long as the peak current does not exceed a safe value for the battery pack (unlikely for 100 Ah 1C rated lithium), the ripple should not be a problem. The only problem might be if the series IGBT failed shorted and full mains current were to be applied to the pack, but even in that case the mains fuse or circuit breaker would trip before too much damage was done.


----------



## dcb (Dec 5, 2009)

I guess I'm jaded by the simplicity of boost mode within the existing topology. But switching out legs (or even the B+ bus) so that they can still handle many hundreds of amps in motor mode sounds like a lot of "external" components, compared to adding an external inductor and an igbt selected for charging power levels. So I abandoned that idea. Am I missing something?

Even if you have wye and externally igbt pwm the common node for buck, you still need something to disable the boost feed (and ensure the buck body diode doesn't screw things up in boost mode).


----------



## PStechPaul (May 1, 2012)

I'm thinking mostly of a high voltage system with a 200-300 VDC battery pack and a motor that is perhaps 240V at 50 HP (37kW) so each leg would normally see no more than 37000/(240*sqrt3) or 89 amps. You may be able to use a 3 pole 50A contactor wired in parallel for 150A, or perhaps a knife switch under the hood, or a fuse that can be easily removed for charging. Even an in-line welding connector could be used. Cost for any of these options is less than $100, and easily implemented.


----------



## dcb (Dec 5, 2009)

Ah, but how does the controller switch between boost and buck? Your fully discharged pack is gonna need buck and your nearly charged pack is gonna need boost (that is my situation, and likely many others). And there will be a transition phase where it might need to switch back and forth, maybe with every input peak/valley if you want to reduce component size via more complicated switching.

I'm liking the CUK converter, simple, fairly seamless simple pwm transition between boost/buck, dc blocking, decent efficiency, etc. Guess I'll bail this thread if there is no value in using the controller/sensors for that (even though the controller isn't doing anything during charging).

You gotta do better than a knife switch, or I will think you were serious about the induction motor/wheel jack idea 
edit: though admittedly I did entertain (briefly) hooking up one of these to my foot shifter as a delta-wye switch. But it is 9x12x4", and I can probably scrap together up a CUK for the same money and space.


----------



## dcb (Dec 5, 2009)

just had a thought, I'm CUKing on the wrong side of the motor... haven't given up yet (though I might cuz of the friggin body diodes). The motor might be better off as a 60hz storage unit, still need another inductor going to the battery and an extra igbt and cap, but are just switching a battery lead if it works.


----------



## PStechPaul (May 1, 2012)

Here's a website on buck/boost topologies:

http://www.boostbuck.com/TheFourTopologies.html

The first one shown is similar to what I proposed, except it uses a boost-buck rather than buck-boost. The Cuk converters generally use a series capacitor for energy transfer/storage and are inverting, unless coupled inductors or transformers are used. That also provides isolation, which might be a good idea for a charger. In that case, you could even use an inductive EVSE charger where you essentially connect two halves of a transformer to perform the charging, and no exposed voltages are present, making it safer for use in the rain and are inherently "touch safe".


----------



## dcb (Dec 5, 2009)

Yah I was pleased with my first experiments with CUK in post 16 , though integrating a converter might require non-inversion, or a less than desirable amount of dc switching, still looking into it.


----------



## dcb (Dec 5, 2009)

*Found it!*

The good news, I found the buck converter that doesn't require breaking up motor leads or that nice igbt/capacitor/bus block.

This is a sweep from 0% duty cycle to 100%. 100vDC input. To buck, you connect input plus to b+, and the battery to a leg. I'm sure it can be interleaved too. The bus capacitor becomes an input filter cap.

The bad news is that it gets a little more involved when switching between buck/boost (and regen) and minimizing components. Input is trivial since it is one directional, output to battery might need more consideration. I *think* output is doable with a surplus igbt half bridge. battery connects to the center. "top" transistor on for boost from B+ or regen (or on whenever not in buck), bottom just a diode to the motor leg.

output voltage peaks at about 97v with the top transistor on full, input switch (from B+ to a leg for boost) should be chunky igbt-ish too, totally worth it if the motor as inductor works out (you know someone is gonna want to try fast charge). 

save the attached .txt file as .asc for ltspice. PHEW!

Edit: it is not happy on rectified AC. at 100% and 10 ohms/14 amps, it looks like AC. Trying to buck the peaks while boosting the valleys is a lot harder with the input and output switches too.


----------



## jhuebner (Apr 30, 2010)

Thats a good one. You'd have a "drive" rated switch anyway (the DC contactor) and you now need a charging rated switch to connect B+ to an output phase.

Personally I'd try to dimension my pack to always stay in buck OR boost mode and never have to switch between them.

BTW the EMW charger I use starts at 510V and ends at 525V because I charge at very low currents and never take the cells down so much that it actually shows in the idle voltage.


----------



## dcb (Dec 5, 2009)

FYI, I did a test and it is pretty unusable on rectified AC, the bus capacitor is getting pumped to line voltage and the swing at %100 duty cycle is peak on r1. So I don't think I'm there yet. I don't know if buck/boost is ever going to be a primary consideration for pack dimensioning though, the charger probably has to deal with it, whatever it needs.


----------



## Tony Bogs (Apr 12, 2014)

Are those inductors in the schematics not coupled by the core of the motor?
If they are, the frequency is limited to a few hundred Hz.

Here's an example of a working boost converter. At 100 kHz.
In combination with *transformer* direct conversion (negative output).
12V to 20V/-5V. Mode: discontinuous current mode. 
Continuous mode is more complex in the frequency domain (stability) / magnetics.


----------



## dcb (Dec 5, 2009)

ok, here is the basic buck boost that uses the motor coils as inductor, and can buck boost to pretty much any level you need from 115v to whatever (just play with r1 till you get a slope that hits your target voltage and amps) with room for adapting the ac waveform.

It requires a bit of configuring, the inverter block is completely disconnected at B+ and B- and battery leads are routed to a couple legs through a diode, then one leg is PWM'ed with the input voltage. It might be doable with a couple IGBT bricks, but I'd probably be ok with knife switches/welding jacks as long as it can do a complete charge (I'd include pre-qualification phase there) without being reconfigured in the middle, so at its simplest it is just the addition of a diode and igbt.

I should source some CUK sized transformers/caps next though, but if they are cost/size prohibitive, then there is still the motor-as-inductor to experiment with. It does keep the igbt/cap bus intact, and tapping a motor lead with charge level wires is not as bad as switching them. I'm not sure if the bus cap is helping or hurting in this mode though. All attempts at using the inverter igbt's with those constraints have not panned out, the body diodes always seem to kill it.

efficiency varies from 90ish at light load to 60ish heavily loaded. "battery" ripple is like 1/4 amp at 33 amps/330 volts in this scenario.

save .txt attachment as .asc and play with r1 till you find a curve that crosses your target voltage/amps (for start and finish) and that will get you in the ballpark for pwm duty cycles needed (1 second = 100% duty cycle in the sweep), haven't addressed active AC ripple cancellation yet, so using rms DC volts for the moment.

EDIT: I attached a pwm sweep on 115 AC, I'm %99.999 certain that the 120hz ripple can be smoothed out with software (sorta FOC-like) that distributes the target duty cycle into different length pulses for each bump instead of identical pwm pulses (maybe there is an LTSpice guru in the house that knows how to do it?). Note also I changed R1 to 40ohms in that picture and it comes reasonably close to crossing my 180V/5A target for finish charge.


----------



## dcb (Dec 5, 2009)

Ok, I think I've been pretty thorough  But after looking at all the connections needed for the last one I think I'm done with avoiding breaking a motor lead, and for good reason. Basically you add a hundreds amp SPST switch to a leg, with a diode, and an igbt and rectifier. Performance looks very good, can top 500v on 115 (perhaps not in real life), and the equipment can stay hooked up in the vehicle, just needs a chord. 

The procedure is simple enough too, hit the disconnect, then start ramping up the pwm duty cycle on the igbt (control is another discussion, but there is no real surge to speak of if you start pwming slowly, even with the input at 500V). This is too simple not to pass up for me, and is crazy adjustable to nearly any imaginable input and output voltage (compromise with current/efficiency). 

I know it is a bit of a "bad boy", in many ways, but ah well, if it works.

Thoughts por favor? I would probably just use an h-bridge for the diode and igbt (same type as in the inverter if you can afford it) you get a good match with the existing diode when they are in parallel, maybe that will make up for the switch a little). If there is any drop in the switch, the new diode is gonna feel a disproportionate amount of current. Plus you have a "spare"  And it will look nice next to the other three.

(ltspice asc attached as txt)

Switch and matching igbt half bridge on order, gonna reuse a 100 amp 6mbi brick for a rectifier for starters so I am prepared for a higher power charge where available. Yay, I have a plan (and I need a charger)!

will make some notes:
no "precharge" needed, ramp up duty cycle.

nothing bad happens if you leave it all hooked up as far as I can tell.

Positive AC shutoff.

It appears to keep bucking @ 60hz if the igbt is shorted :/ results of that are undefined, depends on pack vs line voltage at the time.
edit: it doesn't appear to apply many volts to the pack (less than 96v) but as pstech said it will pop a breaker as the rectified output now goes through the inductor and top diodes and back into itself.


Nothing horrible happens if you plug it into the wall and the switch is closed if it isn't pwming, the controller should test the leg somehow before it starts pwming the charger.
Edit: going with igbt switch instead of knife switch, so applying external power should be the signal to open the switch.

I *think* it doesn't do anything terrible if you try to drive without closing the switch, not %100 on that, controller should check that too before starting though. (check to see if it looks like it is charging, then give one of the non-broken leads a pulse and see if the current looks right on the other legs)

should be able to estimate input current from leg sensors.

needs battery current, has voltage. 
(don't attach rectifier return to battery and use regular battery sensor)

thermal data would be nice, not sure when this becomes a bms thing or a separate charger thing. I/O limited a bit on the inverter controller.

todo: see if extra switch on igbt can be utilized instead of mechanical switch, done, too easy, hope an extra diode drop doesn't mess up FOC estimations though.

Test magnetic coupling and performance at sub khz. See if limiting to one core helps.


----------



## dcb (Dec 5, 2009)

I have a feeling that mutual inductance is gonna be a little bitch, and ltspice is saying the same thing :/ Ah well, live and learn


----------



## PStechPaul (May 1, 2012)

I added mutual inductance and I had to add 0.1 ohm series resistance to make it work. Also you were driving Q1 with a voltage source so the gate current was about 100 amps. I added a 40 ohm resistor:










The simulation runs very slowly so I stopped prematurely. 

I changed the period to 1 mSec for 1 kHz PWM and here are the results:


----------



## dcb (Dec 5, 2009)

if you put all the coils in parallel it seems to cancel out, but that is a lot of switching about of drive-level components, especially in delta. It seems ok if you use one coil and leave the others open ended too, but still some switching there, and the inverter bus is still your enemy for this task. I've been loath to break that up, if only because every one I've ever seen is a monolith of copper bars, igbts, and capacitors.


----------



## PStechPaul (May 1, 2012)

You might not be able to get both buck and boost without driving the IGBT bridge of the VFD, but you can use the motor coils as an inductor for a buck supply, so 113 VAC (160V peak as you have for your simulation) can produce about 135 VDC at maximum PWM. Using your sweep of duty cycle over a 250 mSec time, this circuit provides a soft start and effective PFC. If you need a charge voltage above 130V or so, you can use 240 VAC which may give you 280 VDC or so, and you can add a voltage booster transformer to the mains to get 300 VDC or more. Or you can use a standard PFC boost circuit such as the one from EMW to get 300-400 DC and this same circuit will work for any normal battery pack. All you need is a series element to perform the PWM and you can just pop the motor lead and connect it to the charger, maybe with an SPDT contactor, so it's automagically disconnected when the vehicle senses the EVSE connection.  










The ASCII file: http://enginuitysystems.com/pix/Motorbuck_PES.asc

Using an NMOS as the series PWM control works better:










I added a small inductor and capacitor on the input, hoping to reduce the input current spikes. That didn't work, and in fact they may be larger, but it also seems to perform a little bit of boost, as you can see on the magenta trace for V(n005). Note that the current for V3 is ten times what it appears, and up to 200 amps:










If the MOSFET would be driven by a current sense comparator as I had in my design, it should work much better.


----------



## PStechPaul (May 1, 2012)

Here it is with a 200 uH inductor and 100 uF capacitor. The voltage gets boosted to 280V. One problem with this simulation is that there is no model for the battery pack, and the 10 ohm resistor shows a 150V 10A (1500W) load. I think a battery could be simulated by a capacitor with a value that increases or decreases with current in or out. Thus the voltage would remain the same but the energy would vary with charging and discharging. This would be like a battery with a constant voltage, very similar to lithium types except at the fully discharged and fully charged extremes.

Anyway, the simulation:










And using a comparator and sense resistor for current regulated mode:










And after adding an inductor and tweaking some values:


----------



## dcb (Dec 5, 2009)

Interesting, (and I'm duely impressed) but some practical considerations of course. If you add a potentially high speed mosfet and inductors and caps and diodes, would you still break a motor leg to make a 1500w charger with them? I could see using the motor for major power levels, but even then it is gonna limit switching frequency (and/or involve lots of drive level switching).


----------



## jddcircuit (Mar 18, 2010)

The idea works. Here is a PFC boost simulation with rectified AC input. You don't need to disconnect the motor. I am only modulating one igbt. The PWM duty cycle is just proportional to the phase current to perform PFC.

I am showing the rectified line voltage, the line current, and the battery current.


----------



## jddcircuit (Mar 18, 2010)

I like this method better. I copied the idea from the Tumanako Inverter/Converter web page. There has been quite a bit of reference to it in these forums.

In this setup you need to modulate both the high and lowside switches depending on which AC half cycle you are in but it only requires two more diodes instead of four.

If you replace the diode half bridge with igbts then this setup can be made to be bidirectional.


----------



## jddcircuit (Mar 18, 2010)

I have been working on using my inverter as a boost mode charger. Here are my measured results so far. I only have 48cells (160V) of battery so I am a little limited with the amount of power I can get to at the moment.







I am also measuring about 50mA rms ground leakage current. With a quick and dirty common-mode filter I got it down to 10mA. Higher power is going to create more common-mode currents. I hope I can get them below ground fault levels.







My method is similar to the tumanko version but customized to work with my dual inverter motor Prius setup.


----------



## PStechPaul (May 1, 2012)

It's hard to see the circuit but I opened the attachment in a new tab so I could see it better. It seems that this design requires the peak source voltage to be less than the pack voltage, or the bridge diodes will conduct and full supply current will flow into the pack. Also it seems that the battery pack needs a series 100uH inductor that will need to be rated at the full current from the pack when driving, which could be several hundred amps. This also requires access to the gates of the motor drive PWM, which may involve serious hacking of the VFD.

It seems reasonable and easy to break one of the motor leads and connect it to the charger as needed. Having a series control element in the charger allows the charge current to be switched off as needed, which it could also do if a fault was detected. For buck mode, the extra inductor and capacitor are not really needed, and the slight boost it seems to provide is not very effective.

It may be better to use one of the standard topologies for boosting the charge voltage so that higher pack voltages can be accommodated. The transformer types provide isolation, and may even be able to use inductive coupling so that no exposed voltages are present. A capacitor coupled boost converter blocks DC, which may also be useful, and it might even be possible to use a charge pump which does not require inductors. I'll see if I can simulate that.


----------



## dcb (Dec 5, 2009)

Hi jddcircuit, I must be confused or something (nothing new), but why are you looking at boost mode chargers for a 160v pack hooked up to 220v? Also I didn't recognize a mutual inductance directive in your layout (i.e. K L4 L3 L1 .9). 

FYI, I did figure out a buck mode several posts back, but wasn't happy with it since it couldn't transition to boost nicely on AC.


----------



## jddcircuit (Mar 18, 2010)

dcb said:


> Hi jddcircuit, I must be confused or something (nothing new), but why are you looking at boost mode chargers for a 160v pack hooked up to 220v? Also I didn't recognize a mutual inductance directive in your layout (i.e. K L4 L3 L1 .9).
> 
> FYI, I did figure out a buck mode several posts back, but wasn't happy with it since it couldn't transition to boost nicely on AC.


My pack will be 360V. I just only have 160V to test with right now so it works with a standard 1.5kW 120V AC outlet for now.

I want to be able to charge at full Level 2 charging. 240V 80 amps 19.2kW.

Regards
Jeff


----------



## jddcircuit (Mar 18, 2010)

PStechPaul said:


> It's hard to see the circuit but I opened the attachment in a new tab so I could see it better. It seems that this design requires the peak source voltage to be less than the pack voltage, or the bridge diodes will conduct and full supply current will flow into the pack. Also it seems that the battery pack needs a series 100uH inductor that will need to be rated at the full current from the pack when driving, which could be several hundred amps. This also requires access to the gates of the motor drive PWM, which may involve serious hacking of the VFD.
> 
> It seems reasonable and easy to break one of the motor leads and connect it to the charger as needed. Having a series control element in the charger allows the charge current to be switched off as needed, which it could also do if a fault was detected. For buck mode, the extra inductor and capacitor are not really needed, and the slight boost it seems to provide is not very effective.
> 
> It may be better to use one of the standard topologies for boosting the charge voltage so that higher pack voltages can be accommodated. The transformer types provide isolation, and may even be able to use inductive coupling so that no exposed voltages are present. A capacitor coupled boost converter blocks DC, which may also be useful, and it might even be possible to use a charge pump which does not require inductors. I'll see if I can simulate that.



Yes, Pack voltage must be higher than the peak line voltage.

My Prius inverter already has a 20kW dc boost with a 353uH inductor between the battery and inverter so I can use this to smooth out my battery current. However I don't think it is necessary since the battery sees the same pulsed current on discharge while driving the motor. I think the battery can handle the pulsed current during charging.

The motor current is much higher than the battery current in most cases. Breaking the motor lead to tap in the AC supply is another way to do it.

There are many ways to do it.

Regards
Jeff


----------



## dcb (Dec 5, 2009)

Ah, ok. What is your fully discharged pack voltage? I think if you are only going to need boost then you are in good shape, but make sure the peak input voltage isn't too high above your minimum pack voltage as that won't be so controlled (without extra measures).

Edit, also your mutual inductance problems might be solved if you connect the input power to the wye common connection, then pwm all three lower gates at the same time for massive current.


----------



## jddcircuit (Mar 18, 2010)

dcb said:


> Hi jddcircuit, I must be confused or something (nothing new), but why are you looking at boost mode chargers for a 160v pack hooked up to 220v? Also I didn't recognize a mutual inductance directive in your layout (i.e. K L4 L3 L1 .9).
> 
> FYI, I did figure out a buck mode several posts back, but wasn't happy with it since it couldn't transition to boost nicely on AC.


The mutual inductance is not part of my simulation. It is not relevant for my purposes of this simulation.

My motors are interior permanent magnet types. The terminal to terminal inductance is dependent on the rotor angle. I am putting the rotor is what is called the d axis so there is no rotational torque applied to the rotor when current is flowing.

With an AC induction motor I think you will only be getting the leakage inductance of the stator but you won't have to worry about developing rotor torque.

Jeff


----------



## PStechPaul (May 1, 2012)

OK, here is my simulation for a capcitor doubler circuit running at 1 kHz. As shown, it is not very efficient (2.6kW/3.6kW=72%) and PF is not very good with 3.6kW/(113V*73A)=43%, but that is a major limitation of capacitor charge pumps. It could also be done at 60 Hz. I found that the simulation ran very slow, especially when I used the standard silicon diodes, so I used Schottky, but the two diodes might be better replaced with a half-bridge pair of 50-100A 600V devices. Also I had to play around with the MOSFETs, and IGBTs may be much better.










Here is the ASCII file: http://enginuitysystems.com/pix/Motorbuck_Capacitor_Doubler.asc


----------



## dcb (Dec 5, 2009)

jddcircuit said:


> The idea works. Here is a PFC boost simulation with rectified AC input. You don't need to disconnect the motor. I am only modulating one igbt. The PWM duty cycle is just proportional to the phase current to perform PFC.
> 
> I am showing the rectified line voltage, the line current, and the battery current.
> View attachment 30138


I like the idea of reusing the half bridge in the inverter, but this one with the completely separate bridge is giving me a very smooth output feeding into leg 1 (with .9 mutual inductance).

Turns out IFF I keep my 44s leaf pack above about %85 discharge, AND I am on 115v, I can use this. Probably not suitable for a 144v pack anywhere though. But I need so little boost in this situation that I see about 1/4 amp ripple at 185v/5a and not a lot of heat being created (15% duty cycle @10khz, ~8% at 1khz), so I might have a portable 115 charger after all out of blind luck. If there is room for another leaf module, then I have an excuse to add one.

So who wants to add the charge control code for boost?

Edit, nope, line voltage here is an annoying 120.5 rms, 170.4 peak. not a good plan at the moment :/ back to breaking a leg I guess or CUK (but I get 240 capability those ways too) or adding a module if there is room or?? . No wee boostie for me just yet, will have to analyze my specific min currents and etc.


----------



## dcb (Dec 5, 2009)

ok, did a quick and dirty analysis of my current situation:

from info at:
http://www1.eere.energy.gov/vehiclesandfuels/avta/pdfs/fsev/battery_leaf_0356.pdf
(@96sp2, I'm at 44sp1)

measured line voltage=120.5 rms, 170.4 peak.
stack resistance ~ 0.15ohm

marker, cell voltage, "uncontrolled" RMS amps
1, 4.16v, finish charge
2, 3.8v, 0A
3, 3.75v (nominal), 2.3A
4, 3.7v 5A (target current)
5, 3.6v, 11.6A
6, 3.5v, 21.612A
7, 3.0v, 66.997A
8, 2.5v, 116.99A

so I could actually use a little boost to maintain 5 amps above point 4 (3.7v), but I'm gonna be (hopefully) popping circuit breakers below 3.6v (point 5). And if my series R estimate is off by 0.05 ohms... I suppose adding a tiny bit of inductance/resistance to the rectifier might make a huge difference here. Will revisit jeffs half bridge design, since I have a half bridge on the way, and hey, bike with 115v outlet, why not?


----------



## dcb (Dec 5, 2009)

Just for my own edification, playing with adding mutual inductance then various switching configurations. it looks like mutual inductance severly limits the usable duty cycle range (@1khz). Two [email protected] seems the most efficient at peak power, but the peak input amps for a given power output are huge. interleaved provides about the same power/efficiency at much less peak amps.

for comparison with interleaved, I ran a single leg simulation at 2khz, it reached 4kw @ 89% efficiency 20% DC 180A peak, which is on par with the interleaved 1khz @ 4kw @ 11%DC. It peaked about 5.8kw 79%eff (31%DC). 2khz isn't realistic from what I gather however, I don't know if two igbt's 180 out @ 1khz on different inductors will look like 2khz to the motor though. It certainly doesn't behave like 2khz in terms of DC% response here (and interleaved is a bit more efficient).

Interleaved does show significant efficiency improvement @ 4kw over one leg switching, and peaks at 6kw (vs 4kw for one leg).


----------



## PStechPaul (May 1, 2012)

I think you must have the mutual inductance in the simulation in order to properly model the motor, although I am assuming a three phase induction motor, and yours may be different. If you are driving the low legs of the bridge, the current in the inductors will rise according to the supply voltage and the time for which it is applied. I = V*L*dt. And there will be a point at which the inductor will saturate and current will increase drastically.

Interleaving the drive of two of the windings is an interesting case, where the stored energy in one will be released as a voltage boost to the bus and there will be an alternating polarity imposed on the third leg of the coupled inductors (or transformer). It might be possible to perform a boost by driving the high side IGBTs of the outer half-bridges "A" and "C", along with the low side IGBT of the middle half-bridge "B". But the phase polarities will be opposite so that might be a problem. 

Perhaps driving one phase at a time would work better, although you may need to essentially reverse the motor for every other cycle or it would probably create a rotating field and movement of the rotor.


----------



## Tony Bogs (Apr 12, 2014)

So the mutual inductances are there. And the iron losses? Have they been included in the models?

1kHz is a very high frequency for transformer (motor) iron.


----------



## dcb (Dec 5, 2009)

No LTSpice doesn't seem to do different core materials so much. I am very naive about magnetics though, but I don't understand how it can be pwm'ed at thousands of khz as a motor and not as an inductor.

If the core is a significant factor at 1khz, and pulses don't really matter, then it seems like a triac "and maybe a voltage doubler" is all that is required in a battery charger. Heck if you need higher voltage then, put a center tap on your pack and skip the doubling capacitors , just triac and two diodes (and control), what am I missing? Do you even need an inductor? 
Edit: ok, maybe a small-ish air core inductor http://www.nxp.com/documents/application_note/AN_GOLDEN_RULES.pdf

Also, I did some experiments with buck mode and mutual inductance. It falls pretty flat on efficiency, unless you switch two legs at the same time (interlaced is less efficient when hooked up as a buck), that seems to keep the 3rd coil out of the equation, but still not getting great efficiency at higher power levels. when driving two legs, switching the polarity of one of the active coils reduces the power output dramatically, so I assume the coils are working together with "regular" polarity (phase/whatever).


----------



## Tony Bogs (Apr 12, 2014)

The PWM current is superimposed on the primary LF motor current. 
The amplitude is mostly small. Phase filters reduce the PWM amplitude even further, reducing EMI and iron losses in the motor. 
Keeps the motor cooler by moving a major part of the iron losses to the filter inductors. 
Another downside of phase filters? They're bulky. 

In a boost or buck converter the same principle applies. 
With iron cores the converter must work in continuous current mode. 
The PWM circuit causes a very small variation in the inductor current in a single PWM period. The frequency response is therefore limited.


----------



## dcb (Dec 5, 2009)

Ah, makes a bit more sense, thx. Hard to keep current moving at 60hz. But if I throw a crap ton of capacitance on the rectifier output and tone down the boost power output, the inductor current does start to stay above zero. 

Complimentary for buck mode if I crank up the power output and add capacitance across the input and inductance in series with the battery it stabilize the battery current. Though it causes an imbalance in the coil discharging, and the inductor currents are swinging below 0...

Continuous mode is easier at lower power outputs for boost and higher power outputs for buck.


----------



## Doctorbass (Dec 12, 2008)

The Russian Adaptto max and Mini E controller for powerfull ebike are using this principle. you connect any power supply to one of the 3 phase output and another wire and it boost the voltage and charge usig the motor stator inductor as pulsed energy storage. 

This work great and the can use a 48V 3kW server power supply to charge a 28s battery for exemple.

Here is the info: ( use google translate from Russian to English) http://adaptto.ru/

and the thread on E-S: http://endless-sphere.com/forums/viewtopic.php?f=31&t=58190&hilit=adaptto

Doc


----------



## dcb (Dec 5, 2009)

Doctorbass said:


> This work great and the can use a 48V 3kW server power supply to charge a 28s battery for exemple.


That is no small requirement for an "onboard" inverter based charger. Especially one that is only good for 3kw.


----------



## dcb (Dec 5, 2009)

fyi, been doing a little pfc homework, my ac24ls in delta (in simulation) would need about 10x as much inductance as it currently has (.0015H -> .0155H) to make a 24aRMS pfc with reasonable current ripple while limiting the igbt's to ~10khz. 

Or it would need to draw 240Arms (single phase, also unachievium).

Or my surplus igbts would need to switch at ~100khz (and the steel core motor would have to be happy with it) :/

I think external components are going to be a necessity for decent, but not ridiculous, power levels.

pfc requires somewhat specific inductor vs current vs frequency considerations.

in wye using center tap on the ac24ls it looks like about 5khz switching needed at around 24Arms, which is a pretty good fit for the igbt's however.


----------



## jhuebner (Apr 30, 2010)

For completeness I will post this here as well:






It's only meant as an "emergency charger" at around 2-3kW. For anything higher I see DC charging coming soon. Charger in the station/wallbox, much better place for it to be.

I hardly ever had a use case for high speed charging. Nights and working days are long enough


----------

