On Sun, May 19, 2013 at 12:08:57AM -0400, P E Schoen wrote:
> "Uncle Steve" wrote in message news:a94389325a...@gmail.com...
>
> >I already corrected this part of the circuit. Delete the 4.7K and
> >imagine 18V - 220K - GATE - 1M - 2n2222 collector - 2n2222 emitter to
> >ground. Works fine.
>
> I'm not sure why you are using such high resistor values. I think I
> recreated your circuit with LTSpice, but to get the MOSFET to switch
> properly even at 10 kHz I had to use much lower values. Here is what seems
> to be what you are doing, and this circuit works as a buck converter with
> 18V in and about 13V out into 10 ohms and 100 uF.
>
http://enginuitysystems.com/pix/UncleSteve2.png
Neat. The high-resistor values are clearly a mistake, a result of my
misconceptions about how these devices work, though as I work through
the math the data-sheet parameters are becoming clearer.
> >The power supply is nowhere near capable of 180 amps. 2.5 on a
> >good day.
>
> You need to consider how much capacitance is across the 18V supply. You can
> easily get more than 100 amps for a few milliseconds, which is enough to
> damage some components.
There are no capacitors filtering the 18V supply, ATM.
> >Aha, math. I was anticipating using the sense-resistor to measure
> >power, but I note that the coil reads .5ohms according to my meter,
> >but how accurate is that going to be with the other stuff in
> >parallel?
>
> You can read the current on the high side with an IC made for that purpose.
> A simple differential amplifier will work.
For my purposes, this is about learning as much as it is about
charging a battery, so I'm interested mostly in keeping things as
simple as possible. Plus, I'm using what I have on-hand as much as
possible, so the capacitor on the output is 3300uF because I have
one. I suppose that's a risk since it may source a lot of current as
it charges up, though the MOSFET I'm using is rated at -108A for
repeated pulses of short duration so perhaps it will be O.K.
> >Dammit. I mixed up my parts and installed the IRF1404 thinking it was
> >the P-channel part. Installed a FQP27P06, which is p-channel, and
> >everything works as described with the 220K/1M divider as described
> >above. The FQP27P06 gate capacitance may be 4400pF, if I'm
> >translating correctly: while the IRF part shows gate capacitance, the
> >FQP part datasheet only described gate charge of 43nC, but 55nC for
> >the IRF part.
>
> The 220k/1M divider might turn the MOSFET on and off, but with 4400 pF and
> 220K you have a TC of nearly 1 mSec. That would be just barely adequate for
> 100 Hz switching. If you are trying to reduce power this is NOT the way to
> do it. During the linear portion of the switching you may have 3 amps at 10
> volts or more which is 30 watts.
Yeah, I read that the MOSFETS dissipate most power during state
transitions so lowering the switching time is the way to go.
> >I'm not really at the point yet where I feel I can characterize the
> >circuit requirements that accurately, and I haven't seen R = T/C
> >before. Let me do it my way: 1C = 1VA. 4.4nF, so 3.2V / 220k =
> >14.5uA. Which means i need lower resistors to drive the gate since
> >I'm limited to less than 2.9kHz. OK. Let's say I'm working with
> >62500Hz, which is the fastest I can go with this part unless I majorly
> >refactor the software.
>
> You can use as low as 10 kHz for the PWM as shown in my schematic. If you
> go higher you can get better efficiency, but you will need to use a gate
> driver. A smaller MOSFET will also be OK and will have lower gate
> capacitance.
It is encouraging to see your simulation working at 10kHz, which tells
me that I won't have to do a major rework of the software. By gate
driver do you mean something like a darlington transistor to replace
the 2n2222? I have a BC517 I could use instead, and which will handle
1A, which means 20ohms to the gate should work.
The ATtiny85 has a flexible timer that does all the work, albeit at a
lower frequency, with a mode called phase-correct PCM. I'm using the
timer overflow interrupt to turn on the GPIO, and a timer compare
register to bring it low, which gives me slightly less than 31.25kHz
with a 8MHz system clock. This frees up the second timer compare
register to co-ordinate ADC measurements. The second timer in the
part will do 250kHz PWM with 8-bits resolution for the duty-cycle,
but doesn't interface with the ADC, so I'm using it to do the
serial-output for data logging.
I sort of figured I would have to derive the output characteristics
empirically, but that's the fun part. I hope to be able to code the
thing so it adapts to dynamic loading, but mainly I have two or three
voltage targets which should be current-limited as per the recommended
charge-curve for lead-acid batteries.
> >So anyways, I need 2-4V drop at the gate with two resistors having
> >a ratio of about 1:5, and it needs to come on really quickly so I don't
> >waste all of the PWM phase waiting for the thing to turn on. So,
> >20ohms/100ohms gives a 3V drop at 160mA. That's 10ns to charge the
> >gate by my calculations, which I have no real confidence in
>
> You really need more like 10V on the gate to get lowest RdsON, and you need
> to get there pretty quick or you will get into linear mode which is a power
> hog. I think I see how your circuit is constructed now. But you would do
> better with two 100 ohm resistors for about 9V gate drive. That is 90 mA.
> And the RC time constant will be about 100 * 0.0044 uF or 440 nSec. I
> generally use the RC time constant for rough calculations. Actually there
> are other considerations that affect turn-on and turn-off time, such as the
> Miller plateau which is caused by the gate-drain capacitance conducting
> current into or out of the gate as the Vds changes.
Hmm. That implies it is safe to drive the gate with 10V, whereas I
was assuming I should drive it close to the gate threshold voltage.
Ok, I can work with that, too. The FQP27P06 datasheet lists ~200ns
rise time and so forth, so I can estimate that the maximum usable
frequency it will operate at is about 1MHz, which is well in excess of
my requirements.
> >I'll run over the numbers again, but I think I get the idea from what
> >you've written. I'm going to test the circuit without a capacitor and
> >with a simulated load of some kind to see what happens when the uC pin
> >goes high with my DSO watching the MOSFET output and triggering on the
> >GPIO rising edge. Plus I'm gathering lots of ADC measurements which I
> >can capture via serial output from the uC.
>
> You may want to design a really low speed buck converter that switches
> slowly enough for you to take enough samples to see what's going on. A
> digital storage scope is good for that. But you can also run the circuit at
> more normal speeds like the 10 kHz I show, and you can use a cheap 10 MHz
> scope to see the waveforms well enough.
At 31.25kHz I can still read the ADC at arbitrary phase angles, but
it's slow to switch channels, and I'm thinking I'd be better off with
a multiplexer to route all the measurements to one ADC pin. As it is
sampling four phase angles from three different ADC channels takes
about 1.5mS, but that's just for testing. In practice the most
significant phase angles differ for line, inductor, and sense-resistor
measurement. I should be able to code such that the feedback loop
operates at about 3kHz, perhaps faster if the ADC turns out to be
reasonably accurate at higher frequencies.
> >>Go O's!
>
> >Who? Oakland?
>
> No, those are the "A's". I'm from Baltimore, and the team is the Orioles!
This is way more fun than watching baseball on TV. :)