DIY Electric Car Forums banner

Another homebrew AC-controller

560K views 2K replies 99 participants last post by  nailgg 
#1 · (Edited)
Hello everybody!

I have been reading here for a while and I'm simply impressed by the projects shown here.

So today I want to make my first humble contribution.

Short story:
1,5 years ago I came up with the idea of converting a regular ICE car electric (how unusual ;) ). I decided it would have to be an AC-motor since most of the complicated parts of spinning it are done in software plus it offers the best effiency. I also found out that standard ACIMs are really cheap and can be overpowered for short periods. Unfortunatly I also found out that controllers are really expensive.
Being an electrical engineer I decided to give it a try. My first inverter consisted of some BUZ50 mosfets and controlling circuitry around it. It basically worked but of course would only drive a 1:10 model of a car ;)
So I scaled up and have now got this:



It uses a 1200V 90A IGBT, IGBT drivers, a hardware PWM-module and a PC. It basically spins the motor at whichever frequency you set it to and it even uses the space-vector modulation scheme to achieve the highest possible amplitude. I know 90A isn't much but it's a start.



At the top you see the voltage with the little space vector "dent" and the current at the bottom.

There is one problem though: it is all open loop and it uses a PC. Also the PWM resolution is just 8 bits.
My plan is to put the controller program on a little µC which offers 16-bit pwms. For closing the control loop I want to start out with a speed sensor and thereby control the slip of the ACIM in some clever way that is still to be figured out. Since I have never seen any serious motor controller without current sensors and vector control I might have to implement that as well. There are closed loop sensors already on the IGBT-module but their output somehow didn't seem to linearly follow the amplitude of the current.
When all is finished I want to document it like the well known Open Source Motor Controller.

So... do you think this is a promising project worth continuing? And if yes, any suggestions?

Looking forward for replies :)
Johannes
----
State of the project
As of today there are probably around 100 vehicles making use of this project. There have been forks by "Jack Bauer", arber333 and others to use the technology in OEM inverters (Tesla, Ampera, i3, Leaf, ...)


  • Hardware
    • Logic (brain) board based on STM32F1
    • Simple 4A gate drivers
    • Melexis current sense boards
    • Isolated voltage sense board
  • Software
    • Bootloader for firmware upgrade without programming hardware
    • Firmware with mature support for asynchronous motors and experimental support for synchronous motors
    • Web interface using ESP8266 Wifi chip supporting Parametrization, plotting and firmware upgrade
The "vanilla" kit and documentation can be found here: http://johanneshuebner.com/quickcms/index.html%3Fen_inverter-kit,10.html
Web shop here: https://openinverter.org/shop
Forum here: https://openinverter.org/forum

Tesla Boards here: http://evbmw.com/index.php/evbmw-webshop, Source:https://github.com/damienmaguire
Inverter Source code here: https://github.com/tumanako



Please let me know what else should be mentioned here.
 
See less See more
2
#37 · (Edited)
Thanks, love that basket, too :)

Not sure about the controller specs. I mean I'm sure about the IGBT specs but not the systems capabilities, especially the heat sink.

IGBT-wise it should handle up to 850Vdc, 90A. So thats 76kW. According to semisel thats roughly 1,5 kW of losses. I'm pretty sure the heat sink is not gonna support that kind of power.

For now, the inverter will be run at 18,5 kW maximum (500Vdc, 39A). The bracket is mostly mechanical, it just connects to the "earth" screw of the caps.

Once the car is running I will experiment with liquid cooling.
 
#42 · (Edited)
Some progress made. I have added DC link voltage measurement.
It works like this:

B+ ..3M ........... 10k .......... 1M .. B-
---|\/\/|-------|\/\/|-------|\/\/|----
...................| 100µF |
...................|---||--|
...................| to ADC|

So the ADC is decoupled from the high voltage with resistors. The rather large capacitor smoothes out the voltage. It's one hell of a low-pass but the bus voltage should only change slowly. Anyone see a problem with that arrangement?

The voltage is only used for contactor control. When a threshold is reached by means of precharge, the contactor closes.

I also found out the the SKHI22 drivers add 5µs dead time on each side of the pulse. That might explain some strange voltage jumps observed earlier.
 
#43 ·
So the ADC is decoupled from the high voltage with resistors. The rather large capacitor smoothes out the voltage. It's one hell of a low-pass but the bus voltage should only change slowly. Anyone see a problem with that arrangement?
This doesn't isolate the high voltage from the controller. And you are unlikely to measure what you expect. If your controller is nominally isolated, it will tell you which side of the traction circuit has the most leakage -- probably by saturating the input range and injecting current into the pin. Or it might just pick up capacitively coupled noise.

There are reasonable ways to measure voltages using optocouplers, especially if you aren't demanding about speed or precision. But with two or more voltages you find that using a SPI A/D converter and a Si84xx or ADUM isolator is easier to build.

I also found out the the SKHI22 drivers add 5µs dead time on each side of the pulse. That might explain some strange voltage jumps observed earlier.
That's a really long dead-time, suitable for old, slow IGBT modules. You might want to increase your turn-off time to compensate. The increase in thermal load might be easier than trying to modify encapsulated gate driver modules.
 
#45 ·
I follow similar design, I use a opto isolated gate driver with an Isolated voltage to make sure the IGBT has hard turn off and turn one. this board mount directly to the IGBT This keeps all low level circuits out of the High voltage loop.
I use IGBT with low on resistance to minimize the heat dissipation.
for Cooling I started with Cold Plates but have developed a thin Aluminum sealed case with ports for fluid flow for all IGBT, at 3gpm into a transmission cooler.
 
#55 ·
Ok, some good news, as mentioned here:

http://www.diyelectriccar.com/forums/showpost.php?p=278006&postcount=14

The inverter moved the car!
http://youtu.be/jCyK6MCE66o

It has a tendency to be jumpy e.g. when applying the brakes. Also when accelerating just lightly, desaturation protection kicks in.

Stuff I will try:

- digitally Filter analog inputs
- reduce pwm frequency from 8,8 to 4,4 khz
- Rethink the slip control algorithm
- Run the inverter in V/f mode to see if slip control is the problem
 
#56 ·
Nice, Johannes!

Where is it shutting down? Breaker due to over current? Shoot-thru perhaps? How's your inputs look after your recent mods? Does it spin ok when lifted off the ground but trips under load?

IMHO, I think your frequency is fine. I can hear a bit of it on your video too. Unless you plan to vary the PWM freq with load/speed, you probably won't see much improvement by changing that. Or maybe you're just troubleshooting in which case, I'll shut up 8 - )

JR
 
#58 ·
As mentioned in my conversion thread, I have made some progress also with the inverter:

http://youtu.be/xkuDTby8pQw

I fixed the SVPWM routines. I had fed them through a simulation and it turned out that
a) 0V phase-to-phase voltage wasn't accomplished by running all three phases at 50/50 dutycycle but 0 dutycycle. That also meant that low sine amplitudes happened in the short-pulse range. Not good for accuracy and effiency.
b) There were some general flaws with the implementation that resulted in unclean waveforms.

I also placed a median filter between the slip controller and the rev counter as to minimize problems with induced spikes. It also compromises throttle response quite a bit. Will play with the available parameters like sample time and filter depth.

Apart from that I don't think my 90A IGBT module is up to the job. It shuts down on harder acceleration (which doesn't mean brutal) a bit to soon for my taste. But could also be down to the algorithm - the current rises linearly to the slip.
 
#59 ·
Congrats Johannes! Great progress from the last video where you were just moving back and forth in your driveway.

Hmmm I didn't quite follow the 0V / phase issue you described. Do you mean the phases were fighting each other by being energized 50% at all times? Got any scope screenshots of the latest waves?

Did you get around to change the PWM frequency after all? Any plans to vary PWM base frequency with speed? Not sure that's even necessary other than to squeeze max torque and reduce switching noise.

As it stands, it's a great accomplishment that it runs the truck even if it's not finished yet so congratulations on getting this far.

JR
 
#60 ·
Hmmm I didn't quite follow the 0V / phase issue you described. Do you mean the phases were fighting each other by being energized 50% at all times? Got any scope screenshots of the latest waves?
No fighting ;-) Its just that the way it was the IGBTs were operated with short pulses. My old-ass drivers insert 2,5µs deadtime before AND after each pulse. Thus, any pulse shorter than 5µs will simply not do anything at all.
So now, say you want 20% of your sine amplitude. You should accomplish that by varying your dutycycle from 40% to 60%. Instead I had used 0% to 20%.

Did you get around to change the PWM frequency after all? Any plans to vary PWM base frequency with speed? Not sure that's even necessary other than to squeeze max torque and reduce switching noise.
Yeah, changed it to 4,4 kHz. I think it is better inspite of the huge dead time. Though it is rather noisy. Whats cool though is that it sounds exactly like the tram here in Kassel :)
The frequency is fixed, advanced stuff might follow later on.

As it stands, it's a great accomplishment that it runs the truck even if it's not finished yet so congratulations on getting this far.
Thanks :)

Even if it sounds cocky: 4 years ago I didn't even know what "3-phase current" meant. Now I'm running a car on it. It is quite a kick.
 
#61 · (Edited)
So, yet another power stage.

Since me and others are supposed to be able to reproduce the inverter, I rebuilt in using legacy components:

3 half-bridge modules (Semikron 1200V, 400A)
6 A3120 gate drive opto couplers
6 DC/DC converters to supply switching power
3 custom gate driver PCB to hold the latter (basically Valerys design from the charger)

I decided that I don't need any of the advanced functionality of those expensive SKHI gate drivers:
- dead time: done by the STM32
- under voltage lockout: A3120 supports that
- desaturation detection: will be replaced by a hardware current limit, AC currents will be measured anyway
- Only 2.5A gate current: switching off is "slow", 1.5µs but I'm not aiming towards 98% efficiency

Further advantage of the A3120 is that it can be driven by a controller pin. with the SKHI drivers I needed a level shifter.

I also use a huge heat sink that is more level than the old one and should allow for easier case manufacturing. The motor and batteries are connected directly to the IGBT modules, no additional wiring inside the controller is done.

Ok, enough writing, heres some pics:




I ran my 2hp test motor on it. Tried 16kHz, so smooth!

The bus bar is a 20x2mm alloy strip, couldn't be bothered to use copper for a shabby 30% better conductivity. It directly connects the bus caps, IGBT modules and snubber caps. Like said, the battery terminals are connected to it too.

The controller board is a small STM32H103 from Olimex. I now need to do the IO-stuff: temps, voltages, currents, rev counter, throttle, DC switch, .... Will design another PCB for that.
 
#62 ·
Only 2.5A gate current: switching off is "slow", 1.5µs but I'm not aiming towards 98% efficiency
First off... !WOW! very cool. I have controller envy

So I purchase 3 Fuji 2MBI200N-060 200A / 600V IGBT half-bridge bricks. datasheet

I'd rather use something like this... IRS23364DSPBF - high speed power MOSFET and IGBT driver Because it's cheep and does have the lockouts, protections, and it is at MC voltages.

I now see two problems (please confirm)

- not opto-isolated
- not powerful at 350mA

Where do I figure gate current from the brick spec?

Thanks,

-Bruce
 
#76 ·
New hardware!

I finally pieced things together and built an all new base board for the AC controller. Here it is:


Features external:

  • 8 digital inputs 12V: on, start, brake, motor protection switch, forward, reverse, emergency stop, bms
  • 4 digital outputs, open collector: dc switch, error, over temperature, precharge
  • 1 PWM output with the highest relative temperature signal: motor or heatsink
  • 3 analog inputs: throttle, throttle redundance, motor temperature
  • 1 pulse generator input
Features internal

  • 4 analog inputs: current L1, current L2, DC link voltage, heatsink temperature
  • 3 complementary PWM outputs for the bridge
  • Programmable hardware over current protection
  • 2 UART pin headers: 1 for programming, 1 for console/communication
  • USB - yet unused
  • Hardware PWM inhibit logic. The PWM is interrupted by: over current, motor protection signal, emergency stop signal. The latter two are failsafe: they must be high for the PWM to work
Thats pretty much it, I tried to keep it as simple as possible. Heres the baby built in:



And here are some mistakes I made/lessons I learned:

  • I twisted one of the pin headers for the olimex board. Had to cut all traces and rewire :mad: I thought I'd triple-checked it because I was so afraid of it. Next time I'll quad-check
  • Due to a lack of space I skipped over voltage protection diodes. When I tested the digital inputs I applied 12V to the analog throttle input. BANG, controller dead
  • Also due to a lack of space I skipped OpAmps for the current measuring inputs. Now I realised that the ADC inputs have a nasty low impedance when sampling a pin. This will pose accuracy problems and it makes the over current protection a bit inaccurate, too
  • Some parts are a bit close together. Didn't spend much time on determining the correct foot print for every capacitor, pin header and so on


Things that work as expected:

  • PWM with Al cheapo gate drivers - I'm delighted with the performance
  • hardware PWM inhibit: cut any of the two digins and the motor stops immediatly.
  • hardware overcurrent protection: when set low it will detect a blocked motor shaft even on my 1.5kW test motor run at 60V (instead of 380V)
  • Cheap dc link voltage sensing: no galvanic isolation but high resistance (1M) to high voltage.
  • Temperature measurement: lookup table in software is very accurate
  • 5V Current sensors: no negative supply voltage needed
I will conduct some more tests once the controller is in the car. But most circuits are already proven by the previous model so I'm optimistic.


As soon as I've made corrections I will post the circuit diagram. The software is still the largest question mark: as mentioned here (http://www.diyelectriccar.com/forums/showthread.php/vfd-foc-dtc-back-basics-76985.html) the control algorithm is quite crude but drives a car.


Besides that it might be time to offer a kit. Anyone interested?
 
#80 ·
I don't know if this has been posted before but I think this is a very good piece of information:
http://www.scribd.com/doc/7342732/Dealing-With-IGBT-Modules-Semikron

It shows pretty well what to include in the small gate driver PCB and how to physically design and decouple the DC bus. Just get these right and you should be fine...

IGBT half-bridge modules are very easy to use and need a relatively low number of external components. AC controller is easier than many people think. Of course you can make it as complex as you want, but the basic case is simple, as shown in this thread very well.

We use ACNW3130 as gate drivers (similar if not the same as referred in this thread?); they cost something around $6 per piece and you need 6. It can supply 2 amps (with gate resistor about 10 ohms). With the gate capacitance of our 1200V150A IGBT bricks, this means 0.2 µs RC time - better multiply that by 5 to be sure; so this will limit the rise time by about 1 µs in our case. If high switching frequencies are desired at high power levels, a stronger driver might be necessary, but we will go with those, too. They are optoisolated and have under-voltage lock-out. Having a voltage range of 30V, I'm thinking about having +18/-10V drive. Yes they specify you can live with single-sided supply, but having a negative drive will make switching off faster and more reliable.

You also should pay some attention to driving the LED of the optocoupler; it can fire off falsely from inductive coupling of the wiring. ACNW3130 datasheet specifies a certain way to connect the LED when driven from an open-drain output, but IMHO this is not needed with a typical CMOS push-pull output; but this should be kept in mind.
 
#81 ·
I don't know if this has been posted before but I think this is a very good piece of information:
http://www.scribd.com/doc/7342732/Dealing-With-IGBT-Modules-Semikron

It shows pretty well what to include in the small gate driver PCB and how to physically design and decouple the DC bus. Just get these right and you should be fine...
Well I got the gate drive right: installed right on the module with gate clamping (diode and resistor). The IGBT modules came with snubbers which I installed right at the terminal. I didn't put much effort into the DC busbar. The two poles don't overlap as they do in there drawings, they just run parallel over all 3 modules. Maybe a problem at high power?

IGBT half-bridge modules are very easy to use and need a relatively low number of external components. AC controller is easier than many people think. Of course you can make it as complex as you want, but the basic case is simple, as shown in this thread very well.
Hardware-wise I think its no harder than Valerys charger. Software might be a little harder, especially if you actually want to understand what you're doing.

We use ACNW3130 as gate drivers (similar if not the same as referred in this thread?); they cost something around $6 per piece and you need 6. It can supply 2 amps (with gate resistor about 10 ohms). With the gate capacitance of our 1200V150A IGBT bricks, this means 0.2 µs RC time - better multiply that by 5 to be sure; so this will limit the rise time by about 1 µs in our case. If high switching frequencies are desired at high power levels, a stronger driver might be necessary, but we will go with those, too. They are optoisolated and have under-voltage lock-out. Having a voltage range of 30V, I'm thinking about having +18/-10V drive. Yes they specify you can live with single-sided supply, but having a negative drive will make switching off faster and more reliable.

You also should pay some attention to driving the LED of the optocoupler; it can fire off falsely from inductive coupling of the wiring. ACNW3130 datasheet specifies a certain way to connect the LED when driven from an open-drain output, but IMHO this is not needed with a typical CMOS push-pull output; but this should be kept in mind.
I use the A3120 as in the charger. I only found symmetric DC/DC converter modules and didn't feel like rolling my own.
The Optos are driven with a push-pull outputs, the cable is 20cm long, untwisted and unshielded. I hope that won't stop the show. Since only pulses longer than 1µs make it through all the delays I'm pretty confident it will be ok.
 
#91 ·
hehehehe!! renault R4, my grandfather have one of them about 20 years ago!

about your board, i send you a PM.

I was thought use a Semikron skyper from semikron or from a chinese company than build copies of semikron, infineon and concept drivers:

it is interesting, take a look:
http://www.qtjtec.com/en/products.asp

but finally i have bought a SEMIKRON SKiiP 232 GD120-313/04 MODULE with integrated drivers and current sensors, it is only 200A but it is cheap and seems easier to start
 
#92 ·
hehehehe!! renault R4, my grandfather have one of them about 20 years ago!
I love its simplicity. Theres a total of about ten cables in the engine compartment to run the temp dial, warning lights and the key switch.

about your board, i send you a PM.
I'll get back to you when I've ordered a batch if the revised board.

I was thought use a Semikron skyper from semikron or from a chinese company than build copies of semikron, infineon and concept drivers:

it is interesting, take a look:
http://www.qtjtec.com/en/products.asp
What are the prices for the chinese drivers?

but finally i have bought a SEMIKRON SKiiP 232 GD120-313/04 MODULE with integrated drivers and current sensors, it is only 200A but it is cheap and seems easier to start
Thats a really nice module. How much is it?
What bothers me a little is its need for 15V supply voltage and logic levels which you'd have to step up from the cars 12V battery.
 
#94 ·
new or used part? The gate drivers of my previous inverter alone cost that much.

Did some in car testing today. First I tested my new slip control. The throttle will set the slip between 0..X%, whereas part of the throttle is for braking and gives a slip from -Y..0%. At the same time the sine amplitude is varied from Z..100%, where 100% is the respective point on the FU diagram.

The slip controller itself is a PID controller but after some simulation I removed the I and D parts as they add nothing useful to the controller response.

Since the controller becomes unstable at low speeds it will output a fixed frequency when below R rpm.

So first I tested this with the motor idling. It spins up nicely whereas the first 50% of the throttle don't do much. Will have to play with the parameters or maybe introduce an exponential pedal map instead of a linear one. But then I was only testing with 80V instead of 500 so maybe it will behave different when more power is at hand.

Next test was letting the car drive up a step (as in sidewalk) to see the 0rpm capabilities. It actually climbed the step nicely after playing with the parameters a bit. Doing the test I unwillingly tested the over current protection (set to 100A). Seems to work :)

Only error I found is that the motor temperature isn't displayed. The voltage output of the sensor looked ok but apparently the ADC didn't pick it up.

No video of today because it would have probably been boring.
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top