# Another DIY DC controller mock



## valerun (Nov 12, 2010)

remaining pics:
2: Rg voltage drop of ~20V max (hence the 4A max gate current)
3: +/-15V supply rail in AC scope mode
4. Emitter (top) and Collector (bottom) at turn-off
5. Same for both turn-on and -off

EDIT: added the datasheet of the IGBT I am using.


----------



## valerun (Nov 12, 2010)

more fun today:
1. swapped 5 Ohm Rg into 20Ohm
2. lowered switching frequency to 5 kHz
3. still 30V pack

took the thing to 600A output, which is 50% of the combined continuous rating for the 2+2 devices I am using. Spiking across the switch is now limited to just +70V. This is linear to the current so I expect ~100V at 1000A. Of course, switching transition is a bit long now - especially on turn ON - to the tune of ~5us. 

So I'm thinking to use a 5 Ohm as a turn-on Rg and 20 Ohm as a turn-off Rg. Also want to hook up a shunt to measure current waveform so I can calculate the losses. 

Also probably will have to take the switching frequency down a bit more. The only thing is: got to watch out the caps. Have 17000uF on the bus now which should be good for 1000A output at 300V pack voltage at 5kHz. 

Some pics attached.

V


----------



## jackbauer (Jan 12, 2008)

Nice work val. From what I can see you are getting stuck on the miller plateau on turn on. That HCPL3120 driver does not have near enough kick for the application. Consider a 9amp driver sucj as the mic4421 or better still a VLA501 module. 

If you drive the switch too fast the freewheel diode will not recover properly before the next cycle. I had this problem when I first ran my igbt controler at 16khz. Dropping to 8khz cured this problem. Consider snubber caps. At least 2 or 3 on the dc link and one across the switch. Next be aware of the ton and toff of the device and the freewheel. A lot of older modules have terrible values.


I have a few threads on here from late '09 dealing with these exact issues. Also got some videos on the subject. Hope that helps.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Nice work val. From what I can see you are getting stuck on the miller plateau on turn on. That HCPL3120 driver does not have near enough kick for the application. Consider a 9amp driver sucj as the mic4421 or better still a VLA501 module.
> 
> If you drive the switch too fast the freewheel diode will not recover properly before the next cycle. I had this problem when I first ran my igbt controler at 16khz. Dropping to 8khz cured this problem. Consider snubber caps. At least 2 or 3 on the dc link and one across the switch. Next be aware of the ton and toff of the device and the freewheel. A lot of older modules have terrible values.
> 
> ...


Thanks Damien!

I am using a 3120 only for isolation - it then drives the bigger 8A drivers - one per IGBT. My problem is I can't unleash their full power - even with Rg of 5Ohm (and peak gate current of 4A) the IGBTs switch off too fast (and, as you very correctly noted, exceed the recovery speed of the freewheeling diode). So I needed to slow down the turn-off and it helped a ton for toff spike. But now my t-on is muddling through the miller plateau for too long as you correctly noted. So I am thinking of doing a 5 Ohm Rg for turn-on to keep the speed but 20 Ohm for turn off.

I have read most of your threads and your posts on ecomodder - they've been a great help! Not fully up to speed on the videos, though ;-)

BTW, what is the value of the snubber cap you are using across the switch? All the snubber design docs I have read talk about RCD snubbers for high power applications... Also, how did you connect the caps across the DC link given that + and - connections to IGBT and freewheeling diode much be ~10cm apart (I think you are also using single IGBT modules, right?)

Thanks!!
V


----------



## jackbauer (Jan 12, 2008)

Right now the controller i have in the car is running a pair of Fuji 800amp single igbts. One as the switch the other with its g-e shorted as the freewheel diode. They are joined with a piece of 20x10mm copper bar. Thats a bad idea in theory as the link can ring like a bell and i go shooting down the road trailing flames like a dragster with a blown engine. In practice its worked fine. Remember that app notes are based on ideal conditions with unlimited resources and infinte development times. They are a guide at best. 

I used a piece of standard copper clad pcb board , roughly routed on the drill press to cary the link caps. Kind of a poor man's laminated busbar. I used a 1uf RC snubber across the switch as i was seeing some alarming ringing on turn on if i remember rightly. My advice would be to use 2 resistors and a schottky diode to shape the turn on and turn off. You really need a hard turn on to punch through the miller knee.

What is the ton and toff of the devices your using? Are you using emitter resistors?


----------



## valerun (Nov 12, 2010)

jackbauer said:


> I used a 1uf RC snubber across the switch as i was seeing some alarming ringing on turn on if i remember rightly. My advice would be to use 2 resistors and a schottky diode to shape the turn on and turn off. You really need a hard turn on to punch through the miller knee.


yes, will try that tonight. For the RC snubber, what did you use as R? And how you heatsinked that? From my calculations, at 200V and 8kHz, you would have to dissipate C*U^2*f=10^-6 * 4*10^4 * 8*10^3 = 320W on a resistor -0). I can't find anything close to that in a non-inductive package...



jackbauer said:


> What is the ton and toff of the devices your using? Are you using emitter resistors?


ton: 700 ns
toff: 350 ns
I figured if I want to keep switching time to <1% of the cycle, this would mean <10kHz frequency. Now, since I can't really use that blazing toff speed anyway, I have to reduce the frequency to keep the dissipation under control. I hope I can use 5 kHz. 

EDIT: oh, yes, I am using emitter resistors.

V


----------



## valerun (Nov 12, 2010)

added a 5 Ohm turn-on resistor parallel with the 20Ohm I already have. Turn on now takes 700-800ns as it should. no additional ringing so I am happy. 

took it to 800A today. a bit scary. 

turn-off spike is ~80V at 800A. It was fun to put one end of the scope on one end of the DC+ bar and slide the second end along the bar - the further apart I took it, the more voltage spike I saw ;-) ~30V along the 5" of a bar. Power electronics is fun ;-)

Measured voltage spikes across DC link and across freewheel diode separately to understand what drives voltage stress. DC link spike only ~1/4-1/3 of the overall C-E spike on the switch so not really a problem. So if I want to reduce the spike, I have to deal with the diode part. How's this for an idea: using a smaller u-fast diode (say, 60A 1200V part) in parallel with the big one? It will turn back on much faster and will conduct for the first 200ns while the large diode ramps up. Yes, the initial current will be close to the IGBT current (say, 500A if I push 1000A through the controller) but this will go on for just 200ns and the remaining 200 micro-seconds it will be chilling. So I would definitely not exceed the power dissipation ratings. Is this a crazy idea?

EDIT: also, any ideas how to confirm whether my IGBTs share the current evenly or not?

V


----------



## valerun (Nov 12, 2010)

ok tried the parallel diodes. Largely good news - the turn-off [C-E on the switch] spiking goes down to ~40V at 800A output (from ~80V). 

However, there is now some new small (~20V) spiking and ringing on turn-on. I guess the reverse recovery is too fast / snappy and sets off the ringing... Just can't bloody have it all, huh? ;-)

Also, there is quite a bit of power dissipated on the smaller diodes. Looks like they share some good part of the freewheeling current. Just looked up the forward voltage vs. current dependency: at 600A, the large diode drops ~2.5V. At the same 2.5V drop, the small diode would have to conduct ...250A. So looks like up to 1/3 of the total current can be going through the poor little diode. Not good. Perhaps something like 0.02-0.03 Ohm resistor in series with the smaller diode would cure it. Initial spike of 500A would result in 10-15V drop on a resistor, which would add to a voltage spike on a switch. But then during steady state, every 10A through small diode would generate 0.2-0.3V - enough to force on the current to go through the large diode... Although it's becoming to look a bit complex now ;-) Maybe I should just give up and use a snubber...


----------



## aeroscott (Jan 5, 2008)

great work , teacher !


----------



## jackbauer (Jan 12, 2008)

I'm nearly sure this is the snubber i used:
http://radionics.rs-online.com/web/p/rc-network/4419464/

Right now i'm looking into a 1ka controller myself. I have just completed building Paul's 1000amp control board and melexis current sensor. I'm planning 4 fuji 1200v 800amp igbts in the power stage. 2 as switch , 2 as diode with laminated busbar made from stacked 2 layer copper clad pcb board.

Igbts:
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=250830327377&ssPageName=STRK:MEWAX:IT

I know these are rather old parts but i have had two of them running in the car for past year and a half no problems. Even with less than ideal gate drive of only 12v and ground. Just please don't buy em all on me


----------



## DJBecker (Nov 3, 2010)

We initially picked a diode type (SBR60A200CT) based on availability and power, rather than a careful consideration of the specs. They turned out to be too slow-yet-snappy for our switching speeds. With higher current (and thus high di/dT and dV/dT) but still well within their current rating, they would fail shorted. This would take out the MOSFET power section.

Background: "snappy" diodes are merely-fast diodes that turn off suddenly. This is fine when rectifying a 60Hz sine wave, where the current drops off before the voltage reverses. But with a 15KHz square wave, parts of the diode turn off at different times leaving final still-on areas with very high current density. For our use we need 'ultra-fast' diodes with 'soft' turn off.

The solution was both faster diodes and a slower MOSFET turn-off time.

With the higher value gate resistors to slow the switching time, we had more options for the gate drivers. We are very happy with our switch from an optoisolator to the Silicon Labs Si8233 gate driver. Even if we go back to using a MIC4452 gate driver on a bigger power stage, we'll use the Si82xx parts as an isolator.

The big drawback of those parts for people here is that they are only available in SMD packages. You are are already building with SMD, so that's not a problem for you.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> I'm nearly sure this is the snubber i used:
> http://radionics.rs-online.com/web/p/rc-network/4419464/
> 
> Right now i'm looking into a 1ka controller myself. I have just completed building Paul's 1000amp control board and melexis current sensor. I'm planning 4 fuji 1200v 800amp igbts in the power stage. 2 as switch , 2 as diode with laminated busbar made from stacked 2 layer copper clad pcb board.


got the http://cgi.ebay.com/Aerovox-IGBT-Sn...ltDomain_0&hash=item2c5c345ffb#ht_1185wt_1139
for snubber.

those 800A parts do look cool. 

so you connected the cap across the switch so it discharges through the IGBT every cycle?


----------



## jackbauer (Jan 12, 2008)

Yep. Seems a little counter intuitive at first but it helped greatly.


----------



## aeroscott (Jan 5, 2008)

Jack whats the difference between 2 and 3 post igbt's ?


----------



## jackbauer (Jan 12, 2008)

You mean 2 and 3 terminal? 2 terminal devices typically have one transistor in the package. 3 terminals have 2 with the top transistor's emitter connected to the bottom's collector.


----------



## valerun (Nov 12, 2010)

that's right. and ideally, you want to use 3-terminal parts. That way you get your freewheel diode as close as possible to the switch and minimize the inductance between the two. Unfortunately, high-current dual modules are hard to come by at reasonable prices...


----------



## aeroscott (Jan 5, 2008)

The ones I have all have 3 and I forgot . I have a small diesel welder , when replacing a diode (pigtail/bolt type) I was looking over the good ones and saw that they are built conducting up or down , I put the wrong one in but didn't want to start it until I traced out the path . got it now but how dense ! thanks Jack .


----------



## valerun (Nov 12, 2010)

doubled the voltage to 60V pack. Took to 900A. Spikes at ~50V on top of 60V rail - actually smaller than with 30V pack. Perhaps due to C*U^2 - at higher pack voltage, it takes smaller delta U to absorb the same energy?

I do think my transistors don't share the current evenly - heatsink heats up a bit non-uniformly. Any ideas how to test? I can't really insert a shunt at a single IGBT...


----------



## jackbauer (Jan 12, 2008)

Can you measure Vce sat? Might give you an indication of which one is taking the bulk of the current.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Can you measure Vce sat? Might give you an indication of which one is taking the bulk of the current.


can try. need to read up on that ;-)

Also, after reading through the SEMIKRON doc you posted on the other forum (attached), I realized that my incoming DC connections might not be routed right. Here's what I have:



```
DC "-", Motor "-"  ========================

                   ========================  DC "+"
                    Q1     D1     Q2     D2 
                   ========================  Motor "+" (or "AC")
```
So that might be the reason for uneven sharing - when IGBTs (Q1 and Q2) are on, conduction path is from DC "+" through Q1 & Q2 to Motor "+", then through motor, then to Motor "-"/DC "-". Therefore "ON" path is skewed towards Q2 (which is exactly the side that heats more). When IGBTs are off, conduction path is from DC "-" through D1 & D2 to Motor "+", then through the motor back to DC "-"/Motor "-". Therefore "OFF" path is symmetrical. 

So I gather that I need to move DC+ cable to the left side.

Am I on the right track?

V


----------



## valerun (Nov 12, 2010)

110V pack, 900A output (~12kW). Turn-off spikes at ~200V on C-E (attached is a 600A plot showing ~140V overshoot). So total voltage stress of 310V. Seems to be linear with the output current and not very dependent on the pack voltage. Not sure I need to worry about the spikes anymore given that my parts are all 1200V... 

Anyway, 2uF snubbers are on order. Will at least use on DC rails - that should shave off ~1/3 of the spike voltage. A bit concerned about using them across the switch, though - 2uF discharged through the switch 5000 times a second is ~500W extra dissipation per IGBT at a hypothetical 300V pack voltage that I might try on this thing at some point (;-)...

Connected current sensor and control board (adopted from the charger). Can see the current / temp / voltage / etc on the screen now. Kind of nice. Unfortunately, will have to give up the screen as every refresh eats up 200-300ms which was fine for the charger but is a deal-breaker in a controller that needs to respond to throttle change in <50ms or so... 

Checked thermal balance after rerouting the DC link - seems to be better but not quite equivalent (one side ~5 deg C cooler than the other...). Perhaps that's ok and I just should stop stressing out about that. With 3 92mm PC fans and 7lbs finned heatsink, 250Amps continuous keeps heatsink temp under 55 degrees. As is 600Amps for 30-60 sec. Not bad but expect losses to double-triple when going to higher pack voltage. The last card in the sleeve is automatic PWM frequency reduction with current - at 100uH for something like 9" motor, anything above 400A at 5kHz gives < 40% current ripple. Hence could go down to 2.5kHz for high/low duty cycle and / or high output current. The downside, of course, is the whining becoming more and more noticeable with lowering frequency...

V


----------



## jackbauer (Jan 12, 2008)

Interesting. Always thought i was solving a problem with the snubber across the switch ....... might just remove it to the dc bus and see what happens.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Interesting. Always thought i was solving a problem with the snubber across the switch ....... might just remove it to the dc bus and see what happens.


cap across the switch does help but the loss is going to be ~U^2 so if your pack is 100-150V, you will have 4-9 times lower dissipation than at 300V. 50-100W per one of these devices is not a problem at all. I'm just a bit worried about 500W ;-) 

However, by adding a cap across the switch, I think you are reducing turn-off losses within IGBT as you are slowing down the voltage ramp across the switch and the current has a chance to die down before a significant voltage develops across the switch. As the turn-off loss is the integral of voltage across the switch times current through the switch during the transition period, this reduces the torn-off loss. 

So there might be some optimal value of the cap across the switch when you actually reduce total losses... Haven't seen any literature on this, though - everyone is talking either about RC or RCD snubbers...

V


----------



## jackbauer (Jan 12, 2008)

Yeh it hard to find any real info on the subject. I did look back over my videos and the cap on the switch made a big difference. I may change the value a little.

Damn you Val for starting this thread now i have to go build another one of these things


----------



## JRoque (Mar 9, 2010)

Hi.


valerun said:


> Haven't seen any literature on this, though - everyone is talking either about RC or RCD snubbers...
> 
> V


RCD snubbers are critical in this type of application. Here's some reference, if you don't already have it: http://www.daycounter.com/Calculators/Snubbers/Snubber-Design-Calculator.phtml. 

Hopefully you'll switch from a mock to actual project once you've pieced more things together. Looks very interesting and educational.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hi.
> 
> 
> RCD snubbers are critical in this type of application. Here's some reference, if you don't already have it: http://www.daycounter.com/Calculators/Snubbers/Snubber-Design-Calculator.phtml.
> ...


Thanks JR. I remember seeing this page at some point early in design of my charger but I decided back then that for <100A currents I see in a charger these snubbers were too complex. Now, of course, it's a different story... Still, though - no mentioning of how a simple cap across the switch could work...

Anyway, the 'method 3' from your link peaks my attention as it is lossless. The lossy snubbers all dissipate something like 500W in my calculations (at 1000A 300V hypothetical scenario). I just need to think a bit about how to adopt the Method 3 design to a buck topology.

Re converting this mock to a project - it's already kind of a project but I just don't want to over-promise before going through all the testing.

Thanks for your encouragements!

V


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Yeh it hard to find any real info on the subject. I did look back over my videos and the cap on the switch made a big difference. I may change the value a little.
> 
> Damn you Val for starting this thread now i have to go build another one of these things


Oh, Damien - love the pics! Very nice. Liquid cooling is the way to go for high power and even load sharing...

V


----------



## JRoque (Mar 9, 2010)

Hello V,

This is probably redundant to your own research but here are some links on snubber design:

Videos: http://www.snubberdesign.com/snubber-videos.html
Paper: http://www.newark.com/pdfs/techarticles/cornell/design.pdf
Book: http://store.kagi.com/cgi-bin/store.cgi?storeID=6FFZT_LIVE&KagiAffiliate=SMPSTechnology

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> This is probably redundant to your own research but here are some links on snubber design:
> JR


Thank you JR! Not redundant - haven't seen these before. On my side, the best doc I found so far was http://focus.ti.com/lit/an/slup100/slup100.pdf.

So I decided to try the RCD snubber across the switch - in the clamp configuration (when RC >> switching period). The snubber dissipation is supposed to be much less than in the RC snubbers that recharge on every transition - the only loss in this snubber should be the energy stored in the stray inductances. In my non-ideal snubber design, I have put together a 1200V 60A u-fast diode, 4.7uF metal film cap, and a 5kOhm resistor (the latter could really be much reduced but that was the only >200Ohm resistor I had in a non-inductive package). Below is the screenshot of C-E voltage on turn-off at 800A (110V DC rail). Pretty ugly. My guess is that the snubber diode has too slow forward recovery (indeed, datasheet says 700ns!) and so it doesn't even turn on for the most of the initial spike. Then, when it does turn on, it sets off the ringing. Somewhere around the same time, main diode turns on, as well. The result is a bit of a jagged mess. Not really sure about the origin of the super-high frequency ringing you see on the pick (~30MHz). Perhaps self-resonance of the snubber? Anyway, clearly not the optimal design solution ;-) 

I think the key to making it work is very fast forward recovery diode. In fact, JR, in the paper you forwarded, Rudy says that this indeed may be a problem so I suspect it even more now. What do you guys think of using a Silicone Carbide Shottky diode for a snubber? For example, http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=C2D05120A-ND?

V

PS. Also had a curious inadvertent experiment - while putting things back together after installing the snubber, forgot to plug in the second IGBT driver. Then, after running a few 700A ramps, noticed it! Learnings:
1. There is quite a bit of reserve in a 2-IGBT, 2-diode design - if I can run 700A for 20 sec on just 1 IGBT...
2. It's good to have driver boards bolted to the IGBT. No matter what happens to your upstream circuitry, IGBT won't turn on.


----------



## major (Apr 4, 2008)

valerun said:


> .... I have put together a 1200V 60A u-fast diode, 4.7uF metal film cap, and a 5kOhm resistor (the latter could really be much reduced but that was the only >200Ohm resistor I had in a non-inductive package).


Hi Val,

I haven't been following all this too closely, but thought I'd stick my nose in 

I used to work on 3 phase drives of similar V & I. The RCD snubber clamps were on each half phase. Resistor values were like 5 to 10Ω. Big ones, like 90W each, 6 total. These were pre laminated bus days and operating at around 5 kHz. 

And those electrolytics look familiar 

Regards,

major


----------



## valerun (Nov 12, 2010)

major said:


> Hi Val,
> 
> I haven't been following all this too closely, but thought I'd stick my nose in
> 
> ...


Thanks Jeff! See, those caps *are* being put to good use! ;-)) Thx!

V


----------



## valerun (Nov 12, 2010)

ok another small update. 

After reading that those resistors in an RCD snubber don't really have to be non-inductive, I wired in my 25W wirewound 250 Ohm resistor to the snubber I described above. Resulting C-E voltage waveform attached (110V rail, 900A output). Looks quite a bit better but forward turn-on is still slow (I think that's what you see at T+800ns or so - T being the time when voltage crosses zero on the way up). Still, overshoot is ~130V instead of ?200V.

Also, getting a bit cocky, turned up the output to 1200A (!) and in ~5 sec, ...blew the 100A fuse on the battery side... no damage to controller. Those semiconductor fuses go so quietly, too. Need some more powerful fuses now LOL ;-)

Ordered some 1200V 100A (peak) and 600V 250A (peak) silicon carbide shottky diodes... too bad can't get them from radioshack ;-) ..just $5-8 from digikey.

V


----------



## DawidvC (Feb 14, 2010)

Val - here are some info from Semikron on recommended snubber networks. We use networks 1 and 4 on the big AC drive at work.

View attachment Snubber.pdf


Regards
Dawid


----------



## JRoque (Mar 9, 2010)

Hello V,

Good progress. Once you get this down, I'd go for the 'energy recovery' model adding a cap between two diodes so rather than dissipating the glitch on a resistor, you feed it back to the bus. Note Rudy's comment on smoothing that a bit so you don't create noise on your bus. But that's likely for another day, I imagine.

BTW, though equally brilliant, that was Major, not Jeff.

JR


----------



## valerun (Nov 12, 2010)

DawidvC said:


> Val - here are some info from Semikron on recommended snubber networks. We use networks 1 and 4 on the big AC drive at work.
> 
> View attachment 10336
> 
> ...


Thanks Dawid!

Question: are the resistors connected to the right place on fig (d)? Usually, I see the resistor from the top snubber connected between top diode and cap on one end and to negative DC rail on the other end. The resistor from the bottom snubber is then connected to positive DC rail on one end and between bottom diode and cap on the other end.

JR - Can you say more on the cap between 2 diodes for non-dissipative version? How do you connect it?

V


----------



## JRoque (Mar 9, 2010)

Hello V,

On this link: http://homepages.eee.strath.ac.uk/~bwwilliams/Book/Chapter 9old.pdf figure 9.13 shows the circuit. 

I was looking for a simplified version but came across the one above instead. Since it brought up several of my own questions (ie: how is regen in a 3-ph system going to behave with all the diodes, caps and inductors in there), I contacted Rudy for help and was quickly told (I mean, he replied within 9 mins), that he had retired of power electronics and he doesn't do that anymore  He's done that for over 50 years so I completely understand how he wants out of it.

But there seem to be other resources if you search for combined (or combination) snubbers in energy recovery configuration. Combined in this case is a snubber for both turn on and turn off switching and as you can imagine, it does affect your turn on/off speed, ringing potential and noise.

JR


----------



## valerun (Nov 12, 2010)

Thanks JR!

Got the book, too. Too bad he doesn't sell it on Amazon...

Anyway, since I started blowing the fuses above ~900A output current, I decided to connect the thing to my Fiat pack (256V nominal, 265V most of the time). So now it's not a toy anymore! Still protected using 100A battery-side fuse which should allow me to go to ~30-40kW output power. I think that's ok for now ;-)

Resulting 800A, 260VDC input rail waveform is attached. Almost same as before. If anything, overshoot is ~110V instead of 140V I've seen with a 110VDC input. No spikes to speak of at turn-on.

Also, added control board with current sensor (blue thingy on the bus in the attached photo of my somewhat Frankenstein-ean setup ;-). First draft of the code is ready to go - maybe will do it later today.

One curious thing: after ~900A, I hear some lower-frequency noise added to the usual 5kHz whine. At the same time, I can feel same-frequency vibration through the output cables. Wondering what that might be... Maybe copper bus vibrating from magnetic force? (btw, just plugged in some numbers into http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/wirfor.html to come up with ~0.5lb of magnetic force between the DC'-' and output buses at 1000A... Fun stuff). Any other ideas?

So next step is to wait until SiC diodes show up and try them in the snubber circuit. 

Although, since even at almost 300VDC input, the total voltage stress is below 400V on the switch, I am tempted to actually clean it up and try in a car ;-0! Will see.


----------



## jackbauer (Jan 12, 2008)

What are you using for a load Val? Is that a laminated busbar i'm seeing there?


----------



## valerun (Nov 12, 2010)

jackbauer said:


> What are you using for a load Val? Is that a laminated busbar i'm seeing there?


Load is a 130mm toroid with ~80 turns of 8 strands of 14 gauge (so ~6-7 gauge equivalent). Nominal inductance of ~0.9mH, going down to ~0.3mH at 100A due to saturation. I think it's probably ~100uH at 500A or so - and therefore similar to a Warp9/11 motors. It has a sophisticated liquid cooling system - a bucket of cold water ;-))

And yes, I am using a laminated DC bus - two 48oz copper plates spaced by a 1/4" poly-carbonate sheet. The plates are connected to IGBTs/diodes via 1/8"-thick, 1" wide, ~2-3" long copper buses. These 2-3" buses contribute to ~30V in turn-off spike at 800A. Damn, this high-current stuff is hard ;-) Anyway, when the aerovox snubbers show up and I add them directly to the IGBT terminal, things will be even better.


----------



## valerun (Nov 12, 2010)

just read through the Fuji IGBT modules app manual. Good stuff (3.3MB so can't post here - let me know if you want it and I will email).

One thing that was most useful for me is a detailed explanation of the potential reasons for non-uniform current sharing. Among other more obvious things, there were 3 things that were not super-obvious to me prior to reading the manual:
1. Symmetry of emitter-side wiring is way more important than collector side.
2. Unequal paths from IGBT emitters / FWD cathodes will create unequal path resistances, which, even at fractions of mOhm, will create substantial (on the order of tenths of a volt) Vce differences at 1000A - which can correspond to 100s of A of current imbalance.
3. Even more important than resistance, different paths create differente path inductance, which, at 2000A/uS, drives huge voltage differentials and can suppress sharing for quite a few microseconds...

So I am going to rewire my output into something that really looks like the attached. More copper will be sacrificed! ;-)

V


----------



## valerun (Nov 12, 2010)

valerun said:


> So I am going to rewire my output into something that really looks like the attached. More copper will be sacrificed! ;-)


ok, done. see pics attached. I *think* the current sharing is much more even now - I can't tell the temp difference between 2 sides of the heatsink. Will call it even for now.

Some waveforms attached. 260VDC input. In order of appearance:
1. C-E
2. G-E (aux emitter) at 300A
3. G-E (aux emitter) at 1000A

As you can see, I probably have some finer issues there ("finer" because they unlikely to result in device failures; "issues" still because they likely drive losses up):
1. At very low duty (300A is ~4-6us on-time or duty of 2-3%), gate voltage barely ramps to 10V. As a result, IGBT is likely only partially turned on all this time. It's not too bad as I can't really see the difference between C voltage and DC rail on a 50V/div when it's on so probably below 5-10V on-state but still - 10V gate voltage is far from optimal
2. Even at higher duty (1000A is ~20us on-time or duty of 10%), the two plateaus are clearly visible: 3us at 8V on turn on and 2us 7V on turn off. The former is a bit surprising as I have a 5Ohm Rg_on... The latter is a bit expected as I have a whopping 20Ohm Rg_off. Clearly, ramping up DC input voltage makes a difference (more energy to pump into / remove from C-G capacitance). Still, a bit puzzled about the turn-on plateau, given just 5Ohm Rg... EDIT: just looked up the specs for the diode I am using in series with 5Ohm (to only apply 5Ohm on turn-on) - turns out to be a merely ufast diode (not shottky), with 1.5V forward drop at 4A drive current. Will swap for shottky with 0.5V drop tomorrow - could that be part of it?

Maybe I should use +20V drive instead of +15V I am using now?

Also, hope that I can use smaller Rg once the snubber thing is optimized.

V


----------



## jackbauer (Jan 12, 2008)

I'm no expert but the turn off tail seems quite long. That coupled with the large miller plateaus would seem to indicate problems with gate resistors. I'm currently running 5R on and 2R5 off with 12v drive in the car. The miller effect is still there but not as bad. Granted its only a 500amp version. The schottky will help. I had this problem originally running a uf4007 ultra fast.

I guess the gate resistors are large to slow the turn off to allow the fwd to recover?


----------



## jackbauer (Jan 12, 2008)

Little bit of info here from an old post of mine:
http://www.diyelectriccar.com/forums/showthread.php/snubbers-37937.html


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Little bit of info here from an old post of mine:
> http://www.diyelectriccar.com/forums/showthread.php/snubbers-37937.html


Thanks! When you say
>> Fitted the 1.5uf snubber today. At 8khz the spike has been dramatically reduced with just a little ringing present. at 16khz its ring city so it looks like 8khz it is!

- you mean across C-E, right?

V


----------



## valerun (Nov 12, 2010)

jackbauer said:


> I guess the gate resistors are large to slow the turn off to allow the fwd to recover?


yes. Hope that after I fit in the snubbers, I will be able to use smaller gate resistors (maybe 3-5 Ohm for both on and off)

Reading Rudy's book on snubber design now - it's awesome. 400 pages ON JUST SNUBBERS! ;-) Totally geeking out ;-) Anyway, some of the energy recovery snubbers are just too cool. My favorite (from performance vs. complexity trade-off standpoint) is the one attached. Perhaps I will try it this week after optimizing a lossy turn-off snubber.

V


----------



## jackbauer (Jan 12, 2008)

Nope! Across the switch. By the way great idea using an inductor as a load. I've setup my liquid cooled controller on the bench now for some tests and my old friend the turn off spike is back! Drop a 1uf snubber across the switch and it drops dramatically but rings a little more. I think this is what i saw back in '09.

Edit : pic attached. 12v bus. 500uH load at 100Amps. Looks like i need to slow the turn off. That damn VLA driver is too powerfull


----------



## valerun (Nov 12, 2010)

jackbauer said:


> my old friend the turn off spike is back! ...
> 
> Edit : pic attached. 12v bus. 500uH load at 100Amps. Looks like i need to slow the turn off. That damn VLA driver is too powerfull


Damn those inductive loads! ;-) Those energy recovery snubbers are way cool, though. I'm a bit worried about the component count in combination with requirement for low-inductance design, though. I think this means another custom PCB...


----------



## valerun (Nov 12, 2010)

Guys - what are you using for current sensing? I have fitted a HASS 600A sensor (supposed to be good up to 1200A) but they are $27 apiece and I need at least one more for battery current monitoring...

Any luck with just hall magnetic sensors? How do you calibrate those?


----------



## jackbauer (Jan 12, 2008)

I've just started using a melexis 91205 hall sensor. Good to 2ka i believe. Paul Holmes designed a pcb for use with 20mm x 10mm copper busbar. Seems to work well so far.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> I've just started using a melexis 91205 hall sensor. Good to 2ka i believe. Paul Holmes designed a pcb for use with 20mm x 10mm copper busbar. Seems to work well so far.


Thanks! That's a neat part. Are you using LB or HB part (low-field or high-field)?

$11 from digikey ($8 in 10+ quantity). Now need to decide if extra $14 worth the trouble with custom PCBs... ;-)


----------



## Salty9 (Jul 13, 2009)

valerun said:


> Guys - what are you using for current sensing? I have fitted a HASS 600A sensor (supposed to be good up to 1200A) but they are $27 apiece and I need at least one more for battery current monitoring...
> 
> Any luck with just hall magnetic sensors? How do you calibrate those?


Check post #7 in this thread: http://www.rcgroups.com/forums/showthread.php?t=307133

Good read, Kind of humorous in places.


----------



## DJBecker (Nov 3, 2010)

We are currently using an Allegro A1302 ratiometric hall effect sensor inserted into a Dremel cut toroid.

This has worked wonderfully at lower power levels during testing, producing clean edges when used with mostly resistive loads (e.g. headlamps at 12V). The output signal is low impedance, and the pulse-centered A/D conversion is stable. The almost-closed loop ensures that any external magnetic fields have almost no effect. Compared against our resistive shunt hooked up to a voltmeter, it appears to have a linear response.

There are some down-sides.

Toroids are round. Great for cables, mounted before you terminate them. Not so good for rectangular bus bars.

Magnetic toroids can be frustrating to cut. Some seem to be highly pre-stressed, probably to reduce transduced acoustic noise. (Most people don't think about the mechanical stresses on a coil. Imagine them as stalled motors trying to rip themselves apart. A toroid shape is used because it is mechanically stiff as well as magnetically efficient.) Often just at the end of the cut, the wheel will grab and break them. Or perhaps they are snapping shut, grabbing the wheel.

You rarely know the characteristics of surplus toroids. Are they pressed ferrite? Soft iron? Silicon iron? Silicon steel? We are starting to question the sensor on the car now. It worked fine on the bench, but it may be magnetically saturating with the continuous high current during uphill starts, then returning to normal a few seconds later.

An alternate approach is using one of the Melexis sensors. The popular is the '205 with HB sensitivity. We found that Future Electronics has the best prototype-quantity price.
MLX91205KDC-HB-TU $4.5000ea
MLX91205 Series 4.5 to 5.5 V Surface Mount IMC Current Sensor - SOIC-8

They are SOIC-8 surface mount parts, which are still big enough to hand solder. We mount them to prototype boards from MeasureExplorer 
ME-PB-SM50-8 SMT surface mount adapter prototype board $1.45
with a few decoupling capacitors. These boards have convenient mounting holes. Get the orientation right, insulate the bottom of the board, mount them so they can't change position (which rules out mounting on anything but rigid, flat bus bars).

This sensor has the drawback of being exposed to external magnetic fields. If you use it to monitor battery current at the controller input, it will also pick up some of the field of the motor current bus bar. It's likely the feedback control will compensate, but not certain.

Both of these sensors require 5V to operate, and produce a 2.5V signal with no field / zero current. We mount them so that positive motor current results in a lower voltage, so that their output range is 2.5V down to about 1V. That way we can use the output directly with a controller running at 3.3V or 3.0V.

Our next round of experiments will likely use new hall effect chips that can operate at 3V or 3.3V, using uA or only a few mA. That will get rid of the last 5V devices in the system. But all of them are in tiny packages and need external magnetic concentrators.


----------



## valerun (Nov 12, 2010)

DJBecker said:


> An alternate approach is using one of the Melexis sensors. The popular is the '205 with HB sensitivity. We found that Future Electronics has the best prototype-quantity price.
> MLX91205KDC-HB-TU $4.5000ea
> MLX91205 Series 4.5 to 5.5 V Surface Mount IMC Current Sensor - SOIC-8
> 
> They are SOIC-8 surface mount parts, which are still big enough to hand solder. We mount them to prototype boards from MeasureExplorer


DJ - thanks!! This is great - def going to get those proto boards. Too bad I have already ordered Melexis sensors from DigiKey ;-(

V


----------



## valerun (Nov 12, 2010)

snubber saga, part 23. ;-)

so I put together a lossless turn-off snubber - per attached. 4.7uF caps, 90uH inductor, 60A 1200V ufast diodes. Caps are a bit of overkill - calculations suggest 1uF for 1000A and 300V. But bigger is ok (per Rudy).

Good news is that it works beautifully. Well, almost, as there is some ringing present due to no damping in the snubber circuit. Rudy says putting a small resistor (0.01 - 0.05 Ohm for the types of currents we are talking about here) should dampen it without adding too much loss. 

The bad news is that it works beautifully ;-) It apparently does transfer all the snubbed energy into the load. Now turns out that's quite a bit of energy so on the first run one of my snubber diodes *unsoldered* itself from the circuit ;-0. And that's just at 100A. I think I might have fried that one... Apparently the RMS current is quite high through the snubber and I really need some serious heatsinking on diodes. I think I am going to mount them to the output busbar that's 3/8" thick copper - should be a good start. Maybe. Then there are these bloody cathodes linked to the backs so I need to use thermal tape again (hate it - busted too many devices due to thick tapes).

Anyway, will give it a go in the next few days.

Oh, and another bad news is EMI shoots up quite a bit with the inductive snubber - even using toroid inductor. My scope froze up a few times as I cranked up the current...

Part of me thinks just stick with a simple lossy RCD and mount Rs on auxiliary heatsink - after all, who cares if they get to 150 degrees C - that's what resistors are for. I will lose a few % points on efficiency but no sleep lost thinking about poor diodes not surviving tough energy recovery snubbing...

What do you guys think?

V


----------



## jackbauer (Jan 12, 2008)

My take as always is keep it simple. Less components the better.


----------



## DJBecker (Nov 3, 2010)

Salty9 said:


> Check post #7 in this thread: http://www.rcgroups.com/forums/showthread.php?t=307133


I suspect that these hall sensors are not a good choice for measuring current.

They may even be just raw hall effect squares, with no amplification, buffering or compensation. That's strongly suggested by their 1.5V supply voltage. Their use as position sensors doesn't require more. If the signal changes a bit with temperature, voltage or output load, it's no big deal.

Devices such as the A1302 have the hall effect device, temperature compensation, linearity compensation, and a low impedance output amplifier. The low impedance part is very important for getting the signal to the controller, and having an accurate, repeatable A/D conversion with a reasonable sample time.


----------



## jackbauer (Jan 12, 2008)

Some good news. Upped to 24v bus and larger load inductors. At 200amps the spike was +20v above the bus. Went for it and upped the gate resistors from 3r3 to 33r. Big improvement. Spike now only +3v above bus at 200amps with resultant miller knees. Time to start playing with resistors and schottkys.

i have a theory. The newer powerex cm400 modules i'm using here are much faster than the fujis i used in the car. So if they turn off faster than necessary it causes problems for this application rather than solves them. So if the switch goes off faster than than the diode can come on = problems. Need to find a balance ...


----------



## JRoque (Mar 9, 2010)

Hi.



valerun said:


> Part of me thinks just stick with a simple lossy RCD and mount Rs on auxiliary heatsink - after all, who cares if they get to 150 degrees C - that's what resistors are for. I will lose a few % points on efficiency but no sleep lost thinking about poor diodes not surviving tough energy recovery snubbing...
> 
> What do you guys think?
> 
> V


Let's hope the Society for the Prevention of Cruelty to Resistors don't ever read that. 

I got to about where you're at with snubbers and never tried the recovery ones that dump to the source instead of load so that might be interesting (ie: to see you go through that pain while I play snubber arm chair quarterback ) 

After spending too much time and (burnt) parts on fancy snubbers, I came to the scientific conclusion of: screw it, I'll take the loss. Rudy talks about a 5 to 20% efficiency improvements but I didn't see anywhere near that. Perhaps it was due to the unsteady (heat) load I was using. The consolation prize for the work pain is that your switches will be very well protected and that's always good.

JR


----------



## major (Apr 4, 2008)

valerun said:


> Part of me thinks just stick with a simple lossy RCD and mount Rs on auxiliary heatsink - after all, who cares if they get to 150 degrees C - that's what resistors are for. I will lose a few % points on efficiency but no sleep lost thinking about poor diodes not surviving tough energy recovery snubbing...
> 
> What do you guys think?
> 
> V


Or get it at the source. That is to improve your bus design. And use quarter bridge modules (IGBT & diode in same package). Ever get the chance to see the laminated bus from the GM EV1 PEB? They got by with cap snubbers. I'll see if I have a photo of it.

Of course that is 3 phase stuff. But I don't know why it wouldn't apply to half phase 

major


----------



## valerun (Nov 12, 2010)

major said:


> Or get it at the source. That is to improve your bus design. And use quarter bridge modules (IGBT & diode in same package). Ever get the chance to see the laminated bus from the GM EV1 PEB? They got by with cap snubbers. I'll see if I have a photo of it.
> 
> Of course that is 3 phase stuff. But I don't know why it wouldn't apply to half phase
> 
> major


Thanks major - at the source is def best. I feel though that my laminated DC bus design is pretty close to what can be done in 'small lab conditions'. I totally agree with the dual module approach but I can't source them at the price that makes sense. 

The main point of this project I think is to create a modular design that people can use at [nearly] arbitrary power levels. With open-source software that's not written in assembler or some-such, one can adjust the switching speeds and power cutoffs based on their parts availability and experimental results. So as most people will have access only to single modules from ebay, I feel that I should try to make do with the same. 

I *could* try to use smaller, 200A dual modules I can get for $20 apiece in bulk from ebay but then I'd need 10 of them to get past 1000A and they are only 600V and I would need 10 drivers or deal with all the stray inductances at the gates, etc. Not fun. 

If anyone has a good source for dual modules (or quarter bridge) of 400A+ power level at 1200V, I'd really appreciate a reference!

Thanks!
Valery.


----------



## valerun (Nov 12, 2010)

JRoque said:


> Let's hope the Society for the Prevention of Cruelty to Resistors don't ever read that.


;-)))



JRoque said:


> After spending too much time and (burnt) parts on fancy snubbers
> 
> 
> > any additional tips for me & jack based on your experience?
> ...


----------



## JRoque (Mar 9, 2010)

Hi.



JRoque said:


> After spending too much time and (burnt) parts on fancy snubbers





valerun said:


> any additional tips for me & jack based on your experience?


Yeah, I'm not sure taking advise from someone admitting to have shot a lot of parts playing around is a good idea  Actually, I toasted two nice IGBT modules and some resistors. Fortunately, the film caps were spared.

I agree, "lossy" snubbers protect your switches beyond what caps alone do and they do improve efficiency somewhat. 

One thing I came across is that when you're paralleling switches you also want to parallel their heat since that has a direct correlation to the switch impedance. I started out by putting some distance between the switches thinking I could dissipate heat easier that way. 

Other than that, the layout is critical, as you know. I had better success (with other projects) when I started treating the layout as I do RF designs. Look for current loops in traces, terminate signals that might need it, use star topology returns, keep logic and power grounds on different planes with a single connection between them and shoot for maximum layout symmetry.

I changed the snubbers so many times I don't even know which one worked best anymore. I'll see if I can find my notes on it.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Fortunately, the film caps were spared.


LOL



JRoque said:


> I changed the snubbers so many times I don't even know which one worked best anymore. I'll see if I can find my notes on it.


thanks!

In other news, just finished a PFC stage for my charger - if interested, check out http://www.diyelectriccar.com/forums/showthread.php?p=249779#post249779

V


----------



## jackbauer (Jan 12, 2008)

Here's a few pics from a run today at 500amps continuous. Limited only by some pesky melting cables on my inductor bank and why does water have to boil at 100C? Why not 200. Would make life easier .........

Val , what do you reckon about that gate and emitter resistor board? I just added the two 22R parts yesterday for a test but it seems to be fine. Would I be better with going to seperate 22r for each igbt?


----------



## DJBecker (Nov 3, 2010)

jackbauer said:


> Val , what do you reckon about that gate and emitter resistor board? I just added the two 22R parts yesterday for a test but it seems to be fine. Would I be better with going to seperate 22r for each igbt?


Isn't the usual configuration to have a separate resistor for each gate? That keeps them a little more balanced with slightly different threshold voltages.


----------



## jackbauer (Jan 12, 2008)

Well they still have the original 3r3 resistors on each gate (red parts on the stripboard). I added a 22r to the common point to limit the drive. I guess it would be better to rebuild the resistor board with seperate 22r parts for each gate.....


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Here's a few pics from a run today at 500amps continuous. Limited only by some pesky melting cables on my inductor bank and why does water have to boil at 100C? Why not 200. Would make life easier .........
> 
> Val , what do you reckon about that gate and emitter resistor board? I just added the two 22R parts yesterday for a test but it seems to be fine. Would I be better with going to seperate 22r for each igbt?


first off, these are some beautiful waveforms for 500A! No ringing, very mild overshoot, fast transitions. 

I'd say your transitions are definitely fast for 22R Rg... (or is it 11R with 2 22R in parallel?). I do think you need to have separate Rg per IGBT. And emitter resistors (I am using 0.3R - just because I didn't have 0.5R recommended as minimum by the SEMIKRON doc you posted at some point...). Emitter resistors won't change your waveforms much but will make load sharing much easier to achieve.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Well they still have the original 3r3 resistors on each gate (red parts on the stripboard). I added a 22r to the common point to limit the drive. I guess it would be better to rebuild the resistor board with seperate 22r parts for each gate.....


Ah, got it. Yes, you'd want separate ON and OFF resistors. Then I'd try going down in both Rg_off and Rg_on until you can't live with the overshoots / ringing that ensues. This way you will minimize your switching losses.


----------



## valerun (Nov 12, 2010)

small update: finally connected to my control board - with feedback control and all. Can use throttle pot to control the current - sweet!

But, looks like the slow duty++ charger algorithms just don't cut it for the controller where one would expect sub-50ms response. So today read up a bunch of stuff on the control algorithms. Have to implement proper PID loop controls for this thing. Any tips / suggestions - please let me know.

One thing I am a bit worried about is the 100 microsecond quoted ADC sample time for ATmega328 that's on my arduino board... That probably means I can run my pid loop at 4kHz at the most...

V


----------



## JRoque (Mar 9, 2010)

Hey V, what ADC resolution and system clock are you using? The M32 ADC can complete a conversion in as little as 13uS if set to run in continuous conversion mode.

Are you generating the PWM pulse in the loop or using the hardware PWM port? What analog signals are you looking to read? Are you taking RPM signal from the motor? If so, how many PPR? Sorry if I missed these in your prev posts. 

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hey V, what ADC resolution and system clock are you using? The M32 ADC can complete a conversion in as little as 13uS if set to run in continuous conversion mode.
> 
> Are you generating the PWM pulse in the loop or using the hardware PWM port? What analog signals are you looking to read? Are you taking RPM signal from the motor? If so, how many PPR? Sorry if I missed these in your prev posts.
> 
> JR


Thanks JR - I am using Arduino Pro Mini board (http://www.sparkfun.com/products/9218) based on ATmega328 chip. 16Mhz clock. PWM is hardware controlled. Running 10-bit ADC. At http://www.atmel.com/dyn/products/p...amily_id=760&part_id=4720&ListAllAttributes=1 they quote 15000 samples per second top speed. 

...prompted by your question on resolution, just looked through the full datasheet for the chip. Turns out one can increase the speed up to 80ksps if only doing 8-bit conversions. Hmmm.... I wonder if I can get access to that in the arduino package. After all, I probably don't need 10-bit resolution for current sensing. Especially if I 'flip' the sensor so that higher current = lower voltage and divide it down to get into 0-1.1V range (one of the modes for this chip).

EDIT: just did a bit more research on ADC speed - at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1208715493/11 there is a recipe how to reset ADC clock. Apparently, up to 1Mhz ADC clock is not reducing precision significantly (according to ATMEL, so should be legit). One conversion takes 13 clock cycles, so ~75000 samples per second! Changing the code now. Still need to leard PID loops though. Also, need to figure out how to run my LCD with interrupts and not waiting for LCD to acknowledge... 

V


----------



## jackbauer (Jan 12, 2008)

The PI code from the revolt may give you a few pointers. Not much good with C myself...... If you are doing a new control board could i make a few suggestions:

tachometer input
brake input
rs232 data output
spare io broughtout to a header
hardware current limit and trip


----------



## JRoque (Mar 9, 2010)

Hey V, if you're using the hardware PWM, I assume you're just setting a percentage duty in which case that takes it out of the loop speed dependency. If you are deciding whether to turn the switch on or off per cycle, then your loop speed dependent. Hopefully I'm following that right.

The other thing is that you might not need to ADC sample on every cycle; it's not like the current is changing that quickly. The ADC will interrupt when it has completed it's sampling cycle and you can jump to that and read the register. Or perhaps you can run the ADC on a timer.

I'm not that good with C either but do you have the loop posted somewhere? 

JR


----------



## DJBecker (Nov 3, 2010)

There is a choice of using a PI or PID control loop.
They are pretty much the same, but the PID adds in a predictive factor based on the control input. This can provide faster control, but makes the loop more sensitive to noise and the control factors.

If you want to be general, implement a PID control loop and set the Derivative multiplier to 0. You'll end up with a PI loop.

One reason you want fast A/D sample rates is for fast current limiting. At zero motor speed the current can rise very quickly. A 4KHz motor current sample rate feeding into a gentle PI loop isn't fast enough to give a good limit. Paul's controller fixes this by adding hardware: an analog comparator and latch monitors the same current signal that the controller see and shuts off the gate drive if it goes beyond the setpoint. With a faster ADC this could be done in software, simplifying the controller.

Some microcontrollers have a similar built-in analog comparator that raises an interrupt. This can perform the same function without external hardware, although it does still rely on the software running to handle the interrupt. Read the datasheet carefully before you select the controller. Most need an external analog threshold level, or have really mediocre internal D/A converters to set the threshold.

A similar digial feature is also called an "analog comparator" or "analog watchdog". This compares the digital output of the A/D converter with two numeric values, raising an interrupt when the converted value is out of the range. This is less useful, as it relies on the A/D converter speed, and the conversion being done. It's really only useful if the A/D result is done automatically to DMA, or the (high rate) results are being discarded.

Note that you can't effectively use a free-running A/D conversion. You need to take each sample at the same point on the PWM waveform.

Be careful using a simple resistive voltage divider to scale the sensor voltage. It's easy to increase the source impedance to higher than allowed by the sample rate. That will result in inaccurate, noisy conversions. You may need to use an opamp to scale the sensor value. In the end you'll probably decide that the precision is better using the sensor value directly and losing 1 bit of range.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> The PI code from the revolt may give you a few pointers. Not much good with C myself...... If you are doing a new control board could i make a few suggestions:
> 
> tachometer input
> brake input
> ...


good suggestion! looked through it. programmed the loop in my code. that was the easy part. the hard part is setting the coefficients (gain, integral / reset, and derivative). There are a few ways to not just guess but some involve bringing the loop to instability point and then setting parameters based on where that point is. Although not sure I am comfortable with having 265VDC battery connected to a controller that can oscillate out of control...

brake input, hardware limit and spare io headers already implemented (mostly by inheriting my charger control board functionality). data is streamed to LCD already so having a regular serial output is easy. the only hard thing on your list is RPM control - anyone has suggestions for how to implement? I was thinking the easiest might be to have a counter with DAC output proportional to the count since last reset. Then I can have arduino read it asynchronously and do the division by time since last reset...


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hey V, if you're using the hardware PWM, I assume you're just setting a percentage duty in which case that takes it out of the loop speed dependency. If you are deciding whether to turn the switch on or off per cycle, then your loop speed dependent. Hopefully I'm following that right.
> 
> The other thing is that you might not need to ADC sample on every cycle; it's not like the current is changing that quickly. The ADC will interrupt when it has completed it's sampling cycle and you can jump to that and read the register. Or perhaps you can run the ADC on a timer.
> 
> ...


yes, I am setting % duty but I want that to be my manipulated variable for the PID loop. Agree that might not need to take a current sample every cycle. BUT the problem I have is that the current actually changes quite a bit every cycle - due to PWM, it's on the upslope when switch is on, downslope when it's off. This current ripple could be quite substantial and if I just depend on a single reading for my loop control, I can easily be off by a factor of 2. So I need to either (1) time measurement exactly at the same point in the PWM cycle (unlikely to work), or (2) run moving average over, say, 10 samples. The latter requires fast ADC. Or maybe I am missing something...

Well, the loop code is simple (pi is a PID loop struct with a few variables defined. targetC is a commanded current based on throttle position. outC_avg is a moving average of the output current, dt is average loop duration (sampled and adjusted every second or so). finally, pidLoopDelay is optimistically set at 100 micro-seconds ;-)):
----
pi.err = targetC - outC_avg;
pi.i += pi.err * dt;
pi.d = (pi.err - pi.perr) / dt;
pi.perr = pi.err;
deltaDuty=pi.Kp*pi.err + pi.Ki*pi.i + pi.Kd*pi.d;

if(deltaDuty>0 && (outBC > maxInC || outV > maxOutV || power > absMaxPower)) deltaDuty=0;

duty += deltaDuty; 
if(duty > MAXDUTY) duty=MAXDUTY;
if(duty < 0) duty=0;

//---------- END MAIN DUTY CYCLE MANAGEMENT LOGIC ---------------

Timer1.setPwmDuty(pin_PWM, duty); 
delayMicroseconds(pidLoopDelay);


----------



## valerun (Nov 12, 2010)

DJBecker said:


> Note that you can't effectively use a free-running A/D conversion. You need to take each sample at the same point on the PWM waveform.
> 
> Be careful using a simple resistive voltage divider to scale the sensor voltage. It's easy to increase the source impedance to higher than allowed by the sample rate. That will result in inaccurate, noisy conversions. You may need to use an opamp to scale the sensor value. In the end you'll probably decide that the precision is better using the sensor value directly and losing 1 bit of range.


Thanks DJ! Yes, I figured if I use just free-running ADC, I need to do moving average over 10 cycles or so to get reliable reading. Hence the need for faster per-cycle ADC. I am not sure I can easily time the ADC to PWM cycle. Even if I can, the rate of current change within the cycle will depend on many things including motor inductance, current level, battery voltage, etc - so I can't really know exactly what the average motor current is based on just one reading...

I am using a separate IC for current limit (same as in my charger design) - main PWM goes through that (LM211P IC) and gets disabled if the current exceeds the level set through analodWrite() to one of the arduino pins. Works pretty well on the charger.

I think I am going to start with a PI loop, as well. I will try to use Ziegler–Nichols method to tune the parameters. Am a bit worried about the oscillation thing but then again, just got my Airpax 200A circuit breaker so won't be able to go beyond ~900A output anyway ;-)


----------



## DJBecker (Nov 3, 2010)

valerun said:


> I am not sure I can easily time the ADC to PWM cycle.


Many microcontrollers provide a way for the timer to trigger the ADC conversion.

The Cougar software just takes an overflow interrupt and does a fixed amount of work triggering the next sample. If it's the highest priority interrupt, this is arguably just as good as triggering the sample in the center of the waveform.

The sample is certainly not an accurate average, but not in a way that will cause instability. The human pressing the pedal will compensate for the non-linearity without realizing it. 

For our controller design we just started with PI parameter from Cougar.


----------



## valerun (Nov 12, 2010)

DJBecker said:


> Many microcontrollers provide a way for the timer to trigger the ADC conversion.
> 
> The Cougar software just takes an overflow interrupt and does a fixed amount of work triggering the next sample. If it's the highest priority interrupt, this is arguably just as good as triggering the sample in the center of the waveform.
> 
> ...


Thanks DJ. Just added the interrupt on timer overflow. Which, with phase / frequency correct PWM, should get me within ~20uS after the center of the pulse. Depending on duty, this will give me artificially low (at low duty) or high (at high duty) current. But, as you said, since duty does not change super-fast, that's probably ok. Also, I am still retaining some averaging.

for the PI parameters, Cougar page at http://ecomodder.com/wiki/index.php/Open_ReVolt/Controllersetting lists many [very different] settings. what are the official ones? Based on the spread in the table there, I conclude that our application is not super-sensitive to PI parameters...


----------



## jackbauer (Jan 12, 2008)

This is the code that counts the pulses on PB5 of the at168 on the revolt :

unsigned ui;
// ignore all ON times that are shorter than 16 units of counter_8K, and any OFF times 
// that are shorter than 16 units of counter_8k.
// So, only allow the state of PB5 to change after it has changed and stayed the same for 16 units
// of counter_8k. Ignore all other state changes, since they are just noise.
if (tach_ticks < 0xffff) tach_ticks++;
if (PINB & (1 << PB5)) {
// tach input high
if (tach_input_low) {
// tach input was low (now high) - rising edge. Log the time...
if (tach_ticks >= 16) {
tach_ticks_pulse = tach_ticks; // save number of ticks we had per sensor pulse
tach_ticks = 0; // and reset accumulator
}
}
tach_input_low = 0;
}
else tach_input_low = 1; // tach input low


----------



## valerun (Nov 12, 2010)

jackbauer said:


> This is the code that counts the pulses on PB5 of the at168 on the revolt :
> 
> 
> ```
> ...


----------



## valerun (Nov 12, 2010)

schottky power diodes still haven't shown up... but I did order some 180W thick film resistors ;-) http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&itemSeq=102277689&uq=634460396860212350.

planning to use in a lossy RCD snubber for now - no space to fit in the energy recovery snubber in my current design anyway. will see what happens. got to love iterative engineering ;-)


----------



## jackbauer (Jan 12, 2008)

Arer you planning to snub the switch or the dc bus? I think you have the right idea about the rpm code. Not too sure myself.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Arer you planning to snub the switch or the dc bus? I think you have the right idea about the rpm code. Not too sure myself.


both - bus with a decoupling cap (just got my 2uF 1kV Aerovoxes); switch with an RCD snubber. will prob try tomorrow.


----------



## jackbauer (Jan 12, 2008)

Got a little bit of a mystery. I purchased a range of 1W resistors and set about replacing each of the 3r3 gate resistors from the last experiments with a 15r for each igbt as per convention. Also replaced 0r33 emitter resistors with 1r. Powered up and it rang like a bell at switch on and off. Really bad. upped to 22r. still rang , 10r same or worse.

Went back to 3r3 on each gate and 15r on the input to the gate drive board. No more ringing. Slight bit on turn on. I suspect if I went back to 0r33 on the emitters that this will go away. I'll do this tomorrow and report back. 

Any ideas?


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Got a little bit of a mystery. I purchased a range of 1W resistors and set about replacing each of the 3r3 gate resistors from the last experiments with a 15r for each igbt as per convention. Also replaced 0r33 emitter resistors with 1r. Powered up and it rang like a bell at switch on and off. Really bad. upped to 22r. still rang , 10r same or worse.
> 
> Went back to 3r3 on each gate and 15r on the input to the gate drive board. No more ringing. Slight bit on turn on. I suspect if I went back to 0r33 on the emitters that this will go away. I'll do this tomorrow and report back.
> 
> Any ideas?


Interesting... One hypothesis I have is that by separating gate signals a bit more (separate 15r on each gate give much more signal separation than 15r for all + 3r3 for each) you allow the emitter resistors to sync the on/off points better. Therefore, your dI/dt jumps up (by a factor of 2?) which results in more ringing. Still, wouldn't be going from zero to 'ringing like a bell' I think... I assume that you have the same length for your gate drive path as before, right?


----------



## jackbauer (Jan 12, 2008)

Yeh the gate paths are the exact same. Just resistors changed. One thing that would be different though would be that the gates were "seeing" 30r between each other and now they onlt see 6r or so. I'll get to the bottom of it


----------



## valerun (Nov 12, 2010)

jackbauer said:


> gates were "seeing" 30r between each other and now they onlt see 6r or so


yes, exactly - so you allowed for the currents to self-adjust much more than with 6r. As a result, the switches might be switching more simultaneously than before, hence higher dI/dt. Just an idea.


----------



## jackbauer (Jan 12, 2008)

Try this theory. With 4 larger individual gate resistors , each device turns on at its own rate more or less. So I could have the 4 igbts switching on and off at slightly different times and causing currents to rebound around the busbars.

Now with a "main" large value and individual small value gate resistors. If 1 igbt is a hog and pulls lots of drive in an attempt to be the first "on" , then drive to all 4 is reduced due to voltage drop across Rmain. As it turns on , the drop across Rmain reduces and lets the others switch on. So i'm guessing one device acts as a master and dictates the drive to the others ........... thats the theory anway


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Try this theory. With 4 larger individual gate resistors , each device turns on at its own rate more or less. So I could have the 4 igbts switching on and off at slightly different times and causing currents to rebound around the busbars.
> 
> Now with a "main" large value and individual small value gate resistors. If 1 igbt is a hog and pulls lots of drive in an attempt to be the first "on" , then drive to all 4 is reduced due to voltage drop across Rmain. As it turns on , the drop across Rmain reduces and lets the others switch on. So i'm guessing one device acts as a master and dictates the drive to the others ........... thats the theory anway


well, the fact that with 1R emitter resistor you see more spike would contradict that, no?


----------



## jackbauer (Jan 12, 2008)

Well , spent most of the day playing about with resistor values and configs. Hit on one that gave the best compromise between ringing , overshoot and transition time.

Tests pefromed:

1)With coolant temp at 25C , took the controller to 510amps for 60 seconds. Coolant at 29C at end of test. No air flow through radiator. Simulate hill climb.

2)With modest (estimate 20mph) airflow through 3/4 of the radiator. Throttle locked at 210 amps for one hour. Heatsink temp leveled off at 49C after 40 minutes. At one hour temp difference between front and rear of heatsink at 3C. One minute power excursion to 510amps. Temp at 52C at end of test.

So i figure enough testing. Gonna install it in the car tomorrow.


----------



## valerun (Nov 12, 2010)

Nice! So what combo of resistors in what config did you end up going for?

BTW thanks for the reference to the ebay guy - got 17 600A 600V smart half-bridge modules from him. let me know if you want some...


----------



## jackbauer (Jan 12, 2008)

Went with 6r8 on each gate and 15r "main" and a 10r with schottky in parallel with the 15r for faster turn on. Time will tell if i need to make changes but i figure i've tested it as far as i can on the bench.

I'd be very interested in those devices  Got a part number?


----------



## valerun (Nov 12, 2010)

jackbauer said:


> I'd be very interested in those devices  Got a part number?


http://www.glyn.de/data/glyn/media/doc/PM600DSA060.pdf


----------



## valerun (Nov 12, 2010)

long time no update. Lots of time consumed by polishing the charger - see http://www.diyelectriccar.com/forums/showthread.php/10kw-60a-diy-charger-open-source-59210.html for updates (PFC stage, EEPROM storage of parameters, etc).

Anyway, now getting back to this. Hope to have some update end of weekend. In the meantime, some IGBT porn: http://cgi.ebay.com/NEW-1PCS-FZ1600...ltDomain_0&hash=item35ae6197d0#ht_2009wt_1110

1200V 1600A contunuous collector current (3200A repetitive pulse)! Rise time 230ns, fall time 150ns! 1.3V Vce drop at 1000A!

$500 new on ebay!

The only potential issue is it requires external connection of switch emitter to freewheeling diode's cathode. Which adds 50nH or so, or 250V spike for 1000A switched at the max capability of this device... Still, even with 600VDC rail (for, say, dual 11" Kostovs in series), you are far from 1200V rating... hmm, some food for thought. 

Also, 15uC gate charge means 30A driver chip...


----------



## Arlo (Dec 27, 2009)

Interesting.


----------



## alexcrouse (Mar 16, 2009)

Have you had any problems with EMI? My school project, a 500amp IGBT controller keeps crashing. Tapping RESET on the board brings it back to life. First thing i plan to do is make all wires as short as possible, and move the Microprocessor away from the IGBT driver, with the driver bolted to the IGBT, as that run is supposed to be as short as possible, from what i have read.

Any tips?


----------



## valerun (Nov 12, 2010)

alexcrouse said:


> Have you had any problems with EMI? My school project, a 500amp IGBT controller keeps crashing. Tapping RESET on the board brings it back to life. First thing i plan to do is make all wires as short as possible, and move the Microprocessor away from the IGBT driver, with the driver bolted to the IGBT, as that run is supposed to be as short as possible, from what i have read.
> 
> Any tips?


not really - ramped to 1200A for 5-7 sec without crashing. My phone, when placed near the power cables, does crash though ;-) Are your serial wires (assuming you have a serial display) shielded?

V


----------



## alexcrouse (Mar 16, 2009)

valerun said:


> not really - ramped to 1200A for 5-7 sec without crashing. My phone, when placed near the power cables, does crash though ;-) Are your serial wires (assuming you have a serial display) shielded?
> 
> V



No display, actually. I think it lies in the location of my IGBT driver, which is switching 9amps at ~18khz, way to close to my microcontroller. I am moving it to actually ON the IGBT as i see is popular.


----------



## valerun (Nov 12, 2010)

trying to size up the cap bank for this controller. Question: what is the appropriate amount of voltage sag to allow during the IGBT on-period? I know that high-frequency current pulsing is bad for the batteries so the caps have to provide most of the energy to the power stage. Do you know what it means in terms of allowable voltage sag during the on-time? Or the voltage sag does not matter and as long as I have much lower ESR on caps than on battery pack, I will be fine?

thx!


----------



## valerun (Nov 12, 2010)

so on the long drive back from LA (with 150 more CALB cells, no less - woohoo!), did some calculations. In R(cap)<<R(battery) approximation, I got for the battery current during on-time of the IGBT (Ton):

I(battery) = Ioutput * (1 - exp(-Ton/(R(battery)*C)))

So if one wants battery current ripple to not exceed 100A at output current of 1000A, one would need exp(-Ton/(R(battery)*C))=0.9, which means

Ton/(R(battery)*C)=0.1, or C=Rb * 0.1 / Ton

Which, at R(battery)=50mOhm (100 CALB 100AH cells in series), switching frequency of 10kHz, and duty cycle of 50% (worst for the caps), would mean

C = 0.05 * 0.1 / 5*10e-5 = 10,000uF

Something like that. I might have missed a factor of 2 here to account for the fact that the battery continues to supply 500A current in this case so the caps need to supply only extra 500A during Ton (not full 1000A). In which case, 10,000uF would be sufficient for 2000A output.

Of course, to get R(b)>>R(c) you need film caps or a lot of elcaps. In the former case, you will need a lot of film cap to get the right capacitance. In the latter case, you need a lot of elcaps to get the ESR low enough and at that point your capacitance is overkill... 

After looking at some elcap datasheets, seems to me 1000-2000uF caps are a sweet spot in terms of hitting both capacitance and ESR requirements roughly at the same time for 10kHz switching. And one would need 10 or so of those...

Am I on the right track here?


----------



## valerun (Nov 12, 2010)

largely talking to myself on this thread it seems ;-)

Anyway, hooked up with the guys at SBE who make sweet power ring caps - film, 1000uF 600V in a 2" thick, 7.5" diameter with just TWO nanohenry inductance! Think of using 2-4 of those. If anyone is interested in a group buy, let me know.

Also, considering switching from a micro-based PWM driver to a dedicated chip-based driver. Something like LM2524D, datasheet at http://www.datasheetcatalog.org/datasheet/nationalsemiconductor/DS008650.PDF. Page 9 has a reference circuit. Variable frequency, fully accessible error amp, cycle-by-cycle current control. 

The arduino would run throttle readout loop and set the current reference for a PWM chip. Would also run less time-critical stuff like comms, temp control, etc.

What do you guys think?

V


----------



## JRoque (Mar 9, 2010)

Hello V, not much to add but since you ask for it... 



valerun said:


> Anyway, hooked up with the guys at SBE who make sweet power ring caps - film, 1000uF 600V in a 2" thick, 7.5" diameter with just TWO nanohenry inductance! Think of using 2-4 of those. If anyone is interested in a group buy, let me know.


I think you mean these, shown here: http://www.engineeringtv.com/video/SBE-Power-Ring-Film-Capacitor. Are those $1,200 a pop or so?



valerun said:


> Also, considering switching from a micro-based PWM driver to a dedicated chip-based driver. Something like LM2524D, datasheet at http://www.datasheetcatalog.org/datasheet/nationalsemiconductor/DS008650.PDF. Page 9 has a reference circuit. Variable frequency, fully accessible error amp, cycle-by-cycle current control.


Dedicated PWM is the way to go unless you do FPGA or something similar. I like analog loops with digital references but that chip looks good.



valerun said:


> The arduino would run throttle readout loop and set the current reference for a PWM chip. Would also run less time-critical stuff like comms, temp control, etc.
> 
> What do you guys think?
> 
> V


I've never done anything with Arduinos and it might be a good platform for what you need at the moment. But I'd start looking into breaking away from that and running your own micro with the things you need and none of what you don't. The Atmel micro on those is really great and can stand on it's own with little peripheral devices. I put them on everything I make, short of sprinkling them on my cereal. They come in dozens of packages and can run up to 20Mhz with external crystals or 8 Mhz with their internal resonator. They are so cheap and flexible I rarely use other logic, I/O expanders, etc and instead use a small micro instead.

Anyway, there's some babbling for ya...

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hello V, not much to add but since you ask for it...
> 
> 
> 
> ...


Thanks JR. 

I got a quote of $169 apiece at quantities of 10 for 1000uF 600V part. I think it's a super-deal. Digi-key has some 300-400uF film caps that are far inferior to these at that price... Want some? If I get a couple of people willing to buy 3-4 units total, I'll get a 10-pack from them.

Yeah, raw Atmel is the way to go I guess. I will get there slowly by first getting me a dedicated PWM chip ;-)


----------



## jackbauer (Jan 12, 2008)

Count me in


----------



## piotrsko (Dec 9, 2007)

valerun said:


> largely talking to myself on this thread it seems ;-)
> 
> What do you guys think?
> 
> V


You are aware that there is a very limited amount of people that actually grok what you discuss?

OTOH, your comments and efforts are greatly appreciated by us.


----------



## Salty9 (Jul 13, 2009)

I follow the thread but I am but an egg.


----------



## valerun (Nov 12, 2010)

valerun said:


> Also, considering switching from a micro-based PWM driver to a dedicated chip-based driver. Something like LM2524D, datasheet at http://www.datasheetcatalog.org/datasheet/nationalsemiconductor/DS008650.PDF. Page 9 has a reference circuit. Variable frequency, fully accessible error amp, cycle-by-cycle current control.


going with this schematic (attached). LMK what you think. Uses Hall sensor for current sensing hence avoids the problems related to using shunts. Can accept the Arduino output reference voltage that corresponds to throttle position. 

Or you can connect the throttle pot directly (in which case there is not slew rate control, safety emergency disconnect, voltage limits, SOC measuring and other nice things that micro can provide). 

PCBs on order. Will let you guys know what happens ;-)


----------



## aeroscott (Jan 5, 2008)

Salty9 said:


> I follow the thread but I am but an egg.


me too , love your work . thanks !


----------



## jackbauer (Jan 12, 2008)

So that little circuit will produce a pwm output that is dependent on throttle position and motor current? Can the frequency be changed? If so that is very interesting. It would need a little bit of extra logic to ensure the transistors never run at 100% duty and that if they do it shuts down the driver. Also probably a hardware overcurrent stage. Not very difficult to implement ......

My next thought then would be ramp rate. Can it be controlled?


----------



## valerun (Nov 12, 2010)

jackbauer said:


> So that little circuit will produce a pwm output that is dependent on throttle position and motor current? Can the frequency be changed? If so that is very interesting. It would need a little bit of extra logic to ensure the transistors never run at 100% duty and that if they do it shuts down the driver. Also probably a hardware overcurrent stage. Not very difficult to implement ......
> 
> My next thought then would be ramp rate. Can it be controlled?


Yes. 

Yes, but. Frequency is set via external RC network so yes it is adjustable. Just not on the fly.

re 100% duty - is that the trigger or rather over-current is the right trigger? this circuit will shut down on over-current (threshold set via a resistor divider on pin 4).

The ramp rate is easy. Two ways:
1. My idea is to use this in addition to the microcontroller which will set the reference throttle voltage to this circuit. Micro can manage the slew (ramp) rate. Micro also can watch over the rest of the controller and shut things down if something's not right (e.g., zero throttle, non-zero current, etc).
2. If you don't want micro at all, then you can add an RC low-pass filter after your throttle pot midpoint and bypass the R with a reverse diode. You would set ramp rate by RC values. Diode would quickly drain cap when throttle is reduced. One issue will be that even Schottky diodes will have 0.3-0.4V drop on them so last 50-100A of current reduction to zero will happen at your slew rate (i.e. not immediately). 

One critical thing this does not have (without a micro, that is), is a protection against IGBT failure. If they short out, this thing will detect overcurrent and shut down the PWM but that would not have any effect. That, and a slew rate, are my primary reasons to keep the micro. OTOH, you can just rely on your manual emergency breaker in such a case...

V


----------



## jackbauer (Jan 12, 2008)

That sounds very good indeed. Regards a shorted igbt , what you can do is use something like a cmos nand gate. If pwm=0 and current is not zero then open main contactor. I have this in software on my controller right now. It aloso uses a brake signal input to disable throttle. So another avenue is if brake is on and current is non zero after say 100ms then open main contactor.


----------



## JRoque (Mar 9, 2010)

Hey guys, is that timing source via external RC sufficiently stable (ie: with temperature)? For safety reasons, I would most definitely frontend it with a micro and make the brake pedal my Int0 routine.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hey guys, is that timing source via external RC sufficiently stable (ie: with temperature)? For safety reasons, I would most definitely frontend it with a micro and make the brake pedal my Int0 routine.
> 
> JR


are you talking about the clock for PWM or throttle ramp RC? Either case, temp stability is dependent on RC components. Using mica cap probably best for temp stability (http://en.wikipedia.org/wiki/Types_of_capacitor). But why would we care so much about PWM frequency stability? no harm IMO if it moves by 10% or so, no?

V


----------



## mmark666 (Feb 21, 2009)

Valerun,

why don't you like the PWM output of the Arduino? A normal Arduino has serveral hardware PWM channels, they should do more or less the same thing as the separate logic chip you are planning to use... 

And how is your throttle input controlling the current in your circuit? You don't want the throttle signal controlling the pulse width (which corresponds to the average voltage), but the current. Since voltage and current are not directly related in a motor, you have to use a PID loop or something similar to change the pulse width based on the requested current / throttle signal. 

The pulse width will change while the car is accelerating, even if you keep the throttle at a constant value/position...

Or does the PWM chip contain some kind of PID loop / comparator (I haven't looked into the data sheet yet )? If so, please ignore my mumbling... 

Update:
Ok, just looked into the data sheet (and your circuit). There is a comparator and you compare the throttle input with the current measured by the hall sensor, very clever...


----------



## JRoque (Mar 9, 2010)

Hello V


valerun said:


> are you talking about the clock for PWM or throttle ramp RC? Either case, temp stability is dependent on RC components. Using mica cap probably best for temp stability (http://en.wikipedia.org/wiki/Types_of_capacitor). But why would we care so much about PWM frequency stability? no harm IMO if it moves by 10% or so, no?
> V


I was referring to PWM frequency but yes, you're right, I suppose it won't affect it much even if it drifts some. It would've helped if I had looked from closely at the datasheet Page 6 shows the value of the resistor in the network being large enough that it won't matter if it drifts a little. I'm hyper sensitive to the subject since I did a project that required quite a bit of precision in the clock reference (freq counter/gen) and it nearly drove me crazy. Before that I couldn't even spell rubidium. 

What is your base frequency, btw, have you settled on that yet? 8 Khz or so maybe?

But you are front-ending the throttle with a micro, right?

JR


----------



## valerun (Nov 12, 2010)

Thanks guys for comments.

Got the circuit done on a breadboard (I know, not the best practice but couldn't wait for the PCBs ;-).

Hooked the throttle to the Arduino which did the recalibration into the right reference voltage range and then fed that into the PWM chip circuit. Could run throttle directly to the PWM chip circuit, as well - recalibrating with resistors instead.

It does work. The PWM circuit automatically adjusts the duty to maintain the current commanded. Tested to 1000A at 100V battery voltage (using the inductor as load). Hooked up to the Kostov 11 - worked as expected in neutral. Next step is putting into the car and trying to move around.

Which we will try tomorrow with a proper emergency disconnect system we just built.

V


----------



## valerun (Nov 12, 2010)

almost forgot - we do have a bit of a noise issue. Does not affect the operation but makes a bit of irregular acoustic noise so somewhat annoying. Sounds like an over-sensitive current limiting picking up noise. We've done some no-brainer tweaks such as low-pass filters on potentially noisy inputs etc. Next step is shielding I think. Will report if it helps. Let me know if you have any other ideas..


----------



## jackbauer (Jan 12, 2008)

I used to be the guy who went from theory to practive in 2.7 seconds. You've stolen my job!

When you say you used the arduino to scale the throttle do you mean the throttle was read into the adc and then worked some maths and outputted a scaled pwm to the circuit?

I would like to see a hardware overcurrent sense and shutdown just in case. And i'd be VERY interested to see the emergency disconnect. I have yet to see one that I like....


----------



## JRoque (Mar 9, 2010)

Hi. I'm sure you guys thought of this but just in case: I would make the emergency disconnect so it opens the motor controller contactor but not cut power entirely so your power steering and brakes still work - one key advantage of EV over ICE.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hi. I'm sure you guys thought of this but just in case: I would make the emergency disconnect so it opens the motor controller contactor but not cut power entirely so your power steering and brakes still work - one key advantage of EV over ICE.
> 
> JR


Thanks JR. Check out our emergency disconnect below ;-) Worked like a charm.

Also, guys, those SBE caps (10 pieces) are in the mail - let me know if you want a couple of pieces before we put them all into some use ;-) Datasheet attached.

V


----------



## valerun (Nov 12, 2010)

jackbauer said:


> I used to be the guy who went from theory to practive in 2.7 seconds. You've stolen my job!
> 
> When you say you used the arduino to scale the throttle do you mean the throttle was read into the adc and then worked some maths and outputted a scaled pwm to the circuit?
> 
> I would like to see a hardware overcurrent sense and shutdown just in case. And i'd be VERY interested to see the emergency disconnect. I have yet to see one that I like....


Arduino is used to remap the throttle input into a reference signal that has to be matched to sensor zero-current point and sensitivity. That ref signal is fed into the pwm chip circuit which automatically adjusts PWM duty to keep the current through the motor steady. Hardware overcurrent and shutdown are parts of this chip.


----------



## valerun (Nov 12, 2010)

went around the block yesterday. No issues (heating or otherwise). The scope shows familiar 200V overshoots on turn-off which is not an issue for us with a 300V pack and 1200V devices.

Funny part of the story. At some point last week we have got a bit tired of our PID loop issues and got a couple of Paul's Open Revolt boards - just in case. This weekend, assembled both. Tested working as expected. So all good - except the fact that we also managed to tune our own boards in the same time. So now we have 4 working control boards and one power stage ;-) 

Some more road testing tomorrow & Tue.


----------



## DawidvC (Feb 14, 2010)

You will have to start building those power stages, Val. Can't have all those parts sitting idle ....


----------



## valerun (Nov 12, 2010)

PID loop fully tuned in the car - per http://en.wikipedia.org/wiki/PID_controller using Ziegler–Nichols method. 

Starting on the next-gen power stage tomorrow - 4x 600V 600A half-bridge devices with laminated bus and power ring film caps from SBE. Will post some pics once we get the bus machined.


----------



## valerun (Nov 12, 2010)

The mega - caps are here. Milling the bus and sink tomorrow (pics)


----------



## adamj12b (May 4, 2009)

valerun said:


> The mega - caps are here. Milling the bus and sink tomorrow (pics)


Ah, Solidworks. 

How are you going to mill the plates, and out of what?

It looks like a bus plate design, but why wouldn't you include the igbt connections right on the plates?

-Adam


----------



## valerun (Nov 12, 2010)

adamj12b said:


> Ah, Solidworks.
> 
> How are you going to mill the plates, and out of what?
> 
> ...


Tormach (CNC mill). Copper sheet 14 or 16 gauge. The IGBT pattern is in a separate file - we are still deciding on the bus geometry to avoid impossible angles. The issue is we want the caps on top of IGBTs but that would require bending the sheets in a non-trivial way, esp if we want the caps to stay within heatsink's footprint.


----------



## valerun (Nov 12, 2010)

to test these new intelligent 600A 600V half-bridge IGBT modules, we have assembled what I think may be the smallest 600A (peak) 300V controller. Based on the control board adopted from our open-source charger, and using one PM600 module. It holds 250A for ~2 min without ANY forced cooling - just an upside down heatsink in the picture ;-)

On the scope, overshoot of ~100V at 600A output. No snubbing (apart from the film cap on DC bus). With a simple RCD turn-off snubber, can probably go to 400VDC pack voltage...

$100 bill for size reference, overall probably 10x6x7 inches... Fans would add ~1 more inch to the latter dimension. That would be 500 cubic inches. Or almost 400W/in^3 peak ;-))

In other news, the 650VDC PFC was tested to 15kW output (more details in the charger thread - http://www.diyelectriccar.com/forums/showthread.php/10kw-60a-diy-charger-open-source-59210p9.html). Same power stage tested as a DC-DC booster from a 100V battery)


----------



## valerun (Nov 12, 2010)

valerun said:


> went around the block yesterday. No issues (heating or otherwise).
> 
> Some more road testing tomorrow & Tue.


The car has been driven 25 miles to the paint shop - freeway speeds without issues (yet, anyway ;-)


----------



## JRoque (Mar 9, 2010)

Hello V, sort of unrelated to the main topic but, how did you get a shop to take your car for painting without having had an accident? Around here in Miami, no shop will paint your car unless there's an insurance claim involved that they can scam. I mean, you can go to Maaco and get a $4.95 paint job but it'll look that price.

Don't forget the before/during/after pictures!

JR


----------



## Arlo (Dec 27, 2009)

JRoque said:


> Hello V, sort of unrelated to the main topic but, how did you get a shop to take your car for painting without having had an accident? Around here in Miami, no shop will paint your car unless there's an insurance claim involved that they can scam. I mean, you can go to Maaco and get a $4.95 paint job but it'll look that price.
> 
> Don't forget the before/during/after pictures!
> 
> JR


 Dude I'm sure you just need to ask around more. That would be like a repair shop saying they wont repair your car if its not warenty.

The auto customizing/painting industry is huge!!!


----------



## valerun (Nov 12, 2010)

quick photo update. Those 14 gauge plates turned out to be such an overkill!! Bending those is a b**ch. Should have gone with 22 gauge or so. After all, 1000A continuous at 4-6A/mm^2 across a foot-wide bus needs <1mm thick sheet. The rings on the right side of the sheet are for mounting 9-inch diameter film caps - one on each side of the bus.


----------



## valerun (Nov 12, 2010)

bus and the mega-caps


----------



## valerun (Nov 12, 2010)

The driver PCBs have arrived and been assembled. As were the cap bus and rest of the controller skeleton. Run it at 1,600A from a 240VDC battery for 30 sec. Fun. Fitting in snubbers in the next couple of days (lossy RCD on custom PCBs) and will go for full design current (2,000A). Those SBE ring caps are awesome...


----------



## piotrsko (Dec 9, 2007)

nice work. what kind of temp rise did you get or was that just a functional "SEE if it SMOKES" test?


----------



## valerun (Nov 12, 2010)

more of the latter but heatsink was not hot to touch. Maybe from 25C to 45C rise... we will do more testing soon.


----------



## evimarn (Jun 26, 2008)

Hi,
nice job here.Is it possible to have more info such as expected / real specs , schematics and also do you sell the kit. Pardon my questions but I am having a hard time following my connection is too slow and keeps re-loading.
Good luck for your goals.Thank you for sharing.


----------



## valerun (Nov 12, 2010)

evimarn said:


> Hi,
> nice job here.Is it possible to have more info such as expected / real specs , schematics and also do you sell the kit. Pardon my questions but I am having a hard time following my connection is too slow and keeps re-loading.
> Good luck for your goals.Thank you for sharing.


thx. A bit later. Need to test things first. Maybe in a week or so.


----------



## Arlo (Dec 27, 2009)

Very cool I think Im going to try to build one of theses.


----------



## z_power (Dec 17, 2011)

What is your opinion on using 24V starter motor with removed armature as resistive/inductive test load? Isolation is rated a bit on low side but keeping it cool in water bucket should let it last longer.
I'm asking because I can't find big enough inductor for low $ but I have a few starters in ~3 kW range with damaged rotors. Don't know about saturation issues, can you give me a word of advice? Would be great to see waveforms at ~150V 500A without "real" motor test stand.

Mike


----------



## valerun (Nov 12, 2010)

z_power said:


> What is your opinion on using 24V starter motor with removed armature as resistive/inductive test load? Isolation is rated a bit on low side but keeping it cool in water bucket should let it last longer.
> I'm asking because I can't find big enough inductor for low $ but I have a few starters in ~3 kW range with damaged rotors. Don't know about saturation issues, can you give me a word of advice? Would be great to see waveforms at ~150V 500A without "real" motor test stand.
> 
> Mike


Hi Mike - 150V 500A will be tough regardless. With a stationary inductor, there is no back EMF so all the voltage rise will have to be purely resistive. Maybe if you wind a big inductor (see some of my earlier posts in this thread for example of my test inductor) with heating wire (high-resistance nickel-chromium alloys usually) and put into water?...

but IMO you don't need full 'motor' voltage to test your controller design. Voltage spikes on transistors will be mostly determined by I^2 and battery voltage. The only problem you won't catch this way is thermal management on the switch. But if you are using half-bridge and diode is integrated in the package, even this error will be small.

just my 2 cents. 

Guys - sorry the controller project got put a bit on hold to focus on perfecting our charger (http://www.diyelectriccar.com/forums/showthread.php/10kw-60a-diy-charger-open-source-59210p47.html, http://www.emotorwerks.com/cgi-bin/compkits.pl) and Android EV Dashboard (http://www.emotorwerks.com/emw3/product/ev-dashboard-by-emw-basic-edition/). 

Now that this is largely done, will spend a bit more time on this. 

Stay tuned.

V


----------



## z_power (Dec 17, 2011)

Thanks Val for your answer, I missed the battery/mot amps difference.

How would it affect thermal management if I used two single igbts with one of them as a diode? (a'la your charger setup or jack's first version of power section) With no parallel current trough silicone there shouldn't rather be any problems, am I right?

I keep watching your charger thread too, the amount of knowledge possible to gain from threads like that one is amazing; thank you!

Mike


----------



## valerun (Nov 12, 2010)

z_power said:


> Thanks Val for your answer, I missed the battery/mot amps difference.
> 
> How would it affect thermal management if I used two single igbts with one of them as a diode? (a'la your charger setup or jack's first version of power section) With no parallel current trough silicone there shouldn't rather be any problems, am I right?
> 
> ...


As long as the freewheeling device and switching device are in the same package, it should give a relatively ok approximation.


----------



## SomeOne9032 (Jul 8, 2012)

valerun said:


> Guys - sorry the controller project got put a bit on hold to focus on perfecting our charger (http://www.diyelectriccar.com/forums/showthread.php/10kw-60a-diy-charger-open-source-59210p47.html, http://www.emotorwerks.com/cgi-bin/compkits.pl) and Android EV Dashboard (http://www.emotorwerks.com/emw3/product/ev-dashboard-by-emw-basic-edition/).
> 
> Now that this is largely done, will spend a bit more time on this.
> 
> Stay tuned.


Very interesting project. Do you have any news for it?

I'm looking for cheap controller to DIY EV Drag Bike and this looks very nice


----------



## valerun (Nov 12, 2010)

long time for no update. we were keeping busy with the charger and EV Dashboard upgrades (http://www.diyelectriccar.com/forums/showthread.php/10kw-60a-diy-charger-open-source-59210p44.html, http://www.diyelectriccar.com/forums/showthread.php/25-40kw-pfc-charger-high-voltage-82629.html, and http://www.diyelectriccar.com/forums/showthread.php/new-flavors-ev-display-63265p13.html)

finally something to show - a couple of properly constructed DIY controllers.

1. DC 1000A. 1200V device and 600V caps so should be good up to ~500VDC battery voltage.

2. BLDC 100A, up to 400V. 

Pics attached. 

Now trying to understand how much interest in open-source DIY kits around these.

PM or post here with your thoughts.

Thanks,
Valery.


----------



## Duncan (Dec 8, 2008)

Hi
I'm running an OpenRevolt at the moment but I expect to want to upgrade at some point so I would be interested in the DC controller - or if there is a more powerful OpenRevolt kit available


----------



## atelierve (Oct 22, 2012)

Mr. Valery,
Very interesting and I'm interested in your DIY Controller.
Actually, I'm building my own bms based on diy, next month charger from emw and after the controller (dc motor).

what do you think about sharing some component between controller and charger, ex: arduino, ...?

Gaet


----------



## tylerwatts (Feb 9, 2012)

Hi Valerun. Any chance of a higher power BLDC controller? At least 100kVA? And is there a reason you call it BLDC? How programmable would it be and could it be reprogrammed for different AC motor types?
Thanks!


----------



## valerun (Nov 12, 2010)

tylerwatts said:


> Hi Valerun. Any chance of a higher power BLDC controller? At least 100kVA? And is there a reason you call it BLDC? How programmable would it be and could it be reprogrammed for different AC motor types?
> Thanks!


this particular one is controlled by Arduino pro mini (same as our chargers). The Atmel328P chip inside it is just not fast enough to run proper AC control algorithms. But perfectly fine for a BLDC motors with trapeziodal commutation and 3 Hall Sensors for sensing rotor position.

Power can be easily expanded by using more powerful IGBTs. You would need to redesign power stage, though, as elcaps and PCBs would not work at much higher than 100A output. You would need proper copper bus and film caps (such as PowerRing caps at http://www.sbelectronics.com/products/dc-link-capacitors-for-conversion-and-inverters/).

What is the motor you would be using with a 100kW inverter?

V


V


----------



## tylerwatts (Feb 9, 2012)

Oh ok. That is fine, I am thinking of the cheaper Chinese BLDC motors. These are the first I came across, but there are many options. I want at least 100kVA


----------



## valerun (Nov 12, 2010)

tylerwatts said:


> Oh ok. That is fine, I am thinking of the cheaper Chinese BLDC motors. These are the first I came across, but there are many options. I want at least 100kVA


looks interesting. do you have any further data on these? weight, power curves, pricing, etc?


----------



## tylerwatts (Feb 9, 2012)

No, only what I have seen on the website. There are many companies though. Ruckus uses a Chinese BLDC mtoor with his ScottDrive that is rated at 55kW (small bus motor) that should run peaks of 200kW ok with good liquid cooling, so I am keen to expore this option also.


----------



## valerun (Nov 12, 2010)

tylerwatts said:


> No, only what I have seen on the website. There are many companies though. Ruckus uses a Chinese BLDC mtoor with his ScottDrive that is rated at 55kW (small bus motor) that should run peaks of 200kW ok with good liquid cooling, so I am keen to expore this option also.


got it. I was trying to get any additional data from Ruckus on the motor. Nobody seems to have good info...


----------



## tylerwatts (Feb 9, 2012)

No sure about Ruckus' motor but I am sure he has data for it if you ask him.

Ruckus! You there sir? Car to chime in?

Valerun

I have this from one company which looks to be quite good and authentic.


----------



## valerun (Nov 12, 2010)

tylerwatts said:


> No sure about Ruckus' motor but I am sure he has data for it if you ask him.
> 
> Ruckus! You there sir? Car to chime in?
> 
> ...


not bad - thanks! Do you know how to best contact them? Do they have distributors here in the US?


----------



## valerun (Nov 12, 2010)

atelierve said:


> Mr. Valery,
> Very interesting and I'm interested in your DIY Controller.
> Actually, I'm building my own bms based on diy, next month charger from emw and after the controller (dc motor).
> 
> ...


Hi Gaet - yes, sharing is possible but for now, we decided to build everything as modular as possible - keeps things easy.

If you are building both controller and charger from kits, one thing you can definitely do is share heatsinks / cold plates / fans. A few of our kit builders did exactly that.


----------



## tylerwatts (Feb 9, 2012)

Valerun

No idea of distribution or contacts, but I have emailed them so will wait to hear back. Only ever viewed their data on the website. I will let the forum know what I hear back.


----------



## kunkler99 (Jan 24, 2011)

I have been following your posts from the very beginning while saving money waiting for the day you got the charger and controller done! So definitely put me down for wanting a controller kit! Thanks for the amazing work, and for keeping it open source!


----------



## AmpedSpeed (Mar 25, 2012)

Also have been following since the beginning (ok, not quite beginning, but as soon as I joined). I thought maybe this project was dead, glad to see progress. Very nice work Valerun.

When I first read the thread a long time ago I was inspired to do my own controller. Unfortunately time has not permitted this. I would definitely be interested in one of your kits. I would most likely buy a whole kit and an extra control board, to maybe try my hand at my own power stage.

Would your control stage be adaptable to run a slightly bigger power stage? Say 1200-1400A? 

Earlier you used the Open-Revolt control boards on your power stage, yet they were designed for use with MOSFETs. This was no issue? Maybe your control stage could be used with MOSFETs and slightly higher power?


----------



## valerun (Nov 12, 2010)

AmpedSpeed said:


> Also have been following since the beginning (ok, not quite beginning, but as soon as I joined). I thought maybe this project was dead, glad to see progress. Very nice work Valerun.
> 
> When I first read the thread a long time ago I was inspired to do my own controller. Unfortunately time has not permitted this. I would definitely be interested in one of your kits. I would most likely buy a whole kit and an extra control board, to maybe try my hand at my own power stage.
> 
> ...


Thanks! 

The control stage will be fine from the sheer power perspective (the latest version designed to drive up to 20A gate current!). BUT it is designed to drive a single large device. I would advise against using it to drive multiple small devices in parallel. There are some good docs out there on how to drive multiple parallel devices and they all agree that paralleling gates is not a good idea.

Also, I would advise against trying to get 1400A from a huge number of parallel FETs. Even 500A is potentially troublesome but apparently works out (Revolt). The more devices you parallel, the more problems you will have trying to max out the power.

I would go for the largest devices you can find / afford and build from those.

Lastly, we are using our own control boards now - Arduino for DC controllers, TI 28035 chipset for AC / PMSM / BLDC motors.

Hope this helps.

Thanks,
Valery.


----------



## valerun (Nov 12, 2010)

valerun said:


> Thanks!
> 
> The control stage will be fine from the sheer power perspective (the latest version designed to drive up to 20A gate current!). BUT it is designed to drive a single large device. I would advise against using it to drive multiple small devices in parallel. There are some good docs out there on how to drive multiple parallel devices and they all agree that paralleling gates is not a good idea.
> 
> ...


In any case, power stage design is 80% of the complexity in the high-power motor controllers. A bit tough to get right in home conditions. We are on version 5 of our laminated copper bus and DC link design and every iteration is not exactly cheap. ;-)

We will be offering all the power stage components as part of the kit (including the professionally made copper bus). 

V


----------



## AmpedSpeed (Mar 25, 2012)

Are you still using something like the LM2524D PWM chip or is it all calculated on the arduino?

The prospect of using MOSFETs intrigues me because of how much efficiency can be gained. You can see some of my rambling about that in this thread:
http://www.diyelectriccar.com/forums/showthread.php/igbt-better-than-mosfet-motor-control-72706.html

Basically you can get anywhere from around 2X less conduction losses at high currents, to 10X less at lower currents. MOSFETs can also switch much faster. and should have less switching loss.

I was hoping using them with proper layout and a lot of derating would work, but maybe not.


----------



## PStechPaul (May 1, 2012)

Has anyone tried parallelling MOSFETs and IGBTs, so the MOSFETs would provide the low voltage drop and high efficiency at lower currents, and then the IGBTs would start conducting their share of the load at higher currents?


----------



## piotrsko (Dec 9, 2007)

right off the cuff, I think that the switching/driver circuit would be excruciatingly difficult to design unless you went nucleaar summer overkill.


----------



## PStechPaul (May 1, 2012)

Apparently, it has been proposed and studied before, but I don't think it has been implemented to any significant extent:

http://eetimes.com/electronics-news/4196940/MOSFET-Assisted-Soft-Switching-of-IGBTs-A-Re-Examination

http://scholarsmine.mst.edu/post_pr...ossOfAParallelIGBTMOSFET_09007dcc805584ba.pdf

http://www.ijetae.com/files/Volume2Issue12/IJETAE_1212_40.pdf

http://www.vincotech.com/news/artic...es-for-high-efficient-solar-applications.html


----------



## valerun (Nov 12, 2010)

PStechPaul said:


> Apparently, it has been proposed and studied before, but I don't think it has been implemented to any significant extent:
> 
> http://eetimes.com/electronics-news/4196940/MOSFET-Assisted-Soft-Switching-of-IGBTs-A-Re-Examination
> 
> ...


Clever stuff. Very interesting at the lower power levels. At 1000A 300V, MOSFETS are going to be very hard to use. Also, MOSFET's fast turn off (the reason for lower switching losses) has a flip side - violent voltage overshoots on even minimal parasitic inductances. 

Tough to pull off, overall. 

In reality, the peak power with IGBTs in motor controllers is limited mostly by conduction loss, where MOSFETs can't help.


----------

