On my ongoing effort to create a high end microcontroller controlled universal car battery charger / power supply i accidentally a linear regulator:
Well, not exactly accidentally. At first this fucked my brain: http://www.tuxgraphics.org/electronics/200707/bench-power-supply-unit.shtml; me, being a programmer by education and by practice, i was instantly fascinated by the idea - no analog electronics, microprocessors are fast, they have Analog to Digital converters, they have PWM and means to make cheap Digital to Analog converters, it's wonderful, i can program my power supply (and believe me, i know how to program). The deeper i went, the less i liked the idea.
At first i've made a small prototype - an arduino charging a NiCad battery. It worked, but all i can say - default 256 bit PWM resolution on arduino totally sucks - there was no way to set the current on the exact level i wanted it to be. And 10 bit ADC sucks for the task too. OK, let's get beefier hardware - i've made myself ARM LPC1343 devboard from microbuilder.eu the chip rocks, (the devboard has it's own sucking, but it does not matter here), and i've got several external DAC and ADC chips as free samples from several suppliers.
I've decided to change the tuxgraphics design - they use BJT transistors and that sucks, as the total current, the power supply can ouput, depends on particular transistor configuration and there are limitations. That's becaus BJTs are current controlled devices and micocontroller can not put out enough current and you have to chain them and calculate impedances, etc. MOSFETs are voltage controlled devices, low pass filtered PWM is a voltage, put a mosfet on filtered PWM and you're golden. You wish. It appears, MOSFETs have a very narrow voltage range from threshhold to saturation. For any MOSFET you choose it's about 1.5volts. That's too narrow! I have to scale / cram my DAC output to this 1.5 and then it varies on temperature. There are MOSFETs with wide ohmic region, but they are used in audio and rare and expensive. That sucks. Besides PWM DAC sucks - i checked it on the scope. It's either noisy either slow. BTW, i was able to control the mosfet via PWM directly, event shorted them out and let them melt my breadboard, but the feeling was that i'm not doing it right...
Yeah, slow. If you look at LM317 transient response graph - it recovers in somewhat 5 microseconds. I'd have to cash out big time for DAC and ADC chips to try to achieve something like that in microcontroller... and fail... At that time i've already known enought about opamps to think, wait, what if i set a control voltage in one of opamps inputs and put it's output to gate of mosfet and get a feedback from source of mosfet... wait, whats the block diagram for a linear regulator? oh well...
to be continued...