EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: HwAoRrDk on June 21, 2017, 08:33:07 pm

Title: PWM-ing a MOSFET for control of capacitor charge rate?
Post by: HwAoRrDk on June 21, 2017, 08:33:07 pm
Hi all. I was thinking again some more about what I was trying to accomplish in what was described in a previous post of mine (thread here (https://www.eevblog.com/forum/beginners/switchable-voltage-divider-88640/)) - using an analog mux to switch between various fixed resistors in order to alter the timing of an RC circuit. It occurred to me that, fundamentally, all I really need to accomplish is to control the current flow going into the capacitor.

So, the idea I came up with today was simply PWM-ing a MOSFET on/off at a variable duty cycle in order to control the current flow. It seems so simple, it's almost stupid! I don't know why it didn't occur to me before. |O

The circuit I came up with is as follows:

(https://www.eevblog.com/forum/beginners/pwm-ing-a-mosfet-for-control-of-capacitor-charge-rate/?action=dlattach;attach=325791;image)

I have an N- & P-channel pair to switch the current, with the 0-5V square wave to be generated by microcontroller. Lowering the duty cycle should lengthen the charge time, and vice-versa. A 100% duty cycle should leave the P-channel FET on, giving me my 'zero' setting that I talked about before.

I simulated the circuit, and it seems to work fine and do what I want. It also appears to handle the negative voltage (caused by the other side of the cap changing polarity when the 'home' switch is tripped) without issue. But I can't help feeling that there's some "trap for young players" that I'm missing, and that there may be other considerations to be taken into account.

My concerns:

- The simulator shows that both 'FETs spend a fair amount of time in linear mode (in fact, the N-channel seems to spend all its time like that). I gather that MOSFETs produce more heat when in linear mode. Will this be a problem? Or is it relative to current flow? We're only talking a couple of mA at most here for either of them.
- Will I be reducing the lifespan of the capacitor with this circuit? It is my understanding that excessive ripple current causes capacitors to heat up. Does that apply here? I don't want to prematurely degrade this particular part as I'm trying to not do any modifications or have any adverse effect on the existing componentry.