Pwm 5v pin duet wifi 2 gcode
-
@Phaedrux so, any ideas?
-
@clearlynotstef you are correct, all I/O pins on Duet are 3.3V. You need a level shifter. They are built in on the DueX and EBOB Duet 2 expansion boards.
Ian
-
@clearlynotstef @droftarts
Wouldn't it be possible to use a voltage divider? (two resistors in series, like 47k + 10k)
The resistors would be between 24V and GND permanently and the negative fan-output would short the lower resistor to ground. -
When the negative fan connection stops shorting the bottom of the lower resistor to ground, the connection between the two resistors will be pulled up to 24 Volts.
Are you sure this fan will even work with a PWM signal?
From the data sheet it looks like it takes an analog voltage between 0 and 5 volts to set the fan speed. Sometimes you can drive those with PWM signals and they can sort of work, but usually not well.
You can look around on this site and find links to threads where someone built a PWM-to-Analog-out fan adapter and that would probably work for you.
-
@alankilian said in Pwm 5v pin duet wifi 2 gcode:
When the negative fan connection stops shorting the bottom of the lower resistor to ground, the connection between the two resistors will be pulled up to 24 Volts.
The bottom of the lower resistor is fixed to GND and the negative fan pin is connected between the resistors. That way, the input of the CPAP fan sees a small division of 24V according to the resistor values or it is pulled to GND when the fanport shorts the lower resistor.
-
@o_lampe Would something like this help?
https://smile.amazon.co.uk/gp/product/B0789738RC/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
I appreciate it's a PWM to DC converter, but might help with your situation.
-
@droftarts related question then...Would a new Duet 3 board be able to drive this 5v pwm directly? I've been looking for a hardware reason to upgrade anyway!
-
@clearlynotstef Yes. All Duet 3 mainboards (6HC, 6XD and Mini 5+) have one output with 5V PWM signal level for hobby servos, laser or VFD. It's usually shared with one of the OUT ports, eg on Mini 5+ OUT_6 is shared with LASER/VFD pins: https://docs.duet3d.com/Duet3D_hardware/Duet_3_family/Duet_3_Mini_5+_Hardware_Overview#io-port-pin-capabilities
You should be able to use this for the 5V fan controller.Ian
-
@droftarts @Phaedrux
2 related questions:-
Forgetting pwm, would it be possible to get a 5v binary on/off pin that could be controlled by firmware as a fan on the duet wifi 2? The cpap board has a speed knob I could use to set the power, I can put it somewhere appropriate and just use the board to turn it on and off;
-
Alternatively, if I can't get a 5v pin with or without pwm, I'll see what happens if I just give it a 3.3v pwm signal. Presumably it'll just run between 0-60% or so? Is there a preferred pin to use for this with pwm? What's the gcode look like to create a pwm pin and assign it to be the part cooling fan?
Thanks
-
-
@clearlynotstef Yes, the fan pins on the Duet can be supplied by either VIN or 5V. There's a jumper to select this. But ALL fan pins will run at 5V then. If you just want a binary on/off, just set the fan pin you use to S0 (off) or S255 (on).
Thinking about it, if you already have other 12V fans, you could take 5V (from any 5V pin), connect it to the +ve side of the fan controller, then take a wire from the -ve side of the fan controller and connect it to the GND side of an available fan header (the fan MOSFETs switch on the ground side). That would allow you to have the rest of the fans at 12V.
Ian
-
@clearlynotstef said in Pwm 5v pin duet wifi 2 gcode:
Alternatively, if I can't get a 5v pin with or without pwm, I'll see what happens if I just give it a 3.3v pwm signal. Presumably it'll just run between 0-60% or so? Is there a preferred pin to use for this with pwm? What's the gcode look like to create a pwm pin and assign it to be the part cooling fan?
PWM means Pulse Width Modulation. It is not controlling the actual voltage output, just how long the pin is on for. 50% PWM means that the pin is on, at 3.3V, for half the time. By 'time', I mean the frequency set by the M950 Q parameter. So no, it won't be on at 60%. It's just whether 3.3V is a sufficient voltage to trigger the fan controller to turn on.
Ian