Slow switching mosfet?? - Page 1
Forum section: electronics / projects

author: LukeB
author_rank: Contributor
timestamp: September 02, 2018, 10:28:30 am
content: Hello,I have been working on this solar charge controller project recently and have slowly been figuring things out and have come to this circuit. The trouble is is that I want to run it at 60khz using the attiny85. However when I do this and check the voltage at the gate of the mosfet it seems to take too long to reach the supply voltage. This means that the mosfet doesn't turn off for high duty cycles.See the attachment for schematic. Note: all the values and components are the actual ones i used.Does anyone know why this happens??Thanks

author: Phoenix
author_rank: Frequent Contributor
timestamp: September 02, 2018, 10:40:03 am
content: The MOSFET is only able to turn off using the 1k resistor to discharge its gate capacitance - you will need to make R4 a lot smaller (and fix the consequences) or find a better way to turn off Q2.

author: LukeB
author_rank: Contributor
timestamp: September 02, 2018, 10:54:23 am
content: what are the downsides to smaller resistance? I assume it is only power losses??

author: LukeB
author_rank: Contributor
timestamp: September 02, 2018, 10:55:52 am
content: Oh and what is a better way of turning it off?

author: rs20
author_rank: Super Contributor
timestamp: September 02, 2018, 11:23:54 am
content: Yes, if you only use a resistor to turn it off, reducing the resistor value causes your Q1 to get hot (and at some point, leave saturation.)The ultimate solution is a specific gate driver IC (here's a short list).Here's a guide by TI, section 5.1.2 basically describes your schematic (except you don't have an Rgate), and describes the problem you're having, and subsequent sections describe alternatives that alleviate these issues.Your schematic is poorly drawn. PANEL+ should be at the top, PANEL- at the bottom; and maybe labels used to break the ATtiny and regulator out into a separate section. Also, you don't note on the schematic what the panel voltage is, which would be helpful!

author: Benta
author_rank: Super Contributor
timestamp: September 02, 2018, 11:31:36 am
content: The schematic is horrible, you'll need to learn how to draw.That being said, your circuit is really nasty. The MOSFET is turned on by the 1k resistor and turned off through the BC547. This is a complete no-go, as the MOSFET will turn on uncontrolled while your MCU is booting.For the frequency you're aiming for, I strongly recommend using a dedicated gate driver IC. The input capacitance of your MOSFET is several nF, which takes a lot of punch to charge/discharge.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 02, 2018, 12:24:37 pm
content: Use a high side gate driver. This includes a bootstrap function to generate positive gate drive (for a cheaper N channel FET), and level translation.As for the circuit: there's no current feedback. All it takes is one hiccup from the MCU and the transistor is toast. Consider the transient response of the circuit. Take measures to ensure the peak inductor current doesn't build up beyond design maximum current. This is usually done with a current sensor, maybe a shunt resistor and INAxxx shunt amplifier for this case (placed in series with L1, just before C2). Peak current mode won't be easy with an ATtiny, but average current mode is doable, especially with that large value inductor.Tim

author: LukeB
author_rank: Contributor
timestamp: September 02, 2018, 01:37:54 pm
content: Thanks for all the responses guys. Clearly I have a lot more to learn. Hopefully once I get to uni (only in year 12) I will learn what I need to. For now ill just keep tinkering. The responses are really really good. Thanks again.

author: rstofer
author_rank: Super Contributor
timestamp: September 02, 2018, 09:48:23 pm
content: The problem with MOSFETs is gate capacitance and the capacitor charging and discharging equations.https://www.electronics-tutorials.ws/rc/rc_2.htmlDuring the time it takes to get the MOSFET into full 'on' or 'off', the device is in a linear region and heating up. What you really want to do is get the MOSFET to switch in zero time. Well, in the presence of capacitance, switch in zero time takes infinite energy and you don't have it. You particularly don't have it when you charge through a 1k resistor.Second problem: The capacitance problem means there is a slow rising edge to drain current. And there is a slow corresponding falling edge although the transistor helps. So, there are linear regions taking some amount of time on each end of the on-pulse waveform. Kind of a trapazoid. Here's the thing: As the frequency increases, these edges stay the same (in time) and become a bigger portion of the total period. As a result, the device is never in a full 'on' or 'off' state and is heating all the time.Again, the answer to higher frequencies is to use a MOSFET driver that can pump AMPS into the gate - milliamps just doesn't cut it. It won't be zero time switching but it'll pretty fast.

author: rs20
author_rank: Super Contributor
timestamp: September 03, 2018, 12:34:47 am
content: Quote from: T3sl4co1l on September 02, 2018, 12:24:37 pmI'm curious: the output of the device is a battery, which means that if the switch stays off for a while (or even, spends a bunch of time in discontinuous conduction mode); the voltage at the source of the MOSFET will settle at Vbat; which would prevent the bootstrap capacitor from charging. So depending on the exact startup transients etc; such a solution could end up paralyzed at startup. Am I missing something? What's a non-horrible workaround?PS: I just built an LED driver circuit that failed for a virtually identical reason... so I'm not making this upQuote from: LukeB on September 02, 2018, 01:37:54 pmYou'll do well if you're tinkering with building solar battery chargers from scratch at year 12! Unsolicited career advice: Keep at it though; and don't wait for Uni to teach you things. Uni is way more fun if you're ahead of the curve (like you are now) than if you're in the middle of the curve (like you might be if you rest on your laurels until Uni). We've all been talking about complicated stuff; analysis of exactly what happens in your current circuit, bootstrapping high side drivers, bla bla bla. But this is your thread, feel free to direct it however you like. The one problem (apart from the lack of feedback mentioned by T3sl4) is that the gate is not beingstronglydriven to Vpanel when required. If you focus on that issue, you'll do fine. In particular, just replace your BJT with a TC4428 IC and that'll solve that problem instantly.

author: Phoenix
author_rank: Frequent Contributor
timestamp: September 03, 2018, 01:01:00 am
content: Quote from: LukeB on September 02, 2018, 10:54:23 amLots of power loss!I wasn't sure of your background and how much info was required. I think rs20's document from TI is pretty good, especially the circuit in figure 20 might be the next step up in simplest circuit to do want you want. Would be good to know the input voltage range and expected output volts/amps.

author: LukeB
author_rank: Contributor
timestamp: September 03, 2018, 12:33:53 pm
content: the input voltage is around 18v and the output is around 14. The max amps is around 5 amps.

author: LukeB
author_rank: Contributor
timestamp: September 03, 2018, 12:36:04 pm
content: What would be better, smaller resistance to gate to reduce the switching time or a bigger one to reduce power losses to ground??

author: xani
author_rank: Frequent Contributor
timestamp: September 03, 2018, 01:02:02 pm
content: Quote from: LukeB on September 03, 2018, 12:36:04 pmYou've basically have two problems:* level translating from your micro's 5V to MOSFET voltage* driving MOSFET gate with decent current to switch it fastYou can solve both, as other mentioned, by just using dedicated MOSFET driver. They are cheap and useful so you will probably find use for them.But if you for some reason don't want to, and if you can spare 2 more trannies you can do something like in attached schematic.Q2 does level translation. It's speed will depend on resistor values, Q3/4 provides driving current for MOSFET gate, MOSFET resistor helps with oscillation.