400V flyback capacitor bank charger - Page 1
Forum section: electronics / projects

author: Dreamer1
author_rank: Contributor
timestamp: August 21, 2016, 05:28:07 am
content: Hi guys,do you mind looking at my project and see if you can spot anything that I did wrong?http://imgur.com/a/picaxit's connected to about a 3mF, 400V cap bank.Some notes.. P3 is a little cap I put on the output to be able to test the voltage generation without attaching chunky caps.Does anyone see any safety issues?

author: Circlotron
author_rank: Super Contributor
timestamp: August 21, 2016, 05:32:23 am
content: I was thinking depending on the switching frequency the LM358A current sense amplifier may not have sufficient slew rate.

author: Dreamer1
author_rank: Contributor
timestamp: August 21, 2016, 05:50:52 am
content: That's a good thought...Oh boy, now i'm lost..So I have an LRC meter; I want to aim operation of about 70-100Khz. I should be checking the inductance with F = 100Khz on my LRC meter right?What I'm asking...is the slope of the current ramp the transformer experiences when a voltage is applied across it's terminals a function of L(f(0)), L(F(10khz),, L(F(100khz)?Also you are correct about the LM358; the closed circuit loop is only ~50Khz @ gain of 20V/V

author: matkar
author_rank: Regular Contributor
timestamp: August 21, 2016, 08:56:37 am
content: Not critical but still;As far as I remember the analog input resistance shouldn't exceed ~2k ohm with (some?) PIC uCs. Place lower values to 50/10k ohm Vcc_sense divider and/or place a 10-100nF capacitor across 10k resistor or else you will read a lower value than it actually is.I'd place a zenner diode and a cap across 1k resistor on the AN0 input as well.

author: MagicSmoker
author_rank: Super Contributor
timestamp: August 21, 2016, 02:57:30 pm
content: There is all kinds of stuff wrong with this circuit. I'm not going to exhaustively analyze it, so don't take this as a complete list, but the more glaring things are:1. No clamp across the flyback primary!!! This will result in avalanching (uncontrolled turn on from overvoltage) of the MOSFET which tends to degrade, if not outright destroy, them over time. At the very minimum you need to put a high speed rectifier in series with a zener across the primary. The zener voltage needs to be about 20-50% higher than the sum of the primary voltage ("Vcc" here) and the reflected secondary voltage (found by dividing the secondary voltage by the turns ratio, e.g. 400V/15 = ~27V).2. If VCC is >10V then use a proper low side gate driver IC such MCP1416 or MIC4422 instead of that awful charge-pump type driver, IR2110. Both of the examples I gave accept a logic level input. If VCC is greater than ~18V then use a small linear regulator to drop it down to 12V or 15V for the gate driver IC.3. No feedback loop compensation components for either the current or voltage feedback. You can do compensation in software, of course, I like to enforce a rolloff in the frequency response in hardware of no higher than 1/3rd the switching frequency as a backstop.4. Use a 4-resistor difference amplifier for current sense even though "ground" is one of the inputs, and don't use a wirewound resistor for the current sense shunt - it needs to have minimal inductance.5. No details about the transformera. Note that the polarity of current flow is inverted from primary to secondary in the flyback. This means that if the beginning of the primary is connected to Vcc then the end of the secondary goes to the anode of the rectifier.b. the core used in the flyback must have an air gap - that can either be a discrete gap if using a ferrite core, or a distributed gap if using powdered metal.And a more high level comment is that a self-oscillating flyback - rather than all this mess with a dsPIC, etc. - is the cheapest/simplest way to charge capacitors - it's been used for decades in camera photoflashes (before they started to be supplanted by pulsed LEDs). Take apart an old camera to see how its done.

author: Buriedcode
author_rank: Super Contributor
timestamp: August 21, 2016, 06:45:30 pm
content: Whilst some have shot me down for saying this... using a micro for the control/feedback loop of a flyback can make life very difficult. For peak current mode switchers, at a relatively low frequency, its fine, but for something like a flyback - used just to charge caps so the output ripple doesn't matter, using a micro is over kill, and will cause more problems than it will solve.Sure it *can* be done, but you have to work out the maximum delay between current rise in the transformer (coupled inductor) and the change in switching device. That will go through the current sense amp, into the micro, which hopefully will use a high speed comparator rather than an ADC where you have to actively 'read' the voltage, which then, again, hopefully will have control over the switching directly in hardware - most PWM modules have the facility to hook the comparators output to it to switch off the output. If you're doing this in software then there's more delays, meaning the current can ramp up to saturation levels before the micro even knows.Secondly, you should really know the primary inductance of the transformer. If you have a high speed comparator for current sensing you can switch off the MOSFET quickly when the current reaches a set level, and you can use that to get a rough idea of the inductance. It might not be critical to measure it precisely, but you want to know it, and the saturation current of the transformer. With those two unknown, it'll make it tougher to design any controller for it.I have built a HV cap charger using a micro, but that monitored the flyback, rather than controlled it. As a secondary function it could roughly measure the inductance of the coil based on peak current, and Ton. I did this before I had access to an oscilloscope (believe it or not) and whilst it worked, a scope helps a great.I suggest this will be good reading:http://www.dos4ever.com/flyback/flyback.html

author: Cyberdragon
author_rank: Super Contributor
timestamp: August 22, 2016, 05:27:15 am
content: You should really use some sort of opto-isolator feedback instead of direct feedback. You have R2 as the only thing isolating the HV which is not good. R4 is another component that could cause catastrophic failure if it shorted, since you have the HV sharing the same ground as the low voltage.I know this isn't going to be CAT rated, just like to see things designed with proper electrical safety.EDIT: I see you did ask about safety. But it shouldn't be too hard to fix.