FETs and gate resistors - scope images

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.

Congratulation you have found the problem, never have thought of overvoltage until now. :party:
Thanks for the pics in #39.
That is what I wanted to see. But I am a bit surprised that there is no spike in the diode bypassed picture…?

@dave we know why it is but why does a cap over the diode help…?

Oh no, I only used the big cap because it was at hand and easy to make contact with various points while watching the scope. I'm using an 0805 10uF/16V X7R, same part as the Nanjg's capacitor (and same as used on the BLF boards at C1). Are there any longevity/performance worries with doing it this way? It definitely does cure the problems that come from not using the gate resistor.

It's not perfect but if it fixes the problem, does it matter...?

@werner
parallel to the diode? We have not pure DC here, so current could flow through a cap back.

Since I am supposed to do work I really don’t want to, let’s look at it with spice. :smiley:

Here the circuit with the problem:

Now with cap in parallel:

looks familiar? :wink:
See the red curve, the current through the cap.

Here the falling edge zoomed in. (the cap current in blue is inverted. When it is negative, current flows to the mcu cap)
You can see how the mcu voltage (red) follows the voltage before the diode/cap (grey).
As soon as the voltage before the cap changes, current flows through the cap and the voltage behind the cap also changes. Works in both directions.
The ringing is just resonance with the inductor.
So, yeah, ac can get through a cap, probably sounds familiar too. :wink:

@comfychair
Well, if the cap has a half decent ripple current rating, it’s going to be fine.
It certainly is not a perfect solution with all that crap at the mcu vcc,
but that does not mean it is not a good enough and practical one. :wink:

Good work everyone. Dave’s info makes sense to me now. From his description (& spice sim) it seems that having a cap after the protection diode is integral to the unwanted boost circuit. What if we just move that input smoothing cap to before the protection diode? I’m pretty certain that’s not a perfect fix, but it seems to me that it would eliminate the boost circuit and just leave whatever remains of the spikes, similar to the diode bypass.

Thanks comfychair. Of course that all checks out. As you know I like to make sure I’ve got a handle on the situation - detailed responses help with that. Based on what I know now I guess I’d better throw some strike-thru in a previous post ;-).

Would that cap location work? It would just go from B+ to GND. It would be easy to try anyway. I do know the driver won't run AT ALL with the cap completely removed, but I never tried just a single cap from B+ to GND.

What about... using the zener/resistor regulator, even for the 4.2v drivers? That still provides reverse polarity protection, right? How would low voltage detection be affected, with a resistor in place of the D1 diode and zener between after the resistor and GND? That would effectively dump any excess voltage to ground (though very small current based on the resistor used). Or would that setup not generate the high voltage in the first place? I don't think I've ever tried a zener-modded driver in a single-cell layout...

Or is this second capacitor idea good enough? I mean, it looks better on the scope than even a totally stock 105C, right?

(Something that hit me last night, I worried that this cap+diode thing would screw up low voltage detection - pin 8 is now 2 whole volts lower than before, but I haven't compared what's present at pin 7 between the before-mod and after-mod drivers. I did a quickie check with a used CR123 and it steps down the same in the after-mod driver as it does with the same CR123 in a light with a before-mod driver. So if it's different, it's not vastly different.)

So, there is no cap from b+ to gnd?
I’d try that then first. But keep the diode and vcc cap, just add one there.
With a little luck that’s good enough.

Correct. There is only one cap in the stock BLF20DD circuit, it is placed after the reverse voltage protection diode. Is there a simple explanation of how this cap would be less effective if placed before the diode?

dave_ has probably pointed out the proper way to do this in post #53. I haven’t fully thought out what happens if you move the Vcc cap like I described in post #51. I figured that as long as the cap was still close to the ATiny it would still be able to filter for Vcc, and as long as we moved it to before the diode it would no longer form the unwanted boost circuit. Maybe dave_ can explain why part of that thinking is flawed? Until he shoots a big hole in my thought process I’d love for you to try it both ways if you want ;).

In terms of the effect on voltage monitoring… yeah, looks like it would be affected on any drivers that sample battery voltage after the protection diode. Drivers which hook the divider up directly to B+ are unaffected. Do you get 6v on Vcc in every mode, or does the voltage of the boost circuit vary depending on PWM freq?

On the matter of whether what you’ve already done is good enough - I do not know. I’m not a guru on this stuff, but it seems unconventional. If we can get better results with a conventional method I see no reason not to do it. If just moving the Vcc cap worked and was acceptable that would lower part count. It seems that this would be an unconventional solution as well though.

As to your experience in post #46 with w/ the ICR 28A’s producing the problem and the other cells not doing it… I’d immediately assume it’s higher Internal Resistance. The higher the internal resistance of a cell, the higher voltage will spike in a scenario like this.

Wow. Never figured that would have worked, because otherwise why would the 105C have the cap after the diode?