How to use 12v system fan on a 24v Smoothie using spare pwm output

968 views
Skip to first unread message

Steve Graber

unread,
Oct 12, 2014, 6:15:15 PM10/12/14
to smoothiewa...@googlegroups.com
I want to run a 12v fan blowing across the Smoothie system board that should turn on when the stepper motors are enabled. And this printer uses a 24v PSU so I'm thinking I would rather pwm limit my 12v fan. I'd rather do this than tie two fans together, or use resistor, etc. because the mosfet output is available right there unused, and then I can have the pwm option to set the fan rpm down into the quiet zone.

I'd like to use small mosfet pin 2.6 but haven't found where to specify an output based on motor.enable.

I suppose I could toggle the fan based on some minimum temperature, but would rather switch based off the motor_enable:

I figure if it can be done it will be very similar to this code that I'm using to control the fan on my E3D v6 hotend. Note this is not the part cooling fan.

# automatically toggle a switch at a specified temperature
# useful to turn on a fan or water pump to cool the hotend
temperatureswitch.hotend.enable              true             #
temperatureswitch.hotend.switch              fan2             # select which MOSFET to use, must match a switch configuration (fan2 below)
temperatureswitch.hotend.designator          T                # first character of the temperature control designator to use as the temperature sensor to monitor
temperatureswitch.hotend.threshold_temp      60.0             # temperature to turn on (if rising) or off the switch
temperatureswitch.hotend.heatup_poll         15               # poll heatup at 15 sec intervals
temperatureswitch.hotend.cooldown_poll       60               # poll cooldown at 60 sec intervals

switch.fan2.enable                           true             # enable
switch.fan2.input_on_command                 M42              # gcode to turn on
switch.fan2.input_off_command                M43              # gcode to turn off
switch.fan2.output_pin                       2.4              # pin that controls the fan
switch.fan2.output_type                      pwm              # pwm output settable with S parameter in the input_on_comand
#switch.fan2.max_pwm                         110              # set max pwm for the pin default is 255 (12v fan on 24v PSU)

But instead turn on-off simply if any of the stepper motors is enabled-disabled.

Can this be done?

Arthur Wolf

unread,
Oct 12, 2014, 6:17:53 PM10/12/14
to smoothiewa...@googlegroups.com
2014-10-13 0:15 GMT+02:00 Steve Graber <grabe...@gmail.com>:
I want to run a 12v fan blowing across the Smoothie system board that should turn on when the stepper motors are enabled. And this printer uses a 24v PSU so I'm thinking I would rather pwm limit my 12v fan.

I'm not actually sure PWM limiting is safe for a fan, my guess is you'll damage it.
 
I'd rather do this than tie two fans together, or use resistor, etc. because the mosfet output is available right there unused, and then I can have the pwm option to set the fan rpm down into the quiet zone.

I'd like to use small mosfet pin 2.6 but haven't found where to specify an output based on motor.enable.

I don't think we have a way to do that currently. It wouldn't be much to add, but nobody's tried to do that before.

I suppose I could toggle the fan based on some minimum temperature, but would rather switch based off the motor_enable:

That we have a module for, as you show bellow.
 

I figure if it can be done it will be very similar to this code that I'm using to control the fan on my E3D v6 hotend. Note this is not the part cooling fan.

# automatically toggle a switch at a specified temperature
# useful to turn on a fan or water pump to cool the hotend
temperatureswitch.hotend.enable              true             #
temperatureswitch.hotend.switch              fan2             # select which MOSFET to use, must match a switch configuration (fan2 below)
temperatureswitch.hotend.designator          T                # first character of the temperature control designator to use as the temperature sensor to monitor
temperatureswitch.hotend.threshold_temp      60.0             # temperature to turn on (if rising) or off the switch
temperatureswitch.hotend.heatup_poll         15               # poll heatup at 15 sec intervals
temperatureswitch.hotend.cooldown_poll       60               # poll cooldown at 60 sec intervals

switch.fan2.enable                           true             # enable
switch.fan2.input_on_command                 M42              # gcode to turn on
switch.fan2.input_off_command                M43              # gcode to turn off
switch.fan2.output_pin                       2.4              # pin that controls the fan
switch.fan2.output_type                      pwm              # pwm output settable with S parameter in the input_on_comand
#switch.fan2.max_pwm                         110              # set max pwm for the pin default is 255 (12v fan on 24v PSU)

But instead turn on-off simply if any of the stepper motors is enabled-disabled.

Can this be done?

Not with the current code no.
 

--
You received this message because you are subscribed to the Google Groups "Smoothieware Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smoothieware-sup...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Courage et bonne humeur.

wolfmanjm

unread,
Oct 12, 2014, 7:34:15 PM10/12/14
to smoothiewa...@googlegroups.com
In addition to what arthur said stepers are on all the time in smoothie once you start moving so you may as well hook the fan up to the PSU and have it on as long as the power is on.

PWM for fans will not protect a 12v fan from 24v, you need to use a resistor network or get a 24v fan.

Doubling up fans also does not work for fans.

Steve Graber

unread,
Oct 12, 2014, 7:44:42 PM10/12/14
to smoothiewa...@googlegroups.com
Gotcha -  what I'll do then is make a 12v subsystem. Use a DC-DC buck converter to reduce the voltage from 24 to 12 for my fans. I'll supply the + side of each fan with 12v from the buck and connect the - side of the fan to the mosfet pin. I assume I can pull the -12v side down to the mosfet pins? Would I need to modify the board, for example remove the LED's for those mosfets?

Triffid Hunter

unread,
Oct 12, 2014, 10:32:59 PM10/12/14
to smoothiewa...@googlegroups.com
On 13 October 2014 10:44, Steve Graber <grabe...@gmail.com> wrote:
Gotcha -  what I'll do then is make a 12v subsystem. Use a DC-DC buck converter to reduce the voltage from 24 to 12 for my fans. I'll supply the + side of each fan with 12v from the buck and connect the - side of the fan to the mosfet pin.

Yes, this is the correct way to do it.

Make sure the grounds are connected together if the buck is isolated.
 
I assume I can pull the -12v side down to the mosfet pins?

Yes.

The mosfets simply connect the -ve output pin to ground when on, and leave it disconnected when off.

As long as the mosfet's Vds(max) isn't exceeded (40v) and you don't pull too much current, they'll be quite happy
 
Would I need to modify the board, for example remove the LED's for those mosfets?

No.

There is no need for any modification of this sort. It should all work just fine.

Steve Graber

unread,
Oct 13, 2014, 12:05:54 AM10/13/14
to smoothiewa...@googlegroups.com
This is working great and both fans come on and off with their Mcodes and they respond well to pwm. FYI the power jumper for the small mosfets 2_4 and 2_6 is removed so I guess theoretically I could have attached the 12v buck transformer directly to the pwr in connector for those two small mosfets. But what I've got now is working well.

If anyone is interested, here is the code for 3 fans;


# Switch module for fan control - using Big Mosfet - for PLA printing - large cfm cooling blower @12V
switch.fan.enable                            true             #
switch.fan.input_on_command                  M106             #
switch.fan.input_off_command                 M107             #
switch.fan.output_pin                        2.5              #
switch.fan.output_type                       pwm              # pwm output settable with S parameter in the input_on_comand
switch.fan.max_pwm                           255               # set max pwm for the pin default is 255

# automatically toggle a switch at a specified temperature - HOTEND FAN @ 12v
temperatureswitch.hotend.enable              true             #
temperatureswitch.hotend.switch              hotend_fan       # select which MOSFET to use, must match a switch configuration (fan2 below)
temperatureswitch.hotend.designator          T                # first character of the temperature control designator to use as the temperature sensor to monitor
temperatureswitch.hotend.threshold_temp      80.0             # temperature to turn on (if rising) or off the switch
temperatureswitch.hotend.heatup_poll         10               # poll heatup at 15 sec intervals
temperatureswitch.hotend.cooldown_poll       60               # poll cooldown at 60 sec intervals

switch.hotend_fan.enable                     true             # enable
switch.hotend_fan.input_on_command           M42              # gcode to turn on
switch.hotend_fan.input_off_command          M43              # gcode to turn off
switch.hotend_fan.output_pin                 2.4              # pin that controls the fan - small mosfet
switch.hotend_fan.output_type                pwm              # pwm output settable with S parameter in the input_on_comand
switch.hotend_fan.max_pwm                    185              # set max pwm for the pin default is 255 

# automatically toggle a switch at a specified temperature - SYSTEM FAN @ 12v
temperatureswitch.system.enable              true             #
temperatureswitch.system.switch              system_fan       # select which MOSFET to use, must match a switch configuration (fan2 below)
temperatureswitch.system.designator          T                # first character of the temperature control designator to use as the temperature sensor to monitor
temperatureswitch.system.threshold_temp      88.0             # temperature to turn on (if rising) or off the switch
temperatureswitch.system.heatup_poll         15               # poll heatup at 15 sec intervals
temperatureswitch.system.cooldown_poll       60               # poll cooldown at 60 sec intervals

switch.system_fan.enable                     true             # enable
switch.system_fan.input_on_command           M421             # gcode to turn on
switch.system_fan.input_off_command          M431             # gcode to turn off
switch.system_fan.output_pin                 2.6              # pin that controls the fan - small mosfet
switch.system_fan.output_type                pwm              # pwm output settable with S parameter in the input_on_comand
switch.system_fan.max_pwm                    145              # set max pwm for the pin default is 255 (12v fan on 24v PSU)






Steve Graber

--
You received this message because you are subscribed to a topic in the Google Groups "Smoothieware Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/smoothieware-support/MOshKPLzbe4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to smoothieware-sup...@googlegroups.com.

Brad Hopper

unread,
Oct 13, 2014, 7:39:25 PM10/13/14
to smoothiewa...@googlegroups.com
Steve sounds like a nice mod. Just wanted to mention that I ran two 40mm fans in series for several months and then one fan with cut PWM now for a few more on Azteeg X5. In fairness one of the fans did die leading me to test fate and run the single. But that fan was about 10 years old and of uncertain part bin provenance where the other I picked up from Fry's for nothing.

I have some much nicer/larger silent fans and squirrel blowers I intend to install with the tall Kossel vertices now in place and will probably use your approach.

Reply all
Reply to author
Forward
0 new messages