# $200 Build your own intelligent charger.



## SimonRafferty (Apr 13, 2009)

*Microcontroller and Software*
The project is based on an AT Mega 128 development board which includes a relay, a beeper, a 2 line 16 character LCD (sadly not backlit) and five buttons. It also has several digital and analogue ports brought out on to connectors on the rear.

The microcontrollers themselves are inexpensive, but you need to spend about the same again on a programmer. It is a 'dongle' which connects to the USB port on your PC and to one of the sockets on the back of the controller (the JTAG port in my case).

You also need a language to program it in / with. To make it as widely understandable as possible, I adopted a version of Basic - MikroBasic
I started with the demo version - and found I quite liked it. Because of the size of the program, I bought the 'pro' version which was about $150 - but I will get more use out of it than just this I hope.

That means that unless you can persuade someone else to do it for you, you are looking at another $200 to burn the software on to the microcontroller board.

Once the software has stabilised, I might offer some kind of "send me your board and I'll blow the software on to it for a nominal consideration" type thing - which will lower the cost a bit.

I have attached the code for the charger. This version works but has a few 'issues'. Most are cosmetic (screens not being very clear or UI being poor) but the main one is that the charge cycle times out after about 20 mins - so you only get 20 min charging at a time.

I have also uploaded the .HEX file which you can burn directly on to the controller using a piece of free software

*How the application works*
There are three main functions:
1. Calibrate
From the home screen, push the left button. It will ask you to measure the battery voltage with a meter and adjust the reading on the screen (using the top and bottom buttons) to match. This just calibrates it's internal volt meter.
To exit to the home screen push the middle button (this works from most of the other screens too - sort of like the back button)

2. Edit
From the home screen, push the Bottom button. Edits the charge profile. 
The charge profile consists of five 'Pots' (Why 'Pots' - cos it's short and each pot contains info?). Each represents one charging stage.
within each pot, you can set:
*Enable* - Enables this pot. If your profile only needs 2 pots, disable the other 3.

*Voltage* - Sets the max voltage

*Current* - Sets the max current
The output will try to achieve the specified voltage, unless the current is too high - then it will limit the current. Remember, this is the voltage of the whole string, not a battery or cell.

*Trans Voltage* - this is a voltage which when reached, this pot will terminate and the next enabled pot start. Set higher than the charge voltage to ignore this parameter (as it will never be reached)

*Trans Current* - If the charge current drops below this value the pot will terminate and the next enabled pot begin. Set to zero for it to be ignored.

*Timeout* - the time in seconds (up to 2550s) after which the pot will terminate

You use the top and bottom keys to increase and decrease values, the left and right keys to cycle through the parameters and the middle button to save and exit back to the home screen.

3. Run
From the home screen, push the right button. Runs the charge profile. The duty cucle starts at 1 and climbs slowly until the desired voltage or current is reached - then increases and deacreases to keep it within the desired limits. It will hover around +/- a couple of volts because of the limited PWM resolution but this should be OK for the batteries, it's better than 1% regulation.

4. Test
From the home screen, push the Top button. This was added to test the circuit without necessarily charging a battery. I just conected the output to a light bulb as a load. You can use the top and bottom buttons to adjust the duty cycle from 1 to 255. The display shows the measured current and voltage.




*I forgot to mention* that I had abandoned using a hall effect current probe in favour of a shunt. 
The hall effect probe, for a number of reasons worked better than the shunt but unfortunately I stepped on the only one I had and broke it. In it's place I have used a 0.25 ohm 100W resistor which will drop 5v at 20A - and give me good resolution across this range. I will probably go back to the hall effect sensor at a later date when another suitable one falls in to my hands. This is the type I used previously.


----------



## Tesseract (Sep 27, 2008)

Interesting effort, Simon... but your circuit... well... let's just say it's missing a bunch of stuff. 

1. *WHERE'S THE FUSE, SIMON???* I don't see any surge protection, either. If the IGBT fails it will fail short circuit, and if your battery pack has just enough impedance to not vaporize the IGBT's bondwires, welll... 

2. inrush current limiting, aka "precharge" - this is probably why you blew up one of the electrolytics. You need to put, say, a 100 ohm/5W resistor in series with the cap that gets shorted out by a relay after a second. This will make the bridge rectifier a lot happier, too.

3. proper isolation of the control circuit from the mains - while I think it is arguably pointless to isolate the mains from the battery pack, referencing the microcontroller interface to the mains is a real no-no. Lots of stuff needs to be changed to fix this issue, but start with your current sensing and gate driver.

4. current sensing - I really recommend you go back to a Hall effect sensor both because it is naturally isolated AND likely more accurate in this situation. The reason has to do with the reactance of the stray inductance in the sense resistor approaching or even exceeding the actual resistance value, which exaggerates the output voltage as the frequency goes up.

5. buck inductor - the core material and number of turns of the inductor should be specified with a bit more care. I like to use this site:

http://schmidt-walter.eit.h-da.de/smps_e/abw_smps_e.html

to get a reasonably accurate initial estimate of the component values needed.

Now, please edit that circuit before someone here with even less knowledge/experience builds it with even less suitable components and destroys their battery pack, burns down their car/garage/house/whatever.


----------



## jackbauer (Jan 12, 2008)

Well done. I'm looking at something like this myself but am thinking of a more traditional 50hz transformer based design.


----------



## SimonRafferty (Apr 13, 2009)

> with even less knowledge/experience


That's a little bit hostile - don't you think?

OK - I missed out the fuses, and the bleed resistors. I'll update it in a minute.

Isolation from the mains. The IGBT driver is opto isolated from the microconroller. The current and voltage sensing is more difficult. One option I considered was to use an A to D board with an optical data link to the main board. Do you have a constructive alternative suggestion?

http://schmidt-walter.eit.h-da.de/sm...bw_smps_e.html - the site you suggested is very good. Wish I'd seen it previously.
To use this, the only bit you cannot work out for yourself is frequency - and it's about 41kHz. For my application it suggests 500uH inductance with 2.5mm wire. The inductance I'm using is a bit bigger than that - but it seems to work OK.

Is this really any more dangerous than using a bridge rectifier and a kettle element or capacitor as a current limiter as a battery charger? However, Tesseract's response to the thread on that one was: 


> Good luck, and don't forget your safety glasses with this one


I'm obviously missing something.

I agree in general with your points - but the point of this was to make something low cost which is better than a kettle element! It's not supposed to be competing with multi thousand dollar chargers - so treated with the same caution you would extend to a kettle element current limiter, it should not be a problem.

Si


----------



## neanderthal (Jul 24, 2008)

This is a fantastic idea. I am anxious to watch it's evolution.


----------



## SimonRafferty (Apr 13, 2009)

Good news! It all seems to work rather well.

I built a charge profile from the info here and have achieved a 20% increase in range compared to charging the batteries withg a variac. 

I'm charging at a constant current (8.5A) until the batteries get to 2.45v per cell (Bulk Charge). Then switch to constant voltage (limited to 2A) at 2.45v for a period of 4 hours (Absorption Charge). Then switch to a 2.27v per cell float charge which times out after 4 hours.

I've also fixed several of the bugs in the software and improved the voltage measurement calibration to within 1%

Si


----------



## jackbauer (Jan 12, 2008)

Very interested in this as it looks like I too will be using odyssey batts. What ah capacity are you using and how long to recharge?


----------



## SimonRafferty (Apr 13, 2009)

Mine are 50Ah (15 of them). The bulk charge depends on the degree of discharge but assuming they are completely flat, it should take about 6 hours plus 4 hours Absorption.

This was with the Optimas from the junk yard. Before I fit the Odysseys, I want to build something to limit each battery to 14.7v allowing them to auto equalise.

Si


----------



## jackbauer (Jan 12, 2008)

Yeah i've been brainstorming on that also as the odysseys don't like going above 14.7v per batt and i'm worried that a "dumb" pack charger would cause damage even if the total voltage were limited. Its a tough ball of wax because even if you detect one bat at 14.7v others probably are not.


----------



## Tesseract (Sep 27, 2008)

SimonRafferty said:


> That's a little bit hostile - don't you think?


Not in the slightest. There's a reason the UL/CE/VDE etc. are in existence, you know. Has something to do with electrical problems being the number one cause of house fires I believe. 




SimonRafferty said:


> Isolation from the mains. The IGBT driver is opto isolated from the microconroller.


Indeed it is, but the rest of your circuit is not courtesy of your voltage and current sensing methods. Also, your gate drive resistor is awfully high and there is no return path for the gate current (ie - you need to connect the (-) output of the 15V DC-DC to the emitter terminal of the IGBT, and you ought to put a 15V TransZorb and at least a 10k resistor from gate to emitter).




SimonRafferty said:


> The current and voltage sensing is more difficult. One option I considered was to use an A to D board with an optical data link to the main board. Do you have a constructive alternative suggestion?


There are many ways to transmit voltage level information across an isolation boundary. Probably the most popular is the venerable TL431 and an optocoupler. One clever method uses a self-oscillating flyback converter to produce an output proportional to its input. BTW - using a resistive divider is the same mistake K*lly makes in it's controllers, and why you get a little tingle from them if you happen to be touching the vehicle frame and a battery terminal at the same time.




SimonRafferty said:


> http://schmidt-walter.eit.h-da.de/sm...bw_smps_e.html - the site you suggested is very good. Wish I'd seen it previously. To use this, the only bit you cannot work out for yourself is frequency - and it's about 41kHz. For my application it suggests 500uH inductance with 2.5mm wire. The inductance I'm using is a bit bigger than that - but it seems to work OK.


You have to make an educated guess about the frequency of operation. For a motor controller there is little advantage in going any higher than is necessary to render the motor silent (at least from the switching frequency); for an SMPS, though, there is considerable merit in going higher because you can use less inductance (= smaller core).

For a buck converter, specifically, using more inductance than called for is fine - it just shifts the boundary between continuous and discontinuous modes downward. Transient response is affected, but that's not normally an issue for a battery charger.




SimonRafferty said:


> Is this really any more dangerous than using a bridge rectifier and a kettle element or capacitor as a current limiter as a battery charger?


Yes, it is more dangerous for two main reasons: 1) you have a big fat electrolytic capacitor in the circuit (and your precharge resistor needs to be shunted out by a relay, btw - you can't leave that 100 ohm resistor in there all the time and expect this thing to function worth a damn); 2) the other circuit had some form of current limiting impedance in the circuit whereas yours does not.

I'm not saying the "dumb charger" is better, just that yours has much more potential to do bad things.


----------



## Stunt Driver (May 14, 2009)

Great knowledge sharing!!!

Since you must have studied requirements for charging voltage - what do you think about 12V Scumacher charger:

When set to 8A it will:
- charge at 8A till voltage reaches ~14v, then will start to slowly decrease coltage, but will charge up to *16V*, finishing at 1-2A
- once 16v reached, it will step back to *15.5v* and hold that for 1-2 hours.
- after that switch to float mode at ~13.2 

Similar scenario when set to 12A.

Batteries clearly get good charge, and hold 12.8 even after a 1-mile ride. 
Chargers have another mode of charge, for GEL type of batteries, and will supposively set lower cutoff voltage, but i haven't played with it yet.

Is it too muhc of charge?


----------



## BHall (Aug 1, 2007)

Those Odyssey battery chargers look very similar to the Schumacher chargers. I would guess they are the same with a different sticker.

http://www.odysseybattery.com/chargers.html

http://store.schumachermart.com/sc-1200a.html

I wonder if a couple of the Schumacher SC-1200's could be put in series......

Brian


----------



## Stunt Driver (May 14, 2009)

I can try , but doubt it, about series. Besides, why would you do that? To loose the balancing effect??

Nice link! I can't find such for Schumacher, but it is definitely a different algorithm in "Standard" battery mode. Chargers look similar, but can be programmed differently.


----------



## BHall (Aug 1, 2007)

I am using 8 volt batteries. Two of these Schumachers in series would hopefully make a 24volt charger so I could charge three 8 volt batteries off of two of them. Just brainstorming..........

Brian


----------



## Stunt Driver (May 14, 2009)

I think i have spotted something usefull for my Keystone Interstate (from costco - http://www.batteries-faq.com/activekb/questions.php?questionid=1

BUlk charge - 14.4 but absorbtion - 15.5 ! Schumacher goes a bit past 15.5 but then runs absorbtion charge at 15.5.

Tested GEL mode - charger will go up to 14.5 volts, and stay there for some hours, didn't catch exactly how much. THen go to float. 
Interesting, but that almost exactly what Odyssey recomends. Are odyssey - gel batteries?


----------



## neanderthal (Jul 24, 2008)

Nope, the popular odyssey batteries are agm. Many say they are the best agm batteries you can buy.


----------



## SimonRafferty (Apr 13, 2009)

OK - I've used TL431's in this kind of configuration before:
http://www.powersystemsdesign.com/design_tips_june07.pdf
All be it a long time ago. They are a fine way of providing isolation on an analog signal.

However, this has been where the microcontroller shares it's -ve terminal with other stuff like the casing or heat sink.

In this case the buttons and display on the controller are plastic - and are behind another layer of plastic to insulate the user from the controller. Why does it matter if the microcontroller is isolated or not? There is no electrical connection between the controller and the outside world (other than to the mains and batteries).

In any case, if I were going to go down that route, I would probably just isolate the buttons and display through simple opto's. Likewise if it had a data / rs232 connection.



> (ie - you need to connect the (-) output of the 15V DC-DC to the emitter terminal of the IGBT, and you ought to put a 15V TransZorb and at least a 10k resistor from gate to emitter)


I had missed a connection between the IGBT Emitter and the A3210 driver which I have corrected.

The 590R is a bit high, but the 15v DCDC converter could not deliver the current that a smaller value would pull which resulted in a lot of ringing. 590R was just a compromise which seemed to work. With a higher power DCDC, the value can be lower. If the DCDC can spit out 2A continuous, a 100R resistor works well.

The A3120 doesn't need a 10k bleed resistor to switch the gate off - it has a pair of transistors on it's output - one to pull up and the other pull down. As it stands, the switching waveform is fairly symetrical.

A transorb is a good idea though for a bit of extra protection of the IGBT.

I'll maybe re-draw the circuit with a few of these thoughts included.

Si


----------



## Stunt Driver (May 14, 2009)

neanderthal said:


> Nope, the popular odyssey batteries are agm. Many say they are the best agm batteries you can buy.


Since AGM is just another type of VLRA battery- they must have the same charging pattern. Previous model of 12/8/2A charger has Gel and AGM types on the same button. 
So Shumacher chargers indeed hold the correct charging for different types of batts! I guess I am ok with using Starndard setting for my floodies.


----------



## jackbauer (Jan 12, 2008)

Just a mad idea but what about using part of an inverter arc welder. You get a mains rectifier with filtering , switch mode psu. May need to rewind the hf transformer secondary and play with the feedback control etc.


----------



## samborambo (Aug 27, 2008)

Hi Si,



Good effort on the buck charger. I can offer a couple of points:
EMI Filter. A common mode choke and possibly a low pass filter should be installed before the rectifier bridge.
Consider adding PFC circuit. The materials cost isn't that high and it gives you the advantage of boosting the bus voltage when on a single phase (110V) supply. EDIT: Sorry, didn't notice that you're in the UK (240V mains). The Americans might benefit from a PFC though.
If the current sensing shunt circuit is in fact giving false readings due to the shunt's inductance, put a capacitor just after the inductor to get rid of any AC (switching freq) current.
Consider using RS-232 between your display/buttons and the controller micro. There's lots of example code out there for a small micro to run the display and buttons. Use a MAX232 on the display to level shift and invert the TTL to RS-232 signals. At the controller end, to isolate, level shift and invert requires only two optos and four resistors.
Sam.


----------



## SimonRafferty (Apr 13, 2009)

Thanks Sam - good advice all round.

On mine, I have a choke on the mains input (as well as fuses) - I just omitted them from the diagram to simplify it. Being in an unscreened plastic box, there is a certain amount of RFI produced - but once the hood is closed, I cannot detect any. If it were in production, it would need a bit more screening.

The shunt and potential divider are reading within 1% (compared to my RMS Calibrated Fluke 79) which is porbably good enough. I am using capacitors to smooth the readings - but it was more because the ADC's were reading the waveform itself rather than the average which lead to rather random values!

I think when I build the next one, I'll just use 100W metal film resistors for the shunt.

I mentioned earlier using optos to isolate the display and buttons. Again, I would be tempted to use a separate ADC board connected via optos using I2C. The board has RS232 on board, but I currently do not use it - so although the controller is not isolated, it is insulated.

Si


----------



## samborambo (Aug 27, 2008)

Si, good point on smoothing the input to the ADC on the microcontroller. 

For others attempting a similar project, the inconsistent readings on the ADC will have you tearing your hair out for ages trying to fault-find. This happened to me back in Uni on an SMPS charger design. 

There are two common problems with sampling an ADC - unwanted out-of-band noise (the IGBT switching frequency in this case) and aliasing caused by noise above the Nyquist frequency. The Nyquist frequency is defined as exactly half of the maximum sampling frequency of the ADC. Since the analogue signal we're interested in is at a frequency band below below both constraints, we need to design a filter that passes analogue signals below the lowest of the two constraining frequencies and blocks above it. The answer is to use a simple low-pass resistor-capacitor filter just before the ADC pin to filter HF noise and aliasing. The filter frequency should be at least 1 decade below the switching frequency in order to account for roll-off of 6dB/decade of a simple single pole filter. Eg: If the switching frequency is 40kHz, the filter should be set at 4kHz or lower. If the Nyquist frequency is 2kHz then 2kHz will be frequency you want to set your filter to.

The resistor is inline with the signal and the capacitor is in shunt between the ADC pin and ground. The resistor value will be the ideal impedance for ADC sampling (refer to the microcontroller datasheet) and the capacitor value is determined by 1/(2piRF), R being the resistor value and F the frequency in Hz.

If you're filtering from a high impedance source like a voltage divider, consider this when working out the resistor value. If the voltage divider impedance is too high for the ADC you may need to buffer it with an opamp set up for zero gain to drive the ADC.

Si, would you consider writing up a wiki page on your charger? I think it would be of great benefit to others wanting to go the pure DIY route. I'd like to do the same for my charger when it's finished. Mine is simply a PFC boost design since my pack voltage is above the peak AC RMS voltage - a lot less current to deal with! 

Sam.


----------



## SimonRafferty (Apr 13, 2009)

There is also quite a lot of filtering (moving time average) in the software which seemed to achieve a good approximation to RMS.

I used this design (something like it anyway) for converting 12v to 24v:








Which worked pretty well. When the IGBT's switch on, there is no current flowing - so no loss. When they switch off however, there will be quite a high current flowing - so you need to switch them off quickly! I used an A3120 (same as in the charger) but took A to +5v to switch on and -15v to switch off - which seemed to do the trick.

I had kind of intended this to be a sort of Wiki - however - considering the amount of negative attention it seems to have generated with my dangerous lack of competence - i'm not sure I can be bothered with the flaming. 

I have been using my charger for a week now twice a day (home and work) and it seems rather good. The batteries have equalised remarkably well and I'm getting about 10% more range than last Monday. With the components used, it will charge at 20A without getting any more than warm - that's 4.5Kw. I've improved the software with temperature monitoring on the heatsink and an auto-start on power up so I can just plug it in without opening the hood. 

Before I fit my Odyssey batteries, I think I'll build another version of the charger using all new components. I wrote a program for the mill last night which will cut a nice wavy heatsink  from a slab of Ali with a deep pocket on the reverse to house the components etc. Because the charger lives under the hood - it really needs to be waterproof.

Si


----------



## jackbauer (Jan 12, 2008)

Simon would you be willing to build one for myself or even supply a kit of parts?


----------



## Woodsmith (Jun 5, 2008)

jackbauer said:


> Simon would you be willing to build one for myself or even supply a kit of parts?


I was also thinking that.

Would it work on LiFePO4's?


----------



## SimonRafferty (Apr 13, 2009)

It ought to work on anything you can design a charge profile for. The only thing not implemented in the software is 'delta V' where you control the charge based on the rate of change of voltage (or current) - but as far as I know that's only relevant to NiCd's

I have no plans to make kits - though I have had a call from a Switch Mode PSU maker interested in doing something with the software / microcontroller, connected to more grown-up hardware. Looking at one of their PSU's however, it's not much different to mine - just a bit more signal conditioning and a small, HF transformer in the middle for isolation. 

If you want to build your own hardware - I'll happily program one of the AT Mega 128 controllers for you with the latest version of the software. The point of this thread was that with a bit of effort, pretty much anyone can build something usable if not ideal - by moving a lot of the normal complexity into software.

Si


----------



## jackbauer (Jan 12, 2008)

Is the atmega micro a through hole device and could you provide a circuit diagram for the control board portion? If its just a 5v supply , osc , lcd and a few buttons its probably easier to just make. I think i would prefer to use the hall current sensor so would the code work or need a mod? Sorry for all the questions.


----------



## SimonRafferty (Apr 13, 2009)

The microcontroller would be pretty easy to build - however, when I looked at doing just that, you save about £2 on the cost of just buying one ready built and tested on a nice PCB!

Although the hall effect device seems a great idea, I found the output less stable than a simple shunt. Since the voltage measurement is not isolated, the current measurement being isolated is pointless. It would require a program change - but if you tell me the voltage it spits out per amp and with what offset (mine read 2.55v at 0A then increasing or decreasing for current flow in either direction), I'll adjust the code to suit.

I figured that shunts and voltage dividers are good enough for multi-meters, so they are good enough for this!

Before you start building, let me finish my Mk2 design which will be made entirely out of components from RS so at least you will have the option of buying new.

Si


----------



## jackbauer (Jan 12, 2008)

Thats great. No rush just trying to get the charger end of things locked down. Fair point on the current sensing. As i'm only running a 96v pack i'll probably stick a transformer on the input anyway so no isolation worries. Are you looking at any type of battery balancers?


----------



## Jokerzwild (Jun 11, 2009)

Jack are you still using NI-MH for your 96v? if so how are you going to use this for the NI-MH?


----------



## Woodsmith (Jun 5, 2008)

Nice one Simon.
I'm a way off getting batteries but given a circuit diagram and a shopping list at RS would be a great help when the time comes.

Like the controller, I don't yet know what voltage I will be using so I can't settle on what I am going to do there either.


----------



## SimonRafferty (Apr 13, 2009)

jackbauer said:


> Are you looking at any type of battery balancers?


I looked at building them (it's pretty easy!) but found the 'Volt Blotchers' were cheaper to buy and import from the US than I could build it for - so I ordered some from Brian.

Si


----------



## neanderthal (Jul 24, 2008)

I second the wiki idea. I am pretty stinkin excited about your work! Chargers can be so pricey


----------



## jackbauer (Jan 12, 2008)

I've more nimh samples coming in tomorrow but am looking at using odyssey agm batts for starters. Having said that this charger should be able to use any chemistry hence my interest.


----------



## SimonRafferty (Apr 13, 2009)

jackbauer said:


> I've more nimh samples coming in tomorrow but am looking at using odyssey agm batts for starters. Having said that this charger should be able to use any chemistry hence my interest.


Jack, Do NiMH like a Delta V profile? (I don't think they do) It could be added to the software without too much effort. I left it out because I doubted anyone would be running NiCd's

The software will allow you to set any combination of voltage or current. The profile is split in to 5 steps (you do not need to use all of them though) where you can set different parameters. You can use this for a 'knee' in the profile. You set the conditions which will terminate one stage and move on to the next as Max Voltage, Min Current or timeout.

I reckon this is enough to build any charge profile I've seen.

There is also a pulse charge option (copied from my Forklift charger) which just pulses the charge current 970ms on then 30ms off. 

Si


----------



## jackbauer (Jan 12, 2008)

great news simon. nimh like a constant current charge with either voltage or temp termination. the voltage will rise steadily then fall off. This is the point to cease charge. Do you reckon your charger could pump 40amps dc into a pack?


----------



## SimonRafferty (Apr 13, 2009)

jackbauer said:


> Do you reckon your charger could pump 40amps dc into a pack?


If the components you use are rated to more than 40A then yes. I've taken mine up to 35A - but some components were getting dangerously hot. I therefore only use mine up to 12A

Si


----------



## SimonRafferty (Apr 13, 2009)

*Isolation*

A question for the grow-ups!

Virtually all the isolated designs I can find use a transformer (all be it a small, high frequency type) to provide isolation between the input and output.

I've not found an example of it - but I'm guessing you could do it with a pair of capacitors (one in each rail) as well? Does this provide an adequate degree of isolation?

My reason for asking is that my DCDC converter (an eBay Special) has let the smoke out. It was rated at about 50A. Rather than buy another I wondered about building one. I was going to add another microcontroller for some instrumentation anyway - using the original tacho, fuel gauge and temp gauge for current, voltage and temperature. So making it generate PWM for the converter doesn't add much complexity.

Regards,

Si


----------



## adamj12b (May 4, 2009)

A isolated dc-dc converter usually creates an ac sign wave, sends it through an isolation transformer, then rectifies it back to dc after its been isolated. 



SimonRafferty said:


> My reason for asking is that my DCDC converter (an eBay Special) has let the smoke out. It was rated at about 50A.


50A?? That must have been a big converter. How much was it?


What is this large converter used for in the charger?

-Adam


----------



## SimonRafferty (Apr 13, 2009)

adamj12b said:


> A isolated dc-dc converter usually creates an ac sign wave, sends it through an isolation transformer, then rectifies it back to dc after its been isolated.


I understand that - the question was, do capacitors provide sufficient isolation if you just pass the ac through them? Do they fail open circuit?




> 50A?? That must have been a big converter. How much was it?


It's actually 3 x 20A and they were about £30 each



> What is this large converter used for in the charger?


It has nothing to do with the charger - it's for charging the 12v vehicle battery. However, the question about isolation relates to the charger as it might be a bit more friendly if the output were isolated.

When I build a replacement DCDC converter - it must be isolated, so I need to know what options are available to me as a safe means of isolation?

I like the idea of capacitors because they provide a degree of current limiting and if the IGBT fails, it will not just dump 360v DC into the batteries. So long as the Caps fail open circuit, it makes the design a lot more fail safe.


----------



## Tesseract (Sep 27, 2008)

SimonRafferty said:


> I understand that - the question was, do capacitors provide sufficient isolation if you just pass the ac through them? Do they fail open circuit?


Sure, capacitors CAN provide sufficient isolation (film/oil/ceramic dielectrics, anyway, not electrolytics), it's just rarely done, is all.

Turns out, the size capacitors needed to conduct enough current while sustaining high voltage are rather large (and expensive).

That said, it might be easier to DIY than a transformer. In general you are going to want to use "pulse rated" film capacitors, such as the MKP series, for this type of application. They are self-healing (shorts are cleared through vaporization of the surrounding foil or metallization) and can withstand high ripple currents and dV/dt.

The SEPIC topology converter uses a single series capacitor to allow it's boost-like inductor to produce an output voltage _lower_ than the input and would be amenable to adding a second capacitor in the "ground return", I'd think. Just double the capacitance and use isolated feedback. Actually, I kinda like this idea myself... going to look into it some more.


----------



## SimonRafferty (Apr 13, 2009)

Tesseract said:


> Actually, I kinda like this idea myself... going to look into it some more.


Blimy! I've done something right? 

Although the capacitors have to be fairly high value, this can be mitigated a little by cranking up the frequency a bit. 

Equally, a transformer which will handle the current is pretty chunky too - it was worth a look to see which is cheaper / lighter.

One thought I've had is that with a bit of switching (or a bi-directional converter), the same unit can be used as a DC/DC converter and a charger!

Likewise, it's fairly straightforward to make a speed controller behave as a charger.

Si


----------



## samborambo (Aug 27, 2008)

Tesseract said:


> Sure, capacitors CAN provide sufficient isolation (film/oil/ceramic dielectrics, anyway, not electrolytics), it's just rarely done, is all.


Really T? Draw up a capacitor isolated circuit and then show me a hand to hand across input to output will not cause current to flow.

There is definitely a voltage potential across any capacitive coupling. Discharging that potential requires current movement. In this instance, quite a lethal current.

Sam.


----------



## Tesseract (Sep 27, 2008)

samborambo said:


> Really T?


Really.



samborambo said:


> Draw up a capacitor isolated circuit and then show me a hand to hand across input to output will not cause current to flow.


No schematics on demand, sorry. You only need to provide a DC current pathway on the output side of the isolating capacitors that is at least an order of magnitude lower impedance than the leakage resistance of the capacitors. Simple as that, S. The boost inductor of the SEPIC topology would serve such a function admirably.


----------



## samborambo (Aug 27, 2008)

Tesseract said:


> No schematics on demand, sorry. You only need to provide a DC current pathway on the output side of the isolating capacitors that is at least an order of magnitude lower impedance than the leakage resistance of the capacitors. Simple as that, S. The boost inductor of the SEPIC topology would serve such a function admirably.


I don't I follow you at all. If you're going to look into, I'd be interested to see what you come up with, though.

Sam.


----------



## jackbauer (Jan 12, 2008)

Simon could the charger be setup with a switch that would allow a quick selection of input power depending on what capacity supply is connected ie 13amp , 16amp ,32amp?


----------



## SimonRafferty (Apr 13, 2009)

jackbauer said:


> Simon could the charger be setup with a switch that would allow a quick selection of input power depending on what capacity supply is connected ie 13amp , 16amp ,32amp?


It's in software - so anything is possible!
Instead though, you would only need to change the bulk charge current limit, which you can edit in the charge profile in half a dozen key presses anyway.

This weekend, from my favorite junk yard I scored a load more UPS bits containing half a dozen MG150Q2YS40 1200v 300A IGBT's, several 100A SCR's and three 100A diodes. I might have to find something new (and dangerous) to build! I'm going to add one of the diodes to my charger to see if it will beat the previous 35A @ 220v charging current record!

Si


----------



## jackbauer (Jan 12, 2008)

that sounds fine. I'll be going ahead with the build when i get the controller finished. As my pack is only 96v i'm going to stick in a 110v power tool transformer which negates any safety issues.


----------



## SimonRafferty (Apr 13, 2009)

Little bit of an update - the charger has been working well for three weeks now - charging twice a day. OK, that's not a thorough test - but it seems to be going OK.

I have updated the design a little as a result of feedback from the forum. The latest circuit is attached. The main changes are a precharge relay and MOV (Metal Oxide Varisistor) over voltage protection for the IGBT.

I have also attached the hex file for the latest version of the software.

I'll have a PCB design in the next week or so.

Si


----------



## jackbauer (Jan 12, 2008)

Great news on the pcb. Will it consist of seperate power and control boards?


----------



## SimonRafferty (Apr 13, 2009)

Only in so far as the computer module is separate.

I'm looking at a non surface mount version of the processor - so I might incorporate the whole thing on to one board. The power bits will connect by fly-leads.

Si


----------



## Jokerzwild (Jun 11, 2009)

SI:
Can you take a picture for us so us noobs can see what it looks like?


----------



## SimonRafferty (Apr 13, 2009)

Jokerzwild said:


> SI:
> Can you take a picture for us so us noobs can see what it looks like?


Picture of what? The charger? The PCB?

Si


----------



## Jokerzwild (Jun 11, 2009)

The charger


----------



## SimonRafferty (Apr 13, 2009)

Ah!
If you go to the very first post in this thread:
http://www.diyelectriccar.com/forum...build-your-own-intelligent-charger-36627.html

There are photos. It's not changed much since then. It now has a honking big 100A diode on the output for reverse polarity protection.

It's now charging at 13A at 220v and staying cool - which is up to the 1/4C recommended for my Odyssey batteries. I have tested it up to 55A at 40v - at which it gets a little warm.

Si


----------



## Jokerzwild (Jun 11, 2009)

SimonRafferty said:


> Ah!
> If you go to the very first post in this thread:
> http://www.diyelectriccar.com/forum...build-your-own-intelligent-charger-36627.html
> 
> ...


 You da'man keep it up!


----------



## jackbauer (Jan 12, 2008)

Any updates on this simon?


----------



## SimonRafferty (Apr 13, 2009)

I ought to finish this 'properly' really.

I've driven my Eleccy Freelander just over 1000 miles so far with about 100 cycles of the batteries using my charger.

A couple of weeks ago, added Volt-blochers to the batteries and had to 'tune' the charging parameters a little as some of the Blochers were getting a bit hot.

I'm running the bulk charge at 15A until the voltage rises to 216v then continuing to charge at 216v, limiting the current to 4A. After 4 hours, it changes to 220v limited to 1A and continues for a further 4 hours.

That keeps the Blochers cool and the range good.

This month the Junkyard has provided two Forklift motors - one of which is enormous 240Lb, 12" diameter, 15" long Series wound 4 brush and a very convenient bolt-to drive flange (coupled to a UJ). I also got a stack of BIG IGBT's - 300A @ 1200v (if you are interested, I could spare some!).

Haven't decided whether to use them to build an electric scateboard of death - or find a different, more worthwhile home for it. Too many projects.

I will get around to designing a PCB for the charger - I just need to get some other projects out of the way first (I seem to be building an electric walking coffee table at the moment).

Si


----------



## jackbauer (Jan 12, 2008)

I'm always interested in igbts! Might well take you up on the offer. My controller seems to be working quite well on them. It'd be great to see it finalised as i'm at the "need a charger" phase of the build. I read in another thread you were having trouble getting insurance. How did that play out?


----------



## SimonRafferty (Apr 13, 2009)

The software and hardware are about as finalized as they are going to get in the short term.

Attached is the current version of circuit I'm using - it has one or two concessions to recommendations made on here. I've found that values of snubbers and filters really need experimentation as they depend on the IGBT and other components being used. However, the Metal Oxide Varisistor gets rid of the worst of the spikes.

For the shunt, I'm using TO3 cased power resistors (4 x 1 ohm in parallel to give 0.25 ohm) bolted to the main heatsink. They are rated at 50w each - so 200W in total. Equivalent to about 28A max current. The value doesn't change too much with temperature and the inductance is very very low.

If anyone wants to build one, mail me one of the microcontrollers with a return envelope - I'll burn the software on to it and mail it back.

Si


----------



## Amberwolf (May 29, 2009)

SimonRafferty said:


> Haven't decided whether to use them to build an electric scateboard of death


Sounds like you'd need to start with a surfboard, and put wheels on it, to have enough room for enough batteries and a big enough motor to make it worth using IGBTs that big on. 
________
VAPORIZER WIKI


----------



## SimonRafferty (Apr 13, 2009)

I have previous for this 4.7Hp Electric Mountain Board

The pictures show it with a baby Mag-Motor (about the size of a coke can) but still a couple of Hp. I replaced it with a bigger 5" dia x 10" long 4.7Hp motor which will propel it to about 50mph - more than a little frightening!


I forgot to answer Jack's Insurance question. National Farmers Union insurance asked for an independent safety report - then refused it because it was 'an experimental vehicle'. I then went to Adrian Flux who accepted it without question saying they insure loads of EV's. Premium is half what I was paying for it as an ICEV.

Si


----------



## Guest (Dec 2, 2009)

SimonRafferty said:


> The software and hardware are about as finalized as they are going to get in the short term.
> 
> Attached is the current version of circuit I'm using - it has one or two concessions to recommendations made on here. I've found that values of snubbers and filters really need experimentation as they depend on the IGBT and other components being used. However, the Metal Oxide Varisistor gets rid of the worst of the spikes.
> 
> ...


Do you have a components list for this thing?

Jack Rickard


----------



## SimonRafferty (Apr 13, 2009)

Quantity---Part---------------------------------------------------------------------RS Part No
==========================================================================
1----------IGBT SK25GAL063 30A 600v----------------------------------------------505-2905
-----------(or whatever you can find)
1----------40A 1200v Bridge Rectifier-----------------------------------------------193-256
1----------600v 50A Fast Recovery Diode-------------------------------------------670-8873
3----------Screw cap fuse-holder---------------------------------------------------236-5731
4----------LTO50 Power Resistor 0R22----------------------------------------------532-8303
-----------connect two parallel lots of two in series to give 0.22R 200W
1----------Al Electrolytic Cap 220uF 500v-------------------------------------------339-7199
1----------USB Port Transient suppressor-------------------------------------------665-8781
1----------Encapsulated 12v PSU 5w-----------------------------------------------667-5786
2----------400v Metal Oxide Varisistors---------------------------------------------???-????
1----------C4C Polyprop Cap 1uF---------------------------------------------------384-7830
2----------PCB Mount 12v coil Relay------------------------------------------------476-804
1----------10way IDC 2 Row transition connector-----------------------------------642-5073
1----------BT224 10 way IDC cable mount socket-----------------------------------458-471
1----------Length of 10 way ribbon cable to connect uController to Charger
1----------HCPL3120 IGBT Driver---------------------------------------------------547-3885
2----------12v in 15v out DC/DC converter 3W--------------------------------------151-492
-----------two connected in parallel to give 6W

I do not offer any guarantee of the suitability of these parts - they are just what I used. The IGBT quoted is just a guide - but must be chosen to suit your requirements. Rated voltage and current must be more than double what you are going to run it at.

You will need a suitable heat-sink and fan. All the components chosen are isolated from the heat-sink so they can all be bolted straight to it.

I obtained many of the components used from scrap computer UPS's - which is obviously a lower cost solution.

eBay is full of Chinese bridge rectifiers with different quoted ratings. Mostly they seem to be rubbish! I bought 10 x 40A rectifiers, but all let the smoke out at less than 10A. The RS one seems to handle 50A (gets quite hot mind) peak and 40A comfortably.

Si


----------



## jackbauer (Jan 12, 2008)

Any info on the inductor?


----------



## SimonRafferty (Apr 13, 2009)

I do not have an RS part number for the inductor - and it was discussed earlier in the thread. Just use as big an inductor as you can find / fit in the box. I'm using one from a UPS that is about 20mH. The calculation says 6mH should be enough though. If it's bigger, it doesn't matter. If you have any spare - stick them on the output to provide a little more smoothing.

I listed some of the IGBT's on eBay £1 start, no reserve: 

Si


----------



## Jan (Oct 5, 2009)

Si,

I'm very impressed by your work. I'm a noob with electronics. But stil am interested in your design, so I have a few questions:

Looking at the pictures you don't seem to have serious heat problem. A small fan, and just a little heatsink. So the efficiency is quite high I recon?

Is your max output 400 volts? And is this limited by the so called IGBT?

I believe that you don't use a transformer, is it than possible to add a DC power source after the rectifier? Like a solar array? 

And must this array have a voltage of 360 volts? Or can it be anything within some range?

And would it be possible to have the 12 (and so the 14) volts, there for, from the DC side of the rectifier? Do you need then an extra IGBT?

Is -it in that case- also usable as a DC-13VDC from the battery pack?

And at last, is it possible to let it work with the mini-BMS of Dimitri?

Thanks.


----------



## SimonRafferty (Apr 13, 2009)

I would have responded sooner - but I thought Tesseract might enjoy answering your questions and didn't want to steal his thunder?

There isn't much of a heating problem - but the heatsink is quite big and I'm barely driving the IGBT to it's full potential. It's rated at 300A - but i'm only drawing 15 or so.

You are correct, you could use a DC source in place of the rectifier - so long as the source voltage is higher than the battery string you want to charge.

>And would it be possible to have the 12 (and so the 14) volts, 
>there for, from the DC side of the rectifier? Do you need then 
>an extra IGBT?

Sorry - don't understand what this means?

If you mean can you use it to derive 12 or 14v from a 360v input - not really. The resolution of the PWM signal is limited - so only has a resolution of about 1v. Also, the pulse durations you would have to feed the IGBT to
output a voltage so much lower than the input are very short. This leads to other complications.

It would be much better to reduce the voltage in two or more stages giving higher resolution and longer pulses. It's no more complicated though than stacking several of this type of circuit.

>And at last, is it possible to let it work with the mini-BMS of Dimitri?
The advantage of it being driven by a microcontroller is you can program it to be compatible with anything you like. The current version has no facility to be controllerd by a BMS though.

Si


----------



## Tesseract (Sep 27, 2008)

SimonRafferty said:


> I would have responded sooner - but I thought Tesseract might enjoy answering your questions and didn't want to steal his thunder?


Bah! It's your thread! I just pop in to disrupt things now and then 




SimonRafferty said:


> >And would it be possible to have the 12 (and so the 14) volts,
> >there for, from the DC side of the rectifier? Do you need then
> >an extra IGBT?
> 
> Sorry - don't understand what this means?


Me either, but I THINK Jan is asking whether you could use a buck converter to charge the 12V "accessory" battery from the main traction pack.

And the answer to that is, NO. There are several reasons why, and each one is show-stopper:

1. No transformer = No isolation.

2. The output voltage is proportional to the input voltage times the duty cycle. There is a practical limit on the range of duty cycles that can be used and still maintain regulation. That range is 10% to 90%. Thus, a buck converter could - if you disregard point #1 - be used to step down a ~120V (nominal) pack to 12V (nominal). Anything higher and you'd be better off using a transformer to assist in the stepping down (and getting isolation to boot).

3. The most common failure mode in buck results in the switch short-circuiting, which then presents the full input voltage to the load. A 12V nominal load won't appreciate getting exposed to the full pack voltage.


----------



## dimitri (May 16, 2008)

SimonRafferty said:


> >And at last, is it possible to let it work with the mini-BMS of Dimitri?
> The advantage of it being driven by a microcontroller is you can program it to be compatible with anything you like. The current version has no facility to be controllerd by a BMS though.
> 
> Si


No worries, my BMS will simply cut the power to the whole shabang via solid state AC relay 

However, if controller can accept NO/NC input, then we can save $30-$40 on AC relay.


----------



## Jan (Oct 5, 2009)

Tesseract said:


> Me either, but I THINK Jan is asking whether you could use a buck converter to charge the 12V "accessory" battery from the main traction pack.


Nope. I'll try again:

See the attached picture of the circuit. If I would use a DC source then transformer A will not be getting any charge. So that part -what I think is crusial for the charger- will not wortk at all. Or am I missing something here?

So I thought I would need some kind of DC DC converter, like a VICOR. What besides charging could be used as -what you are talking about- a DC DC converter from the high voltage pack to the 12V circuit. But you got me already lost at Isolation...



Si said:


> I would have responded sooner


No worries, I am in no hurry. It will be at least a year before I get to order anyting electric.



Si said:


> so long as the source voltage is higher than the battery string you want to charge.


That's a pity. That means I can not have a battry pack higher than 230*root(2)? I am looking at 400 volts drive systems. I could make two separeated packs of course. With two chargers... Or would a transformer before the rectifier be a possiblity? 



Dimitri said:


> However, if controller can accept NO/NC input, then we can save $30-$40 on AC relay.


And how should that be connected?

Thanks guys.


----------



## Tesseract (Sep 27, 2008)

Jan said:


> ...
> See the attached picture of the circuit. If I would use a DC source then transformer A will not be getting any charge....


Ah, I see what you were asking now. Ok, obviously if the power source for the charger is DC then you couldn't use a transformer to step it down. You could replace all of that stuff with a switching power supply - scrounge one out of PC or something. 




Jan said:


> But you got me already lost at Isolation...


Oh, so you don't understand the importance of isolation?

Hmm... okay. Now, please understand it is not my intention to be rude here, but I think it needs to be said that you should only attempt to build a circuit like this if you understand electronics enough to identify its pitfalls and safety issues (and yes there are some with this circuit*).

For example, I know enough about auto mechanics to change the oil, a belt or maybe even a water pump, but I wouldn't even consider rebuilding the engine myself. I recognize the limitations of my knowledge and skillset. That doesn't mean I couldn't learn how to - and the same applies here - but at this point in time I'd recommend you not mess around with this circuit.


* - to wit, the current measurement shunt is common to the microcontroller. I have expressed my opinion that this is intrinsically unsafe and not permitted by, for example, the NEC/NFPA, but Si feels it is not a big issue because the buttons and such on the microncontroller board are all insulated. Hey, sure, be my guest, but one should always keep in mind that the delicate bits aren't isolated in that schematic.


----------



## Jan (Oct 5, 2009)

Tesseract said:


> You could replace all of that stuff with a switching power supply - scrounge one out of PC or something.


OK, thanks. Simple.



> Oh, so you don't understand the importance of isolation?


No, I didn't understand what you mean. That's even worse. So, thanks for the lecture. I need that so now and than. 

But I still don't understand what you mean by isolation: You mean that the high voltage circuit not is 'isolated' from the rest?


----------



## jackbauer (Jan 12, 2008)

Well i bit the bullet and ordered the dev terminal part from sparkfun (lets hope i don't get any real sparks!). I have a little programmer i built for the atmega8 and ponyprog on the pc. Can i program it with that or is the micro soldered to the board?

Just another quick question. Did you change the code for the new circuit and what are the fuse settings?


----------



## jackbauer (Jan 12, 2008)

Recieved the atmega 128 board from sparkfun this morning. Very impressive service. Boulder , Colorado to Ireland in 2 days! Built up a little micky mouse programmer on a piece of stripboard. Loaded the v2 software and works great. Didn't have to change any of the fuse settings on the micro. If anyone wants the programmer i'll send it for the price of postage as i'll only need it once.


----------



## lhogberg (Oct 30, 2009)

Tesseract said:


> 3. ... I think it is arguably pointless to isolate the mains from the battery pack ...


Hi Tesseract!

if I built a battery charger, I would want to connect mains earth to the car chassi for obvious security reasons. And with a charger that has common mains earth and battery minus, the battery pack is no longer isolated from the car chassi! Even if a residual-current device would save you in most cases, you can not count on that it is fast enough.

Or why do you mean that isolation from the mains would be pointless?


----------



## lhogberg (Oct 30, 2009)

samborambo said:


> Really T? Draw up a capacitor isolated circuit and then show me a hand to hand across input to output will not cause current to flow.
> ...





Tesseract said:


> No schematics on demand, sorry. You only need to provide a DC current pathway on the output side of the isolating capacitors that is at least an order of magnitude lower impedance than the leakage resistance of the capacitors. Simple as that, S. The boost inductor of the SEPIC topology would serve such a function admirably.


Here's the schematic: http://www.freepatentsonline.com/5583421.pdf


----------



## Tesseract (Sep 27, 2008)

lhogberg said:


> ...
> Or why do you mean that isolation from the mains would be pointless?


That is what I wrote... 

Actually... I wrote that isolating the battery pack from the mains is ARGUABLY pointless. You can make an argument for it (safer) and you can make an argument against it (the pack SHOULD be isolated; much simpler circuit designs like the buck can be used). I took no stand, though my inclination is to always isolate from the mains, if for no other reason than surges from lightning, load dumps, substation tap switching, etc., can be brutal.


----------



## SimonRafferty (Apr 13, 2009)

jackbauer said:


> If anyone wants the programmer i'll send it for the price of postage as i'll only need it once.


Before you send it - let me post another version of the software! The final version has a few changes including a pulse charge mode, auto start on power-up and a timer for the pre-charge.

Be a couple of days.

Si


----------



## SimonRafferty (Apr 13, 2009)

dimitri said:


> No worries, my BMS will simply cut the power to the whole shabang via solid state AC relay
> 
> However, if controller can accept NO/NC input, then we can save $30-$40 on AC relay.


I presume your BMS is shunting the cells when the voltage exceeds a certain limit? If you were to have an output from each BMS which goes high when the shunt is in operation, then OR them all together - this could be fed in to a single input pin on the charge controller. When the pin is low, the controller increases and decreases the voltage as the profile demands. If the line goes high, it overrides the charger and reduces the voltage until the line goes low again.

That way, the shunt will pass current briefly until the charger reduces the voltage to the point that it does not need to shunt.

The lines would need to be opto-isolated or isolated via a relay - but it would make for a simple integration of the two.

What do you think?

If it's a good plan, I'll add it to the code and post it.

Si


----------



## lhogberg (Oct 30, 2009)

Tesseract said:


> Actually... I wrote that isolating the battery pack from the mains is ARGUABLY pointless.


ok, now I'm with you


----------



## jackbauer (Jan 12, 2008)

Just looking at the isolation issue for the voltage and current measurement again. What about a linear opto such as the il300. Page 14 of this app note gives a simple example that might just work:
http://www.vishay.com/docs/83708/appn50.pdf

Edit: Simon could you do a code change to increase the current measuring? With an 0R22 resistor it will only measure about 22 amps full scale (5v on the adc). I'd like to be able to go to say 50amps with an appropriate shunt.


----------



## SimonRafferty (Apr 13, 2009)

Jack - it's easier than that. Just use a shunt, say 1/10 the value and remember that the displayed current will be 1/10 of the actual.

Here is the current version of the code.
I have added an input for BMS on connector EXT2 Pin 8. This must be connected to 0v via a 1k resistor whether used or not.
If this input goes high, the output voltage / current will be gradually reduced, hopefully until the condition clears and the line goes low again. This could be used to detect one or more of the BMS's shunting or perhaps over-temperature for fast charging?

The application includes a pre-charge relay (connected to EXT2 Pin 10) and a master power relay which disconnects the battery string from the IGBT (connected to EXT2 Pin 11). The power relay output is also connected to the little relay on the Atmega128 module - but I found this would only handle a couple of amps!

Si


----------



## jackbauer (Jan 12, 2008)

Thanks Simon. Did a quick video of a first run on the bench today. Seems to work very well. Am i correct in saying it runs at 62khz switching frequency?


----------



## SimonRafferty (Apr 13, 2009)

Are you going to post the vid?

I can't remeber what frequency I left it at - I changed it dozens of times until it worked nicely!

Si


----------



## SimonRafferty (Apr 13, 2009)

jackbauer said:


> Just looking at the isolation issue for the voltage and current measurement again. What about a linear opto such as the il300. Page 14 of this app note gives a simple example that might just work:
> http://www.vishay.com/docs/83708/appn50.pdf


That looks pretty good to me! I may even give it a go!

Si


----------



## jackbauer (Jan 12, 2008)

Here's the vid:
http://www.youtube.com/watch?v=uqwIIadkRYg

I'm trying to get my hands on an LIA120:
http://www.clare.com/home/pdfs.nsf/www/LIA120.pdf/$file/LIA120.pdf
Thats a one chip solution designed for power supply feedback. I'm also going to try some to247 diodes and igbts to keep the size down.


----------



## SimonRafferty (Apr 13, 2009)

Thanks for the credit Jack! 

It might be useful to other people in the future is to run through the software operation. It's often easier to understand if you see it.

You were using the 'Test' mode there - but go through editing then running a charge profile.

Si


----------



## jackbauer (Jan 12, 2008)

Will do when its in the car. Was just doing a quick test to get my feet wet.


----------



## jackbauer (Jan 12, 2008)

I came upon an old 80's era 40amp 3 phase inverter plasma cutter today with a dead control board. its a charger in a kit! Input rectifier complete with precharge and bleed resistors , Massive fan cooled heatsinks , a huge ferrite core transformer with primary inductance of about 3.6mh , output rectifier rated at 400v 60amps fast recovery and a big honkin' output choke! Interestingly the transformer seems to be a 1:1 ratio which has me thinking about building it up as a forward converter with RCD reset. This would give an isolated output

Thoughts? , comments? , ideas? am i insane?

Edit: Well worth checking out welder repair places. The guy where i got the inverter welder and plasma from wanted to give me more of them because it costs him to dump em but i was on the bus so couldn't carry 20 welders


----------



## lhogberg (Oct 30, 2009)

jackbauer said:


> Thoughts? , comments? , ideas? am i insane?



That's freakin' awesome!  How much does it weigh? (approx)


----------



## jackbauer (Jan 12, 2008)

about 4kg or so


----------



## Jan (Oct 5, 2009)

samborambo said:


> Consider adding PFC circuit. The materials cost isn't that high and it gives you the advantage of boosting the bus voltage when on a single phase (110V) supply. EDIT: Sorry, didn't notice that you're in the UK (240V mains). The Americans might benefit from a PFC though.


 
Hi *****,

With a PFC you mean a circuit that increases the voltage to a desired level? I think I want a 400 voltage system, and with 230 Vac I would need a little more volts. I can't find any leightweight high power transformers on internet that will do this for me. Is there another way?

Tesseract, 

I will not do anything with this stuff before I'm convinced I can, or get the help it requires. But because I want -eventually- a pretty complex setup with solar power and the highest efficiency I can reach, I'm interested in this stuff. I will tell you before I do anything, I promisse.


----------



## jackbauer (Jan 12, 2008)

Ok just a quick question / suggestion. From my observation of the controller it needs to see the bat voltage before it will engage charge so should the output relay be on the mains side? My thinking is to use a contactor (seen on the left of the photo) on the mains input so as the power section is not energised until the "run" function is selected thus perhaps adding a little safety margin?

I'm using 2 generic "power packs" from junked tvs for the 12v and 15v lines as they were free. Bit cheaper option than the new parts.


----------



## jackbauer (Jan 12, 2008)

Christmas entertainment 
http://www.youtube.com/watch?v=uUzZbtLtzDQ


----------



## SimonRafferty (Apr 13, 2009)

jackbauer said:


> Ok just a quick question / suggestion. From my observation of the controller it needs to see the bat voltage before it will engage charge so should the output relay be on the mains side? My thinking is to use a contactor (seen on the left of the photo) on the mains input so as the power section is not energised until the "run" function is selected thus perhaps adding a little safety margin?


My charger is installed permanently in the vehicle. The mains side is only live when plugged in to the mains whereas the battery side is always connected. I figured therefore that the safest option was to have the relay isolate the IGBT when it's not in use.

It's not implemented in your version of the software, but one of the things mine does is monitors the battery voltage all the time the charger is connected to the mains and after it's initial charge cycle, if the battery voltage drops below a threshold, the charge cycle will repeat.

I don't believe it's good for Lead Acid to leave them on trickle charge for long periods. I don't know if this is the case for other chemistries so it's not in the release version.

Si


----------



## jackbauer (Jan 12, 2008)

Makes sense. I've actually set it up to isolate both sides. I like the ability to change settings and mess about with the controller in the knowledge that the main power is off. I'll be doing quite a bit of that during setting up.

You mentioned the software is in basic. Would you be willing to make the source code available? In any event I'd like to thank you for making this design available to the ev community.


----------



## SimonRafferty (Apr 13, 2009)

jackbauer said:


> You mentioned the software is in basic. Would you be willing to make the source code available?


I'm pretty sure it's in plain text inside one of the attached files. The code is compiled using the MikroBasic AVR compiler. There is a free version of this, but it has a restriction on the number of lines of code that was too small - so I bought the full version. At the very least, the code would give you some idea of what's going on!



jackbauer said:


> In any event I'd like to thank you for making this design available to the ev community.


No worries - thank you for being the first volunteer (Victim? ) to have a go at building it!


----------



## jackbauer (Jan 12, 2008)

Just doing a few tests today i've noticed the voltage and current readings jumping about quite a bit. I slugged a .1uf disc ceramic on the adc terminals on the control board and it made a big difference but i'm still seeing 5v or more jumps with each reading. I'm guessing its down to the long leads I have between the a to d pins and the interface board picking up noise. I'll shorten them tomorrow to see what happens. Any thoughts?


----------



## SimonRafferty (Apr 13, 2009)

Bigger Capacitors (higher value). For something like this, it doesn't matter how big they are - they are just being used to average and damp the reading.

Shorter leads will help also. Why don't you put your scope on the ADC input pins to see how much noise there actually is?

Si


----------



## jackbauer (Jan 12, 2008)

SimonRafferty said:


> Bigger Capacitors (higher value). For something like this, it doesn't matter how big they are - they are just being used to average and damp the reading.


Thanks i'll give that a try.



SimonRafferty said:


> Why don't you put your scope on the ADC input pins to see how much noise there actually is?


Cos scope ground is connected to mains earth and adc ground is mains neutral. Pop went the rcd Least it proves it works


----------



## Amberwolf (May 29, 2009)

Your scope should have an isolated reference ground for the probes that can be disconnected from it's earth ground (otherwise it's very very difficult to use in many troubleshooting situations). Mine is very very old but has this feature (a Tektronix 531A that is perhaps a few years older than I am).
________
FIND HEADSHOP


----------



## jackbauer (Jan 12, 2008)

A lot of older scopes had that facility as they were sold for tv servicing in the days when the chassis was live! I had a an old gould (no not the bad guys from stargate!) with that feature.


----------



## SimonRafferty (Apr 13, 2009)

However, since the design is not isolated, one leg of the ADC will be connected to mains neutral - so unless you get it the wrong way round - it should not care.

You could always power the scope through an isolating transformer?

Si


----------



## jackbauer (Jan 12, 2008)

Well I found the problem. Good old Radionics! If you look at the part number for the 0R22 resistors:
http://radionics.rs-online.com/web/...=searchProducts&searchTerm=532-8303&x=19&y=18

Everything looks fine until:
Resistance Value 0.022Ω !!!!!!!!

they supplied 0R022 resistors instead of 0R22 No wonder the current reading was crazy as it was buried in the noise! I went through the rubbish and found the packets. Labeled as 0R22. This is the correct part number :320-4924 but at that price its more expensive then a 50amp lem current sensor so i'm going to go that route.

By the way the new (2.10) version of mikrobasic needs the pwm definitions changed to pwm1 or it returns a syntax error. that brought back memories of my good old commodore 64


----------



## jackbauer (Jan 12, 2008)

I decided to have a rethink on the voltage and current sensing. First the current. I looked at the popular lem hass series of transducers but didnt like the limited output of only 625mv for full scale. Noise would be an issue and the code would need to be altered beyond my ability. Some searching revealed the Honeywell CSNF651 senseor:
http://radionics.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6673465

This simple little guy outputs 50mA at 100A primary. So for a 50amp sense setup it just needs a 200R precision resistor to turn 25ma (50A) into a 5v signal and is of course variable and fully isolated.

Next the voltage. I had looked at linear optos but the only ones i could source were messy setups. Came upon the LEM LV25-p voltage transducer:
http://radionics.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0286361

Similar to the current sensor it converts primary current to secondary current with full isolation. Nominal primary current of 10ma results in a secondary current of 25ma. So a primary resistor of 10k would result for a nominal voltage of 100v and a precision 200R secondary resistor converts this inot a 5v o/p. the only real disadvantage here is that the primary resistor must be chosen to be reasonably close to the nominal pack voltage being charged. 96V in my case so I use 100v for easy maths. This does bring a little added complexity but the resistor could be mounted in a sil socket for easy changes.

These two mods , I believe , solve the isolation issue. The control board gnd can then be tied to mains earth for complete safety. The only unisolated parts being inside an earthed metal enclosure makes it no more hazardous than a pc power supply. Granted the battery terminals are still "hot" but good practice would be to have the terminals fully insulated in any case. The charger is probably close to $300 with these changes but still exteremy cheap and versatile.

Soon as Radionics reopen next week (year?) i'll get the bits in and report on progress. Any thoughts?


----------



## jackbauer (Jan 12, 2008)

Had a little play with mikrobasic and have the board outputting charge voltage and current via rs232 at 9600 baud. Its a nice language easy to get to grips with. Now all i need is a pc frontend. hint hint









Happy new year all


----------



## Amberwolf (May 29, 2009)

Silly question: Will the Arduino Duemilanove http://www.sparkfun.com/commerce/product_info.php?products_id=666 work in place of the dev board you used? I have a separate serial-input LCD I can use for display. 

I've a feeling it'd require significant alterations to the program to work, but thought it worth asking. 


EDIT (ADDED): Or would this one work, http://www.sparkfun.com/commerce/product_info.php?products_id=38 with one of the listed 20-pin AVRs?
________
California medical marijuana


----------



## SimonRafferty (Apr 13, 2009)

You could adapt the code to run on any hardware. It would be easiest to get it working on hardware supported by http://www.mikroe.com/en/compilers/ 
The source code is provided in the downloads to make this possible. Mikrobasic is pretty easy to follow.

Si


----------



## Guest (Jan 6, 2010)

jackbauer said:


> I decided to have a rethink on the voltage and current sensing. First the current. I looked at the popular lem hass series of transducers but didnt like the limited output of only 625mv for full scale. Noise would be an issue and the code would need to be altered beyond my ability. Some searching revealed the Honeywell CSNF651 senseor:
> http://radionics.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6673465
> 
> This simple little guy outputs 50mA at 100A primary. So for a 50amp sense setup it just needs a 200R precision resistor to turn 25ma (50A) into a 5v signal and is of course variable and fully isolated.


I have been shopping hard for hall effect current devices. Actually, I've come to the LEM HASS 200 and it will do a +- 4.8v bidirectional current and measure up to 600 amps. I'll have to divide it down, but the resistor allowance is pretty generous.

The Honeywell shows 10 to 125 R as the allowable resistance range for this current output. At 200R, it will likely not pass enough current to be at all viable.


----------



## jackbauer (Jan 12, 2008)

Good catch i'd missed that. Not a problem though. With a 100r sense resistor it will o/p 2.5v at 50a primary current. So its just a case of setting the adc ref at 2.5v via 2 resistors from the 5v rail.

Edit: Simple fix. Use a 100r sense resistor and put 2 loops of cable through the sensor. o/p will then be 50ma at 50A primary


----------



## jackbauer (Jan 12, 2008)

Small update. the current and voltage sensors are now up and running. quite accurate and linear. control board is now fully isolated from the power section.


----------



## Guest (Jan 8, 2010)

jackbauer said:


> Small update. the current and voltage sensors are now up and running. quite accurate and linear. control board is now fully isolated from the power section.



How much power will this thing put out? What is the voltage range and current range you are seeing with this?

Jack Rickard


----------



## jackbauer (Jan 12, 2008)

Output is limited by the component choice in the power section and how much energy can be drawn from the mains supply. In my case the inductor is the limiting factor as it came from a 50A plasma cutter therefore 50A would be absolute max. On a 240v supply it will go from anywhere from 35v dc to about 300v dc. I've used a universal input power pack to supply the logic so it can actually run on anything from 100v ac to 260vac though as its just a buck supply this limit the range of pack voltages that could be charged from lower inputs.

I intend to build in 3 phase capability in the future for even greater power. I'm waiting on a qoutation from a transformer manufacturer to supply a 150amp rated torodial inductor. I hope to do a few videos over the weekend.


----------



## jackbauer (Jan 12, 2008)

quick vid of the first isolated run:
http://www.youtube.com/watch?v=xtAC9qJTods


----------



## jackbauer (Jan 12, 2008)

Water cooled resistor Popped the stupid 3 amp fuse in the plug.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> quick vid of the first isolated run:
> http://www.youtube.com/watch?v=xtAC9qJTods


Exciting video, Jack. You haven't isolated the input yet? I thought you were considering that with a transformer?


----------



## jackbauer (Jan 12, 2008)

Yeah i looked at transformer isolation but it would have negated the weight benefit of a switchmode charger. I then found out that the manzanita chargers are non isolated so if its good enough for them....

Also the control board is now fully isolated and its ground plane connected to mains earth. I've also reworked the igbt drive and lowered the switching frequency with the result of much lower switching losses and cooler heatsink.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> I then found out that the manzanita chargers are non isolated so if its good enough for them....


Ah, that's what you said. I obvious didn't understand that part in the video. 



> I've also reworked the igbt drive and lowered the switching frequency with the result of much lower switching losses and cooler heatsink.


Can you estimate the efficieny you've reached? 

If I wanted to go this way too, and I need a 400 volt charger from 230 Vac, I must use a transformer or is there another way?


----------



## jackbauer (Jan 12, 2008)

Jan said:


> Can you estimate the efficieny you've reached?
> 
> If I wanted to go this way too, and I need a 400 volt charger from 230 Vac, I must use a transformer or is there another way?


No idea of efficiency as yet as i'm still bench testing. The simplest way would be to use an autotransformer to boost the input or you could reconnect the charger in boost mode. If this design works out i may build up a buck-boost circuit.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> If this design works out i may build up a buck-boost circuit.


That means you can charge whatever voltage your pack needs? That would be great. When can I order?


----------



## Frank (Dec 6, 2008)

I just wanted to say Kudos to both Simon and jackbauer (or whatever your name is!) on this project. It's been a fun read and inspirational for guys like me who can't easily do what you're doing.


----------



## few2many (Jun 23, 2009)

Hey jack, any luck using the solar/wind battery shunt?


----------



## jackbauer (Jan 12, 2008)

I'm using a hall sensor for current monitoring. Seems to be working well.


----------



## teraamper (Nov 18, 2009)

Hello
excellent work

Can I get the last shematic
Is there any purpose for isolating DC / DC 15V. Can I use a transformer and the 7815 for Power 3120.


----------



## SimonRafferty (Apr 13, 2009)

You have kind of answered your own question - it's for isolation.

The Gate needs to be supplied with a voltage ~15v above the emitter. As the device switches on and off, the voltage of the emitter varies between 0 and the rectified mains. 

Therefore, whatever is supplying the 15v needs to be able to float above the emitter voltage by 15v. The output of the DC/DC converter is fully floating so will deliver 15v above whatever you connect the 0v line to.

You could use a separate PSU with a floating output and regulate that to 15v - but it amounts to the same thing. The DC/DC converter just does the whole thing in one neat package.

While I was prototyping, I used a bench-top PSU with a floating output to determine how much current was actually needed to make it run - then chose the cheapest DC/DC converter that met the requirement.

Si


----------



## teraamper (Nov 18, 2009)

Thank you and keep the good work.


----------



## SimonRafferty (Apr 13, 2009)

jackbauer said:


> I'm using a hall sensor for current monitoring. Seems to be working well.


Do you fancy drawing a circuit? I'll add it to the two circuits I've posted so far. Something isolated is obviously more ideal - so it would be better to point people in the right direction from the outset!

Si


----------



## jackbauer (Jan 12, 2008)

Ok figured it was about time i did an update. I bit the bullet and purchased mikrobasic. Its a nice language and i got to grips with it well enough considering the last basic program i wrote was for a commodore 64.I expanded the current range from a max of 25.5 amps to 51 amps and added significant software filtering to the inputs. Also dropped to 32khz switching to ease igbt switching and improve noise. As mentioned i isolated the control module from the power section and this is working well.


I've had an insidious little problem with the lcd. Started noticing the lcd crashing at high current levels. After much head scratching it turned out i have some crazy earth loop if the metal frame of the lcd is in contact with the earthed metal box. So i've ordered some nylon bolts and will stand it off a bit.

Next weird problem was on adc0 which is used for current monitoring. For some reason it draws upto 20ma at 5v. Probably some setting in the micro so i just changed to adc1. No more problems.

Simon , i'll get a diagram done tonight. it'll just be freehand on paper but will give an idea. I'll also post up the new code. Adamj12b and I are working on a pcb for the whole control , drive and sensor section so just add power stage! I also have some limited rs232 functionality that sends current and voltage out the serial port at 9600 baud.


----------



## jackbauer (Jan 12, 2008)

Ok schematic attached. Not pritty best i can manage for now. The "CON" contacts are a large 50amp contactor controlled but the small relay onboard the sparkfun board. This takes care of switching and precharge in one package. Also in this revision the power is totally off until a charge cycle is engaged.

The 12v psu is a power brick from a scrap portable tv. Also included is an inhibit relay to stop the car from turning on while on charge. The 15mH main inductor is the hf transformer from a scrap 50amp inverter plasma cutter with its primary and secondary in series and in phase. The choke is a laminated unit from the same plasma cutter. Diodes are 150amp fast recovery modules from a scrap inverter welder.

IGBT is a 150amp fuji 2mbi150 module. A miller clamp circuit is used on the driver to improve switching tails. Both diodes and igbt are mounted on a heatsink and fan cooled using parts from the plasma. No noticable heat is generated since igbt drive upgrade. Not on the power section battery output diagram are two mkp caps. one is a 1uf 1000v part the other a 500v 50uf.


----------



## SimonRafferty (Apr 13, 2009)

That sounds rather good! Maybe we should go into business .

Si


----------



## jackbauer (Jan 12, 2008)

Ok major progress today. I've been dogged by the voltage readings going very high at anything over 10 amps. Charging 4 batts i had to set it to 200v to charge at any real power despite the voltage never exceeding 58v in reality. Its a pure noise issue related to the layout of the components etc and its a generally noisy environment for the sparkfun board in any event.

Last night I had a brainwave. The voltage measurement is fine with the charger off so i coded the voltage measuring subroutine to put the pwm at 0 , take a few readings and average and then return the pwm to its previous value! What a difference! Today I ran the batts down a bit and opened the charger up to 30amps! Voltage read perfectly and the heatsink topped out at 33C! Ran a full 3 stage charge with voltage based transisitions not a problem. At high currents the inductor makes a tick-tick-tick sound. Reminds me of faulty tv line output stages!

Another unintended consequence of this setup is that the charger is measuring the pack voltage at zero charger current. This makes the voltage reading much more vaild. I subscribe to Jack Rikard's views on the bottom balancing / bms issues and i have seen that the voltage of a battery on charge is entirely dependant on charge current. Even today on absorbsion charge i had set the charger to an equivalent of 14.5v per battery. 14.8 being the max. Voltages were 14.5 , 14.3 , 14.2 and 14.4. I had the opertunity to speak to odyssey yesterday and they confirmed that they no longer recommend charging to 14.7v for anything more than 2 series connected batteries. they sugest setting the charger to 14.4v to allow for the slight tolerance in capacity.


----------



## Posthumane (Feb 21, 2010)

It's interesting to come upon this thread and read through it, since I've been playing around with a few different blocks to build something similar myself. The charger that I am building, however, has a few differences in that it will be for LiPo batteries (different charge profile), and it will have a balancing mechanism/BMS built in.

The initial stage (rectifier and converter) are similar to your design, except that mine will likely run off of 120V/60Hz (north america). Rather than using an IGBT driven by a DC-DC converter, I had played around with using a pair of N-channel MOSFETS, one a very low resistance power device as the switch with the gate tied to the drain through a resistor (high resistance), and the other tying the gate of the first to ground, and driven on from the microcontroller through a simple buffer. That way, when the second transistor is on (using only 5 volts), the first transistor is off. This saves me getting a DC-DC supply, but it means that the duty cycle of the buck converter switch is actually the opposite of the duty cycle put out by the uC (i.e. the micro puts out 90% duty to get 10% duty from the switch - simple software adjustment).

The balancing will be accomplished by having a bypass inductor connected across each cell through a MOSFET or other switch and individually controlled by the micro, all of which will be magnetically linked to an inductor across the entire pack (in effect a multi-tapped transformer). This allows the individual cells to be balanced both during charge and discharge, either by taking energy out of a high cell and feeding it back into the entire pack, or vice versa for a low cell.

I will probably use a PICmicro ds30F4013 from microchip to control everything, since I happen to have a bunch of them on hand and they are very powerful, but I will probably have to supplement it with additional ADC and PWM driver chips, depending on how many cells I end up doing. I was planning on making this for 12S packs (36V to 48V nominal), as I don't really feel like going to a boost converter. Boosting to a higher voltage pack would mean low charger currents anyway, since most standard circuits here are 120V/15A.

I will post some diagrams of my thoughts, and maybe some pictures of completed circuit blocks, when I get a chance. Getting late tonight.

Cheers!

Jacob


----------



## jackbauer (Jan 12, 2008)

You may have a problem with that setup as there is no isolation between the driver transistor and the micro. Also the added complexity will present more problems. Not trying to shoot you down just saying simple is better in these cases


----------



## Posthumane (Feb 21, 2010)

The isolation from the micro can be provided by the buffer driving the transistor, as it can be something like an opto coupler. I'm not discounting the idea of using a DC-DC converter, just working with what I have on hand at the moment. Also, as mentioned earlier in the thread, I don't know if isolating the micro from the high voltage side of the circuit is necessary, as long as the human and computer interface is isolated from it. I think that may be a simpler thing to do, as it will probably just be programmed via RS232 or usb.

I didn't get a chance to look through the entire thread yet, I will do that tonight, but I'm liking your project and learning some new things from the tips offered by various people. Various posters have chimed in with their opinions on isolation and the necessity of UL/CE/etc to prevent mishaps, which amuses me somewhat as a lot of the household appliances I've taken apart which carried those ratings had very little for isolation. In fact, one coffee maker timer board that I have is downright scary - it carries HVDC (169V after rectification) through the housing of a 3 position switch which the operator uses to turn the thing on with only a thin bakelite cover separating the switch housing from the user's fingers. Not saying that's the right way to do it, and I certainly do want to make my final circuit safe, just saying that a lot of commercial appliances are far worse for isolation than you'd expect.


----------



## MozRover (Sep 19, 2009)

Simon and Jack, 

thank you both for your work on this project. I am anxious to start building and testing a charger myself. Now I'm trying to produce a list of parts/sources. I am in Africa and don't have access to 'retired' equipment for scavenging (things here are used until they are useless) so I will be ordering all the parts (except the controller, as I have plenty of Atmel/Arduinos laying around.) 
I am much more comfortable with digital than I am with analog electronics so I have some questions which may seem silly to you:

1. the IGBT gate control signal goes through 22ohms, 220 ohms, or 0.22 ohms? What current/voltage rating for the Miller clamp diode?

2. what is the function of the varistor? are there two in parallel or just one? 

3. how important is the exact value (and is it mH or uH?) of the coil after the IGBT? is larger better? 

4. is the post-coil diode also fast-recovery?

Thank you again for the great work!

p.s. I am converting a 1995 Land Rover Discovery and planning on using twenty 12V PbA batteries.


----------



## Guest (Feb 25, 2010)

Jack:

I'm using an Arduino 1280 Mega as the basis for an EV instrument. Basically an amp meter with AH counter and a GPS module for speed to calculate AH out and AH in from regen to determine state of charge on LiFePo4 cells. The GPS provides speed which I can integrate to distance and so calculate AH per mile. From this I can calculate miles to empty.

The LEM HASS you have uses a + and - 15v supply which is problematical. They LEM HASS 50-S model is about $26 and uses 5v. If you power the Arduino from 12v, you can use the 5v output of the Arduino to power the LEM HASS current sensor. I'm actually powering BOTH a 50S and a 200S from the same board. It works great. They come in at 2.5 volts and vary above and beneath showing current flow in both directions. By using two, I get good resolution from the 50 for under 100 amps, and good range up to about 700 amps on the 200. I simply switch between the two in software.

Anyway, that would let you eliminate the 15v.

Jack Rickard
http://EVTV.me


----------



## jackbauer (Jan 12, 2008)

Good idea. I had the +/- 15v already due to using the lem LA-25p voltage transducer so it was no real problem. That said i'm sure my method is not the only way nor probably the best but it seems to work! Next steps for me will be to upgrade the igbts in the charger for use with 415v three phase ac and dc fast charge points.


----------



## Posthumane (Feb 21, 2010)

Jack, just curious (I might have missed this earlier in the thread) but do you have a PCB for your project, or are you building it on protoboard or something similar? I've decided to go the same route as yours and use an IGBT for the switching rather than the MOSFET array I was playing with (more efficient as that way I'm not dumping current when the switch is off), so I plan on ordering a bunch from digikey that are rated to 1 kV blocking voltage. That would be suitable for the fast charge points, as well as household voltages. The reason I ask about the protoboard vs breadboard is I'm not sure if the pad spacing on most of protoboards is adequate for the kind of voltages you will find in a 415V AC setup (415*1.414=587V). If you are using a PCB, did you etch it yourself, or order it from a custom etching place? Any recommendations on component distributors? I've always used digikey for work orders, but there may be cheaper places that I'm not aware of.


----------



## jackbauer (Jan 12, 2008)

To be honest I used normal .1" stripboard for the little igbt driver and sensor boards due purely to time constraints. I couldnt justify the time involved to make a pcb without knowing if the circuit was feasible. What i did was to cut out the strips between hv points and then sprayed both sides with conformal coating. No problems thus far. Now this has two disadvantages. First it looks very messy and second its very noise prone. Now this did force me to write updated software and the charger is now running very well indeed even with this lousy layout so yes i will look at a pcb version shortly.

Regards suppliers I used ebay , junk pile and radionics. I dont know if you have radionics where you live. They are ok for certain stuff but very expensive. I've no experience of digikey.


----------



## SimonRafferty (Apr 13, 2009)

Posthumane said:


> Jack, just curious (I might have missed this earlier in the thread) but do you have a PCB for your project, or are you building it on protoboard or something similar?


Mine was built on protoboard. There was a plan for a PCB - but I have too much on my plate to design one at the moment. I also plan to CNC mill a nice heat-sink with an integrated window for the uController - but again time is against me at the moment.


> I've decided to go the same route as yours and use an IGBT for the switching rather than the MOSFET array I was playing with


More the merrier - hopefully, like Jack you'll adapt it a little and move the design on a little too.



> The reason I ask about the protoboard vs breadboard is I'm not sure if the pad spacing on most of protoboards is adequate for the kind of voltages you will find in a 415V AC setup


In Jack's design, there should be no more than 15v difference anywhere on the protoboard. Everything else (at least in mine) is wired point to point via ring terminals. Even on a protoboard the separation between tracks should cope with about 1000v per gap before it arcs.

As Jack said - the bigger issue with it is noise.



> I've always used digikey for work orders, but there may be cheaper places that I'm not aware of.


Digikey is fine - but you can buy from RS just about anywhere in the world. They seem to have subsidiaries in most countries.

Failing that, I'm sure you could order the stuff for delivery to one of us & we'll stick it in the post to you?

My charger has now completed 250 charge cycles (2 per day) without a problem. 

Si


----------



## SimonRafferty (Apr 13, 2009)

My little project for the Easter weekend is to update my charger to incorporate Jack's improvements.

To help anyone else, the RS part numbers for the additional components are as follows:
LEM LV25-P Voltage transducer - 286-361
Honywell Current Transducer CSNF651 - 667-3465
Fast recovery diode for IGBT Driver - 671-5470
Second +/-15v DCDC converter for sensors - 672-7420

I'm also going to CNC a face-plate / heatsink for the charger incorporating a slot for the microcontroller LCD.

I'm going to replace the buttons on the microcontroller board with slightly more robust versions as one of mine has all but stopped working! These will be panel mount (rather than board mount) which will make the whole thing a lot neater.

Well done Jack, I like your modifications a lot! It does increase the cost to about $300 - but worthwhile I think!

Si


----------



## illuminateddan (Dec 19, 2009)

jrickard said:


> Jack:
> 
> I'm using an Arduino 1280 Mega as the basis for an EV instrument. Basically an amp meter with AH counter and a GPS module for speed to calculate AH out and AH in from regen to determine state of charge on LiFePo4 cells. The GPS provides speed which I can integrate to distance and so calculate AH per mile. From this I can calculate miles to empty.
> 
> ...



Hey Jack,

Great to hear you're using a mega, I'm basing my car control and BMS on a mega and it's such a great platform. Have you checked out processing for the PC interface using the megas serial0 (usb). it's like arduino coding but for graphics using all the same librarys and idosyncracies..

Just watch out for pulling too much current from the 5v pin. I lost a nano that way....


----------



## SimonRafferty (Apr 13, 2009)

Arduino's seem to get everywhere!

Give or take the same processor as the ATMega boards - but at the time (and it may have changed) there was not a nice, cheap Arduino board with an LCD & some buttons ready built.

Jack, are you going to publish your design for the instrumentation? I'd been thinking along similar lines as an extra for the charger with another big current transducer in line with the battery leads. I'd not thought of using GPS and calculating the range though.

Since the charger can monitor the pack voltage as well, it will give a better indication of the state of charge of the batteries (maybe you are doing similar) rather than relying on the quoted Ah capacity.

I had figured on using the original fuel gauge on the vehicle to monitor remaining capacity as well as the tacho to show current (Fuel gauge can be fed with PWM & tacho with a pulse-stream at 66Hz per 1000 rpm on the gauge (for a 4 cylinder engine)). My tacho reads up to 8000rpm - so divide by 10 for Amps will be about right. The controller will draw about 600A.


----------



## SimonRafferty (Apr 13, 2009)

A small problem I've been having!

At work, all the RCD's have been changed from 100mA to 30mA and I'm finding that the charger will trip the RCD when it's charging at more than about 4A.

I have pat tested the charger and the leakage is only 5mA at 15A charge. I have read that some switch mode PSU's give the effect of earth leakage because the current and voltage are out of phase (power factor).

I've tried it through an isolating transformer - but the same happens. Is there a solution to this? I wouldn't care particularly if it only affected my Unit - but it takes out the whole block of 6 units in one go! Then I get a visit from Mr Angry next door!

Si


----------



## jackbauer (Jan 12, 2008)

I incorporated a 30ma 63amp rcd on the input to my charger. It only tripped when i touched a hot motor terminal by accident while running some heater hose. My charger has been running very well indeed with the hardware and software mods. 

The only change i have made (today in fact) was to up the primary resistor on the input of the voltage transducer to 15k from 10k as I'm now running at 96v. Voltage readings were about 1.5v out before the mod when charging the pack to 116v. Perfect now. On a 32a 240v feed i've had the charger upto 40amps. Heatsink went a little over 40c during bulk charge. The odysseys were thirsty


----------



## jackbauer (Jan 12, 2008)

Here's the updated source code for the charger. Note that the scaling of current and voltage has been changed for use with the sensors. Max current is 51amps and max voltage 307v. Its also got a little beta routine which outputs current and voltage via rs232 at 9600 , n ,8,1.


----------



## illuminateddan (Dec 19, 2009)

Hi Simon / Jack,

I have probably missed it but is there a link somewhere to all the schematics, parts lists and source code?? I seem to have gone forum blind!  Thanks


----------



## SimonRafferty (Apr 13, 2009)

illuminateddan said:


> Hi Simon / Jack,
> 
> I have probably missed it but is there a link somewhere to all the schematics, parts lists and source code?? I seem to have gone forum blind!  Thanks


There is not a single post with diagrams and code - but it's all in here somewhere!

I'm building a new charger based on a hybrid of mine and Jacks designs with a couple of small software tweaks - mainly to drive my tacho as a voltmeter while driving.

I've built Jacks bits on a new board:








Rubbish phone photo!

Once the whole thing is up & running, I'll draw it up properly and post a complete design in a single post.

Yesterday, I was charging 220v @ 55A (about all our main house fuse will take). The heat sink got quite hot - but that is pushing 12kW. Full charge in under an hour!

At work, I have a 400A 230v mains supply - but I think that might let the smoke out!

The end result of this project with Jacks isolation seems to be about as good as any charger on the market for high voltages and currents.

I have completed over 300 charge cycles with it with no problems with batteries or charger so far (with the exception of the earth leakage).

The earth leakage problem has been solved. My building should be on a 100ma as it has it's own earth spike rather than a spike at the substation apparently. Also, all five units are currently connected through a single 30ma non delay breaker - where it should be 100ma Delay because there are two or more RCD's in series. The Electrician has agreed to change it in the next few weeks. The charger is happy on a 30ma RCD at home.

Si


----------



## Roy Von Rogers (Mar 21, 2009)

I have also been looking at a more reasonable cost for a charger, and waiting to see the final cut.

But I do have one question, when I looked at the first schematic on the first post, how do you get 360v dc from 240 ac mains.

240 x 1.414 = 339.35

Roy


----------



## jackbauer (Jan 12, 2008)

Nice work Simon! Much neater than mine. Are you still using the same inductor at 55A? Highest i've gone so far was 40amps. I had planed to use a serial lcd inside the car running from the rs232 output on the sparkfun board.


----------



## SimonRafferty (Apr 13, 2009)

The inductor is a much more chunky one found in a UPS - or more accurately two in parallel (which halves the inductance but doubles the current handling).

The only thing that has suffered ill effects is the relay used to switch the main power on & off. It has changed shape rather and no longer works as a relay!

Mk2 is going to get a 100A relay I think.

I've decided to go for a completely separate volt / current / gps / range monitor - adding more functionality is just a distraction!

I'll use another of the Sparkfun boards in the cab to indicate what the tacho is displaying plus range - which is probably more useful as a number than an analogue dial.

Si


----------



## SimonRafferty (Apr 13, 2009)

Roy Von Rogers said:


> I
> 240 x 1.414 = 339.35
> Roy


You are correct - but I think I said 350 and it was just rounding it to a rounder number rather than a specific, accurate number.

In Europe, the mains these days is 230v - so it's closer to 325v.

Either way, there are not many vehicles running that high a voltage.

Later on I posted a boost converter configuration which is a bit more complicated but can double the voltage - which is probably enough!

Si


----------



## jackbauer (Jan 12, 2008)

Simon have you tried my code with the voltage readings taken at zero pwm?


----------



## SimonRafferty (Apr 13, 2009)

Just finished building the Mk2 Charger a few mins ago! Too tired to test it at the moment.

I did try the current and voltage monitoring circuit on my kettle - and it seemed to work perfectly!

This time the charger is totally waterproof in a sealed box. Last time condensation started to affect the LCD which lost a few lines.

I've bought 5 x IP67 waterproof push button switches from RS which are mounted on the panel. The LCD is now behind a polycarbonate window stuck to the box with silicone sealant.

Ill test it tomorrow or Thursday and post some piccies!

Si


----------



## SimonRafferty (Apr 13, 2009)

I've attached a complete circuit for the Mk2 Isolated version incorporating Jacks improvements. It is intended to charge at up to 306v at, potentially up to 50A depending on the ratings of the components chosen. I'm using it at 220v at 13A which is about the max you can get out of a 230v 13A UK plug socket. It will cope with lower voltages just as happily though as it is fully programmable.

This circuit works with the last version of the code published by Jack. I have another version that I'll publish when I've tidied it up a bit which improves the UI a little.

Si


----------



## jackbauer (Jan 12, 2008)

Nice one Simon! I've actually been hunting about for a source for inductors but all the suppliers i've spoken with only offer tiny inductances with any real power. If a ready made inductor could be sourced then anyone could build this charger.


----------



## SimonRafferty (Apr 13, 2009)

Why don't you wind your own?

Lots of multimeters measure inductance these days, so you don't even need to calculate it.

You can buy ferrite cores and chunky copper wire from most suppliers.

Si


----------



## SimonRafferty (Apr 13, 2009)

A little more feedback!

I've been trying out the new version of the charger today. There are a couple of issues with switching off the PWM to measure the voltage.

Firstly, when the batteries are nearly charged, all the volt blochers (shunt type top balancers set up at 14.7v) are lighting up when the charger is only measuring 14.2v. OK, you could reduce the charging voltage to compensate - but the batteries are supposed to be charged at a specific voltage, not measure that voltage when the charger is disconnected.

Secondly, and more seriously, when it had been charging at 10A for a few mins, I could hear a 'ticking' noise at the same frequency as the voltage measurement interval - then the fuse blew. It appeared that the inductor was arcing inside and then one of the smoothing capacitors shorted out inside!

I think it's generating high voltage spikes and putting too much stress on the components.

Needless to say - I've gone back to measuring the voltage while the PWM is running! 

Little bit of a re-build this week!

Si


----------



## jackbauer (Jan 12, 2008)

I get the ticking sound at much over 5 amps. Havent had those problems though

One thing i was going to do and may now revisit is a slow (say 250ms) ramp down and ramp up on the pwm.


----------



## SimonRafferty (Apr 13, 2009)

Remember that mine is charging at double the voltage of yours - that may be a contributor too?

Si


----------



## jackbauer (Jan 12, 2008)

Quite possible....i wonder about reducing the sample count on the voltage measurement to reduce off time. Then again if you dont suffer from noise on the voltage mabey you dont need to turn pwm off at all?


----------



## teraamper (Nov 18, 2009)

Hello
I'm decided to build this charger too.
But, I wonder what constitutes an element 5v Clamp


----------



## SimonRafferty (Apr 13, 2009)

It's intended to limit the voltage applied the microcontroller inputs exceeding 5v. It's essentially just a 5v zenner diode. The one I used was intended to protect a PC from what you plug in to the USB port.

There is a circuit I posted on the previous page which supersedes the circuit shown - and does not use the clamp.

Si


----------



## ga2500ev (Apr 20, 2008)

This is a somewhat generic question related to this project. It's pretty clear that inductors are the driving force behind virtually any power electronics project. The three major power systems in EVs: motor controller, charger, and DC/DC converter each are fundamentally the same device, which takes a high voltage, high current DC energy source and converts it to a lower voltage, high current output. Each integrate an inductor, switch, and freewheeling diode as the core conversion system.

Unlike most electronic components, inductors for this type of application are not available off the shelf. Fortunately for motor controllers it isn't too much of an issue as the motor itself serves as the inductor. However, for the other two it's somewhat of a guessing game as how to obtain a suitable inductor.

So my question comes in two parts. The first is can the primary coil of a microwave transformer serve as a test inductor for these type of applications? They are easily savlagable, wired for high voltage and reasonably high current, and due to the loads of iron in the core, can transfer a lot of energy before saturating.

The second is what to do for production use? Would it be best to extend the salvaged microwave transformer and add a secondary in a flyback configuration? Or is there an OTS inductor that is appropriate for these types of applications?

I have IGBTs for switching. I have a set of 100V 200A Schotty diodes for freewheeling. I can program PIC microcontrollers for control.

Inductors are my bugaboo. I'm looking for some guidance here.

Any help would be appreciated.

ga2500ev


----------



## jackbauer (Jan 12, 2008)

You can't use a microwave transformer as its core is laminated. This will cause huge issues at high frequency. You need a ferrite (iron core). I agree they are hard to find. I got mine out of an old 50amp inverter plasma cutter. I also got some from 200amp inverter welders. If your stuck drop me a pm i have a few in stock.


----------



## SimonRafferty (Apr 13, 2009)

Unfortunately, Jack's right. I tried using a transformer - and it just didn't work!

In practice, there are loads of off the shelf inductors available so even for production it's not a big issue.

Worst case, they are easy to make. You can buy ferrite cores and just choose a gauge of insulated copper wire that will carry the current.

Many Multimeters will measure inductance - so even without being able to calculate the inductance, you can easily measure it and change accordingly.

In a Microwave, it will likely have a couple of inductors on the mains input to stop RF leaking out into the mains supply. These are a pretty good choice I have found. I'm currently using such an inductor from an old power supply.


----------



## SimonRafferty (Apr 13, 2009)

I've made a couple of design 'improvements'!

Firstly, the pre-charge circuit. Originally I had one relay to connect the output of the circuit to the battery string and another for the pre-charge.

Now, I have a pair of relays which are operated by the small relay on the microcontroller board (coils connected in parallel) such that the pre-charge resistor is shorted when the battery string is connected. This saves building any additional relay drivers for the uController. It also means that the pre-charge has a minimum of 5 seconds to charge the capacitor. I'm using a 1k 10w wirewound resistor for the pre-charge.

Second, the 15v DC/DC converter I was using to drive the IGBT gate was a bit weedy (low power). This means that the circuit is less efficient as it takes longer to charge and discharge the gate capacitance and the IGBT spends longer than necessary transitioning from on to off and vice-versa.

I have now replaced it with a 240v to +/-15v PSU brick much like the one I've used to generate the 12v supply. It is rated at 300mA and switches the IGBT 10x faster than before. The brick was £25 - which is only a bit more expensive than the original DC/DC converter.

Previously the IGBT was being switched on with +15v but switched off with 0v - so the on to off transition was fairly slow. I'm now using -15v to switch off. The 3102 high side driver is connected to the IGBT via a 100R resistor which allows 300mA to flow. The switching waveform on the scope is significantly cleaner than before and the circuit generates a lot less heat.

Si


----------



## ga2500ev (Apr 20, 2008)

So would something like this core be the right idea?

http://cgi.ebay.com/Large-Toroid-Co...tem&pt=LH_DefaultDomain_0&hash=item2a045065f4

Also would a wire gauge ampacity chart such as this one be appropriate?

http://www.cerrowire.com/default.aspx?id=46

Thanks!

ga2500ev


----------



## jackbauer (Jan 12, 2008)

That would work but you'd be hard pressed to fit enough wire of sufficient gauge onto that core working by hand. Not trying to put you off just giving benefit of my experiences. Do yourself a favor and find a welding equipment shop or repair outfit and buy one of their scrap high frequency inverter welders or plasma cutters. You'll not only get the transformer (which will operate as your inductor) but things like heatsinks , fast recovery diodes , smoothing caps , rectifiers etc. Its a charger in a box just add the sparkfun board.

Simon have you got a rs part number for that psu?


----------



## SimonRafferty (Apr 13, 2009)

For the freewheeling diode, I'm now using one of these: 40A Insulated Base Diode
Originally I had 4 x 8A diodes in parallel. I guess because they were not perfectly matched, one was taking more current than the rest and it failed with a bang!

The new +/-15v PSU is here 664-1389

I have made another 'improvement'
Jack had added a routine which spits out status information via serial RS232. I bought a SparkFun Serial LCD 16 x 2 Character and modified the code so that it displays the pack voltage while you are driving and some charging status info while charging.

I used it to replace the LCD clock in the dash of the truck.

For the future I have a Garmin GPS 'Mouse' (A GPS module that just spits out RS232, no display or anything else). I would like to use the information along with the motor current to work out remaining range.


----------



## ngrimm (Oct 19, 2007)

Great job gentlemen! I can seen now that this would be a better solution for for my LA floodies than the dumb charger. I have been been using PIC Micro devices for a short time on some other pwm projects and I already have the programmer/debugger (pickit2) and a two line LCD. I looked at the code you attached and of course it doesn't look much like the Pic assembler code I am familiar with. I am thinking about building everything but the controller section and hooking up a Pic to manually control the pwm for starters. Has anyone started duplicating the routine to PIC code?


----------



## SimonRafferty (Apr 13, 2009)

Porting to PIC would be a good plan - although people seem to be moving from PIC to Arduino or Sanguino these days as they deliver much more 'bang for your buck'.

Why don't you use a BASIC compiler for the pic - then you should be able to paste the code and only need to change the calls to LCD, ADC's, PWM and switching pins on and off?

The reason for writing it in BASIC was just because it's easily Human-readable and easy for someone with no programming experience to understand and tinker with.

I think if I were starting again with the project, I would probably use a small Arduino board and one or two of the serial LCD's - but PIC would be just as good.

If you need any help or explanation - just ask!

Si


----------



## jackbauer (Jan 12, 2008)

Nice work Simon! Are you publishing the code? Started messing about with an arduino myself only last week have to say i enjoy it. I should have mentioned the fun i had getting the avr board to talk to a sparkfun serial lcd. Seems the avr board inverts the signals on the 9 pin d socket but not the sil header. Got a few more grey hairs on that one!


----------



## SimonRafferty (Apr 13, 2009)

Yup - but I was intending to add a little text editor so you can change the messages it flashes up - after all, you probably don't want "X-Eng E-Lander" & "Built April 2009" displayed!

The code needs a bit of in-line documentation too. 

I'll post up the source and the compiled code which can then just be blown on to the microcontroller using the free software.

Si


----------



## ngrimm (Oct 19, 2007)

This is really neat stuff. I may have missed but I wonder how many features of a killowatt meter could be included on this charger. Maybe a menu choice to allow your current per kwh cost as a variable used in calculating total cost per day, month year etc. Not sure if the current micro has the necessary memory etc for the extra lines of code though. Not necessary but kinda handy for justifying to the spouse why yer buying more tools. I know I'm getting carried away.


----------



## SimonRafferty (Apr 13, 2009)

Plenty of space in the processor for adding functionality. I have adding a GPS in my sights - which leads to all kinds of possibilities in terms of in vehicle instrumentation.

After all, while you are driving, the charger isn't doing much - but it is connected to your battery string so you might as well use it for something!

Today was my first trip to work using the voltage display. The regenerative braking makes a much bigger difference than people make out - which I'd never been able to see before. Seeing that I'm not running on the electric equivalent of 'vapour' on the way home meant that I could drive it a lot harder. When you leave it in 'High Power' mode, it delivers 400A @ 180v - 72kw / 96 Bhp - and it performs rather well. Much more fun than the donor vehicle ever was!

Si


----------



## ga2500ev (Apr 20, 2008)

SimonRafferty said:


> Porting to PIC would be a good plan - although people seem to be moving from PIC to Arduino or Sanguino these days as they deliver much more 'bang for your buck'.
> 
> Why don't you use a BASIC compiler for the pic - then you should be able to paste the code and only need to change the calls to LCD, ADC's, PWM and switching pins on and off?
> 
> ...


Actually for the PIC JAL would be an excellent choice:

http://code.google.com/p/jallib

Tons of libraries, works with lots of PICs, high level code, should not be too difficult to translate from BASIC.

There's even a jaluino project that can be found here:

http://justanotherlanguage.org/content/jaluino

While I like the idea of the arduino I find there's a challenge leveraging the platform over multiple projects due to cost. Check out SparkFun's arduino price page for example:

http://www.sparkfun.com/commerce/categories.php?c=103

But looking at a bunch of PIC prototyping boards, that's starting to look par for the course. I now know why I always wire wrapped my projects.

ga2500ev


----------



## MozRover (Sep 19, 2009)

I have built a charger based on the designs from Simon and Jack. So far I have only taken it up to around 6 amps (my pack is 20 x 12 = 240v). The house has 3 phase power, and I was wondering if I could rectify the three phases into the smoothing input capacitors. I'm not very good with analog stuff - much more comfortable with the programming side. The coils I am using are pretty small - two of the 150mH units from Coil Winding Specialist (part number E70340-015) in series. Any advice? Will using 3-phase improve anything?


----------



## SimonRafferty (Apr 13, 2009)

Unless your batteries are quite big (Ah wise), you probably don't want to be charging above about 1/10C (the Ah Rating / 10). There are exceptions to that - but I would ask the battery manufacturer what they recommend. You don't want to cook the batteries for sake of charging them a bit quicker!

You can easily rectify 3 phase into DC - but then you are getting in to seriously high voltages. It becomes harder and harder to find DC rated components as the voltage rises.

If you possibly can - I'd stick to 240v which rectifies to about 360v, so plenty for your 240v pack which you will be charging to a peak of 294v.

You could always use a cooker point as the supply - they are generally rated to 30A?

Si


----------



## jackbauer (Jan 12, 2008)

I'm looking at 3 phase input options. It works out to about a 720vdc bus giving a min charge voltage of 72v. Would require a 1200v igbt and diode. Possibly uprated insulation in the inductor.


----------



## MozRover (Sep 19, 2009)

Well, the twenty are 180Ah golf cart/floor sweeper batteries (total weight is over 850kg) so the c/10 rate would be 18A. I was not thinking I would achieve higher voltages rectifying 3 phase, as each phase is still only 240Vac to neutral. (like shown here http://sub.allaboutcircuits.com/images/03269.png)
Rather I hoped for smaller ripples, so my little inductors were adequate, and maybe an improved power factor? When using the charger at 6amp output from 240vac , the plug heated enough to melt one side of the AC socket, which was rated to 16A. I have not measured the input current, but I guess it must be pretty high and I'm wasting a lot of energy. 
I'm really unsure about this 3 phase business, but as I cannot find proper sized inductors, I thought it worth exploring.


----------



## SimonRafferty (Apr 13, 2009)

I think the issue may be that the mains voltage is only high enough for a small part of the cycle so it is drawing nothing from the mains until the voltage rises above 294v.

The mains is only above 294v for 30% of the time. Therefore, the peak mains current will be 19.8A

A better solution is to replace the buck circuit that I have used with a boost converter which multiplies the max voltage. I posted a circuit I've used before towards the start of the thread.
http://www.diyelectriccar.com/forums/showpost.php?p=142384&postcount=24
A simpler solution might be to split the battery string in two and charge the two strings in parallel at 147v. Use two Anderson connectors - one for each string. Either the charger or the motor controller can be plugged in to them - one wired in series and the other in parallel. Anderson connectors can bolt together to make a single, directional multi-pole plug.

Si


----------



## MozRover (Sep 19, 2009)

Hi Simon, I saw that boost circuit back in February, when I first came across this thread, and I still don't understand it. The biggest mystery to me is how the inductors boost the voltage. But I am confused even at the start: is the input AC or DC? If AC, how do you synchronize the signals A and notA to the input wave? 
I do appreciate the help and ideas. I can get my mind around splitting the pack in two for charging a lot more easily than I can these analog circuits.


----------



## ga2500ev (Apr 20, 2008)

MozRover said:


> Hi Simon, I saw that boost circuit back in February, when I first came across this thread, and I still don't understand it. The biggest mystery to me is how the inductors boost the voltage. But I am confused even at the start: is the input AC or DC? If AC, how do you synchronize the signals A and notA to the input wave?
> I do appreciate the help and ideas. I can get my mind around splitting the pack in two for charging a lot more easily than I can these analog circuits.


Take a look at this simpler model:








from this maxim applications note:

http://www.maxim-ic.com/app-notes/index.mvp/id/2031

The basic idea is that the switch is used to charge the inductor. When the switch is opened, the inductor will attempt to keep the current flowing at the same rate as it was charging. However the switch cuts off the current flow path. So the only path that is left is through the diode. Note that the other end of the inductor is attached to the positive input voltage. Therefore the voltage through the diode and the cap will be higher than the input voltage. The energy is "squeezed" through the diode at a higher voltage than the input.

To answer your questions:

Input is DC in both instances.

There is no input wave, so there is nothing to syncronize. You simply PWM A and Not A. In that circuit one side or the other will squeeze energy into the cap while the other is charging.

Hope this helps,

ga2500ev


----------



## MozRover (Sep 19, 2009)

Thank you ga2500ev, I now understand how that circuit boosts voltage out - the magic is in the inductor, a component I understand not at all. Is it the case that in this scheme a bigger inductor is better? If so, I am back to the original problem (I think) of my charger - a smallish inductor.
Or perhaps Simon is correct and the issue is much simpler: the rectified voltage from 240vac is too low, and the batteries' internal resistance too high for this charge to push much current through the whole pack. I will try charging a subset of 8 of the 20 and see how high I can push the current. Though even if that works, it will mean pulling and pushing anderson connectors every night.


----------



## SimonRafferty (Apr 13, 2009)

>Though even if that works, it will mean pulling and pushing anderson connectors every night.

There are worse things in life!

You could achieve the same with a few contactors?

A bigger inductor is not really better - there is an optimum size where bigger does not give an improvement. The reason is that it takes a finite time to charge and to discharge. The time taken is largely down to the inductance. If you are switching at a certain frequency between charge and discharge - you only need an inductor big enough to charge sufficiently in the time allowed and likewise discharge. A bigger inductor at a given frequency will not store any more energy.

It's a bit like filling a bucket from a tap then pouring it into another tank and doing this once a second. If the bucket is too small it will overflow while filling it and you will not transfer the max. If it's the right size, you will transfer the max. If it is bigger, you won't reansfer any more in the time allowed. Hence the right size is optimal - bigger is just a waste of copper!

Si


----------



## teraamper (Nov 18, 2009)

Hello
I am a beginner in programming. I built STK200 programmer. But I can not program the .MBAS file. Can you create a .hex file of last FW with galvanic separation.
Please.


----------



## MozRover (Sep 19, 2009)

I tried charging just 12 (out of 20) batteries and was indeed able to push higher currents. Forgot I had a 10A ATC fuse on the mains input - blew that and then a 25A replacement. A 30A let me get up to about 12A on the output, but then I way overshot (adjusting the PWM manually) and let the magic smoke out of the IGBT. 
I decided that was enough experimenting for the day and reconnected the whole pack of 20. After repairing the charger, I tried adding a final stage of charging 10 minutes at 1A. Well, I walked away for a few minutes, and wouldn't you know, my wife finds me to report she heard a loud pop, "probably towards the rear of the car."
I couldn't see anything, but only 12 of the 20 are easily viewed (8 are under the rear deck enclosed in steel boxes) The pack was still showing continuity, so I drove it about 2 miles without incident. On return, I saw acid dripping from the right side box drain hole. I had to remove all 16 rear batteries (85lbs each) and found that cell number 1 (neg terminal) of the battery I named 'D' had blown its top
(http://www.staarcom.com/EV/DiscoveryConversion/2010-06-05/picts/2010-06-05_19.28.52.JPG)

I cannot explain how this happened - thoughts? The battery still 'works' but is not ideal in mobile applications, perhaps for a solar system bank.
I'm going to take advantage of the batts' removal to change the rear coil springs, which will not happen until August, so no more 'experimenting' for some time.


----------



## adamj12b (May 4, 2009)

If something arc'ed in the battery box during charging, it would cause the hydrogen to ignite and blow the top of the battery off.... I know this from experience. it is incredibly loud when it happens too. So im guessing having the batteries buried muffled it. Mine sounded like a shot gun.

-Adam


----------



## SimonRafferty (Apr 13, 2009)

My guess would be hydrogen generated while charging being ignited by something - possibly a loose connection or the commutator in a motor.

I once blew the top off a big battery by switching on a fan to blow the fumes away to stop them exploding! Doh! <make mental note to switch fan on first!>

Si


----------



## MozRover (Sep 19, 2009)

Well, if it wasn't hydrogen igniting, but simply pressure from off-gassing during charging, the rate of gas being produced must be extraordinary indeed. And at 1 amp, that seems unlikely. 
What I cannot determine is the source of ignition. The fissure in the top of the battery seems to indicate that only the first cell was involved, so what happened in that cell to ignite the H? I cannot say for certain the level of the acid before the incident, but the levels of the other cells were fine (well above the plates) leaving little volume for gas buildup. Perhaps it was this lack of volume, creating higher pressure faster, enough to ignite H, a la diesel.
Or could a loose connection (seemed tight enough to me when I un-did it) at the terminal cause an arc igniting H outside the cell and carrying the 'burn' through the filler-cap's vent hole to the H inside the cell?
I worry that without knowing the cause, I cannot be sure to prevent another incident. And I have terrible luck with batteries. 
I have 7 weeks to chew on this one...


----------



## aeroscott (Jan 5, 2008)

I've had this happen on charging with a loose connection . what a bang ! acid everywhere .pure O2 and H2 in a perfect mix !


----------



## SimonRafferty (Apr 13, 2009)

I think there may be a clue in your reply!

If all but one cell was full and they are all producing hydrogen and oxygen, there will be more of it in the less full cell. The gasses build up in the area around the battery and when it ignites the flame tracks back to the cells through the vents. The small amount in the full cells is insufficient to do damage - but the amount of gas in the less full cell was enough to blow it apart.

The ignition source could be several feet from the battery depending on the conditions.

The fan that ignited my battery was about three feet away.

Si


----------



## peggus (Feb 18, 2008)

If your water level is low you can get arcing across the top of the plates, with the right oxygen hydrogen mixture, the cell goes pop.


----------



## ngrimm (Oct 19, 2007)

I love these diy projects. I am starting with two strings of 72 volt floodies on my 71 Toyota pickup conversion. My batteries are rated at 85 ah so with peukert maybe 85 ah total and charging 1c would only be 8.5 amps right? Would it make sense to make changes to the charger to run it from the 120 volt ac line? If so, would I still need to use a full way rectifier?


----------



## Amberwolf (May 29, 2009)

1C on 85Ah is 85A. (1 x capacity)

0.1C is 8.5A. 

The rest of the questions I don't know the answers to.


----------



## moxncal (May 26, 2010)

hey wouldn't it be cheaper to just buy a arduino board with the added shields and tweeking a few things on the shields?


----------



## jackbauer (Jan 12, 2008)

Ok few updates on the charger. Now running at 30amps on bulk charge but I've been fighting a persistent bug for the past few months. At completly random times the charger would turn itsself off. ie the sparkfun board would return to the main menu. Over the past few weeks its been a real problem. So yesterday i resolved to fix it. Sat for an hour couldnt get it to fail. Eventually penny dropped. I was testing with the cover off. Put cover back on problem returned. Lots of head scratching then realised that it was the same shutdown as pressing the center button. So the board was picking up noise and randomly triggering a center button press. Did a quick software mod to remove the center button check when on charge no more shutdowns!!

Simon , any progress on the new code with the lcd?


----------



## Jan (Oct 5, 2009)

Jack and/or Simon, what do you think of this option: Build the non-isolated version, with a few imporvements you two added. But not the isolation modification. Instead of the ATMEGA-128 use a PICAXE and isolate only the rs 232 interface, and use an arduino via this serial interface to control it?


----------



## jackbauer (Jan 12, 2008)

Could be done but the rs232 would need to be opto isolated to be safe. Not a bad idea.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> Could be done but the rs232 would need to be opto isolated to be safe. Not a bad idea.


Yes, and opto isolation of rs232 is relativly cheap and easy.


----------



## SimonRafferty (Apr 13, 2009)

Jan said:


> and isolate only the rs 232 interface, and use an arduino via this serial interface to control it?


That's a good idea (someone  suggested it way back in this thread too).
The isolation is a good plan for general safety - but it doesn't make it work any better!

I think if I were beginning this now, I would use a simpler microcontroller in the charger, an opto-isolated RS232 link and a terminal with an nice LCD that lives in the car from which the charger is controlled. This can then provide instrumentation while you are driving. 

I've been planning a speed controller with integrated charger for my next project (still a couple of years away). I'll probably do it that way. It will be open source too so everyone can pull it apart!

Jack - good news on the centre button! I had a similar thing but where the plastic case was expanding physically pushing one of the buttons on the board!

The remote serial LCD is going very well! It's nice having a volt-meter!



> hey wouldn't it be cheaper to just buy a arduino board with the added shields and tweeking a few things on the shields?


When I started building this, I looked around for the most cost effective microcontroller solution. This one won because it was good value and had everything ready assembled on a nice little board.

As time goes by, there will be more and more, better solutions - possibly including yours. That's the nature of an open source project though - you can adapt it to your requirements and change as the the technology improves.

I really like the Arduino / Shield system and have used loads of them for other things. 

Si


----------



## Jan (Oct 5, 2009)

SimonRafferty said:


> Now, I have a pair of relays which are operated by the small relay on the microcontroller board (coils connected in parallel) such that the pre-charge resistor is shorted when the battery string is connected. This saves building any additional relay drivers for the uController. It also means that the pre-charge has a minimum of 5 seconds to charge the capacitor. I'm using a 1k 10w wirewound resistor for the pre-charge.


Hi Simon, I don't understand what you mean by this improvement.


----------



## SimonRafferty (Apr 13, 2009)

Jan said:


> Hi Simon, I don't understand what you mean by this improvement.


Originally, the circuit had transistor drivers for two relays. The first connects the battery to the IGBT and the second shorts out the pre-charge resistor.

The circuit uses a big capacitor for smoothing. If you just connect the rectified mains to the capacitor, when you switch on the circuit, you get a huge inrush current as the capacitor charges up. To limit this, you put a resistor between the mains and the capacitor which limits the max current to say 1A. Once you have allowed enough time for the capacitor to fully charge - you short out this resistor with a relay which means that the circuit can now draw more current than the resistor would otherwise allow.

It occurred to me that both these relays could switch at the same time - so don't need to be controlled separately. Furthermore, the microcontroller includes a small relay. Too small to switch the main power - but big enough to switch the coil current for a pair of bigger relays.

It's an improvement because it saves two transistors, a few resistors and a bit of complexity for no loss in function.

Si


----------



## JRoque (Mar 9, 2010)

Hello Simon,

Great thread and thanks everyone for your contributions. May I suggest that you update the first post (or one in the first page) with the latest diagram and code? That way someone interested in building the charger won't accidentally pick up an outdated version - or have to sift through all posts to find the right one. Keeping a short change log on that first post would be nice, too.

I haven't finished reading all posts but, did you decide to go without transformer isolation? If so, perhaps a word of caution can also be added to the front page stating that touching either output pole might cause a tingling sensation 

Are there any plans to cut a PCB that others can buy to make the build easier? Or maybe provide the layout/CAD?

Regards,
JR


----------



## Snakub (Sep 8, 2008)

Simon do you have plans for a 110 volt version?


----------



## jackbauer (Jan 12, 2008)

The design as it is will run on a 110ac input. However you'll be limited in the maximum pack voltage you can charge. I'd guess 84v max. If you needed to go higher then the circuit could be rearranged into a boost config instead of buck which is sort of what manzanita do.


----------



## Jan (Oct 5, 2009)

SimonRafferty said:


> Originally, the circuit had transistor drivers for two relays.


OK, I think I understand. Would you like to check the attached circuit. If I've collected all your improvements in the non-isolated version? And I added an DC option my self for solar. Can you check that too?


----------



## teraamper (Nov 18, 2009)

hello
Is there eny manual for the setup voltage and curent, in the original version of charger.
Ok I already know how

But now I have another problem

If I upload FW 4, I have no pulse on pin9, for the IGBT.
If I upload FW3, it's alweys stuck in any point.
If I upload FW2, works perfectly, but no control for BMS.

*I humbly ask if anyone could upload the HEX file FW4* for the atmega128


----------



## teraamper (Nov 18, 2009)

OK
I get the FW4 in HEX file form the Jack Bauer.
Thanks a lot for thet.
Bat I have the same problem. I don't get any pulses fom the pin 9 to a IGBT.
What I'm doing wrong.
I'm set the charcger the same, as in FW version2


----------



## jackbauer (Jan 12, 2008)

Have you tried the charger in "test mode"? If not try this and advance the pwm manually to see if its outputting.


----------



## teraamper (Nov 18, 2009)

OK
Now I have the pulses. 
Stupid me!
I have simulate teh current and is too high. When I decrese a current then is start with pulses.
Thank you wery much for the help.

Uros


----------



## ngrimm (Oct 19, 2007)

Has anyone had a chance to look at the circuit diagram that Jan graciously posted on the previous page? I noticed he is using a N channel fet as a high side switcher. Is that right? I am unable to read some of the details. Also is there a files section that could be used for these diy projects or do we have to go to the OP to get them? Thank you for all your good work on this.


----------



## The Toecutter (May 30, 2010)

jackbauer said:


> The design as it is will run on a 110ac input. However you'll be limited in the maximum pack voltage you can charge. I'd guess 84v max. If you needed to go higher then the circuit could be rearranged into a boost config instead of buck which is sort of what manzanita do.


​I'm thinking of doing just that. I'm still ordering parts for my EV, but the work done by you and Simon is excellent; the idea of modifying the design here to charge a 216Vdc pack off of 110Vac is appealing.


----------



## martinwinlow (Sep 22, 2009)

SimonRafferty said:


> ...
> 
> I think if I were beginning this now, I would use a simpler microcontroller in the charger, an opto-isolated RS232 link and a terminal with an nice LCD that lives in the car from which the charger is controlled. This can then provide instrumentation while you are driving.
> 
> ...


Simon,

You could use the SV2000 Serial to Composite RCA Video IC to allow a simple output to a small screen near the dash or, if you already have a suitable monitor in your dash, you should be able to input the RCA signal onto a 'Video In' connection. This system is used in Peter Perkins' BMMS project on the BVS forum... http://www.batteryvehiclesociety.org.uk/forums/viewforum.php?f=53 There are lots of his videos on YouTube... just search for 'retepsnikrep'.


There is however a possibly cheaper and more functional alternative, the Tellymate IC - http://proto-pic.co.uk/products/TellyMate.html

Regards, MW.


----------



## Jan (Oct 5, 2009)

Is this a IGBT that can be used?

http://cgi.ebay.nl/IGBT-Modul-FUJI-...pt=Bauteile&hash=item3a5f4a8b89#ht_1449wt_905

And this:

http://cgi.ebay.nl/IGBT-Modul-Mitsu...pt=Bauteile&hash=item3a5f3c3089#ht_1463wt_905

1200V and 150A sounds like a lot of power, but it also says Pc=960W. Does this mean it can handle 1200V, but only at 0,8A or so. And 150A at 6V?


----------



## jackbauer (Jan 12, 2008)

Jan , I've bought igbts from that ebay seller before and found him very reliable. The 150A part would be fine. The 960w refers to the maximum power disipation in the device as far as i'm aware and not its power handling capacity. As its a 2 pack you can use the low side as the freewheel diode.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> Jan , I've bought igbts from that ebay seller before and found him very reliable. The 150A part would be fine. The 960w refers to the maximum power disipation in the device as far as i'm aware and not its power handling capacity. As its a 2 pack you can use the low side as the freewheel diode.


Thanks, Jack. I'm collecting the parts now. I've desided to stay under 300 volts, so, a home made version should be possible. Well, only if I survive this.

Do you know a source for a gate driver, too?


----------



## jackbauer (Jan 12, 2008)

I'd recommend the ACNW3190 driver. Its available from radionics.
http://radionics.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6935895

I have a few spares if your stuck .........


----------



## Jan (Oct 5, 2009)

It has an optocoupler. In my non-isolated version that is not really necessary. But it will not hurt either. Or not?

I’d be happy to take a spare, if you don’t have any purpose for it. Name your price. 

With freewheel diode you mean the Fast Diode in Simon’s circuit?


----------



## jackbauer (Jan 12, 2008)

Its no harm to have an opto. Why have you decided to go non isolated? Don't worry about money i got 5 free as samples from a distributer. Shoot me a pm with your address and i'll pop 2 in the mail during the week.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> Its no harm to have an opto. Why have you decided to go non isolated? Don't worry about money i got 5 free as samples from a distributer. Shoot me a pm with your address and i'll pop 2 in the mail during the week.


Not desided yet. But the first version will be non isolated. 

The idea is that the charger works unattended, but has an opto isolated serial interface with the dashboard computer.

A pm is on the way.


----------



## JRoque (Mar 9, 2010)

> I've desided to stay under 300 volts


Hi. If you have a choice, go for a lower voltage, higher current IGBT modules then. A 600V/400A should cost about the same and give you that much more current handling capacity.

JR


----------



## Jan (Oct 5, 2009)

JRoque said:


> Hi. If you have a choice, go for a lower voltage, higher current IGBT modules then. A 600V/400A should cost about the same and give you that much more current handling capacity.
> 
> JR


Hi JR, I want the highest voltage possible with 230Vac. Voltage is better than current.


----------



## Jan (Oct 5, 2009)

How important is the inductor? It's hard to find a right sized inductor with nearly enough amps.

Does the capacitor not the same job? Or the batteries themselves?


----------



## SimonRafferty (Apr 13, 2009)

Jan said:


> How important is the inductor? It's hard to find a right sized inductor with nearly enough amps.


Very Important! Suitable inductors are available off the shelf from many suppliers. The actual value is not that critical so long as it's not too small. Too big is not a problem, just costs more.

You could always wind your own if you get really stuck? Just some copper wire and a ferrite core.

Many low cost multi-meters will measure inductance - which means you can make your own by trial & error!

Si


----------



## Jan (Oct 5, 2009)

SimonRafferty said:


> Very Important! Suitable inductors are available off the shelf from many suppliers. The actual value is not that critical so long as it's not too small. Too big is not a problem, just costs more.
> 
> You could always wind your own if you get really stuck? Just some copper wire and a ferrite core.
> 
> ...


Hi Si,

You calculated a minimum of 6mH if I remember correctly? And they can be placed in parrallel to increase amps? 

What about these:
http://cgi.ebay.nl/ws/eBayISAPI.dll...63012&ssPageName=STRK:MEWAX:IT#ht_3408wt_1139

I don't know if Pulse is the name of the supplier, or that a pulse inductors is a different kind of inductor. I know not much.


----------



## SimonRafferty (Apr 13, 2009)

You can connect inductors in parallel - but the total inductance is given by:

Lt = 1/(1/L1 + 1/L2)

So, to give 6mH, you would need two 12mH inductors in Parallel.

So, yes, a pair of the 20mH inductors on eBay would give 10mH which should be enough.

One thing to bear in mind, IIRC JackBauer reduced the switching frequency? This in turn increases the size of inductor you need pro rata.

Si


----------



## Jan (Oct 5, 2009)

SimonRafferty said:


> You can connect inductors in parallel - but the total inductance is given by:
> 
> Lt = 1/(1/L1 + 1/L2)
> 
> ...


Thanks Si.

Anyone knows if this oldtimer is able to analyze the output:

http://verkopen.marktplaats.nl/photopopup/384225222/1

I really know next to nothing.


----------



## jackbauer (Jan 12, 2008)

Yeh my charger is running at 16khz. I had to do this to accomodate the rather old fuji igbt i used.My inductor is a transformer from a high frequency plasma cutter. I think it measured something around 25mH. A good source for ferrite inductors are scrap inverter welders. Have a look in your local phone book for welder repair shops and call in with cash!

On another note I was told some time ago that a laminatd core inductor would work fine in this application. The reason being that the current in the inductor never reverses direction and hence no eddy currents are induced in the core. Sadly i've not had time to date to test this theory.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> Yeh my charger is running at 16khz. I had to do this to accomodate the rather old fuji igbt i used.My inductor is a transformer from a high frequency plasma cutter. I think it measured something around 25mH. A good source for ferrite inductors are scrap inverter welders. Have a look in your local phone book for welder repair shops and call in with cash!
> 
> On another note I was told some time ago that a laminatd core inductor would work fine in this application. The reason being that the current in the inductor never reverses direction and hence no eddy currents are induced in the core. Sadly i've not had time to date to test this theory.


I remember you posted your plasma cutters discovery. But I can't find something like that in my neighbourhood. 

I'll try to find the best frequency for my igbt, with a oscilloscope, and then look for apropiate inductors. Or do I need an inductor right away?


----------



## Jan (Oct 5, 2009)

This oldtimer 

http://www.radiodatabase.nl/meetapparatuur/philips/GM5603/GM5603.pdf

is up to 14Mhz. That should be enough?


----------



## adamj12b (May 4, 2009)

Jan said:


> I'll try to find the best frequency for my igbt, with a oscilloscope, and then look for apropiate inductors. Or do I need an inductor right away?


An inductor will work at any frequency. They just work better at high frequencies. You will need an inductor that can take the full current that you plan to put out, continuously. The higher frequency that you run the output buck converter, the smaller in mH the inductor needs to be. 

You could actually use a good size motor and run that in place of the inductor and batteries to work out the max switching frequency to get an idea of what you need. Then it would just need minor tweeking when you get the actual inductor.

-Adam


----------



## Jan (Oct 5, 2009)

adamj12b said:


> An inductor will work at any frequency. They just work better at high frequencies. You will need an inductor that can take the full current that you plan to put out, continuously. The higher frequency that you run the output buck converter, the smaller in mH the inductor needs to be.
> 
> You could actually use a good size motor and run that in place of the inductor and batteries to work out the max switching frequency to get an idea of what you need. Then it would just need minor tweeking when you get the actual inductor.
> 
> -Adam


Thanks Adam.

I just received my IGBT. And my bid on this russian beaty is accepted as well.

The IGBT is from an inverter. Like Jack said, I can use the diode of the low side as freewheel diode. But if I can find two others. I've the heart of an prety powerful AC controler. It's 150A continues, that is I guess, in a sine wave, aprox 100A? But since you nead 3 of these bricks, thats 300A out. At almost any voltage. At 650V that is e.g. 195kW continuasly. That can't be right. I must be mistaking.


----------



## Jan (Oct 5, 2009)

That 400V varisistor (I think it's called a bleeder?) seems to me prety useless in my case. The rectifying diode in the IGBT take care of that. Or not?


----------



## Jan (Oct 5, 2009)

Si, you choose a 20A max relay to control the inrush current of the cap. Is that limiting the total amps to 20A? Or is the current in that part not as high as in the main circuit?


----------



## Jan (Oct 5, 2009)

Jan said:


> That 400V varisistor (I think it's called a bleeder?) seems to me prety useless in my case. The rectifying diode in the IGBT take care of that. Or not?


No, that doesn't make any sence. What's the function of that 400V varisistor? Help.


----------



## jackbauer (Jan 12, 2008)

The varistor is there to absorb any high voltage spikes that may exceed the Vce max of the igbt.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> The varistor is there to absorb any high voltage spikes that may exceed the Vce max of the igbt.


Aha. So it must be in between 400 and 1000 volts. With as much amps I can find. 

It'a bit difficult to find the parts, since the dutch version of RS components is only for companies. Just found a new 500V 220uF on ebay.


----------



## Jan (Oct 5, 2009)

Is it normal the multi-meter measures only 199V over the rectifier bridge from 220Vac?


----------



## jackbauer (Jan 12, 2008)

Is there a smoothing capacitor after the rectifier? If not then the meter would be confused by the full wave rectified ac.

Simon , did you ever finish the little in car display addon for the charger?


----------



## peggus (Feb 18, 2008)

jackbauer said:


> ...
> 
> On another note I was told some time ago that a laminatd core inductor would work fine in this application. The reason being that the current in the inductor never reverses direction and hence no eddy currents are induced in the core. Sadly i've not had time to date to test this theory.


Laminated core may work fine, the thinner the laminations the better. However, eddy currents are caused by the AC component of the current regardless of the presence of a DC offset. 

If there were really no eddy currents then you might as well go with a solid chunk of iron....There is however a good reason for why even the cheapest power supplies use powdered or laminated cores in their DC chokes.


----------



## peggus (Feb 18, 2008)

Jan said:


> Hi Si,
> 
> You calculated a minimum of 6mH if I remember correctly? And they can be placed in parrallel to increase amps?
> 
> ...


20A at 100Ohm????? That's 40kW of dissipation in the inductor. I think they probably meant 20mA


----------



## Tesseract (Sep 27, 2008)

peggus said:


> 20A at 100Ohm????? That's 40kW of dissipation in the inductor. I think they probably meant 20mA


The "inductor" in question here is actually a current transformer... 

See, for example, PE-51687 at Mouser.

20A through a single turn through the hole in the center will induce 200mA through the 100 turn secondary. BTW - never allow current to pass through the primary without a load (or "burden") on the secondary otherwise a dangerously high voltage will be created (probably resulting in internal arcing).


----------



## Jan (Oct 5, 2009)

Tesseract said:


> The "inductor" in question here is actually a current transformer...
> 
> See, for example, PE-51687 at Mouser.
> 
> 20A through a single turn through the hole in the center will induce 200mA through the 100 turn secondary. BTW - never allow current to pass through the primary without a load (or "burden") on the secondary otherwise a dangerously high voltage will be created (probably resulting in internal arcing).


Thanks for the warning Tesseract, but couldn't you just react a few days sooner. Becaus I don't need transformers, I need a powerful inductor.


----------



## Jan (Oct 5, 2009)

peggus said:


> 20A at 100Ohm????? That's 40kW of dissipation in the inductor. I think they probably meant 20mA


They measure 1.3 Ohm. 

So, let me try to understand what that means: 
U=I*R
U=20*1.3=26V
P=I*U
P=20*26=520W

Is that correct? That's still a lot of dissipation power. Prety useless.


----------



## Jan (Oct 5, 2009)

But with 3 paralel and at a more realistic 16A this leads to a 5.3A per inductor.

U=5.3*1.3=7V
P=5.3*7=37W

That could work?


----------



## martinwinlow (Sep 22, 2009)

Hi Simon, Jack etc,

I'd like to put a parts list up on Google Docs for the benefit of all and I gather (having now read all the way through this thread) that the parts have changed a bit. Can I have a definitive list and I'll put it on GD? I plan to make a charger following your plans and it would be nice to have a full list of support documents in Google Docs, schematics, PCB layouts, parts lists, hex code and a description of the circuit as well as a guide to assembling and using the completed charger. If someone could post them on GD or let me have some basic text and I'll do it - it would be great.

As I have a PIC programmer and some experience with them from Peter Perkins' BVS BMMS, I plan to use one instead of the ATMEGA along with the remote monitor/tellymate chip I mentioned in an earlier thread. Some others have mentioned PICs or PICAXEs at least, has anyone got anywhere with transcribing (or whatever it's called) the code?

Lastly, great job you have all done on this project - there must be some very depressed charger manufacturers out there.

Regards,

MW
evalbum.com/2092


----------



## Jan (Oct 5, 2009)

> Can I have a definitive list and I'll put it on GD?


You can start with the last list Simon published. But you've te see it as a guide line, not an exact list. It also depends on what you can get, and what power you eventually want to have.

I'm still collecting. I was able to send the 'inductors' back to the german supplier, and got all of my money including the shipping back. That was really good service. And today I received a little dc/dc converter from china. 

I'm still waiting on a 500V capacitor from Ireland. The ebay seller send already another one, because the first one never arrived. But I'm getting a bit afraid nothing will come from Ireland to the continent. The dc/dc converter from china was quicker. And I hope our Jack will send me a ACNW3190, but he's also from Ireland...


----------



## Jan (Oct 5, 2009)

Correction: The capacitor arrived. So, I can test tonight the pre-charge circuit, and see if I have 300+VDC at my disposal. If I don't come back in a few days, check the news.


----------



## SimonRafferty (Apr 13, 2009)

Sorry I've not been on here for a while - too many projects!

If you need Capacitors, I have loads left over - mostly 450v 3300uF but all of them are in that ball-park. I listed them as well as IGBT's on eBay a while back but had no takers!

My company ships world-wide every day so that wouldn't be a problem.

I have the remote LCD working nicely. Unfortunately the code is not on this PC so I'll have to remember to post it when I get home.

As others have mentioned, there is no definitive list of parts, but everything required to build a working charger is already listed on here - even if you have to hunt for it.

The latest circuit is this one: http://www.diyelectriccar.com/forums/showpost.php?p=177564&postcount=157

Si


----------



## Jan (Oct 5, 2009)

Hi Simon,

Do you know if this is a proper gate driver:

http://cgi.ebay.nl/UCC27322-Gate-Dr...ultDomain_0&hash=item27b67fa76d#ht_2300wt_905

It's not opto isolated, but I don't really mind. My plan is to opto isolate an 'embeded' picaxe.


----------



## SimonRafferty (Apr 13, 2009)

Structurally it is very similar to a 3120 (the driver I used) - but it appears to be able to deliver higher current which, so long as the DCDC converter used to drive it can supply the current, will reduce the switching times.

Give it a go!

Si


----------



## Jan (Oct 5, 2009)

SimonRafferty said:


> Structurally it is very similar to a 3120 (the driver I used) - but it appears to be able to deliver higher current which, so long as the DCDC converter used to drive it can supply the current, will reduce the switching times.
> 
> Give it a go!
> 
> Si


Thanks! My DC/DC converter is 6W, should be enough?


----------



## valerun (Nov 12, 2010)

SimonRafferty said:


> If you need Capacitors, I have loads left over - mostly 450v 3300uF but all of them are in that ball-park. I listed them as well as IGBT's on eBay a while back but had no takers!


Simon & Jack - this is an awesome project. I am about to start building this charger, as well. Interested in your capacitors. Could you please send a link to the ebay listing you mentioned?

thanks!
Valery.


----------



## valerun (Nov 12, 2010)

Just ordered the components from DigiKey and Sparkfun. Total cost of all components - ~$250 for the latest schematics referred to by Si a few posts before this. This includes all the sensors, power supplies, inductors etc. Does not include minor parts like regular resistors, trimpots and small npn transistors etc. I expect these minor parts + enclosure to amount to $30-40 at local radio store. So total BOM is about $300.

One additional note - I will be building based on Arduino Uno USB board coupled with the coilor 128x128 LCD screen. This way I hope to avoid complicated programming setup (just upload from USB) and expand functionality of the display. Board + LCD is ~$70 from SparkFun

Finally, I will be planning to add some instrumentation logic to display drive-time parameters: Amps drawn, pack voltage, AH spent, Ah remaining, % capacity remaining, etc. 

One thing I haven't figured out yet is how to make this thing work off of 110V supply. Not critical since almost every house here in US has 230V mains but would be useful to have when traveling etc. Any ideas?


----------



## few2many (Jun 23, 2009)

valerun said:


> One thing I haven't figured out yet is how to make this thing work off of 110V supply. Not critical since almost every house here in US has 230V mains but would be useful to have when traveling etc. Any ideas?


You can get a 110v to 220v transformer or power supply.
Saw one at a pawn shop the other day, you could put in either voltage and get the other out. 
Also, I've worked on some equipment that has a simple transformer inside. Its a 110/220v trans that works either way. Just replaced one recently.


----------



## valerun (Nov 12, 2010)

few2many said:


> You can get a 110v to 220v transformer or power supply.
> Saw one at a pawn shop the other day, you could put in either voltage and get the other out.
> Also, I've worked on some equipment that has a simple transformer inside. Its a 110/220v trans that works either way. Just replaced one recently.


Yeah but I need one good for at least 5kw. I think a 60hz transformer at this power rating would be write heavy... Anybody knows if I can use a diode-based voltage multiplier at these power levels?


----------



## jackbauer (Jan 12, 2008)

Whats your pack voltage? If its less than say 120v it should work ok. If its more you would need to change the charger design from buck to boost so that it actually increases the output voltage.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Whats your pack voltage? If its less than say 120v it should work ok. If its more you would need to change the charger design from buck to boost so that it actually increases the output voltage.


My pack is going to be ~200V to start with. Just looked up the specs for our 110V mains here - it's a 15-20Amp rating so I can get away with 2kW up-converter. Not really sure how to change the design to boost so perhaps will go for the transformer after all...


----------



## jackbauer (Jan 12, 2008)

http://en.wikipedia.org/wiki/Boost_converter

Just means swapping the switch and diode. Probably not worth it in the long run.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> http://en.wikipedia.org/wiki/Boost_converter


If I'm not mistaking my Mitsubishi CM150DY is a bug/boost converter in a box.


----------



## Jan (Oct 5, 2009)

valerun said:


> ...inductors etc.


Hi Valerun, what is the partnumber of the inductor you ordered?


----------



## jackbauer (Jan 12, 2008)

You could actually use it as either. Depends which side you use as the diode. btw apologies for the delay on the driver chips i'll get em off to you tomorrow.


----------



## Jan (Oct 5, 2009)

jackbauer said:


> You could actually use it as either. Depends which side you use as the diode. btw apologies for the delay on the driver chips i'll get em off to you tomorrow.


Jack, now you're to late. They're on their way from the US of A.


----------



## valerun (Nov 12, 2010)

Jan said:


> Hi Valerun, what is the partnumber of the inductor you ordered?


Hi Jan. I got 2 20mH each rated for 20A I believe. Will connect in parallel for 10mH 40A max.

EDIT: sorry missed the part about the partnumber  here it is: 553-1547-ND


----------



## Jan (Oct 5, 2009)

valerun said:


> Hi Jan. I got 2 20mH each rated for 20A I believe. Will connect in parallel for 10mH 40A max.
> 
> EDIT: sorry missed the part about the partnumber  here it is: 553-1547-ND


 
Hi Valerun,

I'm affraid you've made the same mistake as I've. A little bit back in this topic, you can dicover I ordered exactly the same on ebay. They can't handle 20A as an inductor, but the wire through the hole may carry 20A. But that's not what we need.


----------



## valerun (Nov 12, 2010)

Jan said:


> Hi Valerun,
> 
> I'm affraid you've made the same mistake as I've. A little bit back in this topic, you can dicover I ordered exactly the same on ebay. They can't handle 20A as an inductor, but the wire through the hole may carry 20A. But that's not what we need.


Shoot. Thanks, Jan! So I will have to wind my own then. Any good source for cores?


----------



## MozRover (Sep 19, 2009)

When lasted I posted to this thread, I was dealing with a battery which exploded during the final stage of charging. Still no definitive source of ignition, but static electricity sounds as plausible to me as anything else. I now have a fan ducting air to each battery compartment while charging; hopefully that will keep H2 concentrations low enough.
However, the other issue with which I still have to contend is that my pack voltage is 240v. The charger has been running on single phase 240vac, yet the duty cycle starts at about 94% and spends a while at 100% before finishing. The house has 3 phase power, which I thought would be an easy way to boost voltage. Then I did some quick calculations and realized that most of the components would need to be upgraded to handle 700V, and that would be expensive. 
Then I did some thinking: what if I rectified each phase to neutral, instead of to each other? Then 450V capacitors can still handle the peak voltage, but the average rectified input would be higher, and never drop to zero (see graph).
1. is this correct? is it better than single phase?
2. will this cause my house neutral to drift?

Simon had suggested splitting the pack in two and charging in parallel (120v) which I was reluctant to do thinking it meant adding either more Anderson connectors or contactors. But then I thought: what if I charged each half in sequence. (I originally considered using twenty 12V chargers and ran 14ga wire to each battery, wires which are now used for my battery monitor, which recently showed one cell dropping to 9v four hours after charging, grrrr) So I could add a few relays to the charger and it could charge one half the pack, then switch and charge the other half all unattended. 
3. Should I worry about what will happen when it's not connected long enough to fully charge both halves?
4. Would alternating charging each half for, say, 10 minutes be better?


----------



## teraamper (Nov 18, 2009)

Hello
Well I put the charger on my protoboard. And now I hawe some questions.

Whay the pulsis constantly stoping, like on the video.
http://www.youtube.com/watch?v=sxtAo84m028

And the curent is always changing like on the video:
http://www.youtube.com/watch?v=UBEs2o04iRU

Is this normal operation or I have sam mistake on the circuit.


----------



## jackbauer (Jan 12, 2008)

If your running my latest firmware then yes the igbt shuts off every second to measure the voltage. Thus the circuit is running in discontinuous mode and the current will vary as you have seen.


----------



## teraamper (Nov 18, 2009)

Yes I have your FW. Thanks for the help.


----------



## Jan (Oct 5, 2009)

Maybe interesting info for others. I think the inductor can be a lot lower/simpler after reading this, in my case.

http://www.nxp.com/documents/application_note/AN10338.pdf


----------



## valerun (Nov 12, 2010)

Jan said:


> Maybe interesting info for others. I think the inductor can be a lot lower/simpler after reading this, in my case.
> 
> http://www.nxp.com/documents/application_note/AN10338.pdf


Interesting. I also found the following:
http://www.daycounter.com/Calculators/Switching-Converter-Calculator.phtml

Desired current ripple is what defines the value. Not sure though what current ripple is OK for this application. One article on switching power supplies I read said that 0.3 ripple is ok. Even with only 5% allowed ripple, the above calculator gives 1.5mH inductor value for 30A output current and 32kHz switching. Conveniently enough, the inductor I just wound on a ferrite core from the power cable filter is 1.6mH. 90 turns of 20-gauge copper wire.

My bigger concern is now an output cap value. Simon, in your circuit, you are using 1 microF. If I ask for 5% voltage ripple (which would be 10V at my output voltage of 200V), the calculator above gives me 50 microF requirement. Am I missing something? Is the 220uF cap you have right after the bridge compensating for that? Probably not given it's pre-switch... Anybody can explain this one?

Thanks!
Valery.


----------



## Tesseract (Sep 27, 2008)

valerun said:


> Desired current ripple is what defines the value. Not sure though what current ripple is OK for this application.


The tradeoff between ripple, inductor size, and operating mode (discontinuous or continuous conduction) is pretty complex. A good rule of thumb is to assume a ripple ratio of 0.4 and then go down from there if you can afford the inductor and/or you need to stay in continuous conduction.




valerun said:


> ...Even with only 5% allowed ripple, the above calculator gives 1.5mH inductor value for 30A output current and 32kHz switching. Conveniently enough, the inductor I just wound on a ferrite core from the power cable filter is 1.6mH. 90 turns of 20-gauge copper wire.


There are two huge problems here... one is certain - there's no way you're going to pass 30A through 20ga. wire for very long; the other is probable - a ferrite core for a power cable filter is both the wrong type of ferrite for this job as well as undoubtedly being way too small to support that number of amp-turns.

Switching power supply design is kind of difficult, Valery... it's what I've done for most of my career and it's what I've been most interested in every since I started tinkering with electronics as a kid. Buck converters are the easiest topology to get working, but you still have to do some work to determine the right inductor, capacitor, etc. 



valerun said:


> My bigger concern is now an output cap value.


No, your biggest concern is still your inductor. The output capacitor for a battery charger is almost irrelevant as the batteries themselves will act as the capacitor (assuming the switching frequency isn't too high or the inductor value too low).

That said, you do need to put something there to filter out spikes and ringing. Ideally a polypropylene pulse-rated capacitor (Wima MKP series comes to mind). The actual capacitance value isn't critical; what are important are the ESR, ESL and, most importantly, the ripple current rating. The latter is especially important if the charger will be left permanently connected to the battery pack as it will then be exposed to the reflected ripple from the motor controller (this is an oversight I've noticed in many chargers, including the every popular Zivan's. Elcons seem to be better in this regard, however). One easy fix for protecting the charger's output capacitor from the controller's ripple is to insert about 100uH of inductance in series with the charger's output (after the output capacitor, that is).


----------



## valerun (Nov 12, 2010)

Jeff - you are my hero on this forum. The amount of your own time you spend helping other people is just amazing. Thank you for all your expert input!!!



Tesseract said:


> There are two huge problems here... one is certain - there's no way you're going to pass 30A through 20ga. wire for very long;


eh, you are right. I got carried away a bit I guess ;-) Just did a little calculation - looks like I should be going for 10 or maybe 12 gauge... The good news is with current ripple of 40% I can reduce the turns to 10-15 and fit that into my little inductor. Hope this also takes care of the saturation issue (lower amp-turns...). Am digging through the net on how to measure saturation current...



Tesseract said:


> One easy fix for protecting the charger's output capacitor from the controller's ripple is to insert about 100uH of inductance in series with the charger's output (after the output capacitor, that is).


great point - thanks!

Will try a few things and will report back on progress

Valery.


----------



## Tesseract (Sep 27, 2008)

valerun said:


> Jeff - you are my hero on this forum. The amount of your own time you spend helping other people is just amazing. Thank you for all your expert input!!!


You're welcome, and thanks for the thanks. I do appreciate being appreciated 

A good site to get a first-pass approximation of the inductor size for a number of different topologies is:

http://schmidt-walter.eit.h-da.de/smps_e/smps_e.html

Keep in mind that the inductor in a buck converter mostly sees DC current, so it has to be gapped - either physically gapped or use a material with a distributed gap, like powdered iron, MPP, etc.

Same for that 100uH inductor to block the controller's ripple from making it into the charger (only needed if the charger is hard-wired to the traction pack at all times).


----------



## valerun (Nov 12, 2010)

Tesseract said:


> http://schmidt-walter.eit.h-da.de/smps_e/smps_e.html


thanks Jeff. Going through that now. 

OT: Kostov guys said you at evnetics might have some 11" 192V in stock? Do you think it's a good match for Soliton1 and a 60-cell pack?


----------



## valerun (Nov 12, 2010)

ebay to the rescue - found this - http://cgi.ebay.com/ws/eBayISAPI.dl...ssPageName=ADME:X:eRTM:US:1123#ht_1680wt_1379 - ~300microH 3 inch diameter iron core inductors wound using what looks like 8 or 10 gauge wire! Getting a few...


----------



## Weisheimer (May 11, 2009)

valerun said:


> ... ~300microH 3 inch diameter iron core inductors wound using what looks like 8 or 10 gauge wire! ...


Nice find, but just to clarify, those are ~300 milli-henry (mH) which is an order of magnitude greater than micro-henry (uH)
I think that you needed 25 mh at minimum, so those should do the trick.


----------



## valerun (Nov 12, 2010)

Weisheimer said:


> Nice find, but just to clarify, those are ~300 milli-henry (mH) which is an order of magnitude greater than micro-henry (uH)
> I think that you needed 25 mh at minimum, so those should do the trick.


Thanks for checking, Weisheimer, but I am pretty sure they are microH - see attcahed PDF datasheet (look for T23037). Would be pretty hard to make a 300milliH this size with wire this thick...

Anyway, will get them in a few days and will report ;-)

EDIT: got them. 2.6" wide toroids, ~370microH - see pic


----------



## Weisheimer (May 11, 2009)

valerun said:


> ... but I am pretty sure they are microH - see attcahed PDF datasheet (look for T23037). Would be pretty hard to make a 300milliH this size with wire this thick...
> 
> Anyway, will get them in a few days and will report ;-)


DOH, I must be going blind...or daft!
They are indeed uH...

I thought that they were supposed to be in the 6-20 mH range, depending upon the frequency that the IGBT is driven.
I posted 25 mH minimum in that earlier post, but have re-read the postings and it seems that it was 6 mH.

So, I'll stop nattering. 

It will be interesting to see how they work out.


----------



## valerun (Nov 12, 2010)

ok, designed the PCBs for the charger - see screenshots attached. PLanning to order from ExpressPCB this w/e. Let me know if you see any problems with the layouts - my first try to do it in software...

Schematics mostly follow the latest from this thread (also attached below) except:
1. I believe IGBT driver pins 1,3,4 are connected to the wrong (HV) ground in the attached. So I re-connected to the LV ground in the PCB layout
2. I have used a hall sensor for current that is very similar to the one used for voltage sensing (CSLT6B100 for output current - 100A range, and CSLW6B40M for voltage - 40mA range, in series with ~10-20kOhm resistor to get about the right current range out of 100-300V output)
3. Added thermistor voltage divider for monitoring temp of the high-power assembly (pics coming later). Will connect to another analog input of the Arduino board and write control in software (maybe even control the fan with that).

Obviously, most of the bulky components (12V power supply, Arduino board, main inductor and reflector inductor (per Tesseract's note earlier), IGBT/recovery diodes, and relays) are not on the PCB.

V


----------



## valerun (Nov 12, 2010)

as promised, a setup for cooling the power components (2 ultrafast diodes, IGBT, and a rectifier bridge). I figured in total should be about 50-80W average dissipation at 30A, so I thought a PC CPU cooler might just be the ticket. At my local electronics store, these all-copper units go for $15 each...


----------



## valerun (Nov 12, 2010)

quick update: 

- built a big 12x18x6" box out of 16-gauge steel plates to put everything in. This will include my DC-DC converter (hacked from an 800W PC power supply), main fuse, the charger, etc - basically all the small electrical stuff apart from the "Big 3" - controller, motor, and batteries). Rubber mounts to the car frame (similar to http://www.evsource.com/images/mechanical/310-V10Z_2-307A-K.jpg). Inside, a plexiglass plate is mounted on more rubber mounts to the bottom of the box. All the components are then mounted on the plexiglass plate (PCBs, etc).

- assembled the power stage - a 50A bridge, 2 u-fast diodes, 2 inductors (one for protection against reflected current from motor per Tesseract/Jeffrey's suggestion), 2 50A relays, and an IGBT. Diodes and IGBT are heatsinked on CPU cooling systems with individual fans Hope to be able to push 50-60A with this setup, or 10kW!

- built out & tested the thermal management system (both in hardware and software for Arduino). 4 thermistor-controlled channels to get the temp and then control sets of blower+heater (am going to use hairdryers as a starting point ;-). Will be used to manage battery temps (2 battery banks) and motor temps (no heater for the motor ;-), perhaps even a climate system for the salon (they didn't have those fancy climate control systems back in 1977 for our Fiats ;-)

- tested a PWM control circuit and software (using scaled current and voltage signals). Took a bit of time to figure out how to run Arduino PWM at high frequency (default is ~900Hz out of the box). Now running at 16kHz. Can go up to 32, but (1) no need as my 0.4milliH inductor is sufficient for 16kHz, as well, (2) want to limit losses and EMI.

- started writing software and designing hardware for battery monitor - got to use all the capabilities of the Arduino chip, after all. Ordered a MUX shield from Sparkfun to multiplex 48 analog inputs into 3. Will plan to run a (fused, of course) wire from each group of 4 cells into the box, connect to 40mA hall sensors for isolation, and then multiplex in. The controller will then cycle through all cell groups, reading in voltages. 

- Still need to figure out the display part, though - am running out of a 20x4 line display capabilities. Any ideas for a large (ideally graphics) serial display?

Picking up my 60 cells from LA on Jan 3rd, planning to finish assembly of my Vehicle Control Unit (haha! ;-) first week of Jan. Then will test on my batteries and report the results.

Happy holidays everyone!
Valery.


----------



## valerun (Nov 12, 2010)

ok guys, how about this crazy idea - using a motor controller as a charger?!

swap input and output, add a voltage / current control loop using all the microcontroller and sensing setup from our charger design, wire PWM output to a RC integrator and then to the controller's 5V throttle input...

I wonder what Jeffrey/Tesseract thinks about it... Soliton1 (which is on its way to me from FL now - yey!!) could spit out up to 1000A continuous. The guys at EVnetics have figured out all the tough stuff around 340kW power stage, why not use it???

What do you think?

V

PS. BTW, bought and read a 1/3 of a "Switching Power Supply Design" book by A. Pressman, K. Billings, etc - designing this stuff right IS hard work ;-) I wanted to read up on what I'd be against if I modify our buck design into boost - seems to be quite a bit more involving than just swapping a diode and inductor...


----------



## DJBecker (Nov 3, 2010)

Setting up the timer channels on an AVR takes a little experimentation, but they are fairly flexible. It helps quite a bit if someone points out it can be done, and how to do it.

We are using the Arduino Mega 1280 for our controller, mostly for its extra 8 ADC inputs. I use mode 10 for the primary PWM output, which provides flexible frequency with "phase correct" PWM. The "phase correct" part means that the pulse center doesn't change when you change the pulse width. That's not especially important. What is important is that you can use the overflow/top-value interrupt as the point to trigger the A/D conversion sample so that it's nicely in the middle of the pulse.

I use another timer channel to generate a 8MHz output to clock the MCP2515 CAN bus controller. It is run in mode 4, with a top count of zero. We don't care much about power consumption, but it seems to warm the chip up a bit. I might need to look at that if we keep the motor controller in sleep mode but ready to respond when the car is off.

A third timer channel, with an Input Capture input, is used for the tachometer. It's run at either 2MHz or 62.5KHz in timer mode 0 -- nothing special is needed for this purpose.

One of the challenges in using any controller for battery monitoring is the voltage differential. Once the differential is over 50V, you need to take extra safety precautions. Plus, you really lose resolution when measuring the voltage of the higher cells. One solution is to isolated A/D converters. A way of doing this is to use a I2C or SPI converter, and put it on the other side of a bus isolator, such as the Si8400 and ADUM5400 series. An advantage of doing battery monitoring is that you have a ready power source, so you won't necessarily need an isolating DC/DC power source.


----------



## valerun (Nov 12, 2010)

DJBecker said:


> One of the challenges in using any controller for battery monitoring is the voltage differential. Once the differential is over 50V, you need to take extra safety precautions. Plus, you really lose resolution when measuring the voltage of the higher cells. One solution is to isolated A/D converters. A way of doing this is to use a I2C or SPI converter, and put it on the other side of a bus isolator, such as the Si8400 and ADUM5400 series. An advantage of doing battery monitoring is that you have a ready power source, so you won't necessarily need an isolating DC/DC power source.


Thanks DJ. Don't you love those little chips? That $30 board is more powerful than my first PC ;-)

Anyway, my plan is to run every 4-battery group through a hall sensor in series with a resistor limiting current to 20mA or so. Then connect hall sensor output to the ADC. This way I don't have a problem you described as all sensors are isolated from the logic and there is no loss in resolution. I figured groups of 4 would be a good compromise between complexity and precision. I figure the parts cost of ~$200 for monitoring my 60-cell pack this way.

I am also thinking of running a throttle input from the potbox through the Arduino controller and build in the 'derating' profile vs. battery voltage. The reason I think Soliton1's battery voltage cutoff won't work for me is that it should really depend on the current draw from the battery. For example, we all know that 2.8v is a discharge cutoff for LiFePo4 AT ZERO LOAD. But this number doesn't mean anything under load. For 100Ah CALB cells at 800A, the sag is 0.7V or 2.1v close to discharge cutoff... 

Anyway, I am about to try all of those things and report back soon.

BUT, back to my question: what do you think about using a motor controller to charge batteries (with proper additional feedback control via a microprocessor, of course - see my msg above)

V


----------



## DJBecker (Nov 3, 2010)

It sounds really appealing to get double use out of the motor controller, but I haven't been able to see a way that it will work out. About the only savings I can see is sharing the same heatsink.

A motor controller needs to put out very high current as efficiently as possible. If you are using FETs, there is a strong trade-off between the lowest power loss and break-down voltage. You want to select the lowest voltage you can get away with your traction battery.

With a charger, the working voltage is going to be higher, perhaps much higher. The pack voltage while charging is going to be higher than running, plus you need an even higher source voltage to run a pulse/buck regulator.

Now add in another consideration. A efficient charger needs to be power factor corrected. The usual design to do this is a boost converter, bumping the voltage up, perhaps to 400V. That's much higher than you would want for a motor controller.

Consider also that you may only want to draw 20-30 amps from your charger. That can be handled with a single device, if it's on a good heatsink.


----------



## DJBecker (Nov 3, 2010)

Addressing the problem of cell voltage monitoring, these might be useful parts.

http://www.supertex.com/pdf/datasheets/HV7800.pdf

They mirror the voltage differential (up to 500mV) of two high voltage points (up to 450V) to a ground reference. 

They are under $1 each. The drawbacks are that they only come in a tiny SOT-23 package, and it's not clear how accurate that they are.


----------



## MozRover (Sep 19, 2009)

Valery, 

You might be able to build a battery monitor for well under $200. I made one for my twenty 12V batteries. Each battery powers an Atmel ATtiny85 (through a 7805), which reads its voltage (by a resistor divider) and passes the value, via an opto-isolator (NEC PS2501-4) to an Atmel ATmega644. 

The per battery cost:
$0.60 7805
$1.42 ATtiny
$0.37 socket 8 DIP
$0.48 Isolator ($1.91/4)
$0.20 three resistors
$0.15 two capacitors
====================
$3.22

The ATmega644 is about $7.50 in DIP40 package, but it has two serial UARTS (I use one to read GPS data, the other the data stream from the motor controller) and enough pins to read 24 batteries without multiplexing and also write data to a SD card. All together the total is near $100.

I use mine only to record data, no alarms or shut-downs. With it I discovered one of the (very hard to reach) twenty was reading 9.5v only 4 hours after charging.

In the case of Lithium, you could use just one ATtiny, which has 4 ADC pins, with reistor dividers for each bank of 4. Even when they drop to 2V per cell, the 7805 will still supply 5v. So a 60 cell monitor could cost as little as $80.

-Aaron


----------



## valerun (Nov 12, 2010)

MozRover said:


> Valery,
> 
> You might be able to build a battery monitor for well under $200. I made one for my twenty 12V batteries. Each battery powers an Atmel ATtiny85 (through a 7805), which reads its voltage (by a resistor divider) and passes the value, via an opto-isolator (NEC PS2501-4) to an Atmel ATmega644.
> 
> ...


Aaron - this is awesome! I will def look into this!

DJ - regarding motor controller:
1. I am using a Soliton1 from EVnetics. It's rated at 340V input / output voltage and 1000A continuous. So high input voltage is not a problem for me. It's ~$3K. Yes, it is quite a bit more expensive than lower-voltage / lower-current controllers BUT if we figure out how to re-use it as a charger, than it would become much more viable option
2. I am planning to run off the 220V mains so ~300V rectified. Should not be any problem running a 200V pack buck charger from that. So no need for PFC
3. A lot of people, myself included, want to run our chargers to the capacity of our house mains. My CALB batteries are rated for up to 3C charge rate. I'd love to use 100A-150A from my mains. Building 150A continuous power stage at 200V is not easy so I'd rather leverage someone else's expertise
4. You mention that you don't see an easy way to run a controller as a charger. Could you please elaborate - I am just trying to learn about this. In my somewhat uneducated (when it concerns motor controllers) opinion, the limitations of the motor controller could easily be overcome by (a) hijacking throttle inputs, and (b) inserting a microcontroller-operated feedback loop with current & voltage sensing circuits. Then you program your microcontroller for CC-CV profile and let its PWM output control throttle input to the motor controller. What is wrong with this setup? Again, would be cool to reuse the super-capable power stages from professionally engineered motor controllers - faster charge, lower cost, and higher power to the motor can all be afforded. Win-win-win... no?

V


----------



## ewert (Sep 5, 2009)

I think it's probably best to directly ask Qer/Tesseract.

Yo, ye Gods of Soliton1. Could the controller be "easily" (read: lots of hard work) be made to do doubleduty regarding the batteries, not just drawing but also putting in bad ass amps as a CC/CV charger?


----------



## DJBecker (Nov 3, 2010)

valerun said:


> 1. I am using a Soliton1 from EVnetics. It's rated at 340V input / output
> 2. I am planning to run off the 220V mains so ~300V rectified. Should not be any problem running a 200V pack buck charger from that. So no need for PFC
> 3. A lot of people, myself included, want to run our chargers to the capacity of our house mains. My CALB batteries are rated for up to 3C charge rate. I'd love to use 100A-150A from my mains.


Ahh, a Soliton. It uses IGBTs. They make for a less efficient controller, but perhaps a better choice for a commercial product. The higher voltage capability allows using less capacitance and being less susceptible to a high inductance traction battery.

It's also more likely to be a reasonable battery charger than a MOSFET based controller.

You'll still need PFC. It's a big efficiency boost. And it's absolutely required if you attempt to draw 100+ amps from your local pole pig. The transform will blow up, overheating from high frequency harmonics generated when pulling 300+ amps at the voltage peak and nothing the rest of the cycle.

Finally, your batteries may be able to initially accept a 3C charge, but they probably can't sustain that rate for very long without overheating. (Although I can see a use for a 5-10 minute partial charge.)


----------



## Amberwolf (May 29, 2009)

If the Soliton1 does regen braking (I don't think the original release did, but I recall requests for it), then in theory you could use it's internal settings for regen to limit the voltage and current for charging. 

If it does not do that, then an alternative is to setup contactors to disconnect the motor and batteries, then reconnect the batteries to the motor output thru an inductor (to smooth the PWM). Perhaps that inductor could be the field coil of your motor, if it is the right inductance and it wouldn't cause other problems.

Then setup your AC-DC conversion from the wall to the input side of the Soliton1, ensuring it is filtered to flat DC before it gets there (the Soliton1 isn't likely going to expect or probably be able to deal with wild fluctuations in input voltage, like AC ripple, compared to what it normally deals with when a battery supplies that power). 


Setup a sensor on the battery to monitor voltage and current flow, and feed that information back to the Soliton1 as throttle control so that it limits overall voltage via PWM, which will also limit current flow, just as it does on a motor. If the Soliton1 has the ability to do this internally, then all you need do is have two "templates" for it's internal settings for motor limitations; one for charging and one for driving. Just switch between the two via the web interface as needed. Just set the throttle input to a specific level that forces whatever you need to enable that charging template to output what your batteries need to charge properly. 


If you need a more complex charging curve, you could build even just a simple op-amp or even transistor setup that creates the curve you want, and outputs that to the throttle to control charging to match. An MCU would be more precise and perhaps easier, but may require a lot more support hardware and maybe be more expensive (plus you have to write and debug the software).


----------



## Tesseract (Sep 27, 2008)

Sorry for taking this thread even more off-topic. Perhaps a mod should break this tangent off into a new thread?

Okay - the good news is that the Soliton1 can already function as a CC/CV charger as is. Output current is proportional to throttle and regulated; output voltage can be limited based on calculation of duty cycle and input voltage.

However, the Soliton1 was not designed to be powered by the rectified AC line. Doing so will expose it to transients it would never see when powered from a low impedance fixed DC voltage (ie - a battery pack!) and, conversely, would expose the AC line to lots of noise from the controller's operation.

Additionally, the Soliton1 does not possess nearly enough input capacitance to filter out 100/120Hz ripple* and will register its displeasure by repeatedly shutting down due to low input voltage (even if you set it to something absurd like 10-12V).

Finally, the output voltage (ie - motor) is calculated, not actually measured while the motor current is measured, but not with the sort of precision that might be necessary for a charger.

One other note - the rectified 240VAC line is very close to the maximum allowed operating voltage of the Soliton1 and if the input voltage exceeds that limit even briefly then it will shut down with a "pack voltage too high" error. Of course the power stage can handle a lot more than that, but current has to be derated further to offset the increase in switching losses.

Oh yes... you can use the motor's field as the inductor, but this might still result in an unacceptably high ripple current unless you use a motor wound for high voltage (ie - a Kostov), and not one with advanced brush timing (ie - Netgain, ADC, etc...)

You'll need a lot of contactors to flip the orientation of the high power connections around, and they all need to be rated for the maximum expected current (e.g. - 800A). This is starting to sound less and less economical by the minute.

So, possible? Sure. Practical? Maybe not.



* - C = Q/V where Q is charge in Coulombs and V is allowed voltage droop. If you need to supply 100A for 0.01s (for 100Hz ripple) that is 1 Coulomb. If you can tolerate the incoming voltage drooping by 30V during that 0.01s then you need 10,000uF of capacitance.


----------



## Tesseract (Sep 27, 2008)

DJBecker said:


> Ahh, a Soliton. It uses IGBTs. They make for a less efficient controller, but perhaps a better choice for a commercial product. The higher voltage capability allows using less capacitance and being less susceptible to a high inductance traction battery.


It's dangerous to generalize such things like "IGBTs are less efficient", etc... MOSFETs tend be the superior choice below 150V but above, say, 250V IGBTs tend to be the superior choice because the bulk resistance of the MOSFET goes up exponentially with blocking voltage rating whereas the forward voltage drop of the IGBT goes up linearly with voltage rating.

Your other comments are true to some extent, but not too important in practice. That is to say, there is a broad range of acceptable input capacitance (as long as it has low inductance and resistance!) as well as a broad range of tolerable pack inductance. Given that the latter problem can be reduced greatly by simply running the + and - cables next to each other over the entire run, it's even less of an issue.


----------



## valerun (Nov 12, 2010)

Tesseract said:


> Okay - the good news is that the Soliton1 can already function as a CC/CV charger as is. Output current is proportional to throttle and regulated; output voltage can be limited based on calculation of duty cycle and input voltage.
> 
> So, possible? Sure. Practical? Maybe not.


Thanks Jeffrey! Appreciate your response. So, in summary, 
1. It is possible to use Soliton1 (or other motor controller with compatible voltage ratings) to do the battery charging
2. One would need a big capacitor at input - 20,000microF+ for 100-150A currents 
3. One would need a good inductor at output - based on my calculations for our buck-based charger earlier in this thread, 150-200+ microH would be needed for a current not to go discontinuous too early in the CV portion of the cycle.
4. One would need 4 contactors swapping things around - all rated to max currents - 1000A on the motor/battery OUT side, 200-300A on the rectified AC / battery IN line.
5. One would need to setup a microcontroller-based feedback control loop. This would be VERY similar to the schematics of the charger discussed here, minus the power stage (keeping the inductors, though).

I do see your point about the complexity building up as we go down the list above. Still, one has to compare all this to the cost of the commercial charger with similar performance (20kW+) - IF they even exist. The 10kW charger referenced elsewhere on this site is $5K. The part costs for the above list is likely to be <$1000 so I still see the point in trying.

So here's what I am planning to do:
1. Finish the buildout of the charger based on this thread's design. Expect 50A or so.
2. Try using Soliton1 for charging using the same MCU logic / sensors. 

I will report back on both steps. Probably in a separate thread. Stay tuned.

V


----------



## valerun (Nov 12, 2010)

Just looked at a couple of last posts and realized that even for the charger we are building here, quite large capacitor would be required post-bridge. Let me know if my math is somehow wrong here:
1. I assume 50A 200V output, 220V rectified input (hence ~310V DC at no load)
2. For a Cap to be able to provide current during troughs in the rectified DC and not sag below 200V, C*(Uin^2-Uout^2)/2 should be higher than Vout*Iout*[half a period of AC current]. 
3. In my case described above, this means C>2*Vout*Iout*1/120s / (Uin^2-Uout^2) = 10^4/(60*(9*10^4-4*10^4)) = 1/300 F = 3,300 microF.

In reality, probably might have to be even higher... Am I missing something here?

PS. Also, the ripple current rating should match the average input current (30-40A in my case). These caps go for ~$100 each on Digikey.com...

V


----------



## major (Apr 4, 2008)

valerun said:


> Just looked at a couple of last posts and realized that even for the charger we are building here, quite large capacitor would be required post-bridge. Let me know if my math is somehow wrong here:
> 1. I assume 50A 200V output, 220V rectified input (hence ~310V DC at no load)
> 2. For a Cap to be able to provide current during troughs in the rectified DC and not sag below 200V, C*(Uin^2-Uout^2)/2 should be higher than Vout*Iout*[half a period of AC current].
> 3. In my case described above, this means C>2*Vout*Iout*1/120s / (Uin^2-Uout^2) = 10^4/(60*(9*10^4-4*10^4)) = 1/300 F = 3,300 microF.
> ...


Hi Val,

I didn't check your math because I know the cap banks are quite large. This is from VFDs I've salvaged. And those are 3 phase bridge rectifies. Don't know if you intend 3 or single phase.

Anyway, I have a lot of electrolytics (high quality, most new, old stock) with high uF and voltage ratings. PM me if you need some for shipping cost.

major


----------



## jackbauer (Jan 12, 2008)

I used a pair of 470uf 450v caps on the input. Still working fine a year later....


----------



## Tesseract (Sep 27, 2008)

valerun said:


> Just looked at a couple of last posts and realized that even for the charger we are building here, quite large capacitor would be required post-bridge...


Hey V... You don't need a whole lot of capacitance for the charger discussed in this thread, just when you are trying to trick a Soliton1 that expects to be powered by a nice, smooth, stable battery pack into acting as a charger instead.

How little an amount of capacitance after the bridge rectifier the charger discussed in this thread can tolerate depends a lot on the programming of the microcontroller. It would even be possible to make the charger operate off the unfiltered but rectified line directly - except for some film caps required for spike suppression.


----------



## MozRover (Sep 19, 2009)

valerun said:


> C*(Uin^2-Uout^2)/2 should be higher than Vout*Iout*[half a period of AC current].



V, 
Not sure about that formula, but using Vripple = current / (freq * C) gets about the same result, though using a different Vinput.

339V(rectified mains) - 200V (min output) = 140V (ripple)
140V = 50A / (120Hz * C)
C=50/(120*140) = 2976uF 

I do not plan to charge over 20A, so ten 220uF, 450V (allelectronics CAT# EC-2245) in parallel will do. I'm also going to use half rectified three-phase power, so the input never drops to zero.
On anaother note, my pack voltage is 240, and I was thinking of using 4 computer power supplies with the 3.3V outputs in series as a DC-DC converter to help the old battery, which runs vacuum pump, P/S, etc. Anyone ever try this?

-Aaron


----------



## jackbauer (Jan 12, 2008)

Lots of interesting things happening lately. On a more mundane note , I have sucessfully grafted a LEM HASS 50-s to the mega128 board.No external components required (possibly a .1uf ceramic?) and reads 0 to 50amps in 0.1amp increments. Code available if anyone is interested.


----------



## mmark666 (Feb 21, 2009)

All,

I did a simple simulation to test the required capacitor size. The first image shows the effect of capacitors after a bridge rectifier if the output current is 10A, the second one the same for 20A. The blue curve is for 3000uF, the green for 1000uF, the red for 500uF and the cyan for 100uF. The main voltage is set to 220V rms (311V pp). 

So if you want to charge to 200V and 20A, I would say that 1000uF is the minimum you should use... Please be advised that the current through the cap goes up to 80A in this case, so make sure your caps can handle this.

The simulation is done with LTSpice, I included the circuit for it as well...

Mark


----------



## valerun (Nov 12, 2010)

Thanks Mark - 

That's what I thought. 

Jeffrey, I understand that you might not need input cap at all with this microcontroller-based design. However, you would then only have current going into the batteries for a part of the 120Hz rectified cycle, right. And the closer the output voltage gets to the 1.41*line AC voltage, the smaller that part of the cycle will be. So the average output current can be way smaller than your programmed max charge current, hence longer time to charge. 

If large input caps are used, the output current can be continuous but at the expense of very large ripple current into the caps on rectified peaks.

As someone mentioned above, the right solution is the PFC before this charger to get sine current draw from the mains stabilized into, say, 400V DC. I will probably try this, as well, at some point. 

Couple of additional points / questions regarding this DIY charger:

1. The pin 5 of the IGBT driver needs to be attached to the emitter of the IGBT, right? (where it connects to the inductor and ultra-fast diode; This is per reference specs from datasheet on the IGBT driver). In the last schematics published on this thread, it's not connected to the emitter. 

2. In order to make sure your output current does not go above the limit at any point, you need to ensure your sampling frequency is high enough to sample the 120Hz rectified DC shape with sufficient precision. This probably means it should be at least 1kHz. This is relatively easy. What is much harder is maintaining output voltage / current control on the rise / fall of the input sine mains waveform. The sine waveform moves quite fast - up to 100% per 3-4ms. If you want to track that with 0.4% PWM steps (1 step per cycle in the code out of total of 255 steps in PWM duty cycle available), you would want to be able to do 250 steps in 3-4ms, or 100kHz sampling rate. I am not sure a 16Mhz clock frequency on the MC's we use would allow this. Especially if you are building in some additional vehicle control logic into the MC's code (which I am trying to do)... Am I on the right track here? Has anybody looked at the output currents / voltages with the scope? Note that big input caps help reduce (but not eliminate) this problem - you'd probably be looking at 15-20kHz required sampling rate. To further reduce the problem, you'd have to implement staggered stepping in the code - the larger the difference observed compared to the previous sampling, the bigger the step. That might reduce required frequency further down to maybe 5kHz or so. Of course, an ultimate solution to all this is a PFC but it does add more complexity (but probably not weight / size since those big input caps you have to use without PFC are huge!)

Am I making sense here?

Thanks all for comments/help!!!

V


----------



## MozRover (Sep 19, 2009)

jackbauer said:


> sucessfully grafted a LEM HASS 50-s.... Code available if anyone is interested.


 Jack, 
I am interested, thank you. I used one before (charger I am building now will use an Allegro ACS-756) and was unable to get it calibrated to my satisfaction - the readings seemed non-linear. 

-Aaron


----------



## ev_nred (Sep 23, 2009)

hey just a stupid question, could this be used with lipoly cells?
thanks,
ev_nred


----------



## valerun (Nov 12, 2010)

ev_nred said:


> hey just a stupid question, could this be used with lipoly cells?
> thanks,
> ev_nred


yes, you will just have to make sure to use the right voltage cutoff and max current. If you use the versions of code by Simon and jackbauer posted earlier to this thread, you can set all these parameters. From what I understand in the code, you have to set it once and it stays in non-volatile memory so you don't have to repeat the setup unless you change your pack in some way.

V.

EDIT after thinking about this some more:
While the program does allow setting the right parameters for LiPo, see the discussion across the last 10-20 posts regarding potential output voltage / current drift mirroring 120Hz rectified mains frequency. The result might be that your *average* output voltage is right but if you look at it with the scope, it will move up and down with 120 times a second. You will probably be fine with LiFePo4 as the chemistry is super-safe, but with LiPos I'd be just a bit more careful and check your outputs with the scope before plugging your battery.

Again, as per my last posting, am not entirely sure how much of a problem it is so would be great if someone who already built one of these chargers per schematics posted earlier on this forum shares the output waveforms measured by the scope.


----------



## valerun (Nov 12, 2010)

BTW, a couple of programs I found. Pretty useful for designing your high-power inductors... See attached. You can also download them from their websites if you google for program names


----------



## jackbauer (Jan 12, 2008)

Just an update on using the charger with lithium. Today i set it for 84v (3.5v/cell) and terminate by current. Worked absolutly perfectly , hit the voltage within .2v and this is with some very rough hardware thats been in the car a year.


----------



## valerun (Nov 12, 2010)

Yey - 30Amps, 250V DC test today, 20 degree temp rise on a heatsink. ~1 min test only since blew up my electric kettle - got to think up some better load design ;-). Full control from ~20V to ~250V with this type of load. PCBs arriving this week - will post another update then. 

[earlier test from 110V line in the pic. 7kW run was from 220V line]


----------



## jackbauer (Jan 12, 2008)

Is that a solid state relay i see in there? Well done


----------



## SimonRafferty (Apr 13, 2009)

I seem to have missed lots of good stuff on this thread. It seems the email notifications went on holiday!

Valerun - I like your build - I'm a sucker for blue LED's! Nice little scope too - it looks a bit like a cellphone?? What is it - where can I get one! It makes my Fluke handheld scope look very 'last century'!

I drew some circuits for combined controller / chargers - but decided that it was cheaper to keep them separate. A better option is a combined charger & DCDC converter! If it will charge the pack at 50A, it should be able to charge the 12v battery from the pack at 50A. Because the currents are much lower, simple cheap relays are enough to effect the switching.

The main issue is the resolution of the PWM. With an input at 220v or so, an output of 12v needs a very short pulse duration. It does not have the speed to regulate the voltage to the nearest 0.1v - even to the nearest 0.5v is a struggle.

The easiest solution was to set the output voltage at around 15v and use a simple linear regulator to spit out 14.6v. Linear regulators do not have to dissipate too much power when the voltage drop is small. In this case the drop was typically less than 1v so at 50A, I'm loosing 50W as heat - which I could live with for the simplicity. Clearly a second switching buck converter stage would be better.

Si


----------



## valerun (Nov 12, 2010)

SimonRafferty said:


> Valerun - I like your build - I'm a sucker for blue LED's! Nice little scope too - it looks a bit like a cellphone?? What is it - where can I get one! It makes my Fluke handheld scope look very 'last century'!


very nice unit - love it. try this link - $50 on Ebay - http://cgi.ebay.com/ws/eBayISAPI.dl...621030&ssPageName=STRK:MEWNX:IT#ht_4306wt_905



SimonRafferty said:


> I drew some circuits for combined controller / chargers - but decided that it was cheaper to keep them separate. A better option is a combined charger & DCDC converter! If it will charge the pack at 50A, it should be able to charge the 12v battery from the pack at 50A.


that's a pretty good idea although that's like 4 additional relays, right? No, even more, as the grounds are different for HV and 12V... Have to think about this one. For now, my plan was to use a 30Amp PC power supply hacked to 13.8V output and buffered with 10AH high-discharge LiFePo4 battery for those spiky loads from windshield wipers etc. Would probably be ok for my Fiat but for my next conversion (BMW 330) might adopt your suggestion.



SimonRafferty said:


> The easiest solution was to set the output voltage at around 15v and use a simple linear regulator to spit out 14.6v. Linear regulators do not have to dissipate too much power when the voltage drop is small. In this case the drop was typically less than 1v so at 50A, I'm loosing 50W as heat - which I could live with for the simplicity. Clearly a second switching buck converter stage would be better.
> Si


Can you put a secondary winding on the main inductor with 1/10th of turns and rectify that?



jackbauer said:


> Is that a solid state relay i see in there? Well done


yes, works like a charm (so far, anyway ;-)


----------



## jackbauer (Jan 12, 2008)

I have added simple CAN communications to the charger. Used this little guy for the hardware:
http://www.mikroe.com/eng/products/view/129/canspi-board/

Charger outputs voltage and current to a dash display over the can bus.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> I have added simple CAN communications to the charger. Used this little guy for the hardware:
> http://www.mikroe.com/eng/products/view/129/canspi-board/
> 
> Charger outputs voltage and current to a dash display over the can bus.


this is awesome! I was thinking about that for my next conversion (a 2001 BMW) - no CANbus in 1977 Fiat I am converting now LOL ;-). There is an Arduino CANbus shield that can do same job, as well. 

So which gauges do you map this to?


----------



## jackbauer (Jan 12, 2008)

Its just simple transmission of 8 bytes per message frame. I'm not trying to get it to talk to an automotive system as yet but of course thats do-able. In a modern vehicle the ideal situation would be to use the fuel gauge as well a fuel gauge


----------



## SimonRafferty (Apr 13, 2009)

What are you going to talk to then?

Si


----------



## MozRover (Sep 19, 2009)

jackbauer said:


> Charger outputs voltage and current to a dash display over the can bus.


Do you have a custom display with another CANSPI, using the car's existing CAN simply as a convenient route to connect the charger to the dash display?

p.s. could you send me the C code you wrote for the Mega128 to read current from the LEM HASS 50 ?


----------



## jackbauer (Jan 12, 2008)

Moz , its in mikrobasic i'm afraid. Here is the subroutine to use a lem hass 50-s for current montoring. 

sub function MeasureAmps() as Word
dim nAmps as Word
dim nAmpsM as Word
dim nCurrentScale as word
dim nCnt as byte

nCurrentScale = EEPROM_Read(0x100 + 33) * 256 + EEPROM_Read(0x100 + 34)
'Average cos it jumps about a bit
nCnt = 1
nAmps = 0
do
nAmpsM = ADC_Read(2) 'read adc value 20 times to average
nAmps = nAmps + nAmpsM
delay_ms(5)
inc(nCnt)
loop until nCnt > 50
nAmps = nAmps / 50 'divide by 50 for avg value
nAmps = nAmps - 502 '2.5v = 0amps

nAmps = nAmps * 2
MeasureAmps = nAmps 'nCurrentScale
end sub

I'm using an atmega168 and a serial lcd with another canspi board as a dash display. I'm relearning CAN after a 10 year absence


----------



## MozRover (Sep 19, 2009)

jackbauer said:


> delay_ms(5)
> inc(nCnt)
> loop until nCnt > 50


Jack,
thanks for the code. The two differences with what I was using are the sample count (I was doing 1000 samples) and, more importantly I think, you have a 5ms delay between reads. I will have to try adding that. Probably helps drain any residual capacitance in the ADC.
Is there isolation (optical?) between the charger and its attached CANSPI?
-Aaron


----------



## jackbauer (Jan 12, 2008)

No isolation on the spi. The control board is isolated from the power stage however.


----------



## valerun (Nov 12, 2010)

MozRover said:


> Jack,
> thanks for the code. The two differences with what I was using are the sample count (I was doing 1000 samples) and, more importantly I think, you have a 5ms delay between reads. I will have to try adding that. Probably helps drain any residual capacitance in the ADC.
> Is there isolation (optical?) between the charger and its attached CANSPI?
> -Aaron


Hi MozRover, Jack - do you see the residual 120Hz ripple in the output? One hypothesis I have is that that ripple might be throwing off the voltage reading... If that's true, I'd rather either (1) increase sensing circuit RC time constant way up - to 1sec, maybe, or (2) go all the way to the other extreme and increase PWM adjustment rate to 2-5,000 times / sec per my earlier posts. I will be testing both in my charger.

Thanks,
Valery.


----------



## MozRover (Sep 19, 2009)

valerun said:


> do you see the residual 120Hz ripple in the output?


I don't see it because I don't have the equipment  though I have ordered one of the mini DSO's you mentioned before. 
Also:
1. my PWM is at 32kHz
2. I have 2200uF of filtering capacitors

BTW, I put most of the power stage (less the rectifiers) on a home-etched PCB. The etching was a little too aggressive and some of the traces were pitted. Yesterday the main trace arced/burned away in three spots with a very loud pop. Took some time to identify the source, being on the bottom of the mounted PCB. 

I've since soldered some bare 16ga wire along the path, and flowed solder over other sections. I mention this because I read that you were awaiting PCBs, which will undoubtedly be higher quality than mine, but still the traces have a finite current carrying capacity.


----------



## jackbauer (Jan 12, 2008)

Quite frankly i don't have any problems reading voltage. Because I do so with the pwm at zero! I spent weeks messing about with filter circuits to no avail. Reading at zero pwm also negates the problem of cable voltage drop affecting readings at high currents. Very important with charge termination voltage for lifepo4.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Quite frankly i don't have any problems reading voltage. Because I do so with the pwm at zero! I spent weeks messing about with filter circuits to no avail. Reading at zero pwm also negates the problem of cable voltage drop affecting readings at high currents. Very important with charge termination voltage for lifepo4.


oh yes, I remember. Do you account for voltage drop when you stop current into battery? My 100AH CALB cells have ~2 milliOhm internal resistance during charge (measured at ~3.35V with 0.05C current variation). So at 0.3C we are looking at 0.06V drop when current is terminated. So I'd switch over to CV mode at 3.54V instead of 3.6V spec'ed at 0.3C charging current. Am I making sense?

But in general I agree that zeroing out PWM eliminates voltage readout problems. What about the current sensing though? I'd expect it to be affected by 120Hz ripple unless take care of by either long RC constant or adjusting PWM duty to follow the rise and fall of 120Hz ripple waveform...

Re PCBs blowing up - yes, absolutely - planning to solder gauge 12 onto the PCB there. No way they can handle 30-50A I am planning for them ;-))


----------



## MozRover (Sep 19, 2009)

Jack,
I read that you were using a half controlled 3 phase rectifier. Do you have a part number and/or new schematic including it?


----------



## jackbauer (Jan 12, 2008)

The current readings do waver a bit but nothing serious. For example if i set a 10amp current limit it might sit at exactly 10a for a few cycles , jump up to 11 then down to 9 etc. Its only 8 bit pwm after all. 

the scr circuit is still undergoing development. on hold due to other commitments. to be honest the simple buck reg is best for the sort of power involved.


----------



## valerun (Nov 12, 2010)

ok guys, let me know if you have any ideas. I keep blowing up IGBTs in my build. Nothing alarming on the scope (at least with my resolution of ~1-2 microsec) but after playing with power levels (up to 2kW at this point from 110V line) the IGBT locks on and shorts out, dumping full rectified voltage to the output. 

I have tried adding an RC snubber across the coil (24 Ohm in series with 1000pF) but they still blow up...

Any ideas? 

I am using a 60A nominal, 120A max 600V Field Stop IGBTs (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&itemSeq=95282339&uq=634308885275535461 on digikey)

Thanks!
V.


----------



## Weisheimer (May 11, 2009)

valerun said:


> ok guys, let me know if you have any ideas....
> V.


My first thoughts are to check for feedback, Miller turn-on, and perhaps the lack of a negative voltage drive on turn off.
Can you borrow a good battery powered portable O'scope, such as a THS-730 or something similar?
It will help a lot to get a good shot of what is happening at the gate, and also to check for ringing on the output.
Is this the IGBT that you are using?
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=FGA60N60UFDTU-ND
It shows a VCE of 2.4v at 15 amps, so you seem to have enough power dissipation.
What are the diodes that you are using? I couldn't make them out in the photo. I don't suspect them as an issue, I just wonder what they are.


----------



## valerun (Nov 12, 2010)

Weisheimer said:


> My first thoughts are to check for feedback, Miller turn-on, and perhaps the lack of a negative voltage drive on turn off.
> 
> What are the diodes that you are using? I couldn't make them out in the photo. I don't suspect them as an issue, I just wonder what they are.


Thanks for ideas! Yes, this is the IGBTs I am using. 

Driver circuit: it's a single supply driver so no negative voltage on turn off. It does use a separate gate resistor for turn-off (another 22 Ohm resistor in series with a diode opening on turn-off). This paper (http://www.avagotech.com/docs/AV02-0599EN) I've read said that negative drive is used primarily in circuits above 100A.

Diodes: 
* Freewheeling diode is a 60A 600V ultra-fast diode (datasheet http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00110835.pdf)
* Just noticed that my reverse gate diode (the one in series with the second 22 Ohm resistor) is not an ultra-fast diode but just regular rectified diode. Could that be a reason? Just ordered u-fast ones from DigiKey...

good idea re scope - I have a small open-source scope but it's not advanced enough to go deep on this. Will take it to techshop in the next few days - they have a couple of good scopes.


----------



## jackbauer (Jan 12, 2008)

A standard recovery diode in the gate drive will be causing all sort of problems. That would be my no.1 suspect. I used a UF4007. No problems.


----------



## SimonRafferty (Apr 13, 2009)

In my current version of the circuit, instead of using a DCDC converter to drive the IGBT, I'm using a mains power supply (similar to the 12v one) which spits out +/- 15v at 2A.

The IGBT driver is perfectly capable of using the -15v to switch off the gate (as well as +15v to switch it on). This means you can loose the diode / resistor in the gate path. The 2A rating has significantly improved the switching times. The whole thing now runs a lot cooler at high power.

I found an old switching Laptop PSU which spits out +15v and -12v at about 4A - and is isolated. eBay seems to have lots of inexpensive switching laptop supplies with decent current ratings also. So long as they are isolated, they could be a good source for the gate drive.

Si


----------



## valerun (Nov 12, 2010)

thanks Guys! Replacing my driver diode with u-fast type tomorrow. If that doesn't help, will add another 15V DC-DC converter to get -15V.

One other question: how do you guys deal with EMI noise? I have tried to isolate some of the causes for voltage readings jumping around and found that at least some significant part of it is caused by noise (I just wired a voltage divider into one of the analog input pins with wires of roughly same length as the ones from voltage sensing circuit and see jumps of 3-5% from reading to reading). I am thinking of putting the logic boards into a separate metal box inside the charger - wondering how you handled that issue...


----------



## jackbauer (Jan 12, 2008)

I did a little video today showing the charger pumping 20amps into my headway pack and hitting cv almost bang on. Its a bit long and boring and specific to my car so if anyone thinks it doesnt belong on this thread just say so and i'll remove it.
http://www.youtube.com/watch?v=LLa7hYbOEhE


----------



## Guest (Jan 21, 2011)

Jack,

Very nice charger you built there. Nice set point and cut off. It's not a terrible long and boring video. Gets the point across and we get to watch the charger shut off. 

Pete


----------



## mrbigh (Dec 31, 2008)

Jack
nice video.


----------



## valerun (Nov 12, 2010)

SimonRafferty said:


> The IGBT driver is perfectly capable of using the -15v to switch off the gate (as well as +15v to switch it on). This means you can loose the diode / resistor in the gate path. The 2A rating has significantly improved the switching times. The whole thing now runs a lot cooler at high power.
> Si


Wired in dual supply (+/- 15V), got rid of the gate driver diode, shortened the leads throughout (actually mounted the driver board on top of the IGBT), and... blew my 4th IGBT...

A bit at a loss right now. I don't get to see much on the scope, either, as everything happens pretty immediately. Could my larger output cap (500 uF instead you your 1uF) cause any issues?


----------



## jackbauer (Jan 12, 2008)

What freewheel diode are you using? Is it soft recovery?


----------



## teraamper (Nov 18, 2009)

Jackbauer, is in your FW input for the BMS, and how can I conect it.


----------



## jackbauer (Jan 12, 2008)

BMS input is on connector ext2 pin 8 if my memory is correct. If pulled high it causes the pwm to reduce. When low it is ignored.


----------



## teraamper (Nov 18, 2009)

I tried this, thank you very much


----------



## valerun (Nov 12, 2010)

jackbauer said:


> What freewheel diode are you using? Is it soft recovery?


I am using http://www.st.com/internet/com/TECHN...CD00110835.pdf - 600V 60A ultra-fast diode. The datasheet says "specially suited for use 
in switching power supplies".

Thanks Jack!


----------



## jackbauer (Jan 12, 2008)

I'm shooting in the dark here but if your freewheel diode snaps back too fast it will induce a very large spike across the switch. You ideally need a diode with a so called "soft" recovery characteristic. Like i said its just a wild guess. to be honest i built this charger over a year ago , used totally substandard parts , a rubbish layout and it has been in action pritty much every day since then without a blip. From that i would deduce that its quite tolerant of noise etc.

One last thought. Does your igbt have a built in body diode? Some do not.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> I'm shooting in the dark here but if your freewheel diode snaps back too fast it will induce a very large spike across the switch. You ideally need a diode with a so called "soft" recovery characteristic. Like i said its just a wild guess. to be honest i built this charger over a year ago , used totally substandard parts , a rubbish layout and it has been in action pritty much every day since then without a blip. From that i would deduce that its quite tolerant of noise etc.
> 
> One last thought. Does your igbt have a built in body diode? Some do not.


Thanks Jack - my freewheeling diode is NOT soft-recovery, just ultra-fast. Ordered soft recovery from digikey.com now.

IGBT does have a body diode.

V


----------



## valerun (Nov 12, 2010)

Still waiting for my new IGBTs and soft recovery diodes. So the real test will have to wait just a bit.

In the meantime, had a bit of a mental breakthrough. A friend of mine has lent me his Tina circuit simulation program and we inputed the power stage - with all the parasitic IGBT and diode capacitancies. First run - nothing unusual. Then I thought why don't I model wire inductances - 10cm here, 10 cm there - using my real wire lengths from the setup I got. Damn! 1kV+ spikes on the diode, 600V+ ringing on the IGBT, etc. at the design load... Not pretty. Finally, my large output caps result in high in-rush current that doesn't help. 

So in addition to putting in a soft recovery diode, I am planning to:
1. shorten all the high-frequency wiring to absolute minimum. Some creative part placement will be needed...
2. Replace large caps with 1-5uF with low ESR
3. Add RC snubbers across diode and IGBT to dampen the main spiking action. 

Will report back in a couple of days.

Thanks again for all the help troubleshooting!

V


----------



## valerun (Nov 12, 2010)

ok got new IGBTs today and decided to try even without soft recovery diode, but with smaller caps and radically reduced wire lengths. Worked like a charm - up to 5kW when I had another load failure - the contacts connecting wires to the load heated enough to melt the isolation off the wires and the resulting short blew yet another IGBT but this one doesn't count ;-) ...I think it also hit my driver circuit... nice to have logic separated from the high side...

anyway, will rebuild tomorrow - thanks everyone for your help!


----------



## valerun (Nov 12, 2010)

time for another update - everything works beautifully now, ramping up to 40A (at 100V battery voltage - using half of my cells for now). Also built in are the temp monitors for battery boxes, with cooler / heater control wired to arduino - all tested and working. 

The small issue I am struggling with now is my voltage readouts depending on the supply voltage - I suspect variation in 12V supply changes 5V supply to hall sensors, which in turn changes the V/A coefficient, which in turn changes the ADC readout even while the output voltage stays the same. I believe I can deal with this by wiring same 5V supply that hall sensors use into the AREF input of arduino board (ADC reference voltage) (right now, I just use the default reference voltage, which is *arduino's* 5V supply)...

Also, just built a PFC booster unit to supply the charger from 110V lines. Will be testing this weekend. The idea is to get it to work at 5kW output power, 300V. Then, add mains voltage sensor to the logic board and a couple of relays that will be switching the main power supply to the charger between 240V mains and 300V booster. Will post schematics etc once I make sure it works reliably.


----------



## jackbauer (Jan 12, 2008)

Will you be publishing the schematics and code? Quite interested to see this version.


----------



## valerun (Nov 12, 2010)

jackbauer said:


> Will you be publishing the schematics and code? Quite interested to see this version.


yes, Jack - absolutely. You guys have been such great help. The least I could do is to share it all back. Need to work out a few kinks like the above voltage drift etc. before I upload that stuff though. Should be soon.


----------



## valerun (Nov 12, 2010)

just tested the PFC unit to 1kW (270V, ~4A) - seems to be on the right track. Will be testing at 4kW later this weekend. some photos for you guys. If everything works out with the higher power level, will post all schematics etc. Again, the idea is to drive the charger off 110V line at a reasonable power level.


----------



## valerun (Nov 12, 2010)

at 2.1kW (280V on a 36 Ohm load), my power MOSFET failed. And in the boost design, they do fail with a bang as they short the coil to the HV ground ;-). In the next iteration, will be putting in 2 parallel IGBTs. Still not entirely sure if it was caused by a voltage spike or excessive current. I am shunting the MOSFET with a 400V varistor. Also, with an earlier test, I did go to the same voltage but only 800-900W. So I suspect current spike... Let me know if you have any other ideas ;-)

MOSFET I am using is IXTQ480P2, 500V, 52A continuous (25C), 150A pulse, rise / fall times ~10ns. Driven by A3120 (powered at 15V) through 15Ohm parallel with diode & another 15 Ohm.


----------



## JimDanielson (Oct 19, 2008)

Hi, Thanks Simon and everyone else for the schematics and time testing this. I am very interested and think I will build something similar.

I saw some mention of power factor correction with a boost converter but was wondering if anyone has calculated their power factor. I am afraid of the downsides of having too low a power factor.

I am in the US and most times will be charging off a 220v outlet, but occasionally will charge from 120. I think in the case of the 120, I may need boost anyway. The battery is a li-ion 108v pack, will charge to ~120v.


----------



## valerun (Nov 12, 2010)

Time for another update - 2 parts - one for the buck charger discussed in this thread, another for PFC booster I've built for 110V charging. 

*I. The buck charger described in this thread.
*
I finally have completed all the testing - both on software and hardware. Everything works quite well up to 8kW (40A, 200V) - I didn't want to take it beyond that as my solid state relays are rated only for 40A and the inductor gets hot to touch at 40A already anyway. 

Couple of interesting observations / design tweaks I had to make:
1. Resistor in series with hall sensor measuring output voltage was reduced to 4.7kOhm as I had too much voltage measurement drift otherwise (the most sensitive hall sensor I could get from digikey was 40mA max current which is exactly what you get with 4.7kOhm and 192V pack). 
2. Caps on 12V and 5V power lines were needed to reduce the EMI noise seeping through from the power stage at max current
3. mains voltage sensor was added to automatically power on/off the charger when needed
4. Since I had a large 12"x6"x18" box, I have used it for a DC-DC converter (33A) and a small (5Ah) LiFePo4 high-discharge (40C) battery. The battery is connected directly to DC-DC converter and the combination will be used instead of the Lead battery in the car. At the moments of high load (windshield wiper motors, seat motors, etc), the battery can take up to 100-150A before DC converter hits the 33A limit. At no load, converter is recharging the battery so it's all good. 13.8V I have from the converter makes for ~3.45 per cell which is pretty good CV for these batteries. They are rated for 5C charging so I am not worried there.


*II. PFC booster
*
1. Finally got all the pieces together and tested to 3.5kW output power on 110V lines (couldn't go higher yet as keep tripping the breakers at my house. Anyway, no point in going higher anyway as I won't be able to draw much more than 30Amps from those outlets anyway...
2. The booster is configured for 300V DC output, input current limiting to 60Amps (equivalent to ~7kW input)
3. The idea is to connect the booster output through the diode to the output of the buck converter rectification bridge. Then, if there are 220V mains present (and, therefore, 315V rectified), the charger runs off that. If not 220V mains but 110V, the booster gives out 300V and charger runs off that
4. In order to prevent the charger drawing too much from the booster, overcurrent output from the booster is connected to arduino in the charger and software is limiting duty cycle ramp to stay within the safe limits. Have not yet tested this feature, though...

Will be posting schematics and PCB layouts soon... Am thinking of setting up some kind of a kit if anyone's interested.

Valery.


----------



## valerun (Nov 12, 2010)

some pics of the PFC and charger - almost finished products. 

Run the charger today at 8.2kW. Added second output diode, second IGBT in parallel. Had to build additional heatsinks for output diodes and output solid state relay - just cut pieces of 3/8"-5/8" aluminum plate and bolted together. Now the weak (thermally) link is actually the coil - I believe it gets to 80-90 deg C at 40A output. Tricky to heatsink, too... Will be adding a big fan on top of the charger (just ordered a 10" radiator fan (12V 8A LOL)) - will see how that helps ;-)

As promised, schematics are coming.

PS. played with a new serial screen from 4Dsystems - 320x240 RGB touchscreen, 3.2" diagonal. Beauty for just ~$70. Has a micro-SD card reader, too. A b***h to set up though...


----------



## jackbauer (Jan 12, 2008)

Think my charger is due an upgrade Very nice work. I would be interested in a kit.


----------



## JimDanielson (Oct 19, 2008)

Valerun, thanks for all the info you are providing, it looks very professional!

Would it be possible for you to connect an o-scope to the AC voltage input and put a shunt on ac side to view current waveform? I was wondering how good the powerfactor is. Do you actively monitor power factor?

Thanks


----------



## valerun (Nov 12, 2010)

jimbo12d said:


> Valerun, thanks for all the info you are providing, it looks very professional!
> 
> Would it be possible for you to connect an o-scope to the AC voltage input and put a shunt on ac side to view current waveform? I was wondering how good the powerfactor is. Do you actively monitor power factor?
> 
> Thanks


will do. actually, just got 4 current shunt 0.01 Ohm resistors from digikey. The idea is to stick them into the various places and see what's going on with the currents:
1. Input line current for PF monitoring as you suggest
2. Output current for a charger (currently measured by the hall sensor with long-time RC filter on output so can't really be used for instantaneous measurement)
3. Inductor (and, hence, IGBT) current

On #2: when I run off 220V line, I run without PFC (building a 10kW PFC is a bit scary proposition for me right now, as we are talking about IGBT currents well into 100+ Amps and failure modes are pretty violent in the boost design ;-). Also, my PWM control loop is VERY slow (@0.1-5Hz depending on how far I am from target and how fast things are changing - controlled by the Arduino board), so my duty cycle is effectively constant throughout the input line rectified half-cycle (120Hz). Now, since I run without PFC and my PWM duty cycle is fixed, my output voltage (and therefore current) has a 120Hz ripple. At 40Amps output, I see RMS drops of ~50V on the input cap (6800uF). I also see true RMS AC component of ~4-5V on the output at that output level. This makes me think (as I mentioned a few times in the previous page of this thread) that my output current has wild fluctuations at 120Hz cycle (for this frequency, the inductor is pretty much invisible (0.3Ohm impedance for 0.4mH inductor...). Since my current control loop is regulating the *average* current over many points in many cycles, this probably means that my peak current can be over 100A while the average is at 40A. Which would not be good for many reasons: (1) some components are just not rated to withstand this for too long, (2) nobody knows exactly what that does to the batteries - they should be fine but we all know that higher charge rates do affect lifetime - we just don't know how *pulsed* charge rate affects that. TO be safe, I'd like to keep the output current as steady as possible. Couple of ways to do that - PFC before the charger or have my Arduino adjust PWM a 1000 times a second... But the first step is to actually measure those currents, hence putting a shunt in. 

On #3, want to make sure I do not saturate the inductor too much as that tends to burn through IGBTs quite quickly. Especially important given point #2 above...

Will report out on results (with scope screenshots) in the next couple of days.

V


----------



## valerun (Nov 12, 2010)

just had a brain wave - what if I add a hardware current limiter (to, say over 25% of the desired current) with sub-microsecond reaction and, once that current is reached, have it pull PWM output to zero until the next pulse arrives? This way I can still keep Arduino on the slow control loop controlling average current and rely on the hardware limiter to shave the peaks... Would be a kind of poor man's variable PWM control that will effectively reduce PWM duty at rectified peaks, while keeping the Arduino-prescribed duty for troughs...

Does it make sense to you guys? Am I going to hit any stability issues?

V


----------



## valerun (Nov 12, 2010)

HOLY COW!..

...so, just put a current shunt into the output line. as I expected (and mentioned above), the current is REALLY wild with the non-PFC version of the charger. See attached. Ignore the narrow spikes - these are just noise induced on the scope pick up from all the 32kHz action going on. The yellow bands show the real current - bands (as opposed to lines) look solid in this view but in reality it's 32kHz ripple - at this time/division (2ms) they blend together. The large oscillations are 8ms apart (120Hz - double the line frequency). The shunt resistor is 0.01 Ohm, the screenshot is 0.2V/division. Zero line is just below the troughs - you can see a pointer at the left of the screen. The top of the peaks are at 1.2V, hence 120Amps! The trough is at 6-8Amps. Pretty crazy. This is probably part of the reason I was blowing through IGBTs... Right now I have 2 in parallel which helps... 

Same setup connected to a simple resistive load of 4 Ohms (for same 40Amps average output) produces a predictable ~10-15% current ripple. The reason the ripple is so wild when batteries are connected is because they resist voltage rise beyond certain level a LOT.

So, looks like we do need some kind of PWM control to track 120Hz waveform. Any ideas beyond the stuff I mentioned above? Just as a reminder, my current ideas are:
1. Hardware current protection pulling IGBT driver into 0 state when 125% of the commanded current is reached - until the next PWM pulse
2. Increase the Arduino PWM control loop frequency to 1000+Hz (from the current max 5Hz)

Any additional ideas?

V


----------



## valerun (Nov 12, 2010)

BTW just figured out why the solid yellow band gets wider at the high current. As you know, this is opposite to what you'd expect as the inductor current ripple is *usually* inversely proportional to the current (because of the L*I^2 energy formula). I think what happens here is that the *inductance itself is changing* due to the inductor getting progressively saturated beyond ~30-40Amps. In fact, I would probably blow my double diodes and double IGBTs and solid state relay if I went just 10Amps more on the AVERAGE current - it would probably drive the peak current beyond 200Amps given the saturation ramp I see in the screenshot. 

Also, since power dissipation is proportional to the square of the current in most cases (even for semi components like IGBT voltage drop is increasing with current), this waveform generates MUCH more heat that the flat 40Amps waveform. Which is probably why I had to start thinking about putting a car radiator fan on this thing...

All comes together now ;-)


----------



## dodgemanx (Feb 23, 2011)

Spent the morning and a few cups of coffee reading this thread. Just wanted to let V (and contributors) know all the hard work and reporting is fascinating and appreciated. Keep it up, lots of discovery going on here, thanks for sharing.

Ed


----------



## valerun (Nov 12, 2010)

ok did some research and here's what I am planning to do (hardware current protection)- see pic below.

Its is based on the comparator comparing the voltage output from the hall sensor measuring the current with the voltage threshold set by arduino through a separate PWM output filtered through a long-time-constant RC filter (call it PWM2). The main IGBT driver PWM output (call it PWM1) is used to gate/strobe the comparator output. 

In order to not have this circuit react to 32Hz ripple, the hall sensor output will be filtered through an RC with time constant of 0.1ms or so. 

So basically what happens is PWM1 is disabled whenever the output current exceeds 125% of the target average current (allowing for max 25% 120Hz current ripple). Since the Arduino control loop is setup with really long time constant (0.3-5sec) and controlling average current, it will keep increasing duty cycle until it hits the average target current. The net result will be high PWM duty cycle which goes uninhibited during troughs in the rectified voltage (smoothed by the large input cap that I have already), then the PWM starts getting disabled for a few cycles at a time - maxing out on the 120Hz peaks. 

Makes sense to you guys? Any issues you see with this setup?

V


----------



## vwdevotee (Mar 8, 2008)

Any news on when a full schematic and code for the 8kW charger version will be available? What's the minimum pack voltage that the buck will support? I thought I think I remember one of the posts saying something like 80V, but what do I know. What's it looking like the cost as of now will be? Also, would it be possible to move the microcontroller off the development board to the main pcb? To eliminate the LCD readout, would it just be a matter of not hooking it up? 

You guys are rock stars. This is such a cool project!


----------



## valerun (Nov 12, 2010)

vwdevotee said:


> Any news on when a full schematic and code for the 8kW charger version will be available? What's the minimum pack voltage that the buck will support? I thought I think I remember one of the posts saying something like 80V, but what do I know. What's it looking like the cost as of now will be? Also, would it be possible to move the microcontroller off the development board to the main pcb? To eliminate the LCD readout, would it just be a matter of not hooking it up?
> 
> You guys are rock stars. This is such a cool project!


it's coming ;-) First I want to deal with that 120Hz over-current problem I have described earlier - intrinsic to this charger / software design. I don't think anybody knows the effect of high-current pulsed charge mode that the current design puts out on the lifetime of the batteries. So I want to address that first.

On that, I have tried to go for a software solution first - changed arduino code to sample as fast as possible and adjust duty on the fly. The good news is that with all the code in the loop, it is still able to sample at ~2kHz, which should be good enough to control 120Hz cycle. The tricky part is how to change duty cycle in response to any observed divergences. In my current version of the code, I use progressive duty cycle step - if I am far from the target current (>60% off), I adjust duty by 10 (out of 255) per cycle, if I am a bit closer (30-60% off) - by 5, if closer yet (10-30%) - by 2, and if closer than 10%, by 1. Still, based on my last run, this is not enough to track the 120Hz current waveform. I was thinking of programming tables of duty step vs. how far I need the current to move but I'm afraid that I can't get away with one table as the varying battery internal resistance and SOC makes duty-current dependency highly non-linear and changing with SOC, etc.

Any additional ideas very welcome!

V


----------



## JRoque (Mar 9, 2010)

Hello V. Mine are more questions than suggestions. I haven't read every post on this thread so forgive me if I'm missing something obvious.

Why a 120Hz pulse? Is that by design or a limitation of the micro? If I recall correctly, the Arduino boards use Atmel mega chips which can go a lot faster in fast-pwm mode. If the problem is system resources not being able to keep up with sample/pulse cycles, maybe a second chip can do the sampling and pass that on to the pulser. After all, going over voltage/current for a few milliseconds while you send that message to chip #2 shouldn't do much harm.

I'm going to guess that anything above a 500 Hz PWM pulse will not adversely affect the cells. In fact, I bet those cheap (in design) chargers floating around ripple a lot at all sorts of frequencies. By the time you get to the cells, going through the wiring and the caps you have connected to your drive pack, that square pulse will be round enough to not bother your cells.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Why a 120Hz pulse? Is that by design or a limitation of the micro?


Hi JR - thank you for your note. Yes, you're right - Arduino can do much higher PWM frequency. Actually, my design runs at 32kHz PWM - the max possible with 8Mhz clock. The problem I have is different - 120Hz is double the mains frequency - you get half-sines at this frequency after the rectifier bridge. Even smoothed by the big input cap, at high currents the voltage will drop from peak of ~315V to 260V (in my case) every 8ms cycle. Now the charger design discussed in this forum adjusts its PWM duty cycle very slowly - once-per-second kind of frequency. Therefore, duty cycle stays same throughout these 8ms. Hence, 120Hz ripple on output. Due to non-linearity of the battery as load (load resistance drops *dramatically* once you cross certain voltage level per cell), current ripple is quite big - 7 to 120 Amps in my case when the average current stays at 40Amps.

V


----------



## JimDanielson (Oct 19, 2008)

V,

Why not upgrade your arduino to run at 16Mhz. The oscillator is only ~$1 and most all arduinos run at this speed now. That way you should be able to sample faster.

You might need a larger inductor to keep current ripple down. What is the inductance of the one you have now?


----------



## JRoque (Mar 9, 2010)

Hi. The internal oscillator on ATMega chips that run at 8 Mhz is prone to frequency drifts effected by temperature changes. An external crystal is much preferred for accurate time keeping. Also, most newer ATMega micros run up to 20Mhz now, though PWM frequency has no linear dependency on system speed.

I agree with Jimbo, either larger switching inductor or more input capacitance (or both) might help. You probably knew that already but just trying a software fix.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hi. The internal oscillator on ATMega chips that run at 8 Mhz is prone to frequency drifts effected by temperature changes. An external crystal is much preferred for accurate time keeping. Also, most newer ATMega micros run up to 20Mhz now, though PWM frequency has no linear dependency on system speed.
> 
> I agree with Jimbo, either larger switching inductor or more input capacitance (or both) might help. You probably knew that already but just trying a software fix.
> 
> JR


Thanks guys - I should definitely try overclocking the base board to get better sampling rates. I am not really after higher PWM frequency or larger inductor as those won't help me as my current ripple problem is not at the PWM frequency. PWM frequency ripple is actually quite ok. It's the low-frequency 120Hz that hurts me. Inductor would have to be super-huge to affect that at all - perhaps 100x what I have now... Larger input cap would help but not eliminate the root cause.

So I will plan to try more aggressive progressive duty cycle adjustment first; if that still doesn't work, I will overclock the board. If that doesn't work, I will add hardware overcurrent protection. 

PS. I feel like I should have the hardware overcurrent protection in any case - what if I short-circuit the load??? Reliable design should be immune to such stuff...


----------



## MozRover (Sep 19, 2009)

V, 
in the design for a current limiter, using a comparator to gate the PWM signal - no need to use a reference from the Arduino. The current limit is a hardware limit, regardless of the desired current. You can buffer the hall effect current sensor's output (via an op-amp) and compare it to a fixed voltage, then [AND] the comparator's output with the PWM from the Arduino. You will still have the 120Hz swings at lower currents, but the peaks won't stress the hardware. 
The real question - can you achieve 40A average without the 100A spikes?
-Aaron


----------



## valerun (Nov 12, 2010)

MozRover said:


> The real question - can you achieve 40A average without the 100A spikes?
> -Aaron


Very good point, Aaron. I think it might be possible given my caps discharge down to 260V - still quite a bit higher than target output voltage of ~208V. So I expect Arduino to crank up duty cycle to 85% or so to get 40A average if I limit high spikes (right now I get 40A at 69% duty cycle). Am trying the software solution now...


----------



## valerun (Nov 12, 2010)

ok so I spent some good time optimizing the charger cycle code to get it to ~4000 cycles a second. Thought this would be good enough given it corresponds to ~30+ samples per one 120Hz cycle. However, I still wasn't able to get the current curve to flatten out, even with progressive duty step. I did get some flattening going on but it wasn't particularly smooth and covered only part of the cycle. 

so moving on to the hardware solution. After thinking about this some more and doing some research, I now have 2 hardware options:
1. PWM pulse blocking once current reaches certain value. Arduino still controls duty cycle but with the original design's time constant (0.1-1 sec) so effectively controls for average current
2. Changing the approach altogether and running the whole PWM circuit off a dedicated chip. The PWM chip has to provide a way to set the error amplifier bias voltage from the outside, thus controlling output voltage. The Arduino will then drive that pin with analog voltage ramped up to the point when it sees target average current. Since analog voltage is produced by PWM output in Arduino, this effectively uses the same control loop design as in the original.

I guess I will try #1 first for simplicity, then if I hit any stability issues etc, will go for #2. Main benefits of #2 are stability of fast control loop, various built-in protections, and very tight voltage control. The latter is important for the CV stage of the charge.

order to digikey is out - will report on results once done.

V


----------



## vwdevotee (Mar 8, 2008)

Hey V,

Keep up the good work. You're just cruising through solution options on this. This might be a dumb question, but couldn't ripple caps be used to put a good sized dent in the oscillations, or would they need to be crazy big to be effective? I'm sure you've thought of it, but I'm curious.


----------



## valerun (Nov 12, 2010)

vwdevotee said:


> Hey V,
> 
> Keep up the good work. You're just cruising through solution options on this. This might be a dumb question, but couldn't ripple caps be used to put a good sized dent in the oscillations, or would they need to be crazy big to be effective? I'm sure you've thought of it, but I'm curious.


crazy big. basically, the current changes by 10A in <1% of voltage change once you cross the charging voltage threshold... So capacitors pretty much won't help you at all - you'd need to have capacitance of 40A*0.008s/3V=0.1F. At 450V rating, 100,000 microfarad capacitors don't come cheap ;-)


----------



## vwdevotee (Mar 8, 2008)

I figured it was somethign like that. But then again, I'm an ME, not an EE, so what do I know.


----------



## jackbauer (Jan 12, 2008)

I've been asked a lot of questions about the construction of the charger. While i had mine out of the car over the weekend for a rebuild i made a boring video on the subject  Enjoy!
http://www.youtube.com/watch?v=aju-KNLn1GE


----------



## aeroscott (Jan 5, 2008)

great teaching job . I like to see hardware compared to the drawing . thanks


----------



## vwdevotee (Mar 8, 2008)

jackbauer said:


> I've been asked a lot of questions about the construction of the charger. While i had mine out of the car over the weekend for a rebuild i made a boring video on the subject  Enjoy!
> http://www.youtube.com/watch?v=aju-KNLn1GE


 
I do love an Irish accent, they're so lyrical. That aside, thanks for the video. I too liked the way you went from most generic concept to how yours was designed to the actual parts.


----------



## ken2 (Feb 6, 2011)

thanks jack


----------



## JRoque (Mar 9, 2010)

Great vid Jack. Good to know your switches work well with a low-side shunt. I imagine the shunt and choke are low impedance. It's also good that you're fully fused as low-side current sensing can miss short circuits or ground leaks elsewhere.

Any plans on putting that paper diagram on a sheet in electronic format? I'm mostly interested in the inductor values (voodoo stuff to me).

JR


----------



## MozRover (Sep 19, 2009)

JRoque said:


> I'm mostly interested in the inductor values
> JR


While values can be calculated (see here: http://schmidt-walter.eit.h-da.de/smps_e/ivw_hilfe_e.html ) the real challenge is finding inductors with those values AND current ratings. I gather Simon and Jack used scavenged parts, from discarded welders and UPSs - a source to which I do not have access
While my implementation has no choke, for an inductor I used two of these E70340-015 in series (from CWS: http://www.coilws.com/index.php?main_page=index&cPath=113)
My pack is 240v flooded and I was having trouble towards the end of the charging, with PWM maxed out. I switched to half-rectified 3 phase (from fully rectified 1 phase) on input and things are better, but I anxiously await the posting of Valerun's PFC design. Controlling those things is voodoo to me


----------



## teraamper (Nov 18, 2009)

Hello JackBauer
Excellent work
Also, I'm going to the end of building my charger.
Can you send me a new FW for the charger.
Haw du you configure it for the LiFePo4 battery

by


----------



## vwdevotee (Mar 8, 2008)

It's my understanding that if you have current and voltage feedback from the charger to the MCU, then you can pretty much charge any chemistry you have enough voltage for (and maybe a BMS input if you have one of those). It's just a matter of changing the charging algorithm. Do I have that right? Or did I miss somethign fundamental?


----------



## JRoque (Mar 9, 2010)

vwdevotee said:


> It's my understanding that if you have current and voltage feedback from the charger to the MCU, then you can pretty much charge any chemistry you have enough voltage for (and maybe a BMS input if you have one of those). It's just a matter of changing the charging algorithm. Do I have that right? Or did I miss somethign fundamental?


Hi. I'll let others chime in but my opinion is that you're correct, with the assumption that you're talking about lithium and lead acid chemistries. Beyond the standard CV/CC loops, other types of batteries require temperature sensing to know when to terminate charge cycles. But yes, from what I've read, lithium cells are pretty easy to charge. Kinda begs the question, why some manufacturers want >$4K for their chargers? I'm not sure the chargers discussed here will be "$200" but they certainly won't be four grand either.

JR


----------



## jackbauer (Jan 12, 2008)

Charged my full lithium pack today to 163v. Hit the voltage SPOT ON. Voltage at the pack terminals very same as read by the charger. Sensing the voltage at zero current is the way to go. Oddly , this simple design beats a commercial unit featured on Jack Rickard's latest show that he spent i think 3k on! I am simply amazed at the noise immunity of the little avr dev board. Sitting right on top of the main bus cap and never even lifts an eyebrow.

The unit is running a lot cooler now for the same current thanks to the powerex cm400 igbt. Its much happier at 32khz then the fuji. Voltage sensing is now 0.2v accurate over a span of 0-230v. Current sensing is about 0.3amp resolution with the hass 50-s.

Setting up for lithium is easier than lead on this design! I just set pot 0 to 163.5v , current 25amps , trans curerent 5 amps , trans voltage 164v , timout 180mins. Job done. It ticks away happy.


----------



## teraamper (Nov 18, 2009)

thanks 
But do you have any new program for the charger?


----------



## jackbauer (Jan 12, 2008)

I do have new software in so far as the voltage and current sensing is concerned. Its on my laptop so i'll post it on here tomorrow.


----------



## SimonRafferty (Apr 13, 2009)

Thank you all for extending my original design - it's turned into something quite good now!

My charger has completed nearly 700 cycles on a set of recycled lead acid batteries which came from a junk yard in the first place. I tested the batteries at the yard before I bought them - and only bought the best ones but they had all been fitted to a car for at least a year before being condemned.

My guess is that the 120Hz (100Hz in the UK) ripple does not present a problem for the batteries as I've had way more cycles out of the batteries than I would have expected. In fact, my range has increased slightly over the life of the batteries - not what you would expect at all!

The only conclusion I can draw is that the charger has been better for the batteries than an Alternator in a car.

The last modification I made to my charger was, instead of the low side shunt, to drive the IGBT with a +15v 0v -15v supply - so it is being actively switched off. This made a pretty decent difference to the heat generated. It's been running for six months without a problem.

Si


----------



## DawidvC (Feb 14, 2010)

SimonRafferty said:


> The last modification I made to my charger was, instead of the low side shunt, to drive the IGBT with a +15v 0v -15v supply - so it is being actively switched off. This made a pretty decent difference to the heat generated. It's been running for six months without a problem.
> 
> Si



It is recommended by most (if not all ) IGBT manufacturers to use a negative voltage to switch off. Some igbt's are actually still conducting with the gate tied to 0V.

Congratulations on a good design

Dawid


----------



## teraamper (Nov 18, 2009)

Hello 
Jackbauer, did you forget on my FW for charger.


----------



## jackbauer (Jan 12, 2008)

Attached. Sorry i'm up to my eyes!


----------



## teraamper (Nov 18, 2009)

Jack bauer
Thanks for the FW

Now I hawe another problem. How can I convert in the hex file with mikrobasic.


----------



## valerun (Nov 12, 2010)

Hi Guys, 

got my current limiting circuit working based on a comparator IC comparing output of the hall current sensor and the reference voltage set by Arduino (through another PWM output). Seems to be working - 120Hz ripple is now barely noticeable - at least up to 30A where I tested to so far. Effectively, the current limiter now converts the charger into a dynamic PWM duty cycle system by disabling pulses when instantaneous current exceeds commanded average current by 25%. Arduino then ramps PWM duty until average hits the target value - even with the peaks cut off by the current limiter. So far, works fine.

The setup is a bit more noisy (audible noise, I mean) - not entirely sure yet what drives it - perhaps all the long-ish wires connecting new circuit's breadboard... Will tidy up in the next few days and put both the circuit and the wires under the shield. Will post the schematics of this additional circuit (very similar to the one I posted a couple of pages back) after I do that.

PS. Also am developing a new PCB now with line voltage sensor, more relay controls for fans / heaters, direct socket for Arduino pro mini board (http://www.sparkfun.com/products/9218), and this new circuit addition.

PPS. Gave up on a PFC booster for now - kept blowing up over 3kW. Waiting on some 1200V 400A modules from ebay now and some RCD snubbers to try again. In the meantime, will be using a regular capacitive voltage doubler to get 320V DC out of normal 110V line.


----------



## teraamper (Nov 18, 2009)

Hello
I tried build the hex file with mikrobasic but I get an error. HOw can I fix this.



0 133 Compilation Started D:\Moji Dokumenti\polnilec\polnilec.mbas
1 1015 Hint: Compiling unit "D:\Moji Dokumenti\polnilec\polnilec.mbas" polnilec.mbas
91 303 Identifier "PWM_Set_Duty" was not declared polnilec.mbas
91 304 Syntax error: Expected "end" but "PWM_Set_Duty" found polnilec.mbas
91 304 Syntax error: Expected "sub" but "(" found polnilec.mbas
91 348 Return value of the function "MeasureVolts" is not defined polnilec.mbas
91 304 Syntax error: Expected "end" but "0" found polnilec.mbas
91 304 Syntax error: Expected "." but ")" found polnilec.mbas
0 102 Finished (with errors): 13 mar 2011, 14:16:55 polnilec.mbpav

Please help me because I have no idea how to program processors


----------



## jackbauer (Jan 12, 2008)

What version of mikrobasic are you using? I'm using v1.5 which has slightly different deffinitions for pwm than the newer versions.What programmer are you using? The hex file i included can be loaded into the at128 by using pony programmer.


----------



## teraamper (Nov 18, 2009)

Yes I have the pony programer.
And I use the 4.6 mikrobasic. I will tray to get the 1.5


----------



## jackbauer (Jan 12, 2008)

You don't need to chage mikrobasic. Look in the help section under "pwm" If i remember it needs to be pwm1_setduty or something like that. Look at one of the older versions that simon posted.


----------



## teraamper (Nov 18, 2009)

It works. but I have some wornings. Is this ok.
It is PWM1_Set_Duty



0 133 Compilation Started E:\Moji Dokumenti\Polnilec\polnilec v7.mbas
1 1015 Hint: Compiling unit "E:\Moji Dokumenti\Polnilec\polnilec v7.mbas" polnilec v7.mbas
136 1016 Warning: Source size (16) does not match destination size (23) polnilec v7.mbas
139 1016 Warning: Source size (16) does not match destination size (7) polnilec v7.mbas
324 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
358 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
381 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
410 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
504 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
517 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
523 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
524 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
546 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
616 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
618 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
623 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
673 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
676 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
680 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
683 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
739 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
740 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
751 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
752 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
803 1006 Warning: Generated baud rate is 9615 bps (error = 0.16 percent) polnilec v7.mbas
810 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
816 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
870 1009 Warning: Implicit typecast performed from "integral" to "real" polnilec v7.mbas
829 1001 Hint: Variable "nVoltageScale" has been declared, but not used polnilec v7.mbas
830 1001 Hint: Variable "nVoltageOffset" has been declared, but not used polnilec v7.mbas
831 1001 Hint: Variable "nCurrentScale" has been declared, but not used polnilec v7.mbas
832 1001 Hint: Variable "nCurrentOffset" has been declared, but not used polnilec v7.mbas
834 1001 Hint: Variable "fVPB" has been declared, but not used polnilec v7.mbas
835 1001 Hint: Variable "nTemp" has been declared, but not used polnilec v7.mbas
838 1001 Hint: Variable "nAmps" has been declared, but not used polnilec v7.mbas
839 1001 Hint: Variable "nBats" has been declared, but not used polnilec v7.mbas
483 1001 Hint: Variable "nAmpsM" has been declared, but not used polnilec v7.mbas
829 1011 Hint: Variable "nVoltageScale" has been eliminated by optimizer polnilec v7.mbas
830 1011 Hint: Variable "nVoltageOffset" has been eliminated by optimizer polnilec v7.mbas
831 1011 Hint: Variable "nCurrentScale" has been eliminated by optimizer polnilec v7.mbas
832 1011 Hint: Variable "nCurrentOffset" has been eliminated by optimizer polnilec v7.mbas
833 1011 Hint: Variable "nRunOnPowerUp" has been eliminated by optimizer polnilec v7.mbas
834 1011 Hint: Variable "fVPB" has been eliminated by optimizer polnilec v7.mbas
835 1011 Hint: Variable "nTemp" has been eliminated by optimizer polnilec v7.mbas
837 1011 Hint: Variable "nVolts" has been eliminated by optimizer polnilec v7.mbas
838 1011 Hint: Variable "nAmps" has been eliminated by optimizer polnilec v7.mbas
839 1011 Hint: Variable "nBats" has been eliminated by optimizer polnilec v7.mbas
82 1011 Hint: Variable "nVolts" has been eliminated by optimizer polnilec v7.mbas
84 1011 Hint: Variable "nVoltsT" has been eliminated by optimizer polnilec v7.mbas
85 1011 Hint: Variable "nVoltsP" has been eliminated by optimizer polnilec v7.mbas
110 1011 Hint: Variable "nAmpsM" has been eliminated by optimizer polnilec v7.mbas
111 1011 Hint: Variable "nCurrentScale" has been eliminated by optimizer polnilec v7.mbas
132 1011 Hint: Variable "nTemp" has been eliminated by optimizer polnilec v7.mbas
222 1011 Hint: Variable "nCurrentScale" has been eliminated by optimizer polnilec v7.mbas
223 1011 Hint: Variable "nVoltageScale" has been eliminated by optimizer polnilec v7.mbas
224 1011 Hint: Variable "nCurrentOffset" has been eliminated by optimizer polnilec v7.mbas
225 1011 Hint: Variable "nVoltageOffset" has been eliminated by optimizer polnilec v7.mbas
226 1011 Hint: Variable "nRunOnPowerUp" has been eliminated by optimizer polnilec v7.mbas
483 1011 Hint: Variable "nAmpsM" has been eliminated by optimizer polnilec v7.mbas
496 1011 Hint: Variable "nTempTime" has been eliminated by optimizer polnilec v7.mbas
801 1011 Hint: Variable "nVolts" has been eliminated by optimizer polnilec v7.mbas
930 1010 Hint: Unit "polnilec v7.mbas" has been recompiled polnilec v7.mbas
0 134 Compiled Successfully E:\Moji Dokumenti\Polnilec\polnilec v7.mbas
0 139 All files Compiled in 801 ms 
0 1144 Used RX (bytes): 32 (100%) Free RX (bytes): 0 (0%) Used RX (bytes): 32 (100%) Free RX (bytes): 0 (0%)
0 1144 Static RAM (bytes): 57 Dynamic RAM (bytes): 4038 Static RAM (bytes): 57 Dynamic RAM (bytes): 4038
0 1144 Used ROM (bytes): 15586 (13%) Free ROM (bytes): 107294 (87%) Used ROM (bytes): 15586 (13%) Free ROM (bytes): 107294 (87%)
0 145 Project Linked Successfully polnilec v7.mbpav
0 140 Linked in 521 ms 
0 141 Project 'polnilec v7.mbpav' completed: 1472 ms 
0 103 Finished successfully: 13 mar 2011, 15:57:26 polnilec v7.mbpav


----------



## vwdevotee (Mar 8, 2008)

valerun said:


> Hi Guys,
> 
> got my current limiting circuit working based on a comparator IC comparing output of the hall current sensor and the reference voltage set by Arduino (through another PWM output). Seems to be working - 120Hz ripple is now barely noticeable - at least up to 30A where I tested to so far. Effectively, the current limiter now converts the charger into a dynamic PWM duty cycle system by disabling pulses when instantaneous current exceeds commanded average current by 25%. Arduino then ramps PWM duty until average hits the target value - even with the peaks cut off by the current limiter. So far, works fine.
> 
> ...


 
Wow V, that was super quick. I can only hope to get as good at my craft as you are with yours. Not that I'm not super thrilled with what you've done, but to make the charger more widely applicable, would it be possible to add temp inputs for other chemistries? Like I said, I'm thrilled - especially since I'll be rockin' PbA batteries - but I'm thinking for people using ones other than lead and lithium. You're amazing; I'm looking forward to seeing the full schematic.

Damon


----------



## MozRover (Sep 19, 2009)

valerun said:


> Hi Guys,
> 
> The setup is a bit more noisy (audible noise, I mean) - not entirely sure yet what drives it -


V,
Is it a ticking noise or a humming noise?


----------



## SimonRafferty (Apr 13, 2009)

Valerun - Good work!

That's a very interesting and useful addition! I look forward to seeing how it operates long term and to have a look at the circuit!

teraamper - if the program runs OK, don't worry too much about the warnings.

Si


----------



## JRoque (Mar 9, 2010)

valerun said:


> Hi Guys,
> 
> got my current limiting circuit working based on a comparator IC comparing output of the hall current sensor and the reference voltage set by Arduino (through another PWM output). Seems to be working - 120Hz ripple is now barely noticeable - at least up to 30A where I tested to so far. Effectively, the current limiter now converts the charger into a dynamic PWM duty cycle system by disabling pulses when instantaneous current exceeds commanded average current by 25%. Arduino then ramps PWM duty until average hits the target value - even with the peaks cut off by the current limiter. So far, works fine.


Way to go V! That's the way to do it. I've always thought handing the loops to analog circuits and setting those values digitally is how it should be done. Nearly nothing else can be as quick - and certainly not as easy - as a comparator/amp to do the current loop checks. I've used an external DAC to set the needed value against a hardware reference and it worked well.

JR


----------



## teraamper (Nov 18, 2009)

My fw with the program version 4.6 is not working. Then I tried the 1.5 version of the program is working.

But now I hawe a problem with my current measurment. Can I use the old current transformer with this FW, what I hawe to change.


----------



## jackbauer (Jan 12, 2008)

the new firmware is setup to use a lem hass 50-s current sensor. Much simpler hardware than the old honeywell. Is that what you are using?


----------



## teraamper (Nov 18, 2009)

Yes I hawe the honeywell. Because I can get it from the old UPS


----------



## SimonRafferty (Apr 13, 2009)

Since there are hardware variations creeping in which affect the required firmware, could I suggest that if you make such a change, you add a programming option (in the same place as you set up the charge profile as it's non volatile) for which hardware options are installed?

Si


----------



## mister.blonde (Feb 15, 2011)

This thread is incredible and has helped me tremendously. Thank you to everyone that has contributed to this!

I am building this charger as an addition to an electric car I am working on for my senior design project. As of right now I have assembled almost everything on the charger, am waiting for the IGBT and bridge rectifier to come in the mail, should be here tomorrow. One thing I can not seem to find for the life of me is an inductor that will work though. Does anyone have any advice where I might find one? I have tried finding old welders, with no luck... 
Any advice would be greatly appreciated! I have found two online that I can use but are $60 a piece, so I am trying to find something else....


----------



## JimDanielson (Oct 19, 2008)

How much current do you want to run and what inductance? I might have one extra that will work for you


----------



## SimonRafferty (Apr 13, 2009)

I think I posted this here earlier somewhere but...

You can buy a cheap multi-meter on eBay which will measure inductance for a few $ - actually, for less than an inductor.

You can buy ferrite rings, intended for reducing RF emissions from equipment fairly cheaply - and you can buy copper wire or use hookup wire etc.

Choose wire which will take the current. Wrap ten or so coils round the inductor and use the meter to measure the inductance.

You need about 12mH (for Jacks lower frequency version or 6mH for mine). Scale the number of turns to give you the inductance you need.

The inductor I have (made like this) is about 2" with copper wire which was salvaged from a transformer. Mine only runs at 10A or so - so you may have to scale up a bit!

The meter I bought has a hall effect Clamp-meter built in too which will measure DC current up to 1000A. It has been dead useful too!

Si


----------



## mister.blonde (Feb 15, 2011)

JimDanielson said:


> How much current do you want to run and what inductance? I might have one extra that will work for you


About 15 amps and 12mH. That would be great if you did, otherwise I might try making one like simon said. I had researched making one, but I was under the assumption that I would have to wrap a 5 inch core thousands of times to get the right inductance, I must have done the calculations wrong, I will look into it. 

Thanks guys!


----------



## adamj12b (May 4, 2009)

SimonRafferty said:


> I think I posted this here earlier somewhere but...
> 
> You can buy a cheap multi-meter on eBay which will measure inductance for a few $ - actually, for less than an inductor.
> 
> ...


Simon,

I have not spoken much on this thread, but Always read it. 

I was wondering what frequency you are running your charger at. Also, what pwm style and resolution? 

I know jack is running 32khz at 8 bit with phase correct pwm.

-Adam


----------



## valerun (Nov 12, 2010)

SimonRafferty said:


> You need about 12mH (for Jacks lower frequency version or 6mH for mine). Scale the number of turns to give you the inductance you need.


You actually don't even need that much - per http://schmidt-walter.eit.h-da.de/smps_e/abw_smps_e.html (a great resource for calculating this stuff given your parameters), with 300V input (220V full-wave rectified), 200V output (yours will be different), 30A peak current, 32kHz switching (what I have - max for Arduino), I get 0.18mH which is way smaller than 12mH. It assumes 40% ripple current which is optimal compromise per all SMPS design books. This ripple current will be largely smoothed by your output cap. 

The required minimum inductance scales *inversely* with max current, so if you need 15Amps (instead of 30 in the above example), you will need ~0.4mH inductor. It also scales inversely with PWM frequency - the higher the frequency, the lower the inductance.

Going for higher inductance is generally ok BUT note that the inductance you measure with the multi-meter at 0amps may not have the slightest relation to the inductance you would measure at 15amps (if you had a meter that could, that is). If you use a typical small-ish ferrite core (e.g., 2 inches diameter toroid, 0.5 inch thick), it will likely be deeply saturated at 15amps for 12mH coil. So your circuit will see much lower inductance at high current levels - hopefully it won't be below the minimum you calculated above but you just don't know. Inductor saturation is one of the common causes of failures in switching power supplies so pays to be careful there

I've got my inductors on ebay after looking at their datasheets (attached). You will see that they list saturation properties in the table - this is what you would be looking for. They probably still sell these on ebay. 

If you do want to build your own, I would suggest picking the right core type (normally powder iron for these levels of current) 2-3 inches diameter, 1 inch thick. 15Amps continuous will require 14-gauge wire (see attached PDF). Then use Simon's suggestion of making 20-30 turns and measuring inductance (with the right type / size of core, you can be sure your measured inductance will not be too far from inductance under load). If you need to increase the inductance, remember than L is proportional to the *square* of the number of turns.

Hope this helps.

Thanks,
Valery.


----------



## valerun (Nov 12, 2010)

ok I just looked it up and they actually still do sell them - exact copy of the one working in my charger (although at higher current level compared to yours so you might need to either re-wind or use 2 - depending on your switching frequency). In either case, I would use at least a 2x cushion in your inductance choice just in case you will saturate it.

http://cgi.ebay.com/Falco-T23037-Po...ltDomain_0&hash=item2c598b702c#ht_1680wt_1379

note that even with this size / type of core, it does saturate - to the tune of losing 50% of its inductance at 45amps. 

V

PS. Finally, note that with the charger design described here, you will likely see a 120Hz current ripple at up to 2-3x your average current - your exact mileage will depend on the size of the input cap and difference between input and output voltage...


----------



## mister.blonde (Feb 15, 2011)

valerun said:


> The required minimum inductance scales *inversely* with max current, so if you need 15Amps (instead of 30 in the above example), you will need ~0.4mH inductor. It also scales inversely with PWM frequency - the higher the frequency, the lower the inductance.


I am not that experienced with inductors so, I apologize for the stupid questions, but if this is the case why would I want my max current to be lower, just in regards to the inductor? The max current my circuit will experience is about 15 amps, so why would I not just get an inductor rated for .36 mH (2*.18mH you discussed) and 30 amps? Does it effect the circuit poorly if the inductor is rated for more amps than it will see?

Also, on a side note; This is probably a silly idea, but would it be possible to use a transformer as an inductor? My understanding is that a transformer is basically two inductors, so would it make sense to use the transformer in a way to just to use one of these internal inductors? Again, I am not that experienced on this, it was just a wild idea. 

Thanks


----------



## mister.blonde (Feb 15, 2011)

Valerun, 

What voltage transducer did you end up getting? Part number etc, I had ordered one from RS but something got mixed up in the order and I received a second current transducer instead. I would like to order from somewhere in the States, because of shipping costs etc. 

Thanks


----------



## valerun (Nov 12, 2010)

mister.blonde said:


> Valerun,
> 
> What voltage transducer did you end up getting? Part number etc, I had ordered one from RS but something got mixed up in the order and I received a second current transducer instead. I would like to order from somewhere in the States, because of shipping costs etc.
> 
> Thanks


Hi M.B., 

I actually didn't get the transducer, I used a 40mA hall current sensor in series with a 5kOhm 10Watt resistor. Transducer I could find on digikey was way too expensive...

on your inductor question - no problem over-designing the inductor (building in a higher current rating) if you're ok with larger size / weight. 

transformer core as a base for this inductor might not be a good idea unless it's a high-frequency transformer (i.e. not regular mains transformer). In a low-frequency mains transformer, the core is normally composed of thin sheets of laminated metal - I think that type of core would have large losses at high frequencies. 

The ebay inductor I linked in my earlier post might work but you wouldn't have much of the safety margin... I would either get that inductor and re-wind with thinner wire or wind your own starting with the right core type/size. Check out design software at http://www.micrometals.com/software_index.html - it was a good educational experience for me...

hope this helps. 

V


----------



## teraamper (Nov 18, 2009)

I tried with 1.1mH coil and work prfect.

But I hawe another problem. The BMS inpud doesant reducet the voltage.
If I conect the +5V on the pin EXT2 pin8 nothing happens


----------



## jackbauer (Jan 12, 2008)

The bms input is on portb bit 3. Just check its the right pin on the ext connector from the datasheet.


----------



## 2010Ranger (Mar 10, 2011)

First I want to thank all of the very talented individuals who have support this topic with their ideas and time. I've been a follower of this and many other posts. I'm building Paul’s controller now and looking for a viable charger build. Which leads me to ask?
Is there any where to find a complete set of instructions and bill of materials so that someone can confidently build any one of the battery charger versions covered here. It's a bit madding trying to discern who is commenting on what version of which battery charger on any given day. I know this is a place to invent, share and support each other, but is it possible to have a space / separate page that would be solely for the illustration of the progress of a project through its completion?

2010


----------



## teraamper (Nov 18, 2009)

I will set out my version of the charger, when it's completed.
But it may still take a month to finish it.

Jackbauer
Today I tested all pins to +5 V, but none of them reduced voltage.
Only ext2 pin 13 stops the charge.


----------



## jackbauer (Jan 12, 2008)

I agree the documentation is poor. I just don't have the time these days to sit down and write it all out. I am making a few videos which should help. I posted the first on here about a week ago.

teraamper , not sure what's going on. I looked at the code and it does check that pin for a high signal and should reduce pwm when high.


----------



## mister.blonde (Feb 15, 2011)

I will be compiling an updated version of the charger I am building and will post all documentation once it is complete. This should be done with in a month.


----------



## valerun (Nov 12, 2010)

Ok guys. took a few hours to document stuff on the [under construction] site of the high-performance e-conversion company we are setting up. Go to http://www.rusbaevents.com/cgi-bin/Vevents/EMW/VMcharger.pl

I will also set up another discussion thread to capture comments / discussion more cleanly.

Would like to take this opportunity to thank Simon, Jack, Jeff Major, Jeffrey (aka Tesseract) and many others for insightful comments and help!

Let me know what you think.

V


----------



## SimonRafferty (Apr 13, 2009)

Well done Valerun - that looks very impressive.

I'm a bit disappointed you've deleted the buttons so you have to program the thing using USB. Maybe it doesn't make much difference - but to me, it de-mystifies the workings of the charger and makes it more accessible. The user programmability of it has proven valuable to me.

You might want to reconsider using +/-15v to drive the IGBT Driver. I've been using this for a couple of months - and have blown two of the drivers!

The datasheet says +/-15v will work - but the biggest differential shown in any of the examples (I think) is +15/-5v. I think a 30v difference is pushing it too hard.

I've ordered a +/- 12v supply to see if it helps at all.

When you have kits ready to go - can I order one? (I can always add my own buttons & hack the software). Do I get a discount? 

Si


----------



## jackbauer (Jan 12, 2008)

Very good work indeed. I'll also put my name down for a kit!


----------



## mrbigh (Dec 31, 2008)

I would like to give it a try to, so whenever you will have a set of PCB for the charger, I would like to purchase a pair.
What type of value for the inductor and or the eBay source?
You did a great job
Thank you in behalf of the DIY EV community.


----------



## valerun (Nov 12, 2010)

SimonRafferty said:


> Well done Valerun - that looks very impressive.
> 
> I'm a bit disappointed you've deleted the buttons so you have to program the thing using USB. Maybe it doesn't make much difference - but to me, it de-mystifies the workings of the charger and makes it more accessible. The user programmability of it has proven valuable to me.
> 
> ...


Hi Simon - makes sense on the buttons - just wanted to get this version out as soon as possible and keep the code as simple as possible for now. Will likely add them in the next version.

on +-15V - seems to be working fine for now. I'd be hesitant to go with +-12V as it would mean ~10-11V high on the gate and at high currents it might push the voltage drop too high and hence the dissipation. Ideally one would do what you suggest (+15/-5-10) but not sure such supplies exist and I didn't really want to use 2 isolated supplies on the driver board. 
EDIT: just looked up Digikey and they sell +-15, +5V supply for $40 so probably too much.... :END EDIT
BTW, what did the failure mode look like for you? Did it cascade to IGBTs or just the driver died?

V


----------



## SimonRafferty (Apr 13, 2009)

>BTW, what did the failure mode look like for you? 
>Did it cascade to IGBTs or just the driver died?

The voltage of the output just became fixed at about 11v, switching the IGBT permanently on which in turn blows a fuse. The IGBT was fine after replacing the chip and fuse.

I suspect that the gate capacitance is high enough that at 30v I am exceeding 250mW dissipation whereas at 15v I was not. The reason yours is OK, is probably just lower capacitance.

The IGBT's I'm using are pretty big (about the size of a pack of Cigarettes) rated up to 500A - which is way over the top but I have loads of them!

The 3120 chips are so cheap that it might be practical just to parallel two or three together to reduce the switching time? More fruitful than upping the voltage - particularly if you are charging towards the top end of the voltage range.

If you are commercializing the charger, surely it's worth upping the switching frequency? You reduce the size of the input and output capacitors as well as the inductor which are amongst the most expensive components.

Si


----------



## valerun (Nov 12, 2010)

SimonRafferty said:


> >BTW, what did the failure mode look like for you?
> >Did it cascade to IGBTs or just the driver died?
> 
> Having looked at the data sheet, it has a max dissipation of 250mw - so 8.3mA at 30v requiring a series resistance of 3k75
> ...


thanks Simon. Here's how I'd calculate the dissipation in this circuit. The dissipation happens only during gate voltage changes. The work that A3120 does is essentially charging and recharging the input capacitance of the IGBT. In my case of dual IGBTs, the capacitance is ~6,000pF or 6*10^-9 F. With 30V difference, the energy going in and out (twice per cycle) is 6*10^-9*30^2/2 =~3*10^-6 J. On a per-cycle basis: 6*10^-6 J. At 32kHz switching frequency, this is 0.18W flowing to/from those capacitances. Now, it's known that the circuit charging the cap dissipates the same amount of energy as it transmits to the cap. Therefore, my driver's dissipation is also 0.18W which is within limits.

Now, if your switching frequency is 64kHz, you will exceed this limit and may blow it up. Don't know off the top of my head what frequency you are using, though. 

On the related topic: I am thinking of further reducing the operating frequency of the charger to 16kHz to reduce losses, noise, and possibility for severe inductive kick-backs. Right now, my weakest thermal point is ...the inductor... that heats up to 80+ centigrade at max current due to core losses. Maybe I can then use 2s2p inductor config to get to 80-100A max current... ;-))


----------



## DJBecker (Nov 3, 2010)

valerun said:


> Now, it's known that the circuit charging the cap dissipates the same amount of energy as it transmits to the cap. Therefore, my driver's dissipation is also 0.18W which is within limits.


The way to reduce this is to use a gate driver with lower output impedance, and use a bit bigger gate resistor. This doesn't reduce the total power, but puts most of the heat into the gate resistors. Which are a lot cheaper and easier to cool than the gate driver.


----------



## 2010Ranger (Mar 10, 2011)

Valerun, like Jackie Gleason would say...... How sweet it is ;-) 

I too would like to give your design a try. When you will have the PCBs, I would like to purchase a pair.

2010


----------



## Snakub (Sep 8, 2008)

Has anyone used any other micro controllers other than the one originally used by Simon?


----------



## valerun (Nov 12, 2010)

Snakub said:


> Has anyone used any other micro controllers other than the one originally used by Simon?


I used Arduino - see http://www.rusbaevents.com/cgi-bin/Vevents/EMW/VMcharger.pl


----------



## martinwinlow (Sep 22, 2009)

Hi Valeun,

I am interested in a kit - price permitting...

Whilst I can see the logic in programming the charger with cell numbers etc via USB, not being able to easily adjust the max power input might be a shame as for oprtunity charging or generally charging away from base it would be nice to be able to take advantage of whatever power supply is available without having to get the USB cable/PC out. Of course, I have an on-board carputer so I can quickly change things... Other may not.

Or have I mis-interpreted this?

Regards, MW.


----------



## valerun (Nov 12, 2010)

martinwinlow said:


> Whilst I can see the logic in programming the charger with cell numbers etc via USB, not being able to easily adjust the max power input might be a shame as for oprtunity charging or generally charging away from base it would be nice to be able to take advantage of whatever power supply is available without having to get the USB cable/PC out. Of course, I have an on-board carputer so I can quickly change things... Other may not.


Hi Martin - I will be adding the user controls in the next version so a lot of these functions will be implemented: # of cells, CC voltage cutoff per cell, C rate for charging in CC / stopping in CV, etc. 

Right now, the charger is sensing the input mains voltage and throttles down the power automatically from full power (40A on my house lines - can't get more than that without tripping the breakers in a few minutes) to 1.5-2kW from 110V lines. (note: the code posted on site does not have this functionality yet)


----------



## valerun (Nov 12, 2010)

mrbigh said:


> I would like to give it a try to, so whenever you will have a set of PCB for the charger, I would like to purchase a pair.
> What type of value for the inductor and or the eBay source?
> You did a great job
> Thank you in behalf of the DIY EV community.


hi mrbigh - the charger will work with any inductor > ~0.2mH but I'd recommend 0.4mH or higher. Search for T23037 on ebay. $12.99+shipping.

V


----------



## dimitri (May 16, 2008)

V,

do you have BMS Enable input? So the charger can be stopped/throttled upon BMS signal if/when a cell goes high? 

Really nice project, congrats! Will likely buy a kit when available.


----------



## Roy Von Rogers (Mar 21, 2009)

Another thing that may come in handy down the line would be a low voltage signal indicating the end of charge completion of charger.

This way one could incorporate such signal in to a SOC downcounter indicating the battery is at full charge, instead of manually having to hit a reset button.

Roy


----------



## valerun (Nov 12, 2010)

Roy Von Rogers said:


> Another thing that may come in handy down the line would be a low voltage signal indicating the end of charge completion of charger.
> 
> This way one could incorporate such signal in to a SOC downcounter indicating the battery is at full charge, instead of manually having to hit a reset button.
> 
> Roy


that's a good idea. will include this into the next rev


----------



## mister.blonde (Feb 15, 2011)

For anyone that has programed onto the ATmega128, I am having trouble getting AVRFLASH to recognize read or write to the device. It doesn't even notice the device is attached. I tried using ponyProg 2000, it recognized the device was present, however, when I tried to read it (which it did successfully), it came up with nothing but I could not write to it successfully. I'm using the programmer and board suggested by Simon from sparkfun...Did anyone else have this problem? Am I missing a driver? I don't know what's wrong!


----------



## ElectricS10 (Mar 20, 2008)

Just wanted to say thank you to you guys for putting this together. Looking forward to the final product!


----------



## valerun (Nov 12, 2010)

update on the charger with hardware current limiting - as someone mentioned before on this forum, getting full current out of the charger without any 120Hz ripple is actually tough. Today, I did the first test of the 40A 200V run with current limiter and the processor maxed the duty cycle at 98% to keep the average current at 40A (the previous tests were done at a lower voltage so the dips were not a problem). I might have to increase the allowed 120Hz ripple (right now limited to 20%) or increase the input caps (right now at ~10,000uF). Will first try the former (increasing to 40% allowed ripple - in line with the normal design compromise in SMPS). 

Also, started re-design of the charger layout to mount nearly everything (except input caps) on a big heatsink - inspired by Soliton1 design. Will post some pics later today / tomorrow


----------



## Snakub (Sep 8, 2008)

valerun said:


> Hi Martin - I will be adding the user controls in the next version so a lot of these functions will be implemented: # of cells, CC voltage cutoff per cell, C rate for charging in CC / stopping in CV, etc.
> 
> Right now, the charger is sensing the input mains voltage and throttles down the power automatically from full power (40A on my house lines - can't get more than that without tripping the breakers in a few minutes) to 1.5-2kW from 110V lines. (note: the code posted on site does not have this functionality yet)


Does this mean that your charger works with 110 as well as 220 volts? How are you stepping up the voltage from 110? Is there a way to select just lead acid batteries and not charge with the lithium cell part of the program?


----------



## valerun (Nov 12, 2010)

Snakub said:


> Does this mean that your charger works with 110 as well as 220 volts? How are you stepping up the voltage from 110? Is there a way to select just lead acid batteries and not charge with the lithium cell part of the program?


yes. Actually, I am now thinking of just having two sets of leads coming in - one one for 220V, one for 110V. As the receptacles are usually different, this makes sense to me.

I use a standard voltage doubler circuit to step up 110 to 220. Found in any PC power supply. you can google it pretty quickly. I will add those 'help circuits' to the schematics in my next iteration of materials on site. Busy with redesigning layout and designing new sets of PCBs now...

V


----------



## valerun (Nov 12, 2010)

yesterday decided that some simplification of the design is needed. Was updating the schematics & PCBs for next version and noticed that there might be no need for some of the components and / or some components can be replaced with alternative solutions.

Here's the list of simplifications:
1. take out pre-charge circuit and logic. Replace with a 36A 1 Ohm in-rush limiter. Works fine, spark on mains connect is similar to what I sometimes get from my PC...

2. Remove mains voltage sensing. Before, it was used to switch the mode of the voltage doubler. And I always was a bit worried that due to some kind of fluke one of these days it will decide to leave the doubler in an active mode when I connect 240V - producing 660V DC on the output and blowing everything up. So I just wired two receptacles - separate for 110 and 220V. no chance of mistake now. and fewer components / less code to deal with.

3. Remove output relay. With the recent changes to sensing circuits and code, the voltage readings are very stable so no need anymore. Again, less code and fewer components to deal with.

4. Remove all fans and consolidate everything on one huge heatsink (11x11 inch surface, 3.5 inch tall 10-lb aluminum heatsink from heatsinksusa.com). a 10-lb heatsink cannot fail - can't say the same thing about all those little PC fans I was using ;-)

The resulting unit now drops ~2-3V less from input to output - which means ~100W less to remove so the fan-less design becomes even more feasible.

Will post an updated page once done with this new design / layout.

V


----------



## ElectricS10 (Mar 20, 2008)

valerun said:


> yesterday decided that some simplification of the design is needed. Was updating the schematics & PCBs for next version and noticed that there might be no need for some of the components and / or some components can be replaced with alternative solutions.
> 
> Here's the list of simplifications:
> 1. take out pre-charge circuit and logic. Replace with a 36A 1 Ohm in-rush limiter. Works fine, spark on mains connect is similar to what I sometimes get from my PC...
> ...


Impressive ! I like your thinking. Less is more.

I'm going to set mine up in concert with my internet home alarm system so I can shut it down remotely, should something go boom.


----------



## valerun (Nov 12, 2010)

here's how the new layout looks. PCBs are in the mail. Note that I am now using an IGBT module rated for 1200V 400A (as opposed to smaller dual 600V 60A IGBTs I was using). The relays on the heatsink will control heater & blower for interior of the car and battery packs, and some other TBD accessories.

Tested yesterday to 40A for ~30 min with NO FAN and the worst position of heatsing (upside down as shown in pic) - inductor is at 85 deg C, output diode at ~75, IGBT at ~40, input bridge at ~50. To my slight surprise, I found that my 15uF input and output high-frequency caps are heating up, too - to ~40 deg C... The inductor will be enclosed in a tin box with thermally conductive paste and box mounted to the heatsink so expect the temp to go down by 20 deg or so.

Had to reduce PWM frequency to 10kHz - above 16kHz the driver and +-15V supply overheat. The input capacitance of this IGBT module is 48,000 pF - about 10-15x the smaller IGBTs I was using before. Lower PWM frequency is fine if the output current is higher (I am eventually shooting for 60-70Amp output at 200V with current ripple <40%). At 0.4mH inductance & 10kHz switching, 10 kHz ripple current is ~9A which is pretty minor with the average output of 40-50A. 120Hz ripple will be more of a problem as usual but still should be manageable at <40% with the right input cap selection.

more updates in a couple of days when I install my new PCBs and steel EMI screens between the control board and power stage.

V


----------



## JRoque (Mar 9, 2010)

Hey V, that looks great. Hopefully the shroud/heatsink on the inductor will help lowering the temperature. 

I might have missed it but, what kind of cap is that on the switch? A film cap on the leads makes the IGBT happy, I'm sure you know. I also imagine busbars will replace the large cap wiring.

This is a great project that debunks the notion that a battery charger must cost thousands of dollars. Let's see how many lift your design and offer it as a commercial solution.... for thousands of dollars.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hey V, that looks great. Hopefully the shroud/heatsink on the inductor will help lowering the temperature.
> 
> I might have missed it but, what kind of cap is that on the switch? A film cap on the leads makes the IGBT happy, I'm sure you know. I also imagine busbars will replace the large cap wiring.
> 
> ...


thanks JR! Yes, the cap closest to IGBT is the film cap (15uF, 2mOhm ESR). Not so sure about the busbars - after all, the currents are not at the level of motor controllers... will see what the thermal situation will be...

BTW I am planning to offer kits when I am done.


----------



## Tesseract (Sep 27, 2008)

JRoque said:


> This is a great project that debunks the notion that a battery charger must cost thousands of dollars. Let's see how many lift your design and offer it as a commercial solution.... for thousands of dollars.
> 
> JR


I agree up to point, but you aren't being too fair here. A commercial charger (Manzanita Micro notwithstanding) must be certified for safety and EMC testing by the UL/ETL and FCC if sold in the US (approximately $25-$50k in costs) plus CE testing if sold in the EU (ditto, or worse). So even if you get a working design for free you still have to spend $100k just to sell the damn thing legally worldwide.

Remember, anything that plugs into the AC mains is very much a regulated product, even in the comparative wild west called the US.

Furthermore, a buck converter presents a rather poor power factor to the AC line, limiting the total amp draw to perhaps 60% of the theoretical maximum. Additionally, the EU requires any device that draws more than 75W be power factor corrected.

Nor is this charger isolated, which makes it a potential safety hazard, and chargers with output voltage greater than 60V pretty much have to be isolated for legal sale in the US and EU.

Etc. and so on. This looks like a good DIY project, and perhaps could be a viable semi-commercial kit, but that's about it.


----------



## JRoque (Mar 9, 2010)

Hi.



Tesseract said:


> I agree up to point, but you aren't being too fair here. A commercial charger (Manzanita Micro notwithstanding) must be certified for safety and EMC testing by the UL/ETL and FCC if sold in the US (approximately $25-$50k in costs) plus CE testing if sold in the EU (ditto, or worse). So even if you get a working design for free you still have to spend $100k just to sell the damn thing legally worldwide.
> 
> Remember, anything that plugs into the AC mains is very much a regulated product, even in the comparative wild west called the US.


You're thinking of a manufacturer in US or EU. I was thinking of someone you-know-where copying the design and selling direct to consumers here, bypassing all regulations... not that they've ever done that, of course.

JR


----------



## Tesseract (Sep 27, 2008)

JRoque said:


> You're thinking of a manufacturer in US or EU. ...


Not quite, JR... I'm thinking of anyone that _sells into_ the US or EU, regardless of origin. It could be some raving lunatic in the pacific northwest or some scheming thief in the far east. As soon as someone (okay, several someones) complains that their charger shocked them, caught on fire, caused their TV to go snowy, etc., the pertinent regulators will issue a cease and desist order on the sale (or importation) of that product. If the product has false safety/EMC markings on it then the manufacturer can expect to be fined heftily or even criminally prosecuted (it's far better to not have those markings at all, in other words).

Now many of these regulations true of ANY electronic device, but battery powered devices often get a pass, especially low-volume niche products, doubly so in the US, which is still the wild west when it comes to letting small companies and inventors manufacturer potentially lethal products and sell them with impunity 

AC mains operated products, however, are a whole 'nother story. And if you think about it, it's hard to imagine a more (potentially) dangerous product than a non-isolated battery charger. As me and Qer joke with each other on Skype all the time:

What Could Possibly Go Wrong?



Oh - I don't mean to be a wet blanket here. I actually encourage precisely this sort of DIY hacking _as long as you have some competence and understanding_ about electronics. I sort of get uneasy when I see things like this charger or the Paul-and-Sabrina controller being built by people who couldn't tell a proton from an electron, but, well... natural selection never stops working for you!


----------



## valerun (Nov 12, 2010)

Tesseract said:


> I sort of get uneasy when I see things like this charger or the Paul-and-Sabrina controller being built by people who couldn't tell a proton from an electron, but, well... natural selection never stops working for you!


Tough love, Jeffrey! ;-)

Anyway, new PCBs are in, along with the arduino pro mini (plastic reel on the right), new 128x128 color serial display, and netduino board for some testing (48Mhz .NET system - way more powerful than my first PC, hehe). Will assemble the control board today & attach to the new layout from a couple of posts back. Will see what happens ;-)

V


----------



## JRoque (Mar 9, 2010)

What, no silkscreen? j/k it looks good. Is that display part of this design too?

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> What, no silkscreen? j/k it looks good. Is that display part of this design too?
> 
> JR


yes - it just connects to the Arduino serial output / input. All controls done in software.


----------



## EVMAN (Jul 26, 2007)

Just wondering.....can U get ANY type of certification, USA or European, on a NON-ISOLATED power supply???


----------



## valerun (Nov 12, 2010)

update on new charger layout / design. 

populated the PCB, built enclosure and rewrote software. Tested up to 40A for 10-20 min at a time - about as much time I can run at that level until inductor gets to over 100-110 deg C. I am still waiting for the thermal epoxy from OMEGA - once I get that, will have a good connection from inductor to the heatsink and hopefully can run 50A continuous without fans. 

On the software side, added a couple of things:
1. support for the nifty 128x128 color display (http://www.sparkfun.com/products/10090). Soooo much more real estate than a standard 2x20 display at just $6 more... It is tiny though...
2. power select button as suggested earlier in this forum - now one can press the button at startup to cycle through available mains current draw options (generally designed to match available power ratings from household outlets in the US). the charger then recalculates for output current based on [a guess on] efficiency and output voltage. 
3. thermal protection - a thermistor buried inside heatsink and some code that turns off the charger when heatsink temp exceeds pre-determined value (using 60 deg now). Turns back on after the temp falls by another pre-determined value (using 10 deg now).

some pics attached.

tomorrow will test on my 200V battery pack to do the final check of the hardware current limiter. 

re the kits - I am thinking of packaging everything but the enclosure. Including the heatsink will all the major components mounted but not connected. What do you guys think?


----------



## valerun (Nov 12, 2010)

...also decided to try to use the charger as a DC-DC converter when not charging... with 10-bit PWM I am getting out of Arduino, output voltage control should be within 0.2V. 

thinking of using a heavy-duty DPDT relay to switch things around. default connections will be mains after bridge to input, output to traction pack. when 12V coil is energized, input will be connected to the traction pack and output - to the 12V circuit. This way, if the coil ever fails, nothing bad will happen (worst will be I will lose 'alternator' during drive). will wire it up tomorrow & will report.

seems to be a good use of components - this is exactly the same type of work, only duty cycle will be different...

what do you guys think?


----------



## JRoque (Mar 9, 2010)

Hello V.


valerun said:


> ...also decided to try to use the charger as a DC-DC converter when not charging...


That is tempting, I must admit, but isn't it kinda risky with a non-isolated design to ground the pack to your vehicle's system while operating? There is a level of risk while charging even but that is somewhat mitigated by the fact that the car won't be running at the time and your pack ground is not attached to the vehicle's.

Looking forward to the kit packaging details. If it doesn't already, hopefully "Mark-II" will have expansion ports so we can add things like our own display, serial or IP connectivity, etc. 

I'm still amazed at how much current you pull through that little inductor, even if it sweats a little.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hello V.
> 
> 
> That is tempting, I must admit, but isn't it kinda risky with a non-isolated design to ground the pack to your vehicle's system while operating? JR


you have a point there, JR. Now I remember that's why I didn't do it a few months back... 

ok how about this - a secondary on the inductor would require just a few turns to get 14V reliably. I would have to add an output voltage sensor on the rectified secondary and have the microcontroller work off that but everything else can stay the same, no?

Ok off to reading SPMS design books some more ;-)


----------



## valerun (Nov 12, 2010)

another option that I've also considered is building a simple 110V inverter working off my traction pack. Then I can use any of the hundreds of different inexpensive 110VAC->12VDC supplies. As an added bonus, I would have a 110V line in the car for any aux equipment. will try the secondary winding first.


----------



## JRoque (Mar 9, 2010)

valerun said:


> you have a point there, JR. Now I remember that's why I didn't do it a few months back...
> 
> ok how about this - a secondary on the inductor would require just a few turns to get 14V reliably. I would have to add an output voltage sensor on the rectified secondary and have the microcontroller work off that but everything else can stay the same, no?


Well, your charger feedback loop will set the output voltage so your second tap will vary along with it unless it gets it's own regulation. The inductor and other parts are rearranged for offline but they're about the same. Adding either optical or galvanic isolation for the feedback loop will get us to a topology that can be stacked for more current, etc. Analog Devices have some neat isolation parts they claim are far more reliable than opticals, for a price.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Well, your charger feedback loop will set the output voltage so your second tap will vary along with it unless it gets it's own regulation. The inductor and other parts are rearranged for offline but they're about the same. Adding either optical or galvanic isolation for the feedback loop will get us to a topology that can be stacked for more current, etc. Analog Devices have some neat isolation parts they claim are far more reliable than opticals, for a price.
> 
> JR


yes, all my sensors are fully isolated hall-effect-based. I will use same approach for 14V system sensing. The only thing I am wondering about now is how sensitive car components are to 10kHz ripple...


----------



## ElectricS10 (Mar 20, 2008)

valerun said:


> update on new charger layout / design.
> 
> populated the PCB, built enclosure and rewrote software. Tested up to 40A for 10-20 min at a time - about as much time I can run at that level until inductor gets to over 100-110 deg C. I am still waiting for the thermal epoxy from OMEGA - once I get that, will have a good connection from inductor to the heatsink and hopefully can run 50A continuous without fans.
> 
> ...


I'll buy a kit as you described : )


----------



## valerun (Nov 12, 2010)

quick question for you guys. as I am trying to make it as fail-proof as possible before building a kit out of it, can you suggest any additional safety features? So far, I have:
1. Hardware over-current protection (should also work as short circuit protection)
2. Over-temp protection/ thermal derating
3. integrated resettable circuit breakers on input and output
4. low battery voltage protection (to avoid charging an overly discharged battery)

Any additional ideas?

Thanks,
Valery.


----------



## ElectricS10 (Mar 20, 2008)

valerun said:


> quick question for you guys. as I am trying to make it as fail-proof as possible before building a kit out of it, can you suggest any additional safety features? So far, I have:
> 1. Hardware over-current protection (should also work as short circuit protection)
> 2. Over-temp protection/ thermal derating
> 3. integrated resettable circuit breakers on input and output
> ...


Is polarity reversal covered? 

This is somewhat safety related, but may be too involved. I like to be able to monitor this unit via the internet as a safety tool. It would be great if I could be notified via email or SMS of charge status or fault.


----------



## majorpayne (Mar 27, 2011)

Does the charger have any method of preventing over-charging on individual batteries? or at least recognizing that a battery could be over-charging


----------



## 2010Ranger (Mar 10, 2011)

valerun said:


> update on new charger layout / design.
> 
> re the kits - I am thinking of packaging everything but the enclosure. Including the heatsink will all the major components mounted but not connected. What do you guys think?


 I was hoping to purchase the PCBs and build the unit from the ground up as I have purchased most of the parts.... still looking for some. 

V, I see three caps in the photos, your BOM for this charger listed 1-6800 UF cap at about $95.00 are you ganging three others together for the 6800 UF? 

Still interested in purchasing a couple sets of the PCB's

You deserve much praise for your enthusiasm... keep up the great work 
2010


----------



## 2010Ranger (Mar 10, 2011)

majorpayne said:


> Does the charger have any method of preventing over-charging on individual batteries? or at least recognizing that a battery could be over-charging


_When operating your LFP traction pack you do not want to be at either end of the cells charge curve._​ 
Bad things can happen when charging or discharging your traction pack. 

· Some cells are going to *charge* more readily than others and will arrive at the manufacturers recommended *maximum charge voltage* at differing times. 
· Some cells are going to *discharge* more readily than others and will arrive at the manufacturers recommended *minimum charge voltage* at differing times 
_Start by bottom balancing each cell to a value of the most common voltage found of the cells you intend use. _

If you have a 45 cell traction pack and out of the 45 cells you have 25 that are at 2.8v and 10 at 2.95v and 10 at 2.65v
You will have less work using 2.8v as your target to bottom balance to
Remember all cells must be of the same type, size, AH ratings and manufacturer
When charging your traction pack, avoid over charging the cells by charging to a lower value than the manufacturers full charge recommendation. If the recommendation is 4.25v then charge to 3.75v across the pack.
Remember the lap of the discharge curve begins at approximately 3.3 v
LFP cell capacity lies between the Lap of the charge curve @3.3 volts and the Knee of the charge curve @ 3.0 volts
Charge strategies – Batteries are the central issue​
To maximize the life and potential of rechargeable devices;
1. Charge a traction pack maintaining a constant current of </= .5CA at 4.25 volts per cell or 189.00 volts for a pack of 45 cells.
2. Once the traction pack reaches the target voltage of 3.75 volts per cell or 168.75 volts for a pack of 45 cells switch to a constant voltage charge of 168.75V
3. When the charging current falls to .015 of CA end charging of traction pack 
4. After ending a traction pack charge sequence the voltage seen at terminals of each cell represents a surface charge voltage, which doesn’t have to much to do with the cells capacity. Some cells will be at a higher voltage than you would think and others will be at a lower than you would think
5. The true voltage can only be determined after the surface charge has a chance to dissipate. Wait over night and measure the individual cells again and they should be nearly equal

Remember - Dangerous burns can happen from arcing – think safety first!
2010


----------



## JRoque (Mar 9, 2010)

Hi.



valerun said:


> quick question for you guys. as I am trying to make it as fail-proof as possible before building a kit out of it, can you suggest any additional safety features? So far, I have:
> 1. Hardware over-current protection (should also work as short circuit protection)
> 2. Over-temp protection/ thermal derating
> 3. integrated resettable circuit breakers on input and output
> ...


- I don't know about #4. I get the same thing from my cordless drill charger. If it's current limited, I'd say let it go - it might actually help bring the cell back to life. Maybe have the feature be defeatable by user.

- Since it's non-isolated, I would spec that a GFCI outlet must be used to have some protection in current return imbalance. BTW, have you tried plugging it into a GFCI outlet? I have some hard switching, SCR based lab power supplies that trip GFCI circuits.

- Nothing like a crowbar overcurrent safety net. Adding a thyristor behind the output diode would quickly drain the caps.. and blow a fuse probably.

- A timer. If I know it'll take about 4 hours to charge my pack, I want to set it to that. If all else breaks loose, a timer will shut things down, preventing unwanted chemical reactions in the form of fire.

- If externally controlled by, say, a BMS, the charger should always win for: timer, max current, max volt.

- Bonus/extra: Remote temp sensing with settable limit. If my pack inside the battery box is over temping, the charger should quit. I don't know much (nothing really) about Arduino but it's fairly easy to add a Maxim 1-wire temp sensor with just 2 wires that include power and data. I've used them and they work great. The ADC is done by the chip remotely so it's practically immune to noise. Some might not even want/need a BMS with a feature like this in their charger.

For your DC-DC addition, a smaller inductor and cap on the output of the 14V tap would further smooth out the switching noise, if that were to be a problem. I still don't know what would control the primary side to keep the 14V constant. I'll check again.

JR


----------



## valerun (Nov 12, 2010)

2010Ranger said:


> I was hoping to purchase the PCBs and build the unit from the ground up as I have purchased most of the parts.... still looking for some.
> 
> V, I see three caps in the photos, your BOM for this charger listed 1-6800 UF cap at about $95.00 are you ganging three others together for the 6800 UF?
> 
> ...


Hi Ranger - I will offer the PCBs, as well. Don't worry ;-) just getting feedback before releasing this thing to the wild so to speak ;-) 

I need to update my BOM LOL. Will do soon. I am now using 3 caps - 2 12000uF 200V caps for the voltage doubler circuit that gets me 320V from 110V line (and provides initial 6000uF capacitance at 320V), and an additional 2700uF 450V cap across 320V DC for some capacitance boost. One could probably either (1) do without the third cap (at the expense of higher 120Hz ripple and / or inability to drive more than 30A output) or (2) use 350V cap that is cheaper. I got my 2700uF caps from some extra pile major had (thanks major!) so am using them everywhere ;-)

The PCBs will be ready in a few days. will include 3 PCBs in a set:
1. control board build around arduino
2. IGBT driver board to be bolted onto the IGBT module. (I also have the boards that you can use with regular small IGBT packaging)
3. output current sensing breakout mini-board

stay tuned. 

V


----------



## valerun (Nov 12, 2010)

thanks all for your feedback.

Based on your suggestions, I am going to add:
1. HVC BMS signal to stop the charger
2. charge timer
3. polarity protection using a sophisticated 'crowbar' circuit ;-) Actually, it's already there since there are 2 diodes that would be forward biased if battery is connected in reverse and would immediately blow the output fuse. In one of the next revs, I will probably re-introduce the output relay and will close it only if battery voltage is above the low-battery-voltage threshold. 

Features I am not planning to add at this point (doesn't mean I don't think they may be good, just return on effort consideration...):
1. SMS / email / etc notification
2. interface for setting output voltage, # of cells, etc. Partial reason is that I think it will be much easier to mess things up in the field if these settings are easily adjusted by user. After all, the charger is designed to stay with the vehicle so the user should not have to change these parameters too often. Note that there will be one-button interface to set output power and timer limit.

I should have the PCBs ready in a few days and then a kit in a few days after that.

Thanks,
Valery.


----------



## valerun (Nov 12, 2010)

finished the enclosure and connectors today - some pics below. finalizing code & PCB based on latest feedback now...

edit: I know the mains connectors are not quite there yet but it's just for testing. the in-car one will be grounded ;-)


----------



## JRoque (Mar 9, 2010)

Hello everyone. Man, that looks like one of those micro satellites NASA sends up wrapped in shiny foil. Good job!

Did I read somewhere (and can't find now) that you expect your voltage doubler to be about 97% efficient? That would be great if it does.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hello everyone. Man, that looks like one of those micro satellites NASA sends up wrapped in shiny foil. Good job!
> 
> Did I read somewhere (and can't find now) that you expect your voltage doubler to be about 97% efficient? That would be great if it does.
> 
> JR


Hi JR, 

I don't remember stating that but the voltage doubler circuit I am using is the same simple caps+bridge+some leakage resistors you can find in most PC power supply (and many other supplies). As it does not have any additional active components in addition to the bridge that you must have anyway, there should not be any efficiency penalty (sans ESR losses in big caps which are pretty low at the currents you are going to be pulling from 110V AC - not more than 15A from those lines in US, 20 if you are lucky ;-).

V


----------



## majorpayne (Mar 27, 2011)

How are you going to monitor the voltage on each cell and tell the controller when to stop?

I personally agree with 2010Ranger on bottom balancing to the lowest common voltage. But in order to pull this off you'd still need to read each cell voltage and determine what this lowest voltage is, and then drain all the other cells until they reach this. would a shunt regulator work here?

Some great stuff going on here. keep it up!

T


----------



## MozRover (Sep 19, 2009)

ElectricS10 said:


> to monitor this unit via the internet as a safety tool. It would be great if I could be notified via email or SMS of charge status or fault.


As a first step to tying this the internet, I use a serial Bluetooth transceiver (about U$12 on ebay, the ones with the 5V backplane) connected to the arduino's serial port.The strings that go to the LCD are echoed to the serial port, with a few VT100 escape instructions added to have it display nicely on the terminal (I wrote a terminal app for my Mac that gracefully handles departures and re-appearances of the BT each time the car is in range) There's another transceiver on my battery monitor (does not talk to charger directly yet) so I can see data from both. I changed the charger's 'buttonpress' routine to check the serial port first, so I can even control the charger from my desk. One drawback is the 30ft range, but it's long enough in my situation.


----------



## Snakub (Sep 8, 2008)

Hey Valerun what's your schematic on the voltage doubler? What transformer are you using?


----------



## valerun (Nov 12, 2010)

MozRover said:


> As a first step to tying this the internet, I use a serial Bluetooth transceiver (about U$12 on ebay, the ones with the 5V backplane) connected to the arduino's serial port.The strings that go to the LCD are echoed to the serial port, with a few VT100 escape instructions added to have it display nicely on the terminal (I wrote a terminal app for my Mac that gracefully handles departures and re-appearances of the BT each time the car is in range) There's another transceiver on my battery monitor (does not talk to charger directly yet) so I can see data from both. I changed the charger's 'buttonpress' routine to check the serial port first, so I can even control the charger from my desk. One drawback is the 30ft range, but it's long enough in my situation.


Moz - this is super-cool. Do you have the part # for the Bluetooth tranciever? Also, I assume from the way you describe that it handles bi-directional traffic? Can one then use the second one of those connected to the 'smart serial' display (like the ones from 4D systems - with a processor on board)?

Also, do you have any problems with noise at high current levels? What is the max current you have tried with stable bluetooth connection?

Thanks,
Valery,


----------



## valerun (Nov 12, 2010)

majorpayne said:


> How are you going to monitor the voltage on each cell and tell the controller when to stop?
> 
> I personally agree with 2010Ranger on bottom balancing to the lowest common voltage. But in order to pull this off you'd still need to read each cell voltage and determine what this lowest voltage is, and then drain all the other cells until they reach this. would a shunt regulator work here?
> 
> ...


not quite, majorpayne. See my detailed discussion, testing, and analysis of exactly this situation (detecting end-of-charge of the bottom-balanced pack) at http://www.diyelectriccar.com/forums/showthread.php?p=220827&highlight=resolution#post220827 (read the entire thread if you want the context). The summary is that for the pack of 60 CALB prismatics matched in capacity to 2% (just like my pack, and most of the packs out there), for every 0.1V rise on the smallest cell past 3.6V (as it would be in 3.6V CV step), the pack voltage increases by 0.55V. If you do 3.5V CV, then it's 1V total pack voltage for every 0.1V beyond 3.5V on the smallest cell. So if you want to avoid charging the smallest cell to more than 3.7V, set CV to 3.5V (you are losing VERY little capacity - well below 1% - by not going to 3.6V) and use a 9-bit ADC or better. Arduino's ADC is 10 bit and in my design I am using ~60% of the range by matching sense resistors and providing dual voltage supply to hall sensors, so final resolution is better than 9 bits.

And, of course, if you still don't buy all that, you can always connect BMS disable signal from your BMS system to the charger and make it stop on HVC signal from BMS.

hope this helps


----------



## valerun (Nov 12, 2010)

Snakub said:


> Hey Valerun what's your schematic on the voltage? What transformer are you using?


HI Snakub - not quite sure what you meant by the 'schematics on the voltage'. I will assume 'voltage doubler' for this reply. Super-simple, really. I will update my charger page soon but in the meantime just check Figure 1 on page 2 of the attached. Note that you will have to add leakage resistors in parallel with each cap to ensure correct voltage sharing. I use 82k 2W resistors.

V


----------



## valerun (Nov 12, 2010)

guys - any good source in the US for the RCD relay (I remember jackbauer used 63A 30mA unit)?


----------



## MozRover (Sep 19, 2009)

valerun said:


> Moz - this is super-cool. Do you have the part # for the Bluetooth tranciever? Also, I assume from the way you describe that it handles bi-directional traffic? Can one then use the second one of those connected to the 'smart serial' display (like the ones from 4D systems - with a processor on board)?
> 
> Also, do you have any problems with noise at high current levels? What is the max current you have tried with stable bluetooth connection?


Valery,
no part number, but search ebay for "bluetooth backplane" and you'll see over a dozen.
yes, they are bi-directional BUT these are 'slave' modules - the connection is initiated by a master (the computer in my case) 'Master' modules exist, though I have not seen one with a 5V backplane (the BT module itself is 3.3V, and very small - about 15mmx30mm) 
The master/slave pair would allow my batt monitor to talk with my charger, or a charger to talk with an LCD with 'smart serial' controller.

I do not have noise problems with the BT - I think the BT protocol has some error checking/correcting. Either I have connection or I don't (like when the car is parked just a little too far away) but I don't receive garbage. 
And though I only charge at ~6A, I have had noise screw up the LCD when I tried to mount it remotely using a two foot long 15-conductor round cable. As soon as it hits 5A, the screen displayed garbage and then went blank, but I could still control the charger and see its status on the Mac via BT. 
Note that I am using half-rectified 3-phase input and even 5A makes the transformers in my office hum noticeably, so I really hope we eventually have a PFC stage design that I can understand and build.
-Aaron


----------



## valerun (Nov 12, 2010)

MozRover said:


> Valery,
> no part number, but search ebay for "bluetooth backplane" and you'll see over a dozen.
> yes, they are bi-directional BUT these are 'slave' modules - the connection is initiated by a master (the computer in my case) 'Master' modules exist, though I have not seen one with a 5V backplane (the BT module itself is 3.3V, and very small - about 15mmx30mm)
> The master/slave pair would allow my batt monitor to talk with my charger, or a charger to talk with an LCD with 'smart serial' controller.
> ...


Thanks Aaron - this is some monster LCD screen you got BTW ;-)

this bluetooth thingy is something to think about. Would be so awesome to be able to control the whole thing with your iphone / android phone...

EDIT: just bought 2 of these (3.3V in my case as I already have some stuff running at 3.3V) - datasheet attached.


----------



## 2010Ranger (Mar 10, 2011)

valerun said:


> not quite, majorpayne. See my detailed discussion, testing, and analysis of exactly this situation (detecting end-of-charge of the bottom-balanced pack) at http://www.diyelectriccar.com/forums/showthread.php?p=220827&highlight=resolution#post220827 (read the entire thread if you want the context). The summary is that for the pack of 60 CALB prismatics matched in capacity to 2% (just like my pack, and most of the packs out there), for every 0.1V rise on the smallest cell past 3.6V (as it would be in 3.6V CV step), the pack voltage increases by 0.55V. If you do 3.5V CV, then it's 1V total pack voltage for every 0.1V beyond 3.5V on the smallest cell. So if you want to avoid charging the smallest cell to more than 3.7V, set CV to 3.5V (you are losing VERY little capacity - well below 1% - by not going to 3.6V) and use a 9-bit ADC or better. Arduino's ADC is 10 bit and in my design I am using ~60% of the range by matching sense resistors and providing dual voltage supply to hall sensors, so final resolution is better than 9 bits.
> 
> And, of course, if you still don't buy all that, you can always connect BMS disable signal from your BMS system to the charger and make it stop on HVC signal from BMS.
> 
> hope this helps


Hi V and others.... 

Everyone should watch Jack Rickards' explanation of losing cells from top balancing (AKA BMS) and how bottom balancing would appear to be the logical approach.... I know... I know Jack can be and is admittedly long winded but if you can endure he is willing to share his first hand knowledge and fall on his sword if need be...
http://www.projectooc.com/evtv/index.php?showid=4#4


----------



## valerun (Nov 12, 2010)

2010Ranger said:


> Hi V and others....
> 
> Everyone should watch Jack Rickards' explanation of losing cells from top balancing (AKA BMS) and how bottom balancing would appear to be the logical approach.... I know... I know Jack can be and is admittedly long winded but if you can endure he is willing to share his first hand knowledge and fall on his sword if need be...
> http://www.projectooc.com/evtv/index.php?showid=4#4


Thanks Ranger - I did and am subscribing to his view. My analysis that I referred to a couple of posts ago also proves that the charger CV cutoff can be used with a bottom-balanced pack.


----------



## MozRover (Sep 19, 2009)

valerun said:


> Thanks Aaron - this is some monster LCD screen you got BTW ;-)
> EDIT: just bought 2 of these (3.3V in my case as I already have some stuff running at 3.3V) - datasheet attached.


Valery,

For the LCD (40 char x 2 lines), I do have a part number:
#UMSH-3077JD-YG (allelectronics.com Cat# LCD-3077) 
My status display strings are broken into 20 char groupings so I could swap in a 20 char x 4 line display without changing the code.

With the BT at 3.3V, you may need to level correct the TxRx singals to/from the Arduino - or are you running the ATmega at 3.3 also? The BT module has very tight pin-spacing - will test how well you can solder. The whole thing is half the size of a AA cell. Contact me if you have trouble changing parameters (device name, speed) - it took me some experimenting.

An android device would probably work but, last time I checked, the iPhone (iOS) did not have BT-SPP (Serial Port Profile) support in a general way. I think there's something for braille terminals, and there are hacks for jail-broken devices. 
In fact, I cannot find an Apple-approved way of connecting serial data to an iOS device - very annoying. If I did, I would have an iPad mounted on my dash. I am running in to the speed limit of the Atmel mcu's when controlling a 320x240 graphic display - refresh takes too long.

-Aaron


----------



## mister.blonde (Feb 15, 2011)

Hey guys, 

I have finished putting together the charger, I have however simplified the program so that there is no feedback loop so that it is easier to debug. However, at its current point we are getting 160VDC at the charger leads when the duty cycle is at zero. This is strange to me because we are only plugged into a standard 110v outlet. Once we increase the duty cycle the voltage quickly increases. I am puzzled at what is going on because my understanding is when the duty cycle is at 0, then the IGBT is essentially open and no voltage should be getting to the leads, let alone 160v. does anyone have any idea what might be going on? We have verified that the IGBT is functional and switching according to our PWM. any help would be greatly appreciated! I am stuck and not sure what else to try...


----------



## valerun (Nov 12, 2010)

mister.blonde said:


> Hey guys,
> 
> I have finished putting together the charger, I have however simplified the program so that there is no feedback loop so that it is easier to debug. However, at its current point we are getting 160VDC at the charger leads when the duty cycle is at zero. This is strange to me because we are only plugged into a standard 110v outlet. Once we increase the duty cycle the voltage quickly increases. I am puzzled at what is going on because my understanding is when the duty cycle is at 0, then the IGBT is essentially open and no voltage should be getting to the leads, let alone 160v. does anyone have any idea what might be going on? We have verified that the IGBT is functional and switching according to our PWM. any help would be greatly appreciated! I am stuck and not sure what else to try...


Hey mister.blonde, 

which schematics have you used? would help if you post.

apart from that, the reason for 160V on the output may be leakage current charging the output cap and then staying there?

V


----------



## valerun (Nov 12, 2010)

*PCBs and Kits*

Hi Guys, 

I think I am ready to get those PCBs out now. As I mentioned before, the sets include:
1. Main control board PCB (that's where the arduino pro mini plugs in)
2. IGBT driver board - mounted on top of the standard single-IGBT module package (similar to the attached)
3. Small breakout board for the hall-effect current sensor
they will come as one piece that you would need to cut up.

I think $50 for the set + shipping is fair (the setup fee alone if $55 at PCBexpress so...). Please reply here or PM if you want them. I will be placing an order tomorrow / Sat. 

I can also add a controller with the right pin-out installed and programmed for your battery config if you want. They go for $20 + shipping from sparkfun so I figure $30 all-in should be fair.

Next week, I will be set up to supply additional hard-to-find/configure components. Mainly inductors, programmed chips, screen, heatsinks, and IGBTs. Maybe will be able to get kits together, too.

Let me know.

PS. I will be updating my charger page at http://www.rusbaevents.com/cgi-bin/Vevents/EMW/VMcharger.pl with the latest schematics & all in the next couple of days - will probably be ready before I get the PCBs out.

V


----------



## mister.blonde (Feb 15, 2011)

valerun said:


> Hey mister.blonde,
> 
> which schematics have you used? would help if you post.
> 
> ...


The schematic I have used is attached. We think the reason was the emitter on the IGBT needed to be grounded to the +15v supply (see diagram) 
We are still having trouble measuring the output voltage from the leads. We would like to use an o-scope but the one we have can only handle 30v so we need to set up a voltage divider. Any hints on a good way of doing this, or just from using an o-scope to read the output voltage in general?

Valery- I wish the PCBs were ready two months ago


----------



## valerun (Nov 12, 2010)

mister.blonde said:


> The schematic I have used is attached. We think the reason was the emitter on the IGBT needed to be grounded to the +15v supply (see diagram)
> We are still having trouble measuring the output voltage from the leads. We would like to use an o-scope but the one we have can only handle 30v so we need to set up a voltage divider. Any hints on a good way of doing this, or just from using an o-scope to read the output voltage in general?
> 
> Valery- I wish the PCBs were ready two months ago


yes, you need to connect the emitter to the ground of that 15V power supply you are using for your A3120. I would suggest you then change the way you power your A3120 driver. Namely, connect -15V to Vee (pin 5) (instead of grounding it). That way, your drive voltage will swing full range from -15 to +15. It is important for IGBTs to have negative gate voltage to turn off reliably at high currents.

V


----------



## valerun (Nov 12, 2010)

First full charge with the new charger today - 102 AH into my 192V 110AH pack. Amusingly enough, the pack was run down to 8% SOC by driving to Tesla Roadster show in San Jose (65 miles roundtrip at 75mph) )


----------



## valerun (Nov 12, 2010)

those who've requested PCBs - they are on their way to me now. I will post another message when I get them. If anyone else wants PCBs, PM me.

thx!

V

PS. I am now starting my second conversion (BMW 330) and am planning to build a 1500A controller power stage (control side to be based on P&S OpenRevolt design). Should be fun ;-)


----------



## valerun (Nov 12, 2010)

PCBs are in. Will be testing them today to make sure all works before sending out.

Will post update late today / early tomorrow.

V


----------



## valerun (Nov 12, 2010)

PCBs tested and they do work! ;-)

Also, updated the site page with the latest schematics, pcb design, and code - http://www.rusbaevents.com/cgi-bin/Vevents/EMW/VMcharger.pl

If you are interested in PCBs / kits, PM me. 

I will now send PMs to those who expressed interest already.

Thanks,
Valery.


----------



## JRoque (Mar 9, 2010)

Hello V,



valerun said:


> PCBs tested and they do work! ;-).


With so many things that can go wrong, there's nothing like having your layout work on first try. Congrats!

Is this the version of the board that will also do DC/DC or is that coming on a later release?

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hello V,
> 
> 
> 
> ...


Thanks JR! I'm not quite that good, though ;-) I think this is the fourth revision of the boards. Wanted to make sure that if I offer something to other people, it should be well - designed & tested...

This version does not do DC-DC yet. You guys had some good points around isolation etc so I need to put in a bit more thought into this... This current version does have almost all of the suggestions from this forum already implemented (timer, end-of-charge signal, BMS disable, etc.) - the full list is on the charger page linked to above.

For the next version (probably in a couple of months given everything else going on), my team will be focusing on:
1. adding DC terminals to the charger so it can be used with rectifier of your choice or level 3 DC charging stations
2. increasing the voltage ratings of all components to 800V-1200V to accommodate things like rectified 440 3-phase, doubled 240VAC or 500V DC inputs (all useful for both fast charging and also charging high-voltage batteries) 
3. increasing the output current rating to ~150-200A. This is a bit more involving so not sure how much time this will require

Valery


----------



## valerun (Nov 12, 2010)

...working on a 150A layout now, input voltage up to 600-700V. My hand almost fell off winding that bloody inductor, LOL (80 turns, 8 strands of gauge 14 wire, 5 inch OD).

Anyone has experience with effective thermal connection of the inductors to heatsinks? The program I used to calculate losses says I need to pull away 250-300W at 150A...

V


----------



## martinwinlow (Sep 22, 2009)

Oil cooling... ? MW


----------



## aeroscott (Jan 5, 2008)

martinwinlow said:


> Oil cooling... ? MW


I like oil cooling too !


----------



## valerun (Nov 12, 2010)

martinwinlow said:


> Oil cooling... ? MW


Thanks MW. That would probably be most effective but I am a bit wary of adding any liquids to the system. 

I just did some research on thermal epoxies - there are some pretty good specs out there. What if I just spread 1/2 inch think layer of such epoxy on the heatsink and bury lower half of this doughnut in that? Do you guys think that would work? The thermal conductivity of the epoxy I am getting is 3.2 W/m*K... 

I guess will test and see ;-)


----------



## valerun (Nov 12, 2010)

ok tried the thermal epoxy thing on the lower-current design ramping up current through the small inductor I have been using for that charger to 55A. Seems to be working - could not get the inductor temp over 100 deg C. So will try that as a starting point for a 150A design. Still hope to not have to add fans...

V


----------



## JRoque (Mar 9, 2010)

Hey V, 

Have you considered a top mounted heatsink? It might be a mechanical challenge to adapt but I would look at CPU heatsinks. They are plentiful, cheap, quiet and effective. See some monsters here: 

http://www.thermalright.com/new_a_page/product_page/cpu/true-copper/product_cpu_cooler_t_copper.html

and here: http://www.heatsinkfactory.com/intel-socket-775-coolers.html. 

Some of those things look like they can be launch into orbit.

JR


----------



## valerun (Nov 12, 2010)

JRoque said:


> Hey V,
> 
> Have you considered a top mounted heatsink? It might be a mechanical challenge to adapt but I would look at CPU heatsinks. They are plentiful, cheap, quiet and effective. See some monsters here:
> 
> ...


thanks JR - yes, those things look awesome!!! They do cost a fortune though. I also wanted to avoid fans as much as possible to increase reliability of the charger (a hunk of aluminum can't fail LOL . 

The heatsink I am using now is a structural foundation for the majority of components of the charger (ex caps that don't like heat too much). Inspired by Soliton1 design - the whole controller case seems to be a huge finned slab of aluminum - does 300A continuous with just 2 tiny fans!

update: tried my itty bitty tiny inductor (2.4 inches OD) at 65A constant output just now - after ~1.5 hours inductor is at 95-100 deg C (using the thermal epoxy to heatsink). Awesome (core lifetime starts degenerating only after ~150 deg C and copper enamel is rated for 200C so all good). 

can't wait to try 150A output with a bigger inductor (waiting for some high-voltage / high-current components before can try). If that works, this will be the first DIY Level 3 charger one can build. Heck, I don't see anyone selling that stuff to public either...

Do you guys think people would be interested in something like that?


----------



## martinwinlow (Sep 22, 2009)

valerun said:


> do you guys think people would be interested in something like that?


Yes !!!!!!!!!


----------



## adamj12b (May 4, 2009)

Well I have been holding out on posting this until I was nearing completion. I have been working on what will be an Open Source 7200W PFC Battery Charger. The unit is designed to accept 84-264VAC input 50/60Hz. Input voltage is rectified, boosted and power factor corrected and stored in the 150uF 100Arms 600V film cap. The output stage is based on a 2 pack 400A 600V IGBT (because that is what I had around). The measurement board is designed for 0-400V and 0-100A. The output is measured by a LEM 100-p close loop current sensor and an isolated servo loop voltage measurement circuit with terrific linearity (a few mV over 0-400V range). 

The logic of charger is based on an AVR microcontroller. The user interface is designed to be SIMPLE. A graphic 128 x 64 pixel LCD screen and a rotary encoder knob with push to select feature. The knob is set up as a jog wheel style for easy number incrementing. The logic board features a modular driver output section to allow for different driver cards to be installed to fit the power requirement. Other provisions include 5/12V BMS input, Contactor control, Interlock Relay, Wide Range Logic Supply Input (7-24VDC), Hardware over current detection, Real Time Clock, Serial to USB interface, Buzzer, and Ethernet TCP/IP 10BASE connection. 

Some minor hardware details need to be worked out and firmware is still in early alpha stage. 

Firmware will have provisions for memory for multipal vehicles, multipal battery chemistries, charge Locations for limiting current based on location. 

Well its late, so I will just leave you with some pictures. Enjoy! 

-Adam

Main Charger

Untitled by AdamBrunette, on Flickr

PFC Controller

Untitled by AdamBrunette, on Flickr

Early Internal Wireing

Untitled by AdamBrunette, on Flickr

PFC Inductors(Left) Output Inductors(Right)

Untitled by AdamBrunette, on Flickr

Front Panel Controller(Front)

Untitled by AdamBrunette, on Flickr

Early Layout with Measurement Board(Left)

Untitled by AdamBrunette, on Flickr


----------



## valerun (Nov 12, 2010)

adamj12b said:


> The unit is designed to accept 84-264VAC input 50/60Hz. Input voltage is rectified, boosted and power factor corrected and stored in the 150uF 100Arms 600V film cap. The output stage is based on a 2 pack 400A 600V IGBT (because that is what I had around).


Adam - this is AWESOME! Thanks for posting! What do the transformers do? 

I did initially start building PFC version but then decided to first build the main unit. Need to pick that PFC stuff back up...

what IC are you using for your PFC stage? What is your switching freq in PFC and buck stages?

V


----------



## DawidvC (Feb 14, 2010)

Ditto!!!!!

Dawid


----------



## MozRover (Sep 19, 2009)

Adam,
did you wind your own inductors on EI cores?
-Aaron


----------



## adamj12b (May 4, 2009)

valerun said:


> Adam - this is AWESOME! Thanks for posting! What do the transformers do?
> 
> I did initially start building PFC version but then decided to first build the main unit. Need to pick that PFC stuff back up...
> 
> ...


Thanks Valerun,

The transformers are actually inductors. They are set up 2 in series for each. 1 set of 2 for PFC, another set of 2 for output. They are wound by myself on a jig that I built special for them. They are designed for 40A continuous current ability. PFC inductors are 125uH each for 250uH total and the Buck converter inductors are 205uH each and 410uH total. Once I get a new power supply for my scope, I will be able to get a better reading as these are just done with my cheep Chinese LC meter. 

I am using a Fairchild FAN6982 CCM PFC Controller IC. The PFC stage is switching at 75kHz and the buck stage is switching at 32kHz. The 32khz on the output is a limiting factor of the 8bit AVR. Running a 16mhz clock and 9bit resolution on the PWM, In FAST PWM mode. 




MozRover said:


> Adam,
> did you wind your own inductors on EI cores?
> -Aaron


Hello Aaron,

Yes, They are wound my myself on Epcos E70/33/32 E cores. The bobbin is an Epcos double wide that takes 4 core half's each! It was designed(from what Ive heard) for inverter based welders and plasma cutters in the 4-6kw range.

I built a jig with a gear-reduction stepper motor on my milling machine as an "A" axis (rotary) for winding the bobbins. 

Heres a few pics. 


Untitled by AdamBrunette, on Flickr


Untitled by AdamBrunette, on Flickr 


Untitled by AdamBrunette, on Flickr

-Adam


----------



## valerun (Nov 12, 2010)

adamj12b said:


> Thanks Valerun,
> 
> The transformers are actually inductors. They are set up 2 in series for each. 1 set of 2 for PFC, another set of 2 for output. They are wound by myself on a jig that I built special for them. They are designed for 40A continuous current ability. PFC inductors are 125uH each for 250uH total and the Buck converter inductors are 205uH each and 410uH total. Once I get a new power supply for my scope, I will be able to get a better reading as these are just done with my cheep Chinese LC meter.
> 
> ...


wow, that's what I call The Jig!.. Cool.

75Khz is pretty high - I gather you're not using the big IGBT modules then? The ones I am using in the charger take 1.5-2uS of the cycle time to switch on and off so anything higher than 25 is going to generate to much switching losses...

V


----------



## adamj12b (May 4, 2009)

valerun said:


> wow, that's what I call The Jig!.. Cool.
> 
> 75Khz is pretty high - I gather you're not using the big IGBT modules then? The ones I am using in the charger take 1.5-2uS of the cycle time to switch on and off so anything higher than 25 is going to generate to much switching losses...
> 
> V


This is the MOSFET I picked for the PFC stage. http://www.vishay.com/docs/91341/sihg47n6.pdf

Its a little underrated for the PFC stage, but well see how it works. 

The output IGBT is a CM400DU-12F. Same that Jack is using in his charger, and he says its working fine at 32khz. 

I showed the charger and open revolt controller off at an electric car show in PA on Saturday and am now taking a few days off to relax. I will be getting back to the PFC in the next few days. I will be sure to keep everybody updated.

-Adam


----------



## valerun (Nov 12, 2010)

adamj12b said:


> This is the MOSFET I picked for the PFC stage. http://www.vishay.com/docs/91341/sihg47n6.pdf
> 
> Its a little underrated for the PFC stage, but well see how it works.
> 
> ...


I'd love to see how it works out!!! Do let us know!


----------



## valerun (Nov 12, 2010)

some updates on the charger.

10kW version is fully operational now, charging up my 110AH 200V LiFePo4 pack at 50A in 2.5 hours. Very sweet. Max current tested is 65A at lower voltages. I would imagine the charger would handle 65A up to 144V. 

All the features suggested on this forum are implemented (BMS cut-off, end-of-charge signal, timer shutoff)

Also, NiMh and NiCad chemistries are programmed and tested (negative dVdt termination). 

We are now testing a 25kW, 150A unit (see pics below). Will report on progress.

Valery.
--

P.S. We are ready to ship 10kW kits (no enclosure). See http://www.eMotorWerks.com for details and contact info.


----------



## valerun (Nov 12, 2010)

Hi Guys - am starting developing PFC for this beast. 

Will try the boost (again) BUT this time using rugged a 1200V 400A continuous IGBT instead of 2 wimpy 60A MOSFETS. I am thinking of using IR1153S chip - mostly because that's the only CCM PFC chip available from DigiKey that's switching at slower than 50-65kHz. Since I am using large IGBT, driving at anything higher than 32kHz is going to be too 'expensive' (power loss and beefy drive components - wise).

Anybody had any experience with these chips?

Will be designing the PCB now. Will use the 10A driver boards I have designed earlier. Should be able to do first tests within the next 10 days or so....

Thx!
Valery.

PS. Adam - how is your build going? I am very interested in how your PFC worked out!


----------



## aeroscott (Jan 5, 2008)

great work , I was looking at charging off solar panels using the mppt Outback charge controller . The problem is the limited output voltage of 80 v. 80 amps out put max(great) , the mppt takes the higher voltage of the panels and matches voltage to the batteries . You can take any panel voltage over the battery voltage minimum to a maxium of120 volts . battery voltage can be set for 12,24, 36,48,60, 72 (bulk only on 72) then fine tuned for battery type . This is a musfet system .It's a great system but would need 4 units in series @$500 each to get 320 battery volts I was thinking of running sub 600volt solar into 120-400 volt battery bank , Using the open source charger as a high voltage dc to dc mppt charge controller. see thread on solar charging . Thanks for all the great work on the charger . added just re-read the 502 post seams to say yes , high voltage dc input (panels) to high voltage battery .added 2,maximum power point tracking = adjusting the amps output to get the most power from a varying set of panels or battery ( charging from the solar battery bank) . In the last case may need 2 chargers ,one for the solar panels to house battery and another for house battery to ev battery .


----------



## valerun (Nov 12, 2010)

aeroscott said:


> I was thinking of running sub 600volt solar into 120-400 volt battery bank , Using the open source charger as a high voltage dc to dc mppt charge controller. see thread on solar charging


Not sure if you had a specific question but am going to think one up and answer it anyway ;-)

Yes, it's absolutely possible to use this design to control solar panel to solar battery bank charging, solar panel to EV, and solar battery to EV charging regimes. 

I would be careful of using multiple charging systems on parts of the pack as it is relatively easy to unbalance your packs this way. So unless you have an active, shunt-capable BMS system, I would not do it. BTW, we are normally advocating against such top-balancing BMS systems (there are many threads on this forum with related discussions if you are interested in details).

Let me know if you have any questions on the design. Check out our charger page for more info, as well.

Thanks,
Valery.
http://www.emotorwerks.com/cgi-bin/VMcharger.pl


----------



## valerun (Nov 12, 2010)

for those who are interested, some significant updates on my version of the charger at http://www.diyelectriccar.com/forums/showthread.php?p=246864#post246864


----------



## infantry11b (Feb 6, 2010)

Did anyone here get some emails from infantry11b - got hacked from china and peru and they started sending emails. if you did, DON'T FOLLOW THE LINK, JUST DELETE IT! think I have to solved.


----------



## Roy Von Rogers (Mar 21, 2009)

What link or which link ??

Roy


----------



## infantry11b (Feb 6, 2010)

any link in an email from infantry11b - so far i have found 4 different sets of emails they sent out with different links in them. THEY APPEAR TO BE LINKS TO SOME TYPE OF VIRUS.

so let me make it real easy DON'T FOLLOW ANY LINKS.


----------



## valerun (Nov 12, 2010)

PFC stage done! See http://www.diyelectriccar.com/forums/showthread.php?p=249779#post249779 for details.


----------



## Citystromer (May 2, 2009)

Hi, I`m looking for notes on the coil, an important part.


----------



## valerun (Nov 12, 2010)

Citystromer said:


> Hi, I`m looking for notes on the coil, an important part.


they are all here. See http://www.emotorwerks.com/cgi-bin/VMcharger.pl, part list down the middle of the page.

Thx.
V


----------



## Snakub (Sep 8, 2008)

Hey Valerun I have gotten around to starting on your version of the charger it has definitely been slow going because I have been scrounging for parts and now I find that I haven't been able to find any other source cheaper for the hall effect sensors from digikey particularly the two smaller 40ma hall effects have you found any cheaper sources or have a cheaper substitute part? Another question is do I have to use all the relays for the heater blower etc.? or will not using them result in an error?


----------



## aeroscott (Jan 5, 2008)

valerun said:


> Not sure if you had a specific question but am going to think one up and answer it anyway ;-)
> 
> Yes, it's absolutely possible to use this design to control solar panel to solar battery bank charging, solar panel to EV, and solar battery to EV charging regimes.
> 
> ...


To clarify , mppt is maximum power point tracking meaning adjusting the input amps /volts (panels) to maximize wattage going into the battery many times a second including for clouds , changing battery voltage , panel shading etc. sorry for not checking this sooner .


----------



## valerun (Nov 12, 2010)

Snakub said:


> Hey Valerun I have gotten around to starting on your version of the charger it has definitely been slow going because I have been scrounging for parts and now I find that I haven't been able to find any other source cheaper for the hall effect sensors from digikey particularly the two smaller 40ma hall effects have you found any cheaper sources or have a cheaper substitute part? Another question is do I have to use all the relays for the heater blower etc.? or will not using them result in an error?


Hi Shakub - I don't think it's easy to find a cheaper source. That's why we package things in kits. We order these parts in quantities of 25-100 at a time...

Regarding relays - check out the latest files on the site (schematics etc) - we now control the fan using PWM from one of the arduino pins. As long as your fan is <0.5A rated, it will be fine. Otherwise, you will need a buffer circuit. We use the buffer circuit on our PFC units to drive a monster 7A fan.

Thanks,
V


----------



## valerun (Nov 12, 2010)

aeroscott said:


> To clarify , mppt is maximum power point tracking meaning adjusting the input amps /volts (panels) to maximize wattage going into the battery many times a second including for clouds , changing battery voltage , panel shading etc. sorry for not checking this sooner .


got it. thanks for explaining. Yes, you can easily adapt the system to do that. The main control loop checks input DC voltage every 2-3 ms (to shut the charger down if suddenly unplugged). You can use same info to manage output power.


----------



## Snakub (Sep 8, 2008)

I just tried to verify the code on the arduino compiler and it just keeps giving me the same error "22:error:TimerOne.h:No such file or directory" with this line of code highlighted "*Digital In #13 - BMW HVC input (active high)" with a rectangular cursor around the first bracket before (active. Could it be that I am using linux or maybe I don't have the right board selected even though I have tried all available boards it will let me? I don't see an option to select arduino uno when I go to board options could I use arduino duemilanove because that's the one I have?


----------



## dougingraham (Jul 26, 2011)

Snakub said:


> I just tried to verify the code on the arduino compiler and it just keeps giving me the same error "22:error:TimerOne.h:No such file or directory" with this line of code highlighted "*Digital In #13 - BMW HVC input (active high)" with a rectangular cursor around the first bracket before (active. Could it be that I am using linux or maybe I don't have the right board selected even though I have tried all available boards it will let me? I don't see an option to select arduino uno when I go to board options could I use arduino duemilanove because that's the one I have?


You will need to download the two libraries and install them. There are links to them on the emotorwerks.com website. There is a readme file that tells how to do this once you unzip the file.

However I get a different error, see below.


In file included from charger_2011_07_21_V06.cpp:57:
C:\Documents and Settings\DPI\My Documents\Downloads\arduino-0022\arduino-0022\libraries\Timer1/TimerOne.h:19: error: redefinition of 'class TimerOne'
C:\Documents and Settings\DPI\My Documents\Downloads\arduino-0022\arduino-0022\libraries\Timer1/TimerOne.h:20: error: previous definition of 'class TimerOne'

Not having ever looked at programming on the Arduino I am guessing it will take me a couple of hours to figure out. And I don't have time to mess with this now.

Any ideas Valery?


----------



## valerun (Nov 12, 2010)

dougingraham said:


> You will need to download the two libraries and install them. There are links to them on the emotorwerks.com website. There is a readme file that tells how to do this once you unzip the file.
> 
> However I get a different error, see below.
> 
> ...


Doug - thanks for response. 

The error you are getting is a bit puzzling. There should be #ifdef statements preventing double declarations... I will take a look now... Actually, there are none. I would add a couple of statements and try again: something like:

-------------------
#ifndef TimerOne
#define TimerOne 1

<ALL THE CURRENT CODE>

#endif
------------------------

Also, please check if you are possibly including TimerOne.h twice in the code.

Let me know what happens. 

Thanks,
Valery.


----------



## Snakub (Sep 8, 2008)

Ok so I downloaded the timer zip file and the lcd zip file and I dropped and dragged them into the arduino's library folder is that enough would that be considered installing them? But I don't get what to do with the first file you are supposed to put into the sketch folder are supposed to copy and paste it into the program itself? Should I create a new folder in the examples folder and them copy and paste it somewhere because I won't be able to move it anywhere because from what I can see its just text and I guess moving it to the examples folder won't do any good because arduino (and I could be wrong) won't really draw on those as a part of its environment. Do I create a totally new sketch for this code and save it in the sketch book to clarify here's is the code that is the first thing labeled file on emotorwerks website http://www.emotorwerks.com/cgi-bin/VMcharger.pl

```
#include <EEPROM.h>
#include <WProgram.h>  // for type definitions

template <class T> int EEPROM_writeAnything(int ee, const T& value)
{
    const byte* p = (const byte*)(const void*)&value;
    int i;
    for (i = 0; i < sizeof(value); i++)
      EEPROM.write(ee++, *p++);
    return i;
}

template <class T> int EEPROM_readAnything(int ee, T& value)
{
    byte* p = (byte*)(void*)&value;
    int i;
    for (i = 0; i < sizeof(value); i++)
      *p++ = EEPROM.read(ee++);
    return i;
}
```


----------



## dougingraham (Jul 26, 2011)

valerun said:


> Doug - thanks for response.
> 
> The error you are getting is a bit puzzling. There should be #ifdef statements preventing double declarations... I will take a look now... Actually, there are none. I would add a couple of statements and try again: something like:
> 
> ...


It is all a fresh install. Of the IDE and the Code and libraries downloaded from your site. Unless the latest and greatest libraries already have it there shouldn't be a redefinition. Are you running the latest Arduino software?

Later


I still don't have tome to look at it in detail.


----------



## valerun (Nov 12, 2010)

Code revision coming up soon. New mods to be included:
1. Undervoltage protection for IGBT drivers
2. implementation of the J1772 communication protocol (power available, EVSE turn-on / turn-off)
3. High-speed (1-2kHz) loop regulation to take care of the 120Hz ripple via micro (will be using same interrupt-based ADC code as in our controller)

V


----------



## valerun (Nov 12, 2010)

dougingraham said:


> It is all a fresh install. Of the IDE and the Code and libraries downloaded from your site. Unless the latest and greatest libraries already have it there shouldn't be a redefinition. Are you running the latest Arduino software?
> 
> Later
> 
> ...


TimerOne library is not mine so I didn't check if it has protection against double-declarations. THe above code added to the TimerOne.h should solve it. We will also update the site.


----------



## valerun (Nov 12, 2010)

Snakub said:


> Ok so I downloaded the timer zip file and the lcd zip file and I dropped and dragged them into the arduino's library folder is that enough would that be considered installing them? But I don't get what to do with the first file you are supposed to put into the sketch folder are supposed to copy and paste it into the program itself? Should I create a new folder in the examples folder and them copy and paste it somewhere because I won't be able to move it anywhere because from what I can see its just text and I guess moving it to the examples folder won't do any good because arduino (and I could be wrong) won't really draw on those as a part of its environment. Do I create a totally new sketch for this code and save it in the sketch book to clarify here's is the code that is the first thing labeled file on emotorwerks website http://www.emotorwerks.com/cgi-bin/VMcharger.pl
> 
> ```
> #include <EEPROM.h>
> ...


Hi Snakub, 

You should place the EEPROM file into the same folder as your charger code. Then reopen the charger sketch in Arduino. The EEPROM file will be loaded automatically.


----------



## Snakub (Sep 8, 2008)

I think I figured out those issues now because I reopened the arduino sketch and it now it shows the EEPROM_VMcharger.h tab right next to the charger code tab I had to go to the sketch tab at the top of the arduino compiler and open the sketch folder then go down to show sketch folder then create a new document and copy and paste the eeprom file and save. But I think I am having the same problem that dougingraham is having. Error compiling Desktop/arduino-0018/libraries/Timer1/TimerOne.cpp:85:'TIMSK1' was not declared in this scope is this similar to the problem doug is having?


----------



## valerun (Nov 12, 2010)

Snakub said:


> I think I figured out those issues now because I reopened the arduino sketch and it now it shows the EEPROM_VMcharger.h tab right next to the charger code tab I had to go to the sketch tab at the top of the arduino compiler and open the sketch folder then go down to show sketch folder then create a new document and copy and paste the eeprom file and save. But I think I am having the same problem that dougingraham is having. Error compiling Desktop/arduino-0018/libraries/Timer1/TimerOne.cpp:85:'TIMSK1' was not declared in this scope is this similar to the problem doug is having?


can you tell me which Arduino Dev Environment version you are using?


----------



## dougingraham (Jul 26, 2011)

valerun said:


> can you tell me which Arduino Dev Environment version you are using?


I believe its 0022. That's what it says on the help page.


----------



## Arlo (Dec 27, 2009)

I will have to come back and read this thread later. Very cool.


----------



## Snakub (Sep 8, 2008)

I think I am using 0018 don't know how to upgrade to 0022 though. Do I have to download and install the new version separately?


----------



## valerun (Nov 12, 2010)

Snakub said:


> I think I am using 0018 don't know how to upgrade to 0022 though. Do I have to download and install the new version separately?


yes, would be best. I think you just download, unzip, install.


----------



## Snakub (Sep 8, 2008)

Yeah kind of having problems unzipping it here in linux. The new download for linux comes in a tar tgz file and from my understanding you have to go into the ubuntu terminal but every time I type in the command in terminal using the file name arduino-0022 it says no such file exists or tar-xzvf command not found ubuntu/linux is turning out to be a real pain in the a$$. Why can't I just download the file as an exe.? and also why doesn't arduino have automatic updates rather than having to download and install a whole nother dev environment? Guess I might have to go to another forum/forums to figure out this crap....


----------



## valerun (Nov 12, 2010)

Snakub said:


> Yeah kind of having problems unzipping it here in linux. The new download for linux comes in a tar tgz file and from my understanding you have to go into the ubuntu terminal but every time I type in the command in terminal using the file name arduino-0022 it says no such file exists or tar-xzvf command not found ubuntu/linux is turning out to be a real pain in the a$$. Why can't I just download the file as an exe.? and also why doesn't arduino have automatic updates rather than having to download and install a whole nother dev environment? Guess I might have to go to another forum/forums to figure out this crap....


sorry about the trouble. hope you work it out soon. let me know how the app behaves in the 0022.


----------



## Snakub (Sep 8, 2008)

Finally got it to extract TAR was not enabled with the new version of Linux I just upgraded to. But now I that I extracted the file I open it double click arduino and select RUN nothing happens  I wonder why I never had ANY of these problems with 0018 If its not one thing...WTF


----------



## Ziggythewiz (May 16, 2010)

Were you using the 0018 in linux as well? Linux is really designed for command line usage; getting it to do much by just clicking can be quite difficult.


----------



## steven4601 (Nov 11, 2010)

Not designed for command line, it has a proper one! 

Unlike most other non *nix operating systems which are written like it was lasagna with a lot of teletubby colors to make the un-understandable understandable for the non-able.As a result their just making a heap of unpasteurized plaster of pop ups and balloons with threats written on them. 

Sorry for my rant.


----------



## Snakub (Sep 8, 2008)

I never just double clicked on 0018 I never would open the arduino folder on the desktop then double click on the arduino compiler and it would ask if I would like to run in terminal display cancel or run I always chose run but 0022 doesn't do anything when I select that this is just really aggravating


----------



## Snakub (Sep 8, 2008)

After uninstalling it and reinstalling again 0022 opens up for me don't ask me why I open the sketch and try to verify and it gives me almost the same error as 0018 did

home/desktop/arduino-0022/libraries/Timer1/TimerOne.cpp: In member function 'void TimerOne: : attachInterrupt (void (*)( ) , long int) ' :
home/desktop/arduino-0022/libraries/Timer1/TimerOne.cpp: 78: error: 'TIMSK1' not declared in this scope
home/desktop/arduino-0022/libraries/Timer1/TimerOne.cpp: In member function 'void TimerOne: : detachInterrupt ( ) ' :
home/desktop/arduino-0022/libraries/Timer1/TimerOne.cpp: 85: error: 'TIMSK1' not declared in this scope

Is there something else I need to do with the Timer1.zip other than unzip it and drop and drag into the libraries folder?


----------



## dougingraham (Jul 26, 2011)

Snakub said:


> Is there something else I need to do with the Timer1.zip other than unzip it and drop and drag into the libraries folder?


There was a readme file in the zip with the uLCD_144 folder and it said:

In order to use, you have to copy uLCD_144 folder into your 
Arduino Libraries folder (found in your arduino software
installation folder). You then have to import a uLCD_144 
library from your sketch (by selecting the library
from Sketch->Import Library menu drop-down. 

I assume you need to do this with the timer library also.


----------



## Snakub (Sep 8, 2008)

Ok I imported both TImer1 and u_LCD144 into my sketch from the library now I get this error 

In file included from cpp.57
home/desktop/Arduino-0022/libraries/Timer1/TimerOne.h:19:
error: redefinition of 'class TimerOne'
home/desktop/Arduino-0022/libraries/Timer1/TimerOne.h:20
error: Previous definition of 'class TimerOne'

I will get this right one of these days...


----------



## dougingraham (Jul 26, 2011)

Snakub said:


> Ok I imported both TImer1 and u_LCD144 into my sketch from the library now I get this error
> 
> In file included from cpp.57
> home/desktop/Arduino-0022/libraries/Timer1/TimerOne.h:19:
> ...


This is exactly the same as I am seeing.

I wonder if they included a default timer code in the libraries in 0022.

I might get around to looking at this later today. Working on battery boxes right now.

Best Wishes!


----------



## valerun (Nov 12, 2010)

dougingraham said:


> This is exactly the same as I am seeing.
> 
> I wonder if they included a default timer code in the libraries in 0022.
> 
> ...


Hi guys - could you pls post in the 10kW charger thread - you will likely have more responses from builders of this kit there: http://www.diyelectriccar.com/forums/showthread.php/10kw-60a-diy-charger-open-source-59210p20.html

not sure what the cause of the errors you are seeing - will think about it a bit more. The code works out of the box for me. 

Thanks,
Valery.


----------



## valerun (Nov 12, 2010)

Snakub said:


> Ok I imported both TImer1 and u_LCD144 into my sketch from the library now I get this error
> 
> In file included from cpp.57
> home/desktop/Arduino-0022/libraries/Timer1/TimerOne.h:19:
> ...


I think I responded to this one a few days ago... Please take a look. 


V


----------



## no_hazmats (Mar 16, 2009)

You can't beat a really good fan.


----------



## Micro (Oct 20, 2013)

valerun said:


> I think I responded to this one a few days ago... Please take a look.
> 
> 
> V


I am not sure if all of the PFC tests where done at 110VAC?

I really like this great project, And if possible to share the PFC circuit, I am looking for 2KW PFC


Thanks for sharing this great work


----------



## valerun (Nov 12, 2010)

Micro said:


> I am not sure if all of the PFC tests where done at 110VAC?
> 
> I really like this great project, And if possible to share the PFC circuit, I am looking for 2KW PFC
> 
> ...


Hi Micro - please post in http://www.diyelectriccar.com/forums/showthread.php/10kw-60a-diy-charger-open-source-59210.html - we have moved all discussion there.

All schematics are available, yes

Thanks,
Valery.


----------



## ArtG (Jan 9, 2015)

SimonRafferty said:


> This project started here. I had built a high voltage electric vehicle but found the options for charging somewhat limited and very expensive. I wondered how complicated it could possibly be? A couple of minor explosions and the odd electric shock later, here it is - a fully programmable digital charger capable of operating up to 350v and 35A.
> 
> I built mine largely from parts salvaged from junk computer UPS's but even if you bought all the parts new, I doubt it would come to much more than $200.
> 
> ...


 Do you have the pin out for the LCD-3077? I have one and do not have the pinout or specs. The co. seems to have discontinued them.


----------



## andrea123321 (Aug 5, 2015)

hi, i am interested in your project. i am wondering do u use any micro controller or do u program your own code??


----------



## guimer84 (Mar 13, 2016)

Hi, I´m From Argentina, i´m new in diy. My brother and i convert a car with 144 v baterry pack. here in Argentina we don´t have chargers for this baterieson 144v. I whant to know if this charger works well. because i have some problems on my design. The IGBT shortcuts, and i dont know why. the circuit is similar than ARTG whith the FGY75N60SMD igbt. 

thanks verry much

Guillermo Merdinian 
This is my car https://www.facebook.com/dikhoev/?ref=settings


----------



## PStechPaul (May 1, 2012)

There are more recent threads on battery chargers, although this one still has some good historical information that shows a very basic design, and its evolution to more complex but perhaps more reliable and safer implementations. Here is a list:

http://www.diyelectriccar.com/forums/showthread.php/10kw-60a-diy-charger-open-source-59210.html (10 kW 60A DIY charger - Valerun/EMW)

http://www.diyelectriccar.com/forums/showthread.php?t=130626&highlight=battery+charger (Modular charger - PSTechPaul)

http://www.diyelectriccar.com/forums/showthread.php?t=160386&highlight=battery+charger (Idiot's Guide - itchyback)

http://www.diyelectriccar.com/forums/showthread.php?t=89311&highlight=charger (Open source isolated 12 kW Charger - Valerun/EMW)

http://www.diyelectriccar.com/forums/showthread.php?t=162082&highlight=charger (SIC LLC modular charger - Tony Bogs)

http://www.diyelectriccar.com/forums/showthread.php?t=158057&highlight=charger (Analyzing, troubleshooting, and fixing EMW 12 kW DIY charger - PSTechPaul)


----------

