# The Cheap, $10, Simple, DC Motor Controller (Hijacking a Prius Gen 2 Inverter)



## MattsAwesomeStuff (Aug 10, 2017)

A few years ago, Damien McGuire reverse engineered the Prius Gen 2 inverter as a gateway into dirt cheap OEM inverters you can repurpose to drive any AC motor.

Shortly after, he came up with a way to also use the Prius Gen 2 to control DC motors. It's pretty much just a PWM generator with a few EV things tacked on. And like most things he does, it's all open source.

Cheap, simple, no programming. Can't go wrong.

Prius Gen 2 inverters are available for ~$50-150 from junkyards.

I've never built one, but I've been pestering people to do a more beginner-friendly post about it for a year. That hasn't come to fruition, so, I'll do the next best thing... try my best out of ignorance. Please do correct anything I say, and I'll try to stay on top of it and add it back to this first post.

First up, the open source project, on Damien's Github: Prius-Gen-2-Inverter/DC_Controller at master · damienmaguire/Prius-Gen-2-Inverter

And, for other technical stuff, inverter pinouts, etc, here's the EV community's wiki for the Prius Gen 2 inverter in general: Toyota Prius Gen2 Inverter - openinverter.org wiki

Lots of you won't have the software to open those files, so I downloaded DesignSpark and took screencaps, because those are a lot more convenient as reference materials for the non-engineer type.

Here's the parts you'll need:










Here are the various circuits onboard:




























Here's a list of connections on the terminals that you'd wire to the rest of the vehicle:










And the circuitboard itself (if you want to send this to PCBway or JLCPCB to have a circuitboard made, give them the files on Damien's github, this is just for visual reference):










If it's your first time reading a circuit like this and you're hand-wiring your own circuit, note that some pads have little colored dots top/bottom/left/right, that tell you where they'd connect to on a different circuitboard layer. The 4 green/blue dots mean the pads go to ground, 4 red dots means the pads go to 5v. When in doubt, just refer to the circuit schematic for that component and you'll find where it should go.

For descriptions of what to do with the external connections, see the Prius Gen 2 Throughhole board wiki, linked off the wiki above.

...

Someone's noted in the past how much power this should be able to handle and how it's different from the AC ratings (higher? lower? something about the transistors being on twice as much?), perhaps they could pipe in and I'll replace this sentence with that.

Also I'm not sure exactly what you wire "MG1" and "MG2" outputs to. Just any one random U / V / W PWM input on the inverter?


----------



## remy_martian (Feb 4, 2019)

IC2 is 0 stock everywhere...

So no PWM for you.

This is the problem with building anything these days.


----------



## MattsAwesomeStuff (Aug 10, 2017)

remy_martian said:


> IC2 is 0 stock everywhere... So no PWM for you.


Makes sense, the design pre-dates Covid, so, hasn't been built around available parts like every circuit these days would have to be.

That said, it's just a PWM chip.

Any drop-in replacements you know of that are in reasonable stock? And, is it likely to catch up eventually, or is it depracated entirely?


----------



## remy_martian (Feb 4, 2019)

I just got a note from Micron on a microcontroller - order now, shipping in 2024 🤦‍♂️

Inventory still sucks on most items. I suspect a lot of hoarding going on.

But, you're correct in that the circuit principle is a good study and it might get reworked to available devices, but these days, anythibg in inventory is so low that in can vaporize unexpectedly. I had that happen with an amplifier chip I designed in 🤬

With the trade wars, it's not going to get any better inside of at least a year, maybe two. And now, with rising interest rates, they'll lay off workers, which means....


----------



## kennybobby (Aug 10, 2012)

i wonder what's with all the diodes in those circuits?

You can roll your own PWM generator with fewer parts; pulse width controlled by potentiometer


----------



## MattsAwesomeStuff (Aug 10, 2017)

kennybobby said:


> i wonder what's with all the diodes in those circuits?


Polarity protection?



> You can roll your own PWM generator with fewer parts; pulse width controlled by potentiometer


Indeed, but, anyone who can do that isn't going to benefit from this thread. It's gotta be documented and problem solved and a procedure to follow. Soon as you're doing any engineering, you're back up to why all of 1 or 2 people have ever tried this in the last 3 years despite how almost weekly someone is asking about cheap DC controllers. Soon as it's "it's on my Github" or "just use any x", it's utterly inaccessible to people.

I'm half-tempted to pick something equivalent and have JLC spit out a run of 10 or 20, just because so many people just want to grab something off a shelf and it's a lot quicker than writing advice.


----------



## remy_martian (Feb 4, 2019)

True. Had that key part been in stock, the boards would cost maybe $20 to make, if even that much.

The problem with a new design is time. Design (which is a total PITA these days because you have to find parts that are in stock and buy them), test, documentation, support, etc. You really wanna go there?

Then there's some Canadian zealot (troublemakers of Biblical proportion) proposing to shrivel up the supply, or driving prices up, of Prius inverters for the 3 phase crowd, by using them up as DC PWM switchers when a phase leg IGBT module does the same thing, same money, and is a LOT more compact. Just sprinkle in a gate driver, and stir gently over low heat.

Damien is very resourceful with the free stuff on his junkpile, which I'd bet is how this one got hatched.


----------



## Russco (Dec 23, 2008)

[Edited by mod - How the hell did you end up posting your comments inside a table? Formatting and quoting was all wonky. I tried to fix it. - Matt]

Very interesting, Opel Matt. Didn't know Prius Hybrid electronic devices were in demand...and very plentiful at very low cost. U Tube links show the insides of the generation 2 double inverters. Looks very nicely designed and well built. For a hundred or two bucks and some quick work, a 650 amp controller can be built to power a DC series motor. I would gut the insides and retain only the IGBT's, current sensors, buss capacitors, and some of the bus bars. Fabricate bus bars to parallel the top collectors, middle emitter-collectors and lower emitters. of all the IGBT's. Use the top transistors for the freewheel diodes only by shorting the E-B tabs on all the top transistors and use the lower transistors to PWM the motor. Install a PWM oscillator with torque control using the existing current sensors for current feedback. A little control board from a Russco controller using two op amps would work just fine. Finish with a couple of TO-5 gate drivers.

Simple, easy to perform and the result will be a 650 amp controller for DC motors for two-hundred bucks. But those Prius inverter boxes are a large cubic foot size and weigh 50 pounds.

But cost per amp is almost free.

Great idea.


----------



## Jnbrown3 (10 mo ago)

[Edited by mod - Your formatting was also wonky and your actual content was hidden. I cleaned it up. -Matt]

Hi there, I really like this description of salvaging the parts from the prius controller to build your own. This sounds similiar to Damiens BMW E36 video where he built his on controller from rough parts, this sounds like an easy way to source materials. I am new to the control board piece however. In Damien's video he referenced a guy name "Tony Bob" from the DIY forum for a logic board. In this piece you reference a Rusco control board... can you be more exact? I am not familiar with this. I loved Damien's E36 video, but totally unsure how to obtain/design a board for it. Some advice is much appreciated, thank you!


----------



## MattsAwesomeStuff (Aug 10, 2017)

Arg. Lost my post when i was editing yours.

"Tony Bob" is actually Tony Bogs. He's a member here. He was making an AC controller from discrete components only, no chips or programming. He hasn't updated it in several years. Damien maybe based part of a design off of some earlier work of his.

The Red Arrow project was obsolete before it was finished. Damien evolved the meta out from under himself when he discovered cheap OEM inverters were way better than building your own design from scratch and IGBT blocks. That's part of why he never documented the end of the build. The "cheap EV" build was already no longer DC motor + build your own controller.

Rusco is the previous poster, so he's either referencing his own design or a theoretical design. It's not a thing.

And... this thread is probably useless anyways. Damien's original design doesn't work when implemented in a vehicle. If you read the thread I linked, someone figured out something about the flyback diode taking too much load for how infrequently the transistors were actually turned on, and it fries everything. So they came up with a different design. EV8 came up with another. Someone else with a 4th.

In true Open Source fashion, no one finished their design, no one published their design, you have 4 half-complete competing designs, and no one who's not already an engineer that can interpret those and make their own changes could ever use it. So the whole "Just use this simple design and make your own controller" is dead in the water until anyone does that, and no one's done that.


----------



## piotrsko (Dec 9, 2007)

Back in the days of discussing the Soliton original build, Tess was complaining about odd transient voltage spikes caused by switching big arsed voltages and currents. Mpaulholmes commented also on his build and had his own unique solution. Don't actually recall the specifics but think Damien experiences these transients and tries to sink them with snubbers but to no success. Fwiw, this was back in the day when high power silicon was rare and hideously expensive. Wonder why Otmar uses a bank of hand matched mosfets in parallel? The premise was that commercial engineers had solved the BEMF and related issues then all you had to do was control the power section which turned out to be more of a PITA for a vehicle controller. Apparently you need to be an assembly language programmer, rf engineer, Power engineer, container designer and shielding specialist in addition to prototype machinist. Too much for an amateur to deal with part time.

Dont forget this was during the early days of uncracked CANBUS controls


----------



## Jnbrown3 (10 mo ago)

[Edited by mod - You somehow screwed up your quoting again, you entered your comments inside the quote block. If fixed it. - Matt]

Very interesting, Opel Matt. Didn't know Prius Hybrid electronic devices were in demand...and very plentiful at very low cost. U Tube links show the insides of the generation 2 double inverters. Looks very nicely designed and well built. For a hundred or two bucks and some quick work, a 650 amp controller can be built to power a DC series motor. I would gut the insides and retain only the IGBT's, current sensors, buss capacitors, and some of the bus bars. Fabricate bus bars to parallel the top collectors, middle emitter-collectors and lower emitters. of all the IGBT's. Use the top transistors for the freewheel diodes only by shorting the E-B tabs on all the top transistors and use the lower transistors to PWM the motor. Install a PWM oscillator with torque control using the existing current sensors for current feedback. A little control board from a Russco controller using two op amps would work just fine. Finish with a couple of TO-5 gate drivers.

Simple, easy to perform and the result will be a 650 amp controller for DC motors for two-hundred bucks. But those Prius inverter boxes are a large cubic foot size and weigh 50 pounds.

But cost per amp is almost free.

Great idea.


----------



## Jnbrown3 (10 mo ago)

Hi there, This is a great idea. Is this really possible to disassemble the Prius inverter and build your own controller? I was thinking about trying to copy Damien's 1000 euro BMW controller with the Prius IBGT and heat sink. It looks quite manageable for the beginner, the Prius inverter designs seem more complicated. If anyone has actually done this, would love to hear from you. Thank you, Jeff


----------



## remy_martian (Feb 4, 2019)

Tombstone formatting, for your heirs' convenience:

"It looks quite manageable
...for the beginner"


----------



## Jnbrown3 (10 mo ago)

I take your point, Thanks


----------



## remy_martian (Feb 4, 2019)

Um...that wasn't a point. It was a dire warning.

STAY AWAY FROM BUILDING HIGH VOLTAGE ELECTRONICS


----------



## Jnbrown3 (10 mo ago)

Thank you, I hear you.


----------



## GE11 (Oct 24, 2011)

This is an Awsome thread Matt... Thanks for starting this....

Now.. I have 4 Prius inverters in my gargae and gotta quit being lazy about doing somthing with them..


----------



## MattsAwesomeStuff (Aug 10, 2017)

GE11 said:


> Now.. I have 4 Prius inverters in my gargae and gotta quit being lazy about doing somthing with them..


Correct.

However, do read the thread, Damien's design should not be followed apparently, but you can get reasonable results from similar setups.


----------



## GE11 (Oct 24, 2011)

From my understanding. There are IGBT drivers on the Prius module . Would need to know how to drive this Circuit with a PWM signal… the once I do that I’m home free


----------



## piotrsko (Dec 9, 2007)

Magic words: driver circuit. Pwm is essentially controlling how the igbt is turned on and when, there are driver chips that have a lot of ancilliary functions like desat detection. My caveat is yes it can be done, but it isn't as fail proof as a genuine factory controller makes it seem to be. A lot of silicone power modules have been sacrificed to the smoke gods from not so good ideas. If it were truly that easy, there would be Chinese clone kits for every controller on the market


----------



## Russco (Dec 23, 2008)

GE11 said:


> This is an Awsome thread Matt... Thanks for starting this....
> 
> Now.. I have 4 Prius inverters in my gargae and gotta quit being lazy about doing somthing with them..


Four inverters? Any idea of the part number of the three larger IGBT's inside? Bet they're 400 amps and 1200 volts. Thanks.


----------



## GE11 (Oct 24, 2011)

Russco said:


> Four inverters? Any idea of the part number of the three larger IGBT's inside? Bet they're 400 amps and 1200 volts. Thanks.





Russco said:


> Four inverters? Any idea of the part number of the three larger IGBT's inside? Bet they're 400 amps and 1200 volts. Thanks.


Man, not sure when I would have time to check..


----------



## remy_martian (Feb 4, 2019)

They are dice mounted on bespoke channelized substrates -- you might get lucky with a microscope, though most custom silicon rarely has part numbers where you'll find a datasheet.

Easiest way is to destructively test with a high voltage power supply to see where the breakdown is.

They may be 800V devices, given how long the design has been around.


----------



## Russco (Dec 23, 2008)

[Edited by mod - I don't know how or why you had a triple-nested table in your reply, framing everything, but I fixed it.]

I'm just about finished with the 650 amp DC controller. It uses two 600 amp IGBT's with liquid cooling. Operated fine into an Advance 9" DC motor. Parts cost over $600 new. 

Meanwhile, I've been investigating a Prius generation 1, 2, or 3 inverter conversion to a DC motor controller. I dislike the generation 3 greatly due to its special "open face" many IGBT's used and instead believe the generation 1 and 2 use more common components such as familiar stock capacitors and active components. 

I hope to make the 25 mile trip to the local Pick and Pull junkyard and purchase a Prius inverter for their stated $60. Prius cars are VERY popular in California; they're everywhere and the local junk yard has 3 generation 1's and a dozen generation 2's.

I have absolutely no question I can convert the Prius AC Inverter into a DC Controller.








Stay tuned. I do this for enjoyment and the learning experience. But I may be sorta' slow.
Picture of 650 amp controller enclosed.


----------



## GE11 (Oct 24, 2011)

Oh wow!! Fantastic work dude!! I have 4 gen 2 inverters


----------

