Can Fan PWM Output Be Reversed in Software for a Reverse-Controlled Fan?

Basic Information:

Printer Model: DIY
MCU / Printerboard:ZERO3 OCTOUS pro
I have a fan, but it is reverse-controlled, which means that it is at the highest speed when 0V is input and stops rotating when 5V is input. I would like to ask if it is possible to reverse the PWM output of the fan in software

The thread title should be a brief summary and not the whole description of your topic/issue!

1 Like

Thank you for pointing out the problem. I have corrected it.

PWM is not a matter of a range between 0V and (in this case) 5V
PWM is a matter of the duration of a pulsed signal.

Can you share the type of the fan (lable)?

This is the purchase link of the fan: 商品详情

Would inverting the fan pin have the effect he wants or is that just for input pins?

Hmm. It’s worth a try.

The taobao link isn’t much helpful (language Chinese). Did you find any specifications?

I didn’t find any specs.

None of the standard fans that I know allow reversing their motor direction. This is due to the electronics used on the fans control boards and also due to the mechanical design of the fan blades.

There are some series of fans that allow both directions and they typically use the lower half of the PWM control range, e.g. 0 to 50%, for direction A, then have a dead band between 51 and 55% and from 56 to 100% they reverse the direction.

After my test, it is indeed found that after inverting the PWM signal, as it changes from 0 to 100, the rotation speed gradually decreases.

Ah sorry, I misread the question.
Yes reversing the logic from slow → fast towards fast → slow should work. Reversing the direction of the fan itself, does not.

@TR666
The resolution to your issue may be electronics and not the software. Search for a Schmitt Trigger inverter with a voltage range of your PWM for your fan. Most are controlled by a 5V signal, but there can be other voltages; the fan supply voltage can and, most of the time, more than the PWM control.

Most show transistor circuits, but I don’t think all of them can operate correctly at the PWM frequency.

I will use a NOT gate component - SN74LVC1G14DBVR to try to invert the PWM signal

In fact, control can be achieved without any inverter circuit. After testing, it is found that for the XH2.52_2P interface provided by the PCBA, the high level is always 5V and is used to control the low-level pin. This design is very clever. When the speed is 0%, both the upper and lower interfaces are 5V; when the speed reaches 100%, the lower interface will become 0V.