Invert PWM duty cycle #287

Open
opened 2020-02-05 20:28:58 +00:00 by gergaly · 2 comments
gergaly commented 2020-02-05 20:28:58 +00:00 (Migrated from github.com)

Is your feature request related to a problem? Please describe.
Due to my control logic (an extra transistor in the PWM signal) I would like an inverted PWM signal. When I link the PWM output to temp sensor it will be activated when the print starts (if I understand correctly). This means my fan will rotate at maximum frequency without even printing.

Describe the solution you'd like
The actual PWM duty cycle on the GPIO should be 100 minus the wanted duty cycle if the newly introduced 'Invert PWM output' option is selected.

Describe alternatives you've considered
I thought I'll do the fan control outside of OctoPrint in a bash or python script run by cron or run as a daemon.

**Is your feature request related to a problem? Please describe.** Due to my control logic (an extra transistor in the PWM signal) I would like an inverted PWM signal. When I link the PWM output to temp sensor it will be activated when the print starts (if I understand correctly). This means my fan will rotate at maximum frequency without even printing. **Describe the solution you'd like** The actual PWM duty cycle on the GPIO should be 100 minus the wanted duty cycle if the newly introduced 'Invert PWM output' option is selected. **Describe alternatives you've considered** I thought I'll do the fan control outside of OctoPrint in a bash or python script run by cron or run as a daemon.
4lunester commented 2020-03-26 03:27:30 +00:00 (Migrated from github.com)

Excellent idea when using PWM fans, makes for easier hardware integration.

Excellent idea when using PWM fans, makes for easier hardware integration.
insaneFu commented 2020-04-29 09:18:39 +01:00 (Migrated from github.com)

If you use an optocoupler instead of a transistor, you can hookup its input between 3.3V and your PWM GPIO. (I have PC817, don't forget a resistor, in my case 470O.)

That way, there is no need for inverting the PWM signal.

If you use an optocoupler instead of a transistor, you can hookup its input between 3.3V and your PWM GPIO. (I have PC817, don't forget a resistor, in my case 470O.) That way, there is no need for inverting the PWM signal.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#287