Duet 2 Mosfet switch off ringing
-
Hi all,
I observe an strong mosfet switch off ringing with fans and a Duet3d 2 Ethernet.
Connected is a standard blower, running at PWM 50% duty cycle.
The scope screenshot shows even a "re-ignition" of the mosfet due to inductive/capacitive effects.Edit: All oscilloscope charts shows voltage across the load, i.e. fan or heater. (Thx @jens55 for clarification)
(A simple arduino based creality board shows similar behaviors btw. and also a simple "lab" setup with an Arduino and a Mosfet on pinboard.)
I'm starting with electronics only, so I'd liketo get some hints how to avoid this ringing.
For comparison, the hotend heater (pure resistive load) PWM switching shows a quite normal small ringing only.
-
-
Did you calibrate your probe (adjust probe capacitance) before you started your experimentation? Did you use a proper 10X probe or a straight wire hooked to your measuring point? If properly adjusted, the second trace should show a much cleaner signal.
Besides that, switching an inductive load will always result in some ringing and can be reduced with a flyback diode as alankilian mentions but short of some major circuit design effort you will not get rid of the ringing.
Also, the hotend is not purely resistive .... it is a wire wound element so it experiences some (very small) inductive effects. -
@alankilian said in Duet 2 Mosfet switch off ringing:
@peter_o What signal is your probe connected to?
Do you have a "flyback" diode connected across the fan?Hi Alan, thanks for your feedback and questions.
The probe is connected to the print head connectors with about 1m cable length to the board and 10cm to the fan.
I had connected a flyback diode several times with a desk lab setup and never saw a real difference. Te be sure, I've just connected a flyback diode to the print head connector. Here's the screenshot:
-
@jens55 said in Duet 2 Mosfet switch off ringing:
Did you calibrate your probe (adjust probe capacitance) before you started your experimentation? Did you use a proper 10X probe or a straight wire hooked to your measuring point? If properly adjusted, the second trace should show a much cleaner signal.
Hi Jens,
thank you for your feedback and questions.I'm using a diffential probe in 10x-mode.
Here is the same probe with same probe connectors, connected to a function generator providing a comparable 10V 50% duty cycle square puls:Timebase is 50ns/div in zoom window, so the probe seems to be sufficient for the job above.
Besides that, switching an inductive load will always result in some ringing and can be reduced with a flyback diode as alankilian mentions but short of some major circuit design effort you will not get rid of the ringing.
I somehow was expecting this kind of answer, but was not shure due to lack of electronics experience.
I played with an external mosfet module on the desk some time ago. That module had an optocoupler between control and power circuit, and it works much cleaner.
But it would be difficult to change the gate side of the mosfet on a 3d printing main board.
Also, the hotend is not purely resistive .... it is a wire wound element so it experiences some (very small) inductive effects.
That would explain the sine ripple with the heater switch off, maybe together with the 1m wire from board to heater.
I wonder if this ringing would be present at all 3d printers, if I should just get used to it, or if there is anything in addition that might be considered.
Is it a good idea to add a capacitor to the fan like 100µF or 1000µF, or is there a risk that the initial current overloads the mosfet?
-
@peter_o, just to clarify, when the mosfet output goes low, the fan is switched on and when it goes high the fan switches off.
I am not sure what you are referring to when you say 'sine ripple with the heater off'.
If I was in your situation and super curious, I would hook up a different fan and look at the signal again. Chances are you will see something pretty similar. Beyond that I would forget about it.
Re caps on the fan outputs ... that's a good way to blow the mosfet(s) -
@jens55 said in Duet 2 Mosfet switch off ringing:
@peter_o, just to clarify, when the mosfet output goes low, the fan is switched on and when it goes high the fan switches off.
Thanks for clarification. The probe is connected across the fan, So it's "fan off", not "mosfet off". I will correct that above.
I am not sure what you are referring to when you say 'sine ripple with the heater off'.
2nd screenshot in the first postIf I was in your situation and super curious, I would hook up a different fan and look at the signal again. Chances are you will see something pretty similar. Beyond that I would forget about it.
I already did with my desk test setup. Different blower, premium sunon fans, 120mm PC case fan, all the same.
Ok. Then I will move ahead and leave this topic as it is: Some common noise from 3d printers.
Re caps on the fan outputs ... that's a good way to blow the mosfet(s)
Thanks for corfirming that thougth.
(I've already killed one of the fan mosfets of the duet 2 with a simple short some month ago. Better fix that one first. ) -
@peter_o, please can you post a trace using a single x10 probe connected to the negative fan wire, with oscilloscope ground connected to Duet ground. I will find that easier to interpret.
-
@peter_o said in Duet 2 Mosfet switch off ringing:
Thanks for clarification. The probe is connected across the fan, So it's "fan off", not "mosfet off".
You talked 'differential' mode earlier and here you are talking single probe. If you connected the scope ground lead to one side of the fan, unless your scope is running on battery power and not connected to AC or grounded any other way, you can cause all manor of havoc.
As dc42 suggests, the proper way of doing the measurement is referenced against the Duet ground.
Also since the Duet switches the ground line, that introduces some unexpected things in your measurements and you really need to be aware of what is happening. -
@peter_o Most fans have electronics inside and are not specified for intermittent power supply such as PWM.
You may find this thread interesting https://forum.duet3d.com/topic/21680/designing-a-pwm-to-analog-mini-board-for-fans
-
@dc42 said in Duet 2 Mosfet switch off ringing:
@peter_o, please can you post a trace using a single x10 probe connected to the negative fan wire, with oscilloscope ground connected to Duet ground. I will find that easier to interpret.
@dc42, here as requested: Standard probe x10, ground connected to "always on fan GND" and probe to PWM fan 2 "-" in question.
The pattern is changing from pulse to pulse, I've shot two different ones:
-
@jens55 said in Duet 2 Mosfet switch off ringing:
@peter_o said in Duet 2 Mosfet switch off ringing:
You talked 'differential' mode earlier and here you are talking single probe. If you connected the scope ground lead to one side of the fan, unless your scope is running on battery power and not connected to AC or grounded any other way, you can cause all manor of havoc.
Yes, thanks for giving the warning. I've learned that from Daves Eevblog videos.
Sorry, that I didn't write this clear enough:
I used a diffentical probe with resistor chains and amplifier. (Micsig DP 10007)As dc42 suggests, the proper way of doing the measurement is referenced against the Duet ground.
See last post. That is now standard x10 probe.
Also since the Duet switches the ground line, that introduces some unexpected things in your measurements and you really need to be aware of what is happening.
N-type mosfets, yes. That was the reason for me to use a "real" differential probe except for the last two shots. Sorry for not clarifying this enough.
-
@peter_o, thanks. It looks to me that your fan has no input capacitor at all and doesn't like PWM. It may look better if you connect a 0.1uF capacitor in parallel with the fan.
-
Yes it's one of these cheap 50mm blowers often used in chinese style 3d printers.
(Sometimes I write for the german hobbyists 3d print forum, e.g. [https://drucktipps3d.de/duet-2-erste-eindruecke/]. That's the main reason, why I'm nerding into things like this, to gain a better understanding. The forum community is using low cost components. It's not that easy to convince them to use higher quality components like premium fans or duet boards. )
I've added a 100nF and now it looks like this, again with a changing pattern:
-
I'll try some different capacitor values on my cheap lab setup to avoid overloading the duet's mosfet and will come back with the best result.
Thx so far, dc42 and all for spending the time!
-
Amazing difference for 100 nF !
-
@peter_o said in Duet 2 Mosfet switch off ringing:
I'll try some different capacitor values on my cheap lab setup to avoid overloading the duet's mosfet and will come back with the best result.
Thx so far, dc42 and all for spending the time!
Don't make it too large, or you will increase power dissipation in the mosfet.
-
For convenience I used an arduino setup with an IRF3708 mosfet in my "lab2".
Measurement with the differential probe over the fan.First the same blower as above with 0.1µF again.
It's a different mosfet, but the pattern ist exactly the same. Changing bewtween patterns:Same setup with 0.47µF
Quite some switching time. I understand your warning, @dc42.A Sunon Maglev 40mm fan without capacitor is not behaving better.
Sunon Maglev with 0.1µF
Sunon Maglev with 0.47µF
My conclusion: A more premium fan shows the same problem.
And a capacitor can improve the situation, but seems not to solve it completely.
Thanks for the tip, @dc42!If there are no other ideas, I will leave it with that for now and do some experiments on breadboards with an optocoupler in front of the gate to have 12V avaiable for the gate. Of course this would be no solution for a given 3D printer board.
-
@peter_o said in Duet 2 Mosfet switch off ringing:
Measurement with the differential probe over the fan.
What kind of signal are you expecting to see with a differential probe over the fan when the MOSFET turns off?
The fan will be as we say "Hanging in the breeze" with a connection to VPOWER+ on one end and the other end will have no connection anywhere so the fan coils will be able to boing all over the place if they want to. That doesn't mean the fan is going to turn on and off at all, just that the flying-free voltage on this disconnected fan is boinging around a lot.
What do you want to see under these conditions?
-
Ok. I see. That's a strong argument indeed. Thx.
The argument should be the same, when measuring the "Fan -" Pin vs. GND with a standard probe and high impedance oscilloscope setting.
On the other hand I remember, that these effects vanished, when I used a cheap external mosfet board with optocouplers. Have to go back and check and look into that schematics.
I will fiddle around some time the next days and take your argument into account. Maybe I gain some more understanding. The electronics beginner I am.