Remap heater channel / pin.
I am switching my printer from marlin / RAMPs to a shiny new Duetwifi. Love it so far!
For my RAMPs setup, I built a mosfet circuit to drive the 12v 300mmx300mm heater pcb I have. To drive it I used a spare PWM channel / pin on the RAMPs. The heater PCB draws over 20amps, so using the onboard mosfet of the duetwifi is not possible without grabbing the marshmallows, chocolate and gram crackers for the resulting meltdown and fire.
I can not find any documentation that states remapping the bed heater pin / channel is possible. Is it? If so, what is the gcode for doing so?
I found the gcode for remapping steppers and sensors, but nothing on heaters.
I have a question on GPIO pins in general, will ask in another thread. Thanks all for a great product and looking through the forums, great support.
You can remap the bed heater to another channel using the H parameter of the M140 command. See http://reprap.org/wiki/G-code#M140:Set_Bed_Temperature.28Fast.29. The heater outputs on the expansion bus have 3.3V signal levels and are active low, so you will need to invert the signal level and amplify it to at least 5V to drive your mosfet(s). Or you can connect the input of your inverter/driver to the bed heater output instead, as long as you design it to be tolerant of a 12V input.
Two alternatives you may wish to consider:
- Use a DC-DC SSR to drive the bed heater. See https://duet3d.com/wiki/Connecting_a_bed_heater#Bed_heater_driven_using_a_Solid_State_Relay for recommendations.
- If your bed heater is dual 12/24V then you could either convert the whole printer to 24V, or use a 24V PSU to power just the bed heater.
Thank you dc42, I appreciate the response. I may end up going the SSR route eventually, but I like to tinker and learn so going to go the inverter route first. Please pardon my ignorance and accept my gratitude in helping out.
My plan is use a 2n3906 PNP transistor to do the inverting. I have them lying around. The circuit would be H0 GND to R1 to the base of the transistor. R2 connected from +12v to the base for a pullup. +12v to the emitter and finally collector to the gate of the mosfet.
My question is about the low side switching on the H0 GND. Is the H0 mosfet going to be harmed having a voltage applied to it when it's not switched on and thus not connected to ground?
Here's a text schematic of my inverter circuit.
R1 = 1k
R2 = 10k
| / E
H0 GND–-R1---------| 2n3906 PNP BJT
IRF 3708 N-Mosfet Gate
That won't work because the H0 pin only goes from 0 to +3.3V, so the 2N3906 will be turned on all the time. Use an N-channel mosfet or NPN transistor to invert the signal and increase the signal level.
Sorry, by H0 I meant the output from the bed heater mosfet. H0 GND in my schematic above would be the GND from the bed heater screw terminal. If I could get access to the pin that drives the mosfet for the bed heater, I would prefer that as like you said, I could just amplify the voltage to drive the external mosfet.
That scheme should work. You will need to add a pulldown resistor between the collector of the transistor and ground. 1k should be about right.
Awesome, thanks for the help.
thehair last edited by
I'm interested in remapping my bed output as well so that I can utilize the bed output for a large fan. I'm pretty new to the Duet and just had a couple clarification questions.
I have an AC bed running off an SSR. Since the expansion pins are active low, then can i just wire the SSR(-) to the heater pin in the expansion header, and the SSR(+) to the 3.3v in the expansion header? And then remap the bed output to a different channel using the M140 command. Is that all i need to do for the bed? or do i also need to remap the bed thermistor to match the new heater channel?
Yes that should work. If the fan has a brushed motor, connect a flyback diode in parallel with it.
By default, each heater is controlled by the thermistor associated with that channel. You can change that using the X parameter in the M305 command for that heater.