FETs and gate resistors - scope images

Another 10uF/16v cap placed at D1, with the diode piggybacked:

CH1 = gate, CH2 = VBAT

CH1 = gate, CH2 = MCU's Vcc, pin 8:

The weird behavior of some drivers without a gate resistor, where the MCU seems to shut down right after changing modes, is likely due to the overvoltage to the MCU from that spike. It's doing exactly what it seems like, it's shutting itself down! It sees that ~6v and says 'whoa dude, I need a little nap - wake me up when shit gets back to normal.'

So how did adding the stupid gate resistor cover up this issue - just by reducing the load the MCU has to drive, therefore reducing the current draw through the diode, which reduced the tendency to create the voltage spike?

So by putting in the cap, the load resistor can go away?

Correct, the 100-130 ohm gate resistor no longer needed.

Also, due to the different circuit layout of the zener-mod drivers, those don't suffer the same voltage spike, so don't need any changes. Unless it's one of the zener-specific boards that are designed to keep a polarity protection diode. I don't know if any are, I haven't looked at them that closely. But a normal driver converted with a resistor in place of the diode, and the zener in parallel with the cap, isn't going to be able to generate these spikes. Those drivers likely never needed the gate resistor in the first place.

Do you have a East-92 to compare? As I said earlier in post #987 here, the diode is likely being used to help with this problem. I could certainly be wrong, but I suspect that the diode may work better. Once the cap is charged/discharged it maxes out. Bigger caps will have diminishing returns & high costs. The diode will continue conducting to remove our stray voltage until Vf is reached.

Good work so far.

The resistor softens the turn-off. The sharp turn-off is what causes the spike. The purpose of the diode as I understand it is give the spike a path to escape through rather than shoving itself where we don’t want it.

I'm posting stuff all over the place, these two were in the Oshpark thread.

Stock 105C hardware, CH1 on Vdd (MCU pin 6), CH2 on B+ before the diode:

Battery voltage was well below 4v for that pic.

This is a 20DD, no gate resistor, but otherwise using the original parts in the original spots (without the add-on capacitor across the diode). CH1 is after the diode (MCU pin 8 EIGHT, stupid auto-smiley crap), CH2 is before the diode (B+). Battery voltage was around 4.08v no-load.

Look at that beautiful flat line for CH1... if only it weren't way up there at 6 volts. 6 volts!!

I have one east-092 but it's one of the crap versions. I have dead stuff I can scavenge parts from, where should the diode go - between LED+ and LED-?

It seems that voltage is not always accurately depicted. In your trace with the Stock 105C hardware Vdd is shown >4v, this is not accurate if B+ is <4v. Actual Vdd will be much lower, the combined effects of the protection diode, B+ drop under load, and the ATtiny13A’s hardware should put Vdd closer to 3.0v I’d estimate?

Yes, but the anode and cathode will be backwards compared to the LED.

If I use the scope probes to check the battery voltage, it matches what my DVOM says. And when I add the capacitor in parallel with the diode, the gate voltage no longer goes above battery voltage - the 'boost circuit' is effectively disabled (or at least severely impaired). Shorting across the diode also gets rid of the overvoltage on all 3 spots - gate, Vcc, & B+.

edit: see post #14 for a comparison of diode normal vs. diode shorted, gate voltage drops to battery voltage just by shorting the diode

For clarity I am referring to the trace shown in post #35. I realize that you have it in quotes, but there is no ’boost circuit’. The ATtiny is completely incapable of providing an output higher than it’s input. Vdd is the enable pin on a 7135, the 7135 definitely does not increase the voltage of that pin beyond what the ATtiny puts there. The trace clearly show that the voltage is constant across the pulse, it is not a spike. The battery voltage is clearly shown as lower than the Vdd voltage. All I’m saying is that that is definitely incorrect. Where did you attach your ground clips?

EDIT: see dave_’s post #47 & #50 in this thread. He explains clearly why what I wrote in this post is wrong. (in other words there does appear to be an unwanted boost circuit created by our component layout)

Tried a diode (axial IN5817 schottky) between LED +&-, absolutely zero effect on either the waveforms or on correct mode changing.

This is the 20DD again. No gate resistor.

I have to build 2 BLF drivers later on today, I’ll definitely be trying this out on them. Because it removes the gate resistor it should make low slightly lower right?

Thanks for all the work, I’m trying to finish up a few lights to make some money to buy one of those same oscilloscopes now that I see yours, I’d never seen them before. One thing I’m interested in looking at is the 1/2 off mode using Werners UI when using a long press to turn the light off from low (like in the video I showed you)

Well, without the resistor you can use a lower minimum PWM value, the resistor raises the point at which the LEDs will start making light. I guess one way of saying it (probably wrong, but...) is that the gate resistor reduces the resolution at the low end.

Hmm, interesting. Thanks for trying it. All 3 pictures in post #39 are with a 20DD board which has the IN5817 installed between LED+/-?

I could have made copies of each of the 3 pics and given them different names to differentiate between with output diode and without, because they look absolutely the same either way. :p (and it still wouldn't change modes right, and so far I haven't seen anything that will fix the glitchy mode changing issue that doesn't also fix the over-voltage thing)

Yes, same driver in all 3. From pic 1 to pic 2 it wasn't even shut off, I just stuck a wire onto both legs of the polarity protection diode while it was running. Then for pic 3 I removed the diode, added the cap in its place, and stuck the diode back on. The wires in and out and the scope probes weren't even disconnected for any of it.

This driver previously wouldn't work without the gate resistor, after adding the cap and removing the resistor it runs perfect:

:stuck_out_tongue:

  1. Your B+ trace is generated with the probe stuck where? Directly on the B+ contact pad I assume?
  2. The difference we see from bypassing the polarity protection diode is what’s really intriguing me right now.
  3. The IN5817 was attached between BAT+ and the FET’s tab with the bar facing BAT+, right? Just confirming.

1. Yes... actually, the wire soldered to the + pad I intentionally left with enough exposed wire for the probe to clip onto. So it's about, what, 1mm or less from the pad? For pics showing the gate signal, I clip the probe directly onto the FET's leg. For the MCU pin 8 signal I remove the grabber attachment and use the pointy end and hold it on the pin. Probe grounds are clipped onto the driver's ground ring.

2. Me too, dude. dave_ said earlier that this particular combo of wire length*, capacitor (C1), and diode (D1) is creating a (very) crude boost circuit. There's no single component anywhere that is on purpose generating boosted voltage, I never thought that was the case... but 6V input on pin 8 results in, unsurprisingly, 6V output on pin 6. Whatever fix it takes to get pin 8 down to the actual B+ voltage is what will fix the erratic behavior. (completely removing the diode isn't a solution even if losing reverse polarity stuff would be acceptable, cause it screws up voltage monitoring and also the driver can't be reflashed unless the jumper across D1 is removed, it gives 'no communication...' otherwise. Other than all that, eliminating the diode would be the most simple fix, but not at all practical.)

3. Yup. It did so much of nothing I even reversed it, where of course it shut off the LEDs. 0:)

*The wire length can't be contributing all that much, since the drivers that act goofy on the bench also still act goofy when installed in a light.

As if I need more unexplainable stuff to throw on the pile, I have one really strange one. I have a BLF-SRK driver that has always run fine on all kinds of cells (INR 20R & 25R, Panasonic ICR 2900s), but absolutely freaks out and refuses to change modes or shuts off completely if I put in four Samsung ICR 28As (only charged to 4.20v, never tried with full charge to 4.30). I did the same extra 10uF capacitor trick on it, and it now runs perfect on the 28As. :~

With a big current change in a very short time, you don’t need all that much inductivity to charge a small cap to 6V. And if the mcu + fet drive takes less charge than the spike puts in, it will stay there forever. :slight_smile:
With your quite hard switching (high slope), that’s what you get. :stuck_out_tongue:

Since i’m on limited mobile traffic I won’t go searching for the actual circuit, but with ‘dd’
and ‘reverse protection diode’, I imagine it somewhat like that:

When we draw in some of the parasitic inductance, it looks somewhat like that:

There is your booster. :wink:

To get rid of the effect there are several options:
-soften the switching (gate resistor)
-clamp voltage at mcu with suppressor diode (5.5V types should be available plenty)
-add snubber circuit to dampen the spike (in some way like your big el. cap now does)

I’d probably try softer switching and one of the others. Whatever the easiest/cheapest is.