# cheap home made motor controller



## reubenT (Jun 17, 2009)

I'm no electronics engineer, (perhaps there's one here who can suggest improvements without undue increase in complexity) but I have played with electronics for the last 35 years in various ways. I was just testing a switching circuit with some IGBT transistors I got awhile back, getting a pulse delay function working for another project, using a variable frequency and pulsewidth generator board that I put together a few years ago to test it. And got to thinking. With these transistors I'm playing with it looks like I could stick together a simple 500 to 1000 amp controller with not much over $100 in components. off the shelf stuff from an electronics supplier. It would have 1200V max peakV and need a good heat sink, either forced air or liquid cooled. (a collection of old computer motherboard heat sinks and fans would work fine I think) a 500A version would have 1200A momentary surge capacity. But it would have no protective controls, no current limiting. Therefore running one at around half maximum capacity would probably be good to stay safe. 

Just a simple variable pulse width modulator board driving a rack of IGBT power transistors. With an extra pulse dividing circuit and 3 sets of power transistors instead of one, a 3 phase controller could be done, although that would boost cost a bit. 

Looks like $84 + shipping would get 1000 A worth of power devices, (cheaper by the 100- $230 for 3500A worth) a few dollars in components for the control board, a large heat sink and fan which I would scrounge from junk. Would take a little electronics assembly with small soldering iron and a perf board. And I suppose a little circuit diagram reading knowledge would be helpful, sometimes I sort of forget that most people are blank in that area. But I learned it fast when I was a kid and got interested in it, started collecting electronic junk, pulling components and building simple things. The pulse width modulator I'm using is here; http://www.rmcybernetics.com/projects/DIY_Devices/homemade_signal_generator2.htm
Then using enough HGTP10N120BN transistors in parallel to obtain as much amperage capacity as desired. Might need some current equalizing help, using not too large a wire on each device might be enough, provided it's not too small and overheats. Or a short piece of ni-chrome wire between 2 bolts on each transistor lead if a little more equalization resistance is needed. A junk electric heater would supply that stuff. 

Just some ideas. 
*
*


----------



## dougingraham (Jul 26, 2011)

In concept it is straightforward. In practice there are lots of physical layout issues to work through. Always wear eye protection when you are messing with high power devices. I've been pelted with hot plastic bits when power devices come apart more than a few times when testing circuits.

There is a bit more to it than just wiring up high power switches to pulse width modulation circuits. For use with an EV you are going to want a control loop that limits output based on motor voltage and current and battery current along with RPM and controller temperature. This ends up being a rather complicated control loop. You want the throttle position to command motor current (in essence torque), not motor voltage.

Best Wishes!


----------



## Siwastaja (Aug 1, 2012)

Use a specialized gate driver IC for driving IGBT's. Use one with desaturation detection. Pay attention to gate resistor sizes, physical layout, wire lengths etc. We use ACPL-333J. You may need to use a separate power stage after the driver IC because most only supply 3A. 3A might be enough even for a large IGBT though if you are fine with slowish switching frequencies (3-5 kHz). The datasheet and application notes provide the recommended connection. Use negative gate drive. We use +17V/-7V from 24V DC/DC modules and a zener hack IIRC. You could also do +17/-5 from two DC/DC modules of +/-5 and +12V. Use large enough bypass capacitors for powering the driver. This means electrolytic and ceramic/plastic together. All kinds of stuff you need to be careful with.


----------



## PStechPaul (May 1, 2012)

At first it seems pretty easy to build a cheap controller. But the devil's in the details. When you try to parallel 30 x 35A devices to get 1000 amps, you will have a nightmare of building wiring and a difficult time making a PCB to handle the current. The nichrome emitter balancing resistors will be difficult to mount and will kill efficiency.

It's much better to use high current modules which you can get for cheap on eBay, and even list price is not too bad, like 40 bucks for 1200V 215A:
http://www.digikey.com/product-detail/en/APT150GN120J/APT150GN120J-ND/1494273

Also the simple 555 timer and comparator may be OK for hobby use and toys, but you really need some sort of microcontroller and throttle sensing and current/torque control, which can be obtained in a $5 PIC.


----------



## Siwastaja (Aug 1, 2012)

+1 for IGBT modules. Don't try to parallel small devices. It's a waste of time.

And, if you end up doing an AC inverter, then the only practical choice is using half-bridge modules. And then you need a specialized microcontroller (with three synced PWM generators with deadtime generation). DC motor control can be done using almost any microcontroller.

Devil is indeed in the details.


----------



## reubenT (Jun 17, 2009)

I figured a simple approach would have it's problems, but then, there isn't any better way of getting experience than making stuff yerself. I like the process, especially because when something goes wrong I know how it works and can fix it as well.


----------



## PStechPaul (May 1, 2012)

I also like to try things with hands-on prototypes, but so far I have done so for smaller projects such as my 2 HP electric tractor. I had a DC-DC converter blow up and fortunately it was only pushing about 400 watts and 20-50 amps from the battery. I pretty much figured out what caused the problem but my next step will be a rather complete redesign. See some arcs and sparks:


----------



## Arlo (Dec 27, 2009)

Diy controllers are fun and quite challenging. Brushed control was to hard for me  I must have 20 videos like this one  http://www.youtube.com/watch?v=XOipoz9c6bs


----------



## PStechPaul (May 1, 2012)

I liked this one:
http://www.youtube.com/watch?v=M7XnkkUBHoI

I see you are (or were) using IRFB4110 MOSFETs, which are rated at 100V, and I think your bus voltage was something like 85V. That's not enough headroom, especially with regen. So your controller ate $5000 worth of these guys? I see they are about $3-$5 each from Mouser but you can get them for $1 each on eBay.
http://www.ebay.com/itm/50pcs-IRFB4110-FB4110-POWER-MOSFET-Transistor-TO-220-/170387752114

Do you think they may be counterfeit?


----------



## Siwastaja (Aug 1, 2012)

Leave at least 3x headroom for semiconductor voltage ratings in initial tests. It's easy to control 12V stuff with a 60V MOSFET, and so on. We use 1200V IGBTs and think about going to 400V max.

Professional controller designs may go as low as 1.5x (400V rating for 600V semiconductors) but they are well designed and tested. They have finetuned DC bus filtration, snubbers, DC bus physical design and rise/fall times.

Regeneration needs some consideration because if you blow a fuse etc., you have no more battery pack to sink the current and the voltage will rise enough to kill the capacitors and/or semiconductors. So in the end, you need a DC bus voltage monitoring that disables regeneration (in the control logic/code) if the voltage gets too high. Multiplex this with a BMS "cell full" signal and you prevent overcharging while regening. We have this practically done soon but we are still running regen without any protection, but we have limited it quite a bit.

About rise/fall times: too quick and you have higher voltage spikes killing the semiconductors and more EMC. Too slow and you have too much losses and you risk killing the IGBTs by forming the hotspots in the device -- IGBT's are not rated for linear operation so that region should be avoided at full current. I think 1 µs rise and fall is approximately in a good range for first tests.


----------



## Arlo (Dec 27, 2009)

I was using 4110 fets. One build has irfp4568 fets a little above (100v) and one has irfp4468 fets (84v) so far.
My next build after those 2 is with ixfk230n20t fets.
200v rated. And the plan is for 40s lipo but I will scope it and slowly raise the voltage till I think I have the max.

As for switching times when I run hi amps the shut off of the low side fet causes a hi voltage spike in the low side fet Drain to source because the current cant get through the hi side diodes to the caps fast enough. 
Most of this is cause by layout and will be fixed with the layout used with the 4568 fets.


----------



## mizlplix (May 1, 2011)

I take my hat off to all of you. As I tell anyone who will listen...

"Even a failure is progress."

Miz


----------



## Arlo (Dec 27, 2009)

mizlplix said:


> I take my hat off to all of you. As I tell anyone who will listen...
> 
> "Even a failure is progress."
> 
> Miz


 I see it a little different. You can't fail if you don't give up. I have learnt a lot and it is getting easier.


----------



## Stiive (Nov 22, 2008)

Sweet vids Arlo... Regen's a bitch 

Maybe sit the camera (or a couple on different angles) on a steady surface zoomed in on the controller... Might be good to see where the spark originates. Then it would be good to cross reference with a video of the voltage/current measurements moments before the explosions - maybe it shows a current or voltage surge?

We had some interesting findings from doing this on our TIM600 controller back in 2010. Regen always seems to be the culprit. One time you could clearly see on the video an arc from phase to ground about 100mm long! Clearly there were kV's present. 
Probably after an IGBT popped, the fuse blew, and the motor/axle inertia was still trying to regen with no batteries to accept the current and limit the voltage rising.


Also, Did you write the code for this controller?
To quote from the video;
"I upped the battery current limit from 330 to 340A.. I think the controller just calculates it so its the best guess.. umm... in a way... its pretty smart, it knows what its doing"


----------



## Arlo (Dec 27, 2009)

No I did not write the code for this controller. I have written enough code to make a motor turn but that's it.
The controller uses 3 400 amp hall sensors that respond in 3uS so yes it does watch current on the phase wires and not guess at it.
The blow ups during regen were because of the way I had the wires routed from the battery into the powerstage creating a triangle letting the middle phase build up to hi as well I was trying to push the limits 200-250 phase amps is a reliable setting. I had over 10kw regen multiple times before adding wires to the other end of the power stage. And a few blow ups were because I didn't notice a hole in the kapton under one fet I tested it with a multimete a few times and hi ohm scale and diode check and it would not show up until I passed hi voltage spikes thought it.

I have a much better design on the go. This is all in my spare time which I have little of.


----------

