FETs and gate resistors - scope images

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?

Good work!

Traditionally that cap should be as close to VCC as possible. Putting it after the diode helps achieve that goal and doesn’t cause the original 105c circuit to malfunction (even if it makes the ATtiny operate out of spec). I’d assume that the original 105c was never modeled in SPICE or anything.

The cap after diode is made to buffer the voltage for the Controller which works perfect as we can see a bit to perfect as it never gets discharged and stays at 6V….(post#39)
Cap between - and + will get discharged through the led if voltage breaks in and so its Not so steady DC which can lead to some Controller malfunctions.

The Zener mod to a standard mounted driver should be the best possibility, but would need extra parts.


Voltage protection is no problem because we flash the firmware by ourself anyway, the adc value just needs to be adjusted in the software, which I do anyway because I want a bit higher protection anyway… I always try the driver on a power supply if it works because the internal voltage from the ADC isn’t super accurate, but until now I never found a big mistake. I am also unsure if the voltage drop on the diode is 0.25V because the voltage only drops if current flows and there is just little current flowing, maybe you can measure it with the oscisoftware.
I have an excel sheet for easy calculating different values and get a clue which values are useful, you just fill in the resistors used and the voltage you want the protection kick in and the sheet says the value to select.

Werner is correct. If we go with the latest change (“V2” pic) the a new PCB layout should be made to push the diode and the cap very close to the VCC on the ATtiny. That way it will still be a decoupling cap (I think). As it stands it happens to work, which is good, but I think it would be hard to call that cap a decoupling cap anymore.

FWIW you never posted pictures or results from dave_’s suggestiong (post#53). He recommended keeping C1 in place and adding a cap like you did in your “V2” picture. I’m not sure exactly how that would pan out.

EDIT: Well, I want to clarify what I’m saying. I don’t think it’s normal for a decoupling cap’s operation to depend on a diode, so if Werner is saying that the cap must have a diode to keep the LED from pulling it down I don’t know if I agree with that. All I’m saying (all I know to say :wink: ) is that for the cap to be effective it must be as close to the VCC pin as possible.

Cap moved from C1 to B+/GND:

1 cap at C1, 1 cap at B+/GND:

Adding a cap back at C1 also brings back a little bit of boosting, Vin was below 4v for those pics and Vcc is up above that.

Voltage at pin 7, for voltage monitoring, is nice and flat with either setup (and even in the first config, with the voltage boosting and spikes and the rest). If it's stable and doesn't misbehave with just a single cap relocated, does the oscillation on Vcc hurt anything?

And I found the thing the diode across LED+ & LED- is supposed to deal with...

Yikes. :O (using different dividers to avoid the 'out of range' warnings, 0.8 is actually 8.0 ZERO YOU STUPID AUTO-SMILEY B.S.)

But again, as scary as that might be, I've used lights with these drivers without the diode extensively and haven't had anything croak yet. Is that another something that really should be addressed with a board redesign?

Thanks for testing - the results seem reasonable considering the other test results you’ve already shown. I don’t think the oscillation is going to hurt anything. Hopefully others will chime in one way or another. I would still like to move the diode & cap towards VCC, but no sense fooling with that until we’re reasonably sure of things.

I’m a little lost with the most recent trace. I see the spike, but I’m confused about the scales despite your explanation. It seems that the resting voltage of LED- shows up as 2v? And when the FET turns on LED- dips to 0v, and then spikes to >8v when the FET turns off?

I read some about margins recently. Apparently a 20% margin is normal for engineering. As in, if all the parts subjected to the spike can handle an 10v potential from LED- towards B+ (or whatever), then 8v would be OK.

That's with the probe on LED- & ground clip to battery negative. I only changed the dividers to get rid of the out of range message. The waveform didn't change, just the voltage scale on the side.

By the way, what IS the proper connection to look at the signal to the LEDs?

Sounds legit to me. Remember I’ve got about the same experience with a scope as you :-). Knowing where that clip goes is just part of keeping us on the same page.

Please try the same test with one probe on LED- and one probe on the FET’s tab (eg the other end of the wire that goes to LED-). I don’t understand well enough to know whether the spike should be worse there or not.

Well I dunno if this is normal for all oscilloscopes, but on this one grounding the clip on either probe provides ground for both of them. Nothing on screen changes if you have both clipped to ground and then remove either one.

Ground clip to LED-, probe to LED+?

Now that I think about how I had it connected, I think the trace is inverted... it looks almost like a mirror image of the gate signal.

OK…the BLFDD redesigns are in the works…Mattaus is currently reviewing, finalizing my tweakage of his builds and if they check out he will be re-releasing with the design suggestions you guys recommended

I hope I did him proud!

Thank you all you guys. I could never have figured any of this out by myself and yet I can follow most of the discussion guing on here. You guys are brilliant! TY :-)

If I want to do this with a zener mod would I replace the diode with the R200 resistor (like normal) and add the zener diode to the now empty C1 pads or does the zener diode have to also have the cap in the factory position?