Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fan MOSFET drivers not compatible with Marlin FAST_PWM_FAN #72

Open
melslenstra opened this issue Dec 27, 2021 · 0 comments
Open

Fan MOSFET drivers not compatible with Marlin FAST_PWM_FAN #72

melslenstra opened this issue Dec 27, 2021 · 0 comments

Comments

@melslenstra
Copy link

melslenstra commented Dec 27, 2021

I'm posting this here mostly to document my findings and the modifications I applied, but also as a request to BTT to incorporate better fast PWM handling if and when they decide to design a GTR v2.0 board.

When I configure my Marlin firmware with FAST_PWM_FAN enabled to get rid of fan coil whining, my fans become more or less uncontrollable. When I set the fan to 0% it's off, when I set it to 1% it already gets what sounds like full power... This is at the default 31.4kHz PWM frequency. I personally wouldn't want to set the PWM frequency much lower either, because I'm pretty sensitive to high-pitched sounds.

Measuring with an oscilloscope shows that the voltage on the negative pin for the fan (they're switched on the negative side) exhibits a long ramp-up time, causing the fan to see much more "on time" in the PWM cycle than what was set. Checking the gate of the final MOSFET explains why; it's seeing the PWM "on" pulse go up nice and sharply, but then it's left to tail off very slowly back to ground. The voltage stays above the gate threshold voltage for the AO3400 for almost 75% of the cycle time. Sorry for not capturing a scope screenshot, you'll have to believe me.

The schematic of the GTR 1.0 board shows why; for some reason it contains an emitter follower which decouples the STM32F4 PWM pin from the MOSFET gate. This circuit is able to pull UP the gate quite quickly, but when the PWM signal from the uC goes low it's up to the 10k resistor (R90 for FAN0) to pull it down to ground. Considering the MOSFET has significant gate charge, this take almost half of the 31.4kHz cycle...

image

I successfully modified my board to deal with higher PWM frequencies like this by:

  1. Removing Q7, Q10 and Q11
  2. Removing R87, R75, R80
  3. Adding 215 ohm resistors across the base and emitter pads where Q7/10/11 used to be

This directly couples the PWM signal from the uC into the MOSFET gate, with the 215 ohm resistor value chosen to keep the peak gate charge current nice and civilized (a bit over 15mA). Differential measurement across the resistor after modification confirms the current doesn't peak higher than about 16mA in my case.

image

Please excuse the crudity of the model, didn't have time to build it to scale or paint it.

Disclaimer: Modify your board at your own risk, what works for me may not work for you. Don't blame me if you blow up your board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant