Using Additional PWM outputs on Duet WiFi
-
HI,
I'm adding a Duet to an existing machine, and all the std connections are fine.
Im running on 24v, but the machine also has some RGB LED leds running from the 12v PSU. I Don't want to uninstall these. In fact I want to use them to signify differing phase of the printer cycle. White for load / unload, orange, for heating, red for error, etc etc etc.
My plan id to use 3 small mosfet pcbs to drive each of R, G, and B from 3 PWM outputs on the Duet.
I assume I can use any of these listed pins as PWM outputs ?
So M42 P61 S128 gives me 50% duty cycle PWM on pin 9 of the header ?
and M42 P61 S0 turns it off ?
P Signal Name Expansion Connector Label Expansion Pin
60 CS5 CS5 50
61 CS6 E3_STOP 9
62 CS7 E4_STOP 14
63 CS8 E5_STOP 19Thanks for any help
Keith -
The pins you list are not PWM-capable. Use the Heater3 to Heater7 (aka E2_Heater to E6_Heater) pins to drive your mosfets instead. Note, these pins are active low by default.
-
Thanks for the prompt response David.
I can't find the 'internal' pin number for those. I can see the heaters on the header drawing ( 8,13,18,23,31)
Unless its an M42 E2/3/4/5/6 S0 - 255 command ?
Keith
-
See https://duet3d.dozuki.com/Wiki/Using_servos_and_controlling_unused_IO_pins for the M42 pin numbers.
-
Excellent. Thanks!!
If I needed additional logical switches I assume I can use the original ones I listed with no additional preamble ?
.............and as per your suggestion, and to make sure I get this right,
I need to use :
M307 H3 A-1 C-1 D-1 Frees up the E2 pin on header ( pin 8 )
Then I can use :
M42 P3 S128 to give me 50% duty cycle PWM on pin 8
and M42 P3 S0 to turn it off.
( it's going to be an allnighter I think )
Keith
-
Correct, except that if you drive the MOSFETs directly from the heater signals on the expansion connector, you will need to add the i1 parameter to the M42 commands to invert the output.
-
Thanks David ....All working correctly now!
-
@tkward I'd like to know more about how your led upgrade went? Any pictures?
-
I don’t have access to that printer now. But I did the same thing on my newly designed printer. It works well.
I’ll find a link to a facebook video I did.
https://share.icloud.com/photos/0r_c5pXsyEkLXms1RtpnTJ0Lg#East_Petersburg
https://share.icloud.com/photos/0fsVizVvVhX7C6ozDleqotlGQ#East_Petersburg