Trying to configure heaters



  • I'm finally trying to set up my printer after converting from SmoothieBoard to Duet. The printer has bed and chamber heaters that are line powered and switched by SSRs, so I want them hooked up to E0 and E1 outputs, and there's a 50W extruder heater that I want to connect to the big bed heater screw terminals. And of course I want to swap the thermistors for the bed and extruder heaters, too.

    I used the configurator to generate the config files and found that there's no H0 (the hot-end heater?) set up in the config.g file, so it doesn't appear on the Panel Due or DWC. Any ideas?

    0_1528597049312_Duet configurator.jpg

    here's the config.g section:

    ; Heaters
    M140 H1 ; Remap heated bed to heater 1
    M301 H1 S1.00 P10 I0.1 D200 T0.4 W180 B30 ; Use PID on bed heater (may require further tuning)
    M141 H2 ; Assign chamber heater to heater 1
    M301 H2 P-1 ; Set heater 2 to bang-bang mode
    M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0
    M143 H0 S300 ; Set temperature limit for heater 0 to 300C
    M305 P1 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 1
    M143 H1 S130 ; Set temperature limit for heater 1 to 130C
    M305 P2 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 2
    M143 H2 S60 ; Set temperature limit for heater 2 to 60C

    The chamber heater doesn't show up on the Panel Due or DWC, either...



  • I believe you'll need to bind a heater to a tool with M563 to have it show up.

    Here's what I have for comparison

    ; ############################
    ; 6 - HEATERS
    ; ############################
    
    M301 H0 S1.00 P10 I0.1 D200 T0.4 W180 B30  ; Use PID on bed heater (Auto-tune settings are in config-override)
    M305 P0 T100000 B3950 C0 R4700  ; Set thermistor + ADC parameters for heater 0 (Bed)
    M143 H0 S135  ; Set temperature limit for heater 0 (Bed) to 135C
    M305 P1 X200  ; Remap P1 to PT100 channel 200 (Hotend)
    M143 H1 S305  ; Set temperature limit for heater 1 (Hotend) to 305C
    
    
    ; ############################
    ; 7 - TOOLS
    ; ############################
    
    M563 P0 S"Titan Aero" D0 H1   ; Define tool 0 (Titan Aero extruder)
    G10 P0 X0 Y0 Z0 . ; Set tool 0 axis offsets
    G10 P0 R0 S0 . ; Set initial tool 0 active and standby temperatures to 0C
    

    I don't have a chamber heater, but everything else should match up.


  • administrators

    @mrehorstdmd said in Trying to configure heaters:

    ; Heaters
    M140 H1 ; Remap heated bed to heater 1
    M301 H1 S1.00 P10 I0.1 D200 T0.4 W180 B30 ; Use PID on bed heater (may require further tuning)
    M141 H2 ; Assign chamber heater to heater 1
    M301 H2 P-1 ; Set heater 2 to bang-bang mode
    M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0
    M143 H0 S300 ; Set temperature limit for heater 0 to 300C
    M305 P1 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 1
    M143 H1 S130 ; Set temperature limit for heater 1 to 130C
    M305 P2 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 2
    M143 H2 S60 ; Set temperature limit for heater 2 to 60C
    The chamber heater doesn't show up on the Panel Due or DWC, either...

    Did configtool generate those M301 commands? They are wrong in several respects:

    • M301 commands are not normally used at all now. Instead, M307 commands are used to define a heater model, and PID parameters are computed from those.
    • M301 no longer supports the T, W and B parameters
    • P-1 in the M301 command no longer sets bang-bang mode, that is now done using the B parameter of M307.

    I suggest you try this:

    M140 H1 ; Remap heated bed to heater 1
    M141 H2 ; Assign chamber heater to heater 2
    M307 H2 B1 ; Set heater 2 to bang-bang mode
    M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0
    M143 H0 S300 ; Set temperature limit for heater 0 to 300C
    M305 P1 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 1
    M143 H1 S130 ; Set temperature limit for heater 1 to 130C
    M305 P2 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 2
    M143 H2 S60 ; Set temperature limit for heater 2 to 60C

    and then run auto-tuning on the bed and extruder heaters to determine the M307 heater model parameters. You will probably also need to adjust the heater model parameters in the M307 H2 command to avoid the firmware reporting chamber heater faults.

    The above assumes that you have each thermistor connected to the channel for its corresponding heater, e.g. the bed thermistor is connected to the E0 (heater 1) thermistor input and the extruder thermistor is connected to the bed thermistor input.

    The chamber heater should be displayed in DWC (I have just tested this), however PanelDue doesn't support chamber heaters yet.

    Your M563 tool creation command will need to specify that heater 0 is used (H0).

    HTH David



  • @dc42

    Yes, the configurator generated all of it.

    If I understand correctly, each heater should have autotuning run (including the bang-bang heater in order to get the A,C, and D parameters), and each should have a M307 statement, while the chamber heater, operating in bang-bang mode, will have a B1 parameter and the others will have B0 to operate in PID mode.

    Is the M563 supposed to be in the config.g file or is it used to configure the Panel Due? Is it supposed to be put there by the configurator? My config.g file seems suspiciously short - I'm coming from smoothieware with a hundreds of lines long config file.

    I'll grab the entire output from the configurator and post it in a few minutes- t's on a different computer...

    Thanks!



  • @mrehorstdmd

    Not 100% sure about tuning non pid heaters (no doubt David will be along soon) but M563 tool definitions definitely need to go into config.g.



  • There is one M563 at the bottom of the file, defining the extruder.

    Since I'm remapping heaters, don't I have to specify that the extruder heater is being mapped to the Bed heater output terminals?

    I'm finding it difficult to distinguish between the hardware and firmware in some of the documentation. The configurator refers to heaters/thermistors as Bed, E0, and E1. As far as I can tell, the firmware recognizes/defines heaters using the H parameter, with H0 normally mapped to the Bed Heater output terminals on the board, H1 is mapped to the E0 screw terminals, usually used for the first extruder heater, and H2 is mapped to the E1 screw terminals on the board, usually used for a second extruder or maybe a chamber heater. Each of those output terminals on the PCB has a corresponding temperature sensor input, but I have no idea how they are referenced in firmware.

    If I use M140 H1 to move the bed heater from H0 to H1, and M141 H2 assigns the chamber heater to H2 (comment in the config file is wrong?), doesn't there need to be a statement that maps the extruder heater to H0?
    Do the thermistors follow the heaters or do they also need to be explicitly remapped?

    Here's the whole config.g spit out by the configurator.

    ; Configuration file for Duet Ethernet (firmware version 1.20 or newer)
    ; executed by the firmware on start-up
    ;
    ; generated by RepRapFirmware Configuration Tool on Sat Jun 09 2018 22:35:35 GMT-0500 (Central Daylight Time)

    ; General preferences
    G90 ; Send absolute coordinates...
    M83 ; ...but relative extruder moves
    M555 P1 ; Set firmware compatibility to look like RepRapFirmare

    M667 S1 ; Select CoreXY mode

    ; Network
    M550 PUltra MegaMax Dominator ; Set machine name
    M551 PUMMD ; Set password
    M552 P192.168.1.3 S1 ; Enable network and set IP address
    M553 P255.255.255.0 ; Set netmask
    M554 P192.168.1.254 ; Set gateway
    M586 P0 S1 ; Enable HTTP
    M586 P1 S0 ; Disable FTP
    M586 P2 S0 ; Disable Telnet

    ; Drives
    M569 P0 S1 ; Drive 0 goes forwards
    M569 P1 S0 ; Drive 1 goes backwards
    M569 P2 S1 ; Drive 2 goes forwards
    M569 P3 S1 ; Drive 3 goes forwards
    M350 X16 Y16 Z16 E16 I1 ; Configure microstepping with interpolation
    M92 X160 Y160 Z800 E410 ; Set steps per mm
    M566 X900 Y900 Z12 E120 ; Set maximum instantaneous speed changes (mm/min)
    M203 X12000 Y12000 Z900 E1200 ; Set maximum speeds (mm/min)
    M201 X650 Y650 Z250 E250 ; Set accelerations (mm/s^2)
    M906 X1600 Y1600 Z1120 E960 I30 ; Set motor currents (mA) and motor idle factor in per cent
    M84 S30 ; Set idle timeout

    ; Axis Limits
    M208 X0 Y0 Z0 S1 ; Set axis minima
    M208 X302 Y305 Z680 S0 ; Set axis maxima

    ; Endstops
    M574 X2 Y2 Z1 S1 ; Set active high endstops

    ; Z-Probe
    M558 P0 H5 F900 T12000 ; Set Z probe type to switch and the dive height + speeds
    G31 P600 X0 Y0 Z0 ; Set Z probe trigger value, offset and trigger height
    M557 X15:287 Y15:290 S20 ; Define mesh grid

    ; Heaters
    M140 H1 ; Remap heated bed to heater 1
    M301 H1 S1.00 P10 I0.1 D200 T0.4 W180 B30 ; Use PID on bed heater (may require further tuning)
    M141 H2 ; Assign chamber heater to heater 1
    M301 H2 P-1 ; Set heater 2 to bang-bang mode
    M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0
    M143 H0 S300 ; Set temperature limit for heater 0 to 300C
    M305 P1 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 1
    M143 H1 S130 ; Set temperature limit for heater 1 to 130C
    M305 P2 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 2
    M143 H2 S60 ; Set temperature limit for heater 2 to 60C

    ; Fans
    M106 P0 S1 I0 F500 H0 T45 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned on
    M106 P1 S1 I0 F500 H-1 ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned off
    M106 P2 S1 I0 F500 H-1 ; Set fan 2 value, PWM signal inversion and frequency. Thermostatic control is turned off

    ; Tools
    M563 P0 D0 H0 ; 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

    ; Automatic power saving
    M911 S21 R23 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; Set voltage thresholds and actions to run on power loss

    ; Custom settings are not configured

    ; Miscellaneous
    T0 ; Select first tool



  • I'm trying to sort out the source of my confusion. I think some of the labeling in the configurator is adding to my problem.

    0_1528644327702_heaters.jpg

    On the lower left, "Heater" refers to the physical terminals on the PCB, not the heater in the config file, and "Type" refers to whatever is physically attached to those terminals. "Heated Bed" and "Chamber" are physically SSRs that switch power to those heaters. In the config file there is no heater referred to as "bed", or "E0", or "E1"- heaters are H0, H1, and H2. "Sensor Channel" refers to the thermistor inputs on the circuit board. So the "nozzle" temperature sensor will be plugged into the "bed thermistor" input which is physically next to the Bed Heater screw terminals, etc. I haven't figured how the thermistors/sensors are referred to in the config file yet.

    "Assign bed heater to first nozzle" means 'connect the extruder(nozzle) heater to the bed heater output terminals on the PCB'
    "Bed heater output: E0" means 'connect the bed heater/SSR to the E0 heater screw terminals on the PCB'
    "Chamber heater output: E1" means 'connect the chamber heater/SSR to the E1 screw terminals on the PCB'

    I ran into more confusion on setting up Z probing. I use a simple Z=0 switch and it wasn't clear whether I select "no Z probe" or "switch" and what the trigger heights and trigger value options are for. On my first attempt at configuring motion, I tried the "no Z probe" option, and the manual Z axis adjustment wouldn't work because the Z axis had not been homed. I thought that manually adjusting the Z axis was homing it. In my second attempt, I chose the switch option and left the default 2.5 mm offset on, thinking that was going to be an offset between the nozzle and the bed. When I tested it on the machine (still zeroed from when the smoothieboard was in it), it drove the nozzle into the PEI (glad I didn't have a glass bed!). Looking back at the little info bubbles I understand that those offsets define how deeply you want to gouge the PEI bed surface! I'm still not sure why there are two offsets and why a switch needs a threshold value. Maybe it would be better to default to zero offset when using the "switch" option, then dopes like me will be less likely to damage things.



  • @mrehorstdmd

    I can't say that I've used the configuration tool - (my Duet usage pre-dates it's existence) but as David said, it does look like it hasn't kept abreast of the firmware. There is nothing glaringly wrong with the config.g that you've posted other than some strange heater settings. What David suggested should get you up and running though.

    You'll get more and better information about setting up Z probes and the like from the wiki https://duet3d.dozuki.com/ and especially the gcode section https://duet3d.dozuki.com/Wiki/GCode. Setting the Z probe type and offsets (M558) are explained here https://duet3d.dozuki.com/Wiki/GCode#Section_M558_Set_Z_probe_type.

    You currently have M558 P0 which means that no probe is present. You need to use P4,or 5,6,7,8 depending on how you've wired it.



  • Yes, I found that info useful. Thanks.

    I also found that the firmware released a few days ago fixes the inability to manually zero the bed when the "no Z probe" option is used:
    "When Z probe type 0 is selected and DWC/PanelDue have prompted the user to jog Z, axis movement before homing is allowed"

    I've deleted the M301 statement and added M307s, run PID tuning on both the bed and extruder heaters and then saved the results to config-override file.

    Now I notice that since I swapped the heaters the Panel Due doesn't display the temperature of the extruder, only the bed heater, which means the only way to control the extruder temperature is through the gcode console. I guess i can add a couple macros to set the extruder temperature to specific values.



  • @mrehorstdmd

    As of firmware 1.21 by default, you can't move any axes until they have been homed. I'm still on an older version of firmware but personally I'd find that a right royal pain as I often want to simple move the bed down say 100mm without homing it first. All is not lost though as it can be over-ridden by putting M564 H0 somewhere in config.g. Being an experienced user yourself, you might want to do that. Just be aware that you could accidentally command an axis to move beyond it's physical limits. Once it's been homed and you've set the axis maxima, they won't go beyond their limits in any case.

    I can't help you the Panel Due - that's DC's dept.

    I hope you don't mind me suggesting the following but I know you aren't likely to use any form of bed level or flatness compensation. IMO, those sort of compensations are the main reason why you might want to use config_override.g. I'd suggest that you put everything into config.g and don't use config_override.g at all. If you do, I'll pretty much guarantee that one day it'll bite you in the ar*e. You'l be editing something in config.g and wondering why it's having no effect (because what you are editing is being overriden by config-override). Of course it's up to you but I'm just suggesting it because it's caught quite a few people out in the past.

    HTH



  • I'm no fan of over-ride type files either. Way back in my Arduino/RAMPS days I was bitten by the eeprom storage and thereafter used only the main config file for any changes. Once I have the heaters tuned up and working right I'll copy the stuff out of the over-ride file to the config.g and delete the over-ride file.

    I've been trying unsuccessfully to get the chamber heater modeled. The autotune keeps failing because the temperature doesn't rise isn't fast enough- the tuning runs for about 1 minute then shuts down reporting that the temperature isn't rising as fast as expected. I set A to 11 (the minimum allowed), C to 99000, and D to 70 (the max allowed) using M307 via the console, but still no joy. Maybe it doesn't matter if it's operating in bang-bang mode, but I would think the fire prevention stuff would have some timers that need to be satisfied in order to work properly. The chamber heater is a 500W unit which is probably underpowered for the volume of the enclosure, but it manages to get up to 45C in about 20 minutes or so, which is usually about how long it takes to print the first few layers of most prints that need the enclosure heater, so it's as fast as it needs to be.



  • @dc42 I gave up on trying to create a model of the chamber heater and just went with putting the M307 H2 B1 line in the config.g file, and deleted the config-override file. Now if I set the chamber temperature it still times out and shuts the chamber heater off.

    Is there any way to extend the time-out for that heater?

    I noticed that when I power up the machine, the when the thing is booting up the panel due shows the extruder and bed temperatures, but then the extruder temperature disappears from the screen. Is there a config tweak to fix that?

    panel due boot-up video



  • @mrehorstdmd Check out M570. If you extend the time parameter for fault detection for that heater, it ought to cure that particular problem.


  • administrators

    @mrehorstdmd said in Trying to configure heaters:

    @dc42 I gave up on trying to create a model of the chamber heater and just went with putting the M307 H2 B1 line in the config.g file, and deleted the config-override file. Now if I set the chamber temperature it still times out and shuts the chamber heater off.

    Is there any way to extend the time-out for that heater?

    I'm surprised that M307 H2 A11 C99000 D70 didn't allow you to auto tune. Does it take more than 70 seconds from turning the heater on to seeing the temperature start to rise?

    Still, auto tuning the chamber heater may take a long time if your chamber is well-insulated, so I suggest you set the M307 parameters for the chamber manually as described at https://duet3d.dozuki.com/Wiki/Tuning_the_heater_temperature_control#Section_Setting_the_model_parameters_manually instead of trying to run auto tuning. In particular, I expect the dead time for your chamber heater will be quite large, and so will the time constant. A higher time constant and lower gain than the defaults will reduce the expected rate of temperature rise. The dead time can be set as large as necessary, but the time constant must be at least twice the dead time. As you are using bang-bang control, you don't need accurate M307 parameters.

    I noticed that when I power up the machine, the when the thing is booting up the panel due shows the extruder and bed temperatures, but then the extruder temperature disappears from the screen. Is there a config tweak to fix that?

    I'm sorry, the PanelDue firmware currently has a very simplistic view of heaters. It assumes that heater 0 is the bed heater, heater 1 is the only heater for the first tool, heater 2 is the only heater for the second tool, and so on. It's on my work list to rewrite that part of the code to allow for the flexibility of RRF to do things differently; but there wasn't time to include that in the recent 1.21 PanelDue firmware release.



  • @dc42 said in Trying to configure heaters:

    that in the recent 1.21 Pane

    The autotune runs for about 70 seconds and then fails. D70 is the maximum I can set that parameter to without it complaining that the value is out of range. 11 is the minimum value that works for A.

    The heater is a 500W resistive bar with fins that came from a stratasys printer. It takes about 20 sec or so from power on until it starts feeling warm, and in my enclosure there's a fan blowing air over it so it doesn't get too hot. The enclosure is large, and temperature rises a little over 1C per minute.

    alt text

    Even with the heater simply set to bang-bang mode, it times out and shuts off.

    Thanks- I'll watch for an update of the Panel Due in a future release. In the meantime I can use macros to set temperatures for different filaments.


  • administrators

    @mrehorstdmd, where did you mount the thermistor?

    The reason that D70 was the highest value you could use in M307 is that the C parameter defaults to 140 on heaters that are default to being extruder heaters, and C must be at least twice D. You can use much higher D values if you provide a high enough C parameter in the same command. For example, I just sent "m307 h1 d1000 a20 c2000" and it was accepted.

    For a bed or chamber heater, auto tuning expects the temperature to rise by at least 3C after the dead time + 1 minute.

    However, auto tuning the enclosure heater is likely to take more than an hour, so I suggest you establish approximate parameters manually.



  • @dc42 I see. I'll take another run at it when I get home tonight. If I set the dead time to 500 or so, set C to 10000, and A to 11, it may work.

    I did have the chamber up to 45C with the Duet board - I think it was when it had the M301 statements in the config.g file, though I don't know why that would matter. That was before I swapped the bed and extruder heaters. I haven't been able to get it up to that temperature since.

    I may just swap the heaters back to the original locations- the main reason for the swap is that I use an SSR for the bed heater, and I have some excessively heavy wires running to the hot-end heater that don't fit in the small screw terminals. If I swap them back, everything on the Panel Due will go back to normal, too.



  • @deckingman I'll try the M570 command, too. Thanks!



  • OK, everything is working. I swapped the hot-end and bed heater connections back to the default positions, used A11, C99000, D2000 to get the PID tuning to run on the chamber heater.

    At first the Panel Due wouldn't control the hot-end temperature, but I found a reference to the T0 statement for the config file, added it, and now it's all behaving as expected.

    Thanks for the help and suggestions!


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.