Solved additional fan driven by thermistor (not heater)
-
Hi,
converting for the workplace the old anycubic i3 mega to a duet-ethernet...It sits in a wooden box (chamber), and I would like to drive a fan at the topplate of that wooden box via a thermistor connected to the (currently) unused e1 heat-sensor pin...
The thermistor is working fine, but can anybody give me a hint how to do that trick to have the fan "mapped" to the "thermistor" without creating a chamber-heater (no current plan to have one since the heatplate is getting hot enough to heat the wooden box/chamber)?
Would like to pin it with thermostatic control from 39 to 60 degrees C.
The current section in config.g:
; Heaters/Temp-sensors ; M950 command must have exactly one of the H, F, J, P or S parameters ; use correct pin-names: https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names ; heated bed M308 S0 P"bedtemp" Y"thermistor" T100000 B4725 C7.060000e-8 A"heat plate" ; configure sensor Sx as type"thermistor"/"..." on pin P"...", e.g. typ. types vor 100K are B4725, B4138, B3950, see https://duet3d.dozuki.com/Wiki/Connecting_thermistors_or_PT1000_temperature_sensors#Section_Thermistor_parameters M950 H0 C"bedheat" T0 Q500 ; create H=heater (number) output on x and map it to sensor C"x"; T Temperature sens num, required only when creating a heater; see M308 M140 H0 ; map heated bed to heater 0, in RRF3 M140 with H (other than H-1) must come after M950 command that creates that heater, and before any M143 command M307 H0 B1 ;S1.00 ; for Hx, B 1=bang-bang/0=PID mode, set PWM limit S0.0-1.0 M143 H0 S125 ; set temperature limit for heater Hx to S___(°C) ; extruder M308 S1 P"e0temp" Y"thermistor" T100000 B4725 C7.060000e-8 A"extruder" ; configure sensor Sx as type"thermistor"/"..." on pin P"...", e.g. typ. types vor 100K are B4725, B4138, B3950, see https://duet3d.dozuki.com/Wiki/Connecting_thermistors_or_PT1000_temperature_sensors#Section_Thermistor_parameters M950 H1 C"e0heat" T1 ;Qx ; create H=heater (number) output on x and map it to sensor C"x"; T Temperature sens num, required only when creating a heater; see M308 M307 H1 B0 S1.00 ; for Hx, B 1=bang-bang/0=PID mode, set PWM limit S0.0-1.0 M143 H1 S295 ; set temperature limit for heater Hx to S___(°C) ; chamber heater optional connected then to this sensor... M308 S3 P"e1temp" Y"thermistor" T100000 B4725 C7.060000e-8 A"Chamber" ; configure sensor Sx as type"thermistor"/"..." on pin P"...", e.g. typ. types vor 100K are B4725, B4138, B3950, see https://duet3d.dozuki.com/Wiki/Connecting_thermistors_or_PT1000_temperature_sensors#Section_Thermistor_parameters ;M950 H3 C"e1heat" T3 ;Qx ; create H=heater (number) output on x and map it to sensor C"x"; T Temperature sens num, required only when creating a heater; see M308 :M141 H3 ; historically up to H2 all is used for heatplate and extruders, so use H3 ;M143 H1 S65 ; set temperature limit for heater Hx to S___(°C) ; heater fault def ;M570 H0 P20 T20 S5 ; def heater-fault: for Hx, time in sec Px, Temp exc in Tx, optional S Integer timeout in min (can be set 0) for print to be cancelled M570 H1 P5 T15 S3 ; def heater-fault: for Hx, time in sec Px, Temp exc in Tx, optional S Integer timeout in min (can be set 0) for print to be cancelled ;M570 H2 P5 T15 S3 ; def heater-fault: for Hx, time in sec Px, Temp exc in Tx, optional S Integer timeout in min (can be set 0) for print to be cancelled ;M570 H3 P5 T15 S3 ; def heater-fault: for Hx, time in sec Px, Temp exc in Tx, optional S Integer timeout in min (can be set 0) for print to be cancelled ; Fans ; M950 command must have exactly one of the H, F, J, P or S parameters ; https://duet3d.dozuki.com/Wiki/Gcode#Section_M106_Fan_On ; use correct pin-names: https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names ;print/part cool fan M950 F0 C"fan0" Q500 ; create F=fan(x) with "!" to invert, on pin C; opt set frequency(Q) e.g. for most real 4-wire pwm-fans 25000 (max 65535), ordinary 2-wire must be kept low around 100-500 M106 C"print cool fan" P0 B0.5 H-1 S0 ; P=num; s=set speed 0-255/0.0-1.0; limit L min & X max; H=heater monitored+Thermostatic control, -1=off or Hx(:__...) monitored; B=blip time in ms; if not thermostatic (H-1) define a board-boot-start-up speed S=fan speed; ;extr heat sink fan M950 F1 C"fan1" Q500 ; create F=fan(x) with "!" to invert, on pin C; opt set frequency(Q) e.g. for most real 4-wire pwm-fans 25000 (max 65535), ordinary 2-wire must be kept low around 100-500 M106 C"part cool fan" P1 B0.5 H1 T40:150 ; P=num; s=set speed 0-255/0.0-1.0; limit L min & X max; H=heater monitored+Thermostatic control, -1=off or Hx(:__...) monitored; B=blip time in ms; if not thermostatic (H-1) define a board-boot-start-up speed S=fan speed; ;housing fan M950 F2 C"fan2" Q500 T3 ;! ;Q25000 ; create F=fan(x) with "!" to invert, on pin C; opt set frequency(Q) e.g. for most real 4-wire pwm-fans 25000 (max 65535), ordinary 2-wire must be kept low around 100-500 M106 C"chamber fan" P2 B0.5 T40:90; H1 ; P=num; s=set speed 0-255/0.0-1.0; limit L min & X max; H=heater monitored+Thermostatic control, -1=off or Hx(:__...) monitored; B=blip time in ms; if not thermostatic (H-1) define a board-boot-start-up speed S=fan speed;
-
This should be possible with M106 P2 S1 H3 T39:60
M106 H3 should refer to your M308 S3 for the chamber sensor and P2 refers to the Fan2.
At least that's how I'm reading the behaviour of M106 H in RRF3.
-
Yep - you were right, even without having an active heater h3 creating the sensor (M308 S3 P"e1temp" Y"thermistor" ...) was enough for "M950 F2 C"fan2" Q500 T3" & "M106 C"chamber fan" P2 B0.5 T40:90 H3" to work BUT why I originally thought it did not work is the oukward pwm-behaviour of the 3-pin fan. It needs a minimum amount "L"--paramter of voltage and is quite picky on the frequency ("Q" in M950).
So finally that you insisted on the behaviour brought me to playing around and to finally find the "real" thing/problem...
Thanks - solved
(For everybody interested in the non-finished-file/WIP for an anycubic i3 mega with BMG drive:
; Configuration file for Duet WiFi/Ethernet (firmware version 3) ; executed by the firmware on start-up ; what is this M451 ; Switches to Fused Filament Fabrication mode for filament printing. ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"inno-0" ; set printer name ; Network ;M551 P"inno-0" ; set password ;M540 P___ ; generate MAC-Adress - when wifi or ethernet module this is fix by system M552 P0.0.0.0 S1 ; enable network and acquire dynamic address via DHCP M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P0 S1 ; x ; physical drive Px goes S1=forwards, S0=backwards M569 P1 S1 ; y ; physical drive Px goes S1=forwards, S0=backwards M569 P2 S1 ; z-l ; physical drive Px goes S1=forwards, S0=backwards M569 P3 S0 ; e0 ; physical drive Px goes S1=forwards, S0=backwards M569 P4 S1 ; z-r ; physical drive Px goes S1=forwards, S0=backwards M584 X0 Y1 Z2:4 U4 E3 P3 ; set drive mapping, create two Z axis, name it in order UVWABC, make Px-Axis visible in GUI M350 X16 Y16 Z16 U16 E16 I1 ; config microstepping, I1=with interpolation/I0=without M92 X80.00 Y80.00 Z400.00 U400.00 E420.00 ; set steps per mm, take care for extruder E in this case a BMG with 420 M566 X900.00 Y900.00 Z12.00 U12.0 E120.00 ; set maximum instantaneous speed changes (mm/min) M203 X30000.00 Y30000.00 Z360.00 U360.0 E1000.00 ; set maximum speeds (mm/min) M201 X8000.00 Y8000.00 Z50.00 U50.0 E150.00 ; set accelerations (mm/s^2) M906 X1000 Y1000 Z1000 U1000 E1000 I50 ; set motor currents (mA) and I = motor idle factor in per cent M84 S5 ; Set idle timeout ; Axis Limits M208 X0:210 Y0:210 Z0:200 U0:200 ; set axis minima and maxima ; Endstops M574 X1 S1 P"!xstop" ; see https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names M574 Y1 S1 P"!ystop" ; see https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names M574 Z1 S1 P"!zstop" ; see https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names M574 U1 S1 P"!e1stop" ; see https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names ; Z-Probe M558 P0 H5 F120 T6000 ; disable Z probe but set dive height, probe speed and travel speed M557 X15:195 Y15:195 S20 ; define mesh grid ; Heaters/Temp-sensors ; M950 command must have exactly one of the H, F, J, P or S parameters ; use correct pin-names: https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names ; heated bed M308 S0 P"bedtemp" Y"thermistor" T100000 B4725 C7.060000e-8 A"heat plate" ; configure sensor Sx as type"thermistor"/"..." on pin P"...", e.g. typ. types vor 100K are B4725, B4138, B3950, see https://duet3d.dozuki.com/Wiki/Connecting_thermistors_or_PT1000_temperature_sensors#Section_Thermistor_parameters M950 H0 C"bedheat" T0 ;Q500 ; create H=heater (number) output on x and map it to sensor C"x"; T Temperature sens num, required only when creating a heater; see M308 M140 H0 ; map heated bed to heater 0, in RRF3 M140 with H (other than H-1) must come after M950 command that creates that heater, and before any M143 command M307 H0 B1 ;S0.x ; for Hx, B 1=bang-bang/0=PID mode, set PWM limit S0.0-1.0 M143 H0 S125 ; set temperature limit for heater Hx to S___(°C) ; extruder M308 S1 P"e0temp" Y"thermistor" T100000 B4725 C7.060000e-8 A"extruder" ; configure sensor Sx as type"thermistor"/"..." on pin P"...", e.g. typ. types vor 100K are B4725, B4138, B3950, see https://duet3d.dozuki.com/Wiki/Connecting_thermistors_or_PT1000_temperature_sensors#Section_Thermistor_parameters M950 H1 C"e0heat" T1 ;Qx ; create H=heater (number) output on x and map it to sensor C"x"; T Temperature sens num, required only when creating a heater; see M308 M307 H1 B0 ;S0.x ; for Hx, B 1=bang-bang/0=PID mode, set PWM limit S0.0-1.0 M143 H1 S295 ; set temperature limit for heater Hx to S___(°C) ; chamber heater optional connected then to this sensor... M308 S3 P"e1temp" Y"thermistor" T100000 B4725 C7.060000e-8 A"Chamber" ; configure sensor Sx as type"thermistor"/"..." on pin P"...", e.g. typ. types vor 100K are B4725, B4138, B3950, see https://duet3d.dozuki.com/Wiki/Connecting_thermistors_or_PT1000_temperature_sensors#Section_Thermistor_parameters ;M950 H3 C"e1heat" T3 ;Qx ; create H=heater (number) output on x and map it to sensor C"x"; T Temperature sens num, required only when creating a heater; see M308 :M141 H3 ; historically up to H2 all is used for heatplate and extruders, so use H3 ;M143 H1 S65 ; set temperature limit for heater Hx to S___(°C) ; heater fault def M570 H0 P20 T20 S5 ; def heater-fault: for Hx, time in sec Px, Temp exc in Tx, optional S Integer timeout in min (can be set 0) for print to be cancelled M570 H1 P5 T15 S3 ; def heater-fault: for Hx, time in sec Px, Temp exc in Tx, optional S Integer timeout in min (can be set 0) for print to be cancelled ;M570 H2 P5 T15 S3 ; def heater-fault: for Hx, time in sec Px, Temp exc in Tx, optional S Integer timeout in min (can be set 0) for print to be cancelled ;M570 H3 P5 T15 S3 ; def heater-fault: for Hx, time in sec Px, Temp exc in Tx, optional S Integer timeout in min (can be set 0) for print to be cancelled ; Fans ; M950 command must have exactly one of the H, F, J, P or S parameters ; https://duet3d.dozuki.com/Wiki/Gcode#Section_M106_Fan_On ; https://duet3d.dozuki.com/Wiki/Connecting_and_configuring_fans#Section_Thermostatically_controlled_fans ; use correct pin-names: https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names ;print/part cool fan M950 F0 C"fan0" ;Q200 ; create F=fan(x) with "!" to invert, on pin C; opt set frequency(Q) e.g. for most real 4-wire pwm-fans 25000 (max 65535), ordinary 2-wire must be kept low around 100-500, default seems to be 250 M106 C"print cool fan" P0 B0.5 H-1 S0 ; P=num; s=set speed 0-255/0.0-1.0; limit L min & X max; H=heater monitored+Thermostatic control, -1=off or Hx(:__...) monitored; B=blip time in ms; if not thermostatic (H-1) define a board-boot-start-up speed S=fan speed; ;extr heat sink fan M950 F1 C"fan1" ;Q200 ; create F=fan(x) with "!" to invert, on pin C; opt set frequency(Q) e.g. for most real 4-wire pwm-fans 25000 (max 65535), ordinary 2-wire must be kept low around 100-500, default seems to be 250 M106 C"extr heat sink fan" P1 B0.5 H1 L0.5 T39:160 ; P=num; s=set speed 0-255/0.0-1.0; limit L min & X max; H=heater monitored+Thermostatic control, -1=off or Hx(:__...) monitored; B=blip time in ms; if not thermostatic (H-1) define a board-boot-start-up speed S=fan speed; ;housing fan M950 F2 C"fan2" T3 ;Q500 ;! ;Q25000 ; create F=fan(x) with "!" to invert, on pin C; opt set frequency(Q) e.g. for most real 4-wire pwm-fans 25000 (max 65535), ordinary 2-wire must be kept low around 100-500, default seems to be 250 M106 C"chamber fan" P2 B0.5 L0.7 T39:60 H3 ; P=num; s=set speed 0-255/0.0-1.0; limit L min & X max; H=heater monitored+Thermostatic control, -1=off or Hx(:__...) monitored; B=blip time in ms; if not thermostatic (H-1) define a board-boot-start-up speed S=fan speed; ; Tools M563 P0 D0 H1 F0 ; define tool 0 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; Extruder M200 D1.75 ;set all extruder filament diameters to 1.75mm - if volumetric-slicer is used ;M592 D0 A0.01 B0.0005 ; non-linear extrusion parameters for extruder drive Dx ; PanelDue M575 P1 S1 B57600 ; enable support for PanelDue ; Powerloss behaviour M911 S10 R11 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set S=voltage thresholds and actions for power loss, make sure to have files needed for this created (sys/resurrect.g, sys/resurrect-prologue.g) ; Everything else M501 ; load any viy M500 stored parameters from non-volatile memory from config-override.g - simply uncomment if not wanted ; make machine ready for start T0 ; select first tool M118 P0 S"reached end of config.g" ; message P 0= Generic [default], 1= USB, 2= PanelDue/UART, 3= HTTP, 4= Telnet, 5= second UART (optional)
)
-
@LB Consider submitting your config set to the Github repository?
-
@Phaedrux
When it works, will take some weeks... -
Do you know more about how now to use M143 vs M570 (now that I have the chamber watched by the sensor...):
E.g. If I want the printer to be shut down if the chamber reaches over 60°C, it seems I cannot use M143 or M570 because they all want a heater - not a simple thermistor, but in my case the heat-plate and hot-end are the chamber-heaters?
-> Am I back at the point to make this work via a workaround "pseudo"-heater (which in fact isn´t present) just to "fool" the config.g, to watch that "pseudo"-heater (where the temp-sensor is attached finally)?
In fact the insulation of the chamber is so good that It would be great to have a chamber-fan as an "inverted"-heater, so actually above a certain temperature the fan cools the chamber...
Maybe this is part of the broader "Fine grained heater control"-discussion?
Any hints somebody?
-
Well M143 is meant to control a heater, since the only way a temperature sensor can measure a maximum heat is if a heater generates heat. In the M143 command you can specify a heater to control and a temp sensor to monitor independently. So I'm not sure why you think it's not appropriate to use. The temp sensor would be the sensor you want to watch, and the heater would be whatever is responsible for generating the heat.
https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M143_Maximum_heater_temperature
M570 is almost unrelated since it controls what happens during a heater fault
https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M570_Configure_heater_fault_detection
-
@Phaedrux
Thanks for reminding me about thatBut since I just use the heat-plate to heat up the chamber (as by-product which is totally sufficient if you have good insulation around your printer) how can I attach a fan as an inverted chamber-heater (a.k.a. a cooler so to say) that is hooked up to a chamber-temp-sensor without creating a real heater?
Or am I just thinking to complicated:
I just create an inverted heater (e.g. E1 is free on my board) and put the fan directly there to E1 e.g. and do NOT create an additional fan later but only a sensor (temp-sensor) attached to that (inverted)-heater?
-
You can control a fan based on a temp sensor, no heater need be directly involved.
It would be similar to the hotend fan that is thermostatically controlled when a temp sensor is over a set temp. Or ramps up between a temp range.
-
yep - thanks for posting
Thats what I will stay with right now, because since every "heater" (even if inverted) has to be calibrated in RRF3.x I tried to put a fan to the e1-heater with inversion, but couldn´t calibrate of course and it immediatly threw a heater-fault-> have put material-specific fan speed for fan3 (or fan2 if you count with 0) that is controlled by an additional temp-sensor in the filament-config.g then to have it somewhere (of course each material has its specific temps for the chamber...)
-
@LB said in additional fan driven by thermistor (not heater):
I tried to put a fan to the e1-heater with inversion, but couldn´t calibrate of course and it immediatly threw a heater-fault
I'm not sure I understand what you mean here.
-
was another way to try out to make a heater to a cooler (by inverting it)
- normal: below make on, above make off
- inversion: below have off, above make on
but couldn´t calibrate it... but the fan did what it should...
it all works now via the additional fan defined e.g. for PETG in the filament-config:
M106 P2 B1.0 L0.9 X1.0 T30:32
-
Oh I see what you mean. You literally connected a fan to the heater pins and defined it as a heater. That's clever, but problematic.
@LB said in additional fan driven by thermistor (not heater):
M106 P2 B1.0 L0.9 X1.0 T30:32
You've set the temp range, but what sensor is it tracking? You don't have an H value.
https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M106_Fan_On
-
...yep... didn´t think about that one in the beginning...
but now it works with the little setup in the main/general/system config.g
; chamber heater optional connected then to this sensor... M308 S3 P"e1temp" Y"thermistor" T100000 B4725 C7.060000e-8 A"Chamber" ; configure sensor Sx as type"thermistor"/"..." on pin P"...", e.g. typ. types vor 100K are B4725, B4138, B3950, see https://duet3d.dozuki.com/Wiki/Connecting_thermistors_or_PT1000_temperature_sensors#Section_Thermistor_parameters ;M950 H3 C"e1heat" T3 ;Qx ; F3 ; create H=heater (number) output on x and map it to sensor C"x"; T Temperature sens num, required only when creating a heater; see M308 ;M141 H3 ; exclusive for chamber: map to heater Hx, in RRF3 must come after M950 command that creates heater, and before any M143 command ;M307 H3 I2 ;S0.x Fxxx ;B1 ; for Hx, B 1=bang-bang/0=PID mode, set PWM limit S0.0-1.0, for I inversion see documentation
&
;chamber fan M950 F2 C"fan2" T3 ;Q500 ;! ;Q25000 ; create F=fan(x) with "!" to invert, on pin C; opt set frequency(Q) e.g. for most real 4-wire pwm-fans 25000 (max 65535), ordinary 2-wire must be kept low around 100-500, default seems to be 250 ; set some default vals to start but override it in the print-file with the specific filament-config.g: M106 P2 C"chamber fan" B1.0 L0.9 X1.0 T40:41 H3 ; P=num; s=set speed 0-255/0.0-1.0; limit L min & X max; H=heater monitored+Thermostatic control, -1=off or Hx(:__...) monitored; B=blip time in ms; if not thermostatic (H-1) define a board-boot-start-up speed S=fan speed;
M308 with M950 seem to be sufficient to do the job
(...sorry for all the comments but for setup I like it more that way, later might delete a lot of them again...)
-
Finally: Thanks for helping me get going with the new RRF3
Consider this "solved" (though it worked a little bit diffrent from what I thought in the beginning it would work - it does the job
)
-
(First should I start a new thread at this point?)
So now that I got the nice "ASAIR AM2302"-DHT22 running (https://forum.duet3d.com/topic/14146/duet3d-dht-22/17?_=1605704384964) - thanks everybody - I was wondering if it is as simple, to swap for the fan what it monitors to the dht...:
If my "old" thermistor was within M308 S3, and the DHT-Temp is within M308 is S10, for the fan (after it was initialized with M950) I just re-wire it within the Fan´s M106 from H3 to H10?
Edit: Just swapped to H10 and all works nice
-> What brings me to the more interesting question if a print could be paused until the chamber-humidity (due to heating of print-plate and hotend) is below a certain value? (I see now that the humidity dropped slowly, when printing today, from an 35% (environment/room) down to 21,5% in the chamber with 33-35°C heated up (room 23°C) for PETG
Since it is only an additional Sensor with a value, with conditional g-code that should be do-able? First of course I need to see what is a level I can reach for sure even on days with lots of humidity. Will see about a while or loop with humidity-is-value > chamber-humidity-should-value - pause here/do nothing with the break triggered either by time 20-30min or so or by reaching the value...
let´s see -
@LB said in additional fan driven by thermistor (not heater):
(First should I start a new thread at this point?)
Probably best to create a new thread in the gcode meta commands forum for setting up a conditional loop.