Heater Control
-
Starting a thread for general discussion on the new heater control functionality.
One thing I've been noticing for a while (before this update) is jump discontinuities on the preheat and cooldown curves reported in the web interface. It looks like the jumps happen on a fairly regular interval, but it's hard to tell exactly without a time scale. The faster the temp is changing, the bigger the jump. Both the extruder and bed seem to jump at the same time. I'm wondering if the web interface has pauses or gaps in its temp data that are getting skipped in the plot rather than interpolated with a line across the gap. That's not really a big deal, doesn't keep me from printing, but I DO want to make sure the jumpiness isn't messing up the model tuning.
When I run the tuning, it doesn't clear out the previous temp setpoint. Doesn't seem to hurt anything right now, but it could perhaps produce undesirable behavior?
I ran it twice to check the variation. Seems reasonably consistent. 40w heater, fairly small hot block with some insulation.
M307 H1
Heater 1 model: gain 421.6, time constant 127.7, dead time 8.6, max PWM 1.00, in use: yes, mode: PID
Setpoint change: P6.3, I0.05, D37.8
Load change: P6.3, I0.37, D37.8M307 H1
Heater 1 model: gain 417.1, time constant 126.7, dead time 8.2, max PWM 1.00, in use: yes, mode: PID
Setpoint change: P6.6, I0.05, D38.0
Load change: P6.6, I0.41, D38.0 -
Trying to tune a heater that doesn't exist provides a non-helpful error message:
M303 H2 P0.3 S90
Error: heater 2 reported error '4401212' at start of auto tuning -
Ryan, thanks for trying this firmware. How well do the auto tune PID parameters work for you?
On one of my printers, I get that error message too when trying to tune a non-existent heater. I'll look into it.
-
For a while, it wouldn't let me actually turn on the heater. But now after the printer sitting on for a while and a few power cycles, it seems to be working. That's mysterious.
The last degree or two so after a setpoint change takes quite a while to get there. Might want to be a little more aggressive with the I parameter.
Right now I'm having a lot of problems connecting the web interface. It AJAX timeouts rapidly and then won't reconnect for quite a while. And the PanelDue has completely stopped working. Says idle, won't respond to button presses, doesn't show temperature.
-
Hi Ryan,
I'm sorry to hear you are having problems.
1. Have you tried the new 1.15-rc4 firmware that I released about an hour ago?
2. PanelDue has been incredibly reliable, and most problems people encounter are either down to a faulty cable or a faulty LCD/touch panel. However, you can try pressing the Reset button on PanelDue and/or re-installing the firmware if you like. The only other possibility I can think of is that +5V power is low. You could try disconnecting it from the Duet and powering it from the USB socket, then see if the buttons to switch pages work.
I am not sure what to make of your ajax timeouts. The new firmware displays the RSSI (wifi signal strength) in the connect message if you enable WiFi from USB, or from the PanelDue console if you get it working again.
HTH David
-
This is a follow on from my post in the firmware thread.
This is run three and unless i'm missing something from the instructions lowering P and raising S still didn't work
This is a Dyzend, 24v, 60W heater with the 300c Thermistor
My manual setting are: ;M301 H1 P22.0 I0.2 D180 T0.2 S1 W180 B30 and these work pretty well
-
As your heater is 60W I am more not surprised that you need to use a lower pwm during tuning, if you don't want the temperature to exceed 240C.
-
OK with p0.2
23:51:34Auto tune of heater 1 with P=0.20 S=260.0 cancelled because temperature limit exceeded. Use lower P or higher S in m303 command.
23:40:37M303 H1 P0.2 S260
Auto tuning heater 1 - do not leave printer unattendedI surmise that the tuning is looking for the max stable temp for a given pwm?
midnight here will try again tomorrow with even lower P values.
Cheers
-
The tuning runs at constant PWM (the value you select) and looks at the temperature profile. It stops when the temperature rise is a little less than 90% of the expected maximum.
-
How do you make H0 (bed) to use PID? The M307 H0 after the M303 shows PID, but after putting it in config.g, it's always bang-bang. It overshoots and stops heating using any of the three settings it gives. Error: heating fault on heater 0, temperature excursion too large. I used M303 H0 P0.1 S140 to do the auto-tuning. It does complain about it being overpowered. I do have a 160C thermal fuse installed.
It has no problems with the 40w 24vdc heater in the hotend.
-
Hi Stephen,
Are you sure it is using bang-bang and not PID? What settings does M307 H0 report? Also, were you successfully using PID previously, and if so, what M301 parameters were you using?
-
What I got after the auto-tune:
1:31:55 PMM307 H0
Heater 0 model: gain 271.5, time constant 94.2, dead time 5.5, max PWM 1.00, in use: yes, mode: PID
Setpoint change: P11.2, I0.12, D43.3
Load change: P11.2, I1.02, D43.3
1:31:32 PMWarning: Heater 0 appears to be over-powered and a fire risk! If left on at full power, its temperature is predicted to reach 291C.
Auto tune heater 0 with PWM=0.10 completed in 279 sec, maximum temperature reached 73.4C
Use M307 H0 to see the result
1:26:52 PMM303 H0 P0.1 S140
Auto tuning heater 0 - do not leave printer unattended
–---------------
Sent M307 H0 and got:
2:07:56 PMM307 H0
Heater 0 model: gain 271.5, time constant 94.2, dead time 5.5, max PWM 1.00, in use: yes, mode: bang-bangI did a power cycle after the changes to config.g. M307 H0 A271.5 C94.2 D5.5
I was using the default settings in prior versions, no M301 or M304 used. That didn't work in 1.15-rc4, the bed faulted, so I did an auto-tune.
Firmware Name: RepRapFirmware for Duet
Firmware Version: 1.15-rc4 (2016-08-21)
Web Interface Version: 1.12-RC1 -
Hi Stephen,
It looks to me that auto tuning has failed to measure the time constant correctly, because 94 seconds is very low for a bed heater. That probably means it is under-measuring the gain too. I saw this on one of my bed heaters too, before I lengthened the auto tune process. It occurs when you have a thick bed plate and the thermistor is not in good contact with it. Is that the case in your setup?
You may get more accurate results if you use higher PWM than 0.1, such as 0.15.
Here are some possible workarounds:
1. Use the S parameter in the M307 H0 command to reduce the maximum PWM used. This should reduce the overshoot.
2. Switch to bang-bang control, which was the default before 1.15rc, by using B1 in your M307 H0 command instead of B0. You can still use the S parameter in M307 to reduce the overshot if necessary (you will get a heating fault if the overshoot exceeds 8C when using 1.15-rc4).
3. Enter your own estimates of the M307 A and C parameters instead of using the auto-tune ones..
-
The heater is under a 1/4" MIC-6 plate with the thermister between them in the center. From your #2, to enable PID, just add a B0 to M307. B0 is not mentioned on the web page for tuning the temp control, just to add B1 to use bang-bang. I didn't have any B parameter with M307. So, I added the B0 to the M307, and it now works in PID and no overshoot. It's now holding fine at 65C and 110C. It only went over by a couple of tenths of a degree, then settled on 65C or 110C.
Log file after adding B0 to M307 in config.g and power cycling:
3:42:28 PMM307 H0
Heater 0 model: gain 271.5, time constant 94.2, dead time 5.5, max PWM 1.00, in use: yes, mode: PID
Setpoint change: P11.3, I0.12, D43.4
Load change: P11.3, I1.02, D43.4Adding the B0 put the bed in PID mode, without it, the mode was bang-bang. I didn't need to add B0 for the hotend for it to use PID.
-
I'm glad you got it working. I'll add a note to the tuning instructions that the bed heater defaults to bang-bang, so you need to add B0 to the M307 H0 line if you want to use PID.
-
The tuning runs at constant PWM (the value you select) and looks at the temperature profile. It stops when the temperature rise is a little less than 90% of the expected maximum.
I don't get it then..
my M303 for tuning on the last run was M303 H1 P0.2 S260, it took 11 minutes before it failed with over temperature at 260. this is well over the couple minutes you expect it to run.1. Is the S value the "expected maximum"? It's not clear from the documentation.
2. if so why didn't my tuning run stop at 90%?In that last run it got to around 240 and slowed up and above 250 it got really slow but never stopped rising till it hit 260 and then failed.
-
The S value is not the expected maximum, it's the maximum you want to allow during tuning.
My hot end heaters have time constants of around 2min 20saec and tuning takes around 2.8 time constants. So tuning a hot end will take around 7 minutes.
-
So what is the expected maximum and how is it set?
(deep breath) (a few times)
semi rant on….. apologies in advance.....From the wiki.... Tuning a hot end heater normally takes just a few minutes.
yet above you now say it will take about 7 minutes.No where in the documentation do you discuss the expected maximum, how it is determined or if it is settable.
can you or should you tune for different setting ie PLA v ABS v even higher.I know this is beta and we are testing but i've had 5 runs with different P values and all ended up going over S max each time but no useful ideas on what to look for further.
Is this a case that the default boot up tuning model just can't handle the high powered heater as it stands.
I'm somewhat astounded that what should be for the end user a simple no brainer exercise regardless of the heater power, you are collecting the temperature numbers as it heats and I would expect that the tuning would automatically handle the fast heating.
I have no doubt the behind the scenes firmware calculations are no where near as simple as i think of course.
rant off//
I understand that I continue to represent an edge case in all your testing but I would hope that is valuable as well.
-
I was able to get my E3D V6 heater to auto tune after reducing the max PWM level to 0.3 and setting the max temp to 260 so:
M303 H1 P0.3 S260 yielded:M307 H1
Heater 1 model: gain 732.3, time constant 176.9, dead time 4.1, max PWM 1.00, in use: yes, mode: PID
Setpoint change: P10.6, I0.06, D30.2
Load change: P10.6, I1.30, D30.2I also got this message:
Warning: Heater 1 appears to be over-powered and a fire risk! If left on at full power, its temperature is predicted to reach 752C.
Auto tune heater 1 with PWM=0.30 completed in 500 sec, maximum temperature reached 228.2C
Use M307 H1 to see the resultSounds scary, but I realize it is a pretty powerful heater. I'm running the 12V E3D cartridge at 15VDC.
Now, I try to auto tune my bed heater (Rostock Max V2 12V heater, with an aluminum heat spreader from Trick Laser under the stock glass plate). I tried a few settings but none seemed to work.
The last one I tried was:
M303 H0 P1.0 S140
And I got this message about 30 seconds later:
Auto tune cancelled because temperature is not increasingI realize the bed heater is underpowered and has a lot of thermal capacity with the heat spreader. Any way to increase the timeout for temperature increase so I can get it to auto tune?
EDIT – I think I may have found a solution!! I sent:
M307 B0 H0 D60
to set the dead time to 60 seconds. Curiously, it didn't actually show up as received on the DWC interface, like the other commands seem to do... but it set it nonetheless.When I ran:
M307 H0, it seemed to have updated the dead time to 60.Tuning the bed heater now....
-
A 12v/40w heater would produce 62.5w at 15v. I'd predict that to reach around 650C based on my experience, so that model is not too far off from the truth.