DIY Electric Car Forums banner

Another homebrew AC-controller

542530 Views 2283 Replies 99 Participants Last post by  nailgg
2
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
1 - 20 of 2284 Posts
I am interested in your project but don't really know enough to be helpful. I will be following the thread. There is a real need for a reasonably priced AC controller. Keep it up.
The first lesson I learned when building up my inverter was the importance of a nice stout DC bus. Use flat copper bus bars to connect the capacitor bank to the IGBTs. Keeping the inductance low is key to not blowing IGBTs up, you want to minimize the wire length between the capacitors and IGBTs.

Another lesson, make sure you have hooks in to automatically disable the inverter if the DC bus voltage gets too high. I was surprised that regen worked without any effort, even in volts / hz mode. I was lucky I didn't blow up my capacitor bank, I hit voltages over 400 volts a few times by accident. Also make sure you have proper fusing, IGBTs fail as a short circuit.

Congrats on getting your motor spinning!

You can get a little more low end torque by adding some voltage offset at low speed. Instead of following the V/Hz curve down to 0 volts, 0 Hz, try 10 volts @ 0 Hz.
2
Yes, these sound like important points to take care of, I probably would have forgotten some ;)

Here's another question then:

You can see here the PCB-interface to the pressure-contacts (or whatever the term is) of the IGBT interface. As you can see in the first post I simply fixed some lugs to the power contacts. Would you recommend fabricating a bus bar and try to fix it without drilling holes in the precious copper area?

Edit: picture of the redesign

Now some question concerning the design: enough gap for high voltages? What about the tickness of the PCB, can arcs ignite from the top to the bottom layer?

/Johannes
See less See more
Yet another question:



On the left you can see the current sensors that are supposedly "closed loop". The transfer ratio is 1:2000.

Does anyone know how to make use of them? if I simply attach the scope to either the large or the small coil (or hall sensor?) I do get an output which seems to be in no way proportional to the current though. I then tried feeding the output of the small thing into an OpAmp and feed back the output of the OpAmp to the large coil. I attached the scope to the output, too. That gave me the output you see in the first post but the amplitude stayed the same no matter what the actual current was.

Has anyone ever build a closed-loop current sensor here? What is going wrong?

/Johannes
See less See more
Hey Johannes, welcome to the forum.

Got a part number for the current sensors? I think you're right, that looks like a hall sensor at the end of the coil core. Current transducer these days come complete with opamp, filter, etc; you feed it a voltage and ground reference and they output half of that voltage at rest and move to either rail as current flows through.

If what you have is the discrete coil and hall, you might want to take the hall output, feed each leg to an opamp then the opamp output to one leg of the coil with the other leg being your current output. Reference the output to ground with a resistor. The opamp should output about half the rail voltage so you have both pos and neg current flow measurements. Add some ceramic caps for filtering/bypassing. Or, buy a set of Honeywell CSLA2DK current transducers that have this already done for you.

Good to see you're doing this. I'm taking the Eric T. route and using an industrial VFD brains with external IGBTs and current sensors. These VFD are cheap enough in low HP ratings but they have every possible motor control parameter already coded.

JR
See less See more
You can see here the PCB-interface to the pressure-contacts (or whatever the term is) of the IGBT interface. As you can see in the first post I simply fixed some lugs to the power contacts. Would you recommend fabricating a bus bar and try to fix it without drilling holes in the precious copper area?


/Johannes
It looks like the IGBT has spade lugs? I would drill holes in the PCB and solder some spade lugs on it. Can you make a larger PCB so you can solder in some caps on the same board?

If you are planning to eventually scale up to larger IGBTs, you might consider buying those and designing your DC bus around them.
Got a part number for the current sensors? I think you're right, that looks like a hall sensor at the end of the coil core. Current transducer these days come complete with opamp, filter, etc; you feed it a voltage and ground reference and they output half of that voltage at rest and move to either rail as current flows through.
I don't have a part number for the sensor itself, since it is integrated in the IGBT module. The latter one is called "SKiiP 82 AC 12 I" and manufactured by Semikron.

If what you have is the discrete coil and hall, you might want to take the hall output, feed each leg to an opamp then the opamp output to one leg of the coil with the other leg being your current output. Reference the output to ground with a resistor. The opamp should output about half the rail voltage so you have both pos and neg current flow measurements. Add some ceramic caps for filtering/bypassing.
Thats basically what I did. I'll keep trying.

Or, buy a set of Honeywell CSLA2DK current transducers that have this already done for you.
I don't really like redundancies ;) These sensors are there and I want to use them. But as mentioned above, I will be starting with a V/Hz kindof control which doesn't need them. It's only later with space vector control that I do.

Good to see you're doing this. I'm taking the Eric T. route and using an industrial VFD brains with external IGBTs and current sensors. These VFD are cheap enough in low HP ratings but they have every possible motor control parameter already coded.
Since I'm a professional software developer but a hobbyist at electrics I'd rather buy an all done hardware device and do the programming myself. Haven't found anything like it though. Can I see your progress anywhere?

It looks like the IGBT has spade lugs? I would drill holes in the PCB and solder some spade lugs on it. Can you make a larger PCB so you can solder in some caps on the same board?

If you are planning to eventually scale up to larger IGBTs, you might consider buying those and designing your DC bus around them.
Why would I need holes for soldering on spade lugs? The IGBT module itself is definitly meant to be contacted by a PCB.
A larger PCB would be a dream. I originally planned to integrate the drivers on the same PCB but failed to do so because of limited equipment for making PCBs. Maybe I should employ one of those PCB makers and reconsider that.
I also noticed that most newer Semikron modules are using screw contacts again. So once I upgrade I can just use lugs.

/Johannes
P.S. More pictures can be found here: http://johanneshuebner.com/coppermine/thumbnails.php?album=60
See less See more
Can I see your progress anywhere?
I don't have anything to show just yet. I bought a Hitachi SJ300 5HP VFD and thought it would be better to do my experiments with a known good VFD rather than having to worry about the IGBTs also. Once I get the other parts working, I'll do the external switches/sensors.

I bought a smaller 5HP motor to play with and I'm now working on the accelerator/brake/regen concept. I want to accelerate only and not decelerate with the accelerator :) I will only decelerate - and regen in the process - with the brake pedal. I tried to get the VFD to do this but it looks like I'm going to end up with external logic to handle it using start, stop with coasting, accel/decel functions.

What language and target hardware do you code for? I'm doing mostly basic and assembler on Atmel chips with some dabbling on C. I believe the Tumanako open source project is C exclusively and might be a good reference - or you can lend a hand in their effort.

JR
Looks like Semikron's SKAI is the answer :) Still quite pricy but therefor garanteed to work. I didn't see much progress at the Tumanako project but they did make a good selection of components.
What language and target hardware do you code for? I'm doing mostly basic and assembler on Atmel chips with some dabbling on C. I believe the Tumanako open source project is C exclusively and might be a good reference - or you can lend a hand in their effort
Sorry JRoque, totally missed that question. I only code in C so far. As mentioned I'm still using a PC for sine wave generation. Thus I wrote a C program on top of a linux kernel with the Xenomai real time patch.
I don't need to use lookup tables since the PC can probably calculate 1000 sine waves during one PWM period.

Now I am indeed planning to join the Tumanako project. Their code is written in C/C++ and runs on an STM32 µC.

Yesterday I wanted to employ my redesigned IGBT contact board but it was mirrored :( So now I built a mechanical prototype that looks like that:


Of course the controller board is missing here because it simply non-existent ;)

/Johannes
See less See more
Hey Johannes,

Now I am indeed planning to join the Tumanako project.
Yes I saw your introduction to the team, that's excellent news. To be honest I kinda felt they were cutting themselves short by using a prebuilt external IGBT pack, but I'm warning up to the idea now. I also didn't like the $595 price tag they put on the board the team is developing. That number seems high - and suspiciously Marketing-driven - for an open source project. I've participated in more than one "open source" project where after it was developed, the principals decide it's a good commercial product and split further development to their own branch leaving the open source lagging behind. Hopefully this is not the case here since some of us can really use it for our DIY projects.

Yesterday I wanted to employ my redesigned IGBT contact board but it was mirrored
You mean you didn't mirror the layer before routing it? If so, you have company on that corner. I must have done that so many times in my prototypes I lost count. Now I keep a steps list before I cut my proto boards and one of the steps is "mirror used bottom layers" :)

Do you route your own boards or is that chemically etched?

JR
See less See more
Yes I saw your introduction to the team, that's excellent news. To be honest I kinda felt they were cutting themselves short by using a prebuilt external IGBT pack, but I'm warning up to the idea now. I also didn't like the $595 price tag they put on the board the team is developing. That number seems high - and suspiciously Marketing-driven - for an open source project. I've participated in more than one "open source" project where after it was developed, the principals decide it's a good commercial product and split further development to their own branch leaving the open source lagging behind. Hopefully this is not the case here since some of us can really use it for our DIY projects.
I'm not planning to buy any custom-built hardware for now. I picked up some board with an STM32 from work. Concerning the power stage I'll just use what I've got so far. I designed it with a lot of help from Semikron themselves so I think the chances are good for it to actually work.


You mean you didn't mirror the layer before routing it? If so, you have company on that corner. I must have done that so many times in my prototypes I lost count. Now I keep a steps list before I cut my proto boards and one of the steps is "mirror used bottom layers" :)
Yeah kinda like that ;) Top and bottom line up perfectly but when putting it on top of the module it is "right side left".

Do you route your own boards or is that chemically etched?
Erm what? It's both ;) I did the layout with a program called FreePCB, printed it on a photo-sensitive board and etched everything away that wasn't black.

/Johannes
Progress is slow but visible:



I've mounted IGBT and drivers to a large heatsink and am now driving it with an STM32 with the help of the Tumanako project. I've implemented a very simple sine wave generator which I submitted to Tumanako.

It also looks like I'm close to cracking the current sensor issue with the help of the DRV401 IC. Tumanako has already implemented the field oriented control methods and is waiting for a suitable driver model to run it on.

I'm pretty optimistic that we'll have a working inverter soon, though not road legal...

/Johannes
See less See more
I'm a little worried about the board to IGBT connection not being physically stout enough, especially when you have more than 40A or so going through them. Probly won't happen with no load on the motor, but when you really put this to the test I think that will be the weak link.
Also 8 bit ought to be enough, it doesn't need to be silky smooth looking. :D
Hi. Are you referring to the IGBT driver board? I'm not sure where you say there will be 40 amps. The driver board won't put out that much and the IGBT will likely switch 400 A. Typo maybe?

JR
Hi!

Heres a better picture:



The high current connections are made through the slugs that are screwed onto the board. The small wires are just used for driving the IGBT gates. Do you still think this connection could be overloaded? Oh BTW: theres just a 90A IGBT module beneath, so its not really high performance yet unless run at 800V or so ;)

/Johannes
See less See more
Sorry I misunderstood what I was looking at, for some reason I thought you were intending to pump serious current through that control board!
Awesome job, Johannes!!! You are the man. I can't wait to see you driving down the road with that sucker!
Thanks Paul :)



This weekend i learned my lesson about EMI. All the power cables were rather thin and I lacked an intermediate circuit capacity. As a result I was unable to read the motor shaft encoder because the MCU would count tons of spikes caused by the PWM. Voltage spikes on the DC bus would reach +-100V (at bus voltage of 80V and the motor idling)
As you can see, there are thicker cables now and a large capacitor. The voltage spikes have dropped to around +-5V and I can cleanly read the encoder. Well, sort of. I have to use the STM32s digital filter to get a clean count.
So, next I can implement a simple slip controller with the simple equation slip ~ torque (thats what it says in my text book)

/Johannes
See less See more
1 - 20 of 2284 Posts
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