New heater tuning algorithm
-
@smoki3 said in New heater tuning algorithm:
@smoki3 said in New heater tuning algorithm:
@dc42 said in New heater tuning algorithm:
Thanks @smoki3 , we will add that advice to the documentation.
So looks like my feedback came to early.
I did some prints today and I get heater faults again:
Error: Heater 3 fault: temperature rising much more slowly than the expected 3.0°C/sec
This are my PID Tunings for this heater:
M307 H3 R2.727 C226.900:132.500D5.60 S1.00 V24.2 B0
This only happens if I start heating from room temperature. If its already heated to around 70C it works fine
@dc42 any way to fix this? The heater is working fine but i cant use it because I always get an heater fault.
I am on RC1 now.
And this tool is not heating slower than the others. It faster...
The value is also changing every time:
The same errors! Once it is fixed, calibration, tuning, and things. Everything is actually functioning. Once it is calibrated, other days again false error reports and abort the job! I can`t get work with my giant printer at least one single print due to the paranoid futures of these algorithms.
Is there any way of disabling them? -
@sozkan said in New heater tuning algorithm:
@smoki3 said in New heater tuning algorithm:
@smoki3 said in New heater tuning algorithm:
@dc42 said in New heater tuning algorithm:
Thanks @smoki3 , we will add that advice to the documentation.
So looks like my feedback came to early.
I did some prints today and I get heater faults again:
Error: Heater 3 fault: temperature rising much more slowly than the expected 3.0°C/sec
This are my PID Tunings for this heater:
M307 H3 R2.727 C226.900:132.500D5.60 S1.00 V24.2 B0
This only happens if I start heating from room temperature. If its already heated to around 70C it works fine
@dc42 any way to fix this? The heater is working fine but i cant use it because I always get an heater fault.
I am on RC1 now.
And this tool is not heating slower than the others. It faster...
The value is also changing every time:
The same errors! Once it is fixed, calibration, tuning, and things. Everything is actually functioning. Once it is calibrated, other days again false error reports and abort the job! I can`t get work with my giant printer at least one single print due to the paranoid futures of these algorithms.
Is there any way of disabling them?I assume that the temperature is raising to fast. So I now did a PID tuning with reduced power the first test print was fine now
-
When the hot end is heating and you get the heater fault, is the print cooling fan on or off?
The expected heating rate falls with increasing actual temperature.
-
@dc42 said in New heater tuning algorithm:
When the hot end is heating and you get the heater fault, is the print cooling fan on or off?
The expected heating rate falls with increasing actual temperature.
The pcf is off. It happens immediately after I turn the heater on from room temperature
-
Probably I will be involved in coding or Forking the successful version to run for our solution.
I have a new proposal for a new algorithm as PID Engine!
I can code in C# in the visual studio. We may convert into the platform used into the Duet.(As I am a C# developer I need get used to the code and suggestion interns of compiling)
I don`t find any of these present PID tuning methods efficient. Since we define delay time and expect to finish successful auto tunning is not really auto tunning. Calculating the temperature /time is not really logical. Because temperature increase /time is not linear. On my industrial giant version, simple PID took more than 28 hours.
My proposal could be applied even to every each print if desired. Because it will be really fast and useful. if this desired algorithm is not possible with the hardware limitation, it could be compiled in the 32-bit interface and activate multi-threading.
The algorithm structure should work like this;
The function suggestion;
<<AutoTune>>
User-defined in default or Gcode defined if the dynamic PID engine desired during the printing.
The Parameter set by the user:- Pre-defined Temperature Test Temperature Threshold.
- Temperature Range difference. Which is allowed to range from the target temperature.
- Heater(s) , 0 , 1; ( if multiple heater)
Variables need in the program; - Temp record 0; Test Target Temperature definition;
- Temp record 1; Peak Temp record that reaches after cut-off;
- Temp record 2; Ideal Cut-off Temperature value;
- Temp record 3; Ideal Cut-in Temperature value;
- CutOfDiff; difference from the target temperature and cut-off temperature;
- CutInDiff; difference from the Cut-off temperature and cut-in temperature;
- Temp Range; Allowed Plus/minus temperature Range definition;
- Time Record 0; the time to reach Test Temperature; (just for info)
- Time Record 1; the time to reach Peak Temperature after cut-off;
- Time Record 2; the time to get back to the Test Temperature;
- Time Record 3; the time to get back to the Cut-off Temperature;
- Time Record 4; the time to get back to the Cut-in Temperature;
- Time Record 5; the time to get from the Cut-in Temperature to cut-off;
- Top Range temp = Temp Record 0 + Temp Range x 0.5
- Bottom Range temp = Temp Record 0 - Temp Range x 0.5
- Adding value to cut-in;
1. Premature Cycle:
In this cycle, we will search for the ideal cut-in and cut-off temperature. Once cut-off, it will reach above the desired set temperature and the allowed range by the firmware set heating parameters. Because Cut-in starts from room temperature and unknown cut-off prematurely. The delaying and waiting times founding just for simulation temporary indications. The time values will be of no value in real-time work. If the Temperature above the (pre-defined - Allowed range) target range then, it will wait to start.The task Program will do:
Job 1: Enable the heating until the defined temperature threshold by indication of the sensor.Job 2: Wait while heating is disabled and the device keeps rising temperature due to heat expansion resistance.
Job3: Record the Peak temperature as"Temp record 1" when it starts reducing.
Job4: Measure and record the time as"Time Record 1", How many seconds it took to rise from pre-defined Test Temperature to Peak while keeping disabled.
Job5: Calculate the difference of the peak and target temperature (CutOfDiff= Temp record 1-Temp record 0) and Subruct the difference from the target (Temp record 2=Temp record 0-CutOfDiff) as defining the new pre-mature Cut-off Temperature, record as "Temp record 2" which is below the pre-defined target temperature.
Job6: Wait for the temperature to get back to the pre-defined target value and measure and record the time as"Time Record 2" that took from the peak down to the pre-defined target temperature.
Job7: Keep waiting still until the temperature reduces to the cut-off temperature and measure and record the as "Time Record 3" when reduced to the "Temp record 2". We consider the CutOfDiff = CutInDiff as pre-maturely.
Job8: Calculate the new Cut-in as; Subruct the CutInDiff value from the Cut-off temperature (Temp record 3=Temp record 2-CutInDiff ) Record the Found Temporary Cut-in Temp as "Temp record 3".
Job9: Wait from the new Cut-off Temperature below to the cut-in temperature and Record the measured time as "Time Record 4".
Job10: Full Report of Premature Cycle values to the console.
2. Intermediate Cycle:
in this cycle, we will verify the values once again. it will be a very short cycle. This cycle could be also a live PID engine during the code feed.The task Program will do:
Job 1: Enable the heating on premature cut-in temperature value.Job 2: Cut-off and Measure the time and record the time as "Time Record 5".
Job 3: Wait until the second time peak temperature after the cut-off and record the time as "Time Record 1". Record the new Peak temperature as"Temp record 1" when it starts reducing the temperature.
Job 4: Compare the New peak value and Pre-defined target temperature.
Job 5: if the new peak "Temp record 1" is within the range of the pre-defined target (Temp record 0 + Temp Range and Temp record 0 - Temp Range)
then break the loop and full report, finalize.Job 6: if the new peak outside the range of (Below or above within the Temp Range) predefined temperature target; calculate the difference of peak and pre-defined temperatures. The difference will be added to the new cut-in temperature as plus or minus. But if the Cut-in seems bigger than the Cut-off, We add the value in Cut-off too.
3. FinalCycle:
The final cycle tests and shows the results;
New Peak temperature,( It is probably below the Target temperature) Because in the intermediate cycle we subtract the value from the higher peak temperature and Target temperature. It should be a positive value.The task Program will do:
Job 1: Enable the heating on intermediate cut-in temperature value.Job 2: Cut-off and Measure the time and record the time as "Time Record 5".
Job 3: Wait until the second time peak temperature after the cut-off and record the time as "Time Record 1". Record the new Peak temperature as"Temp record 1" when it starts reducing the temperature.
Job 4: Compare the New peak value and Pre-defined target temperature.
Job 5: if the new peak "Temp record 1" is within the range of the pre-defined target (Temp record 0 + Temp Range and Temp record 0 - Temp Range)
then break the loop and full report, finalize.Job 6: if the new peak outside the range of (Below or above within the Temp Range) predefined temperature target; calculate the difference of peak and pre-defined temperatures. The difference will be added to the new cut-off temperature as plus or minus. if the new cut-off value smaller than the new cut-in value, we subtract adding value from the cut-in value too.
Job 7:
if the finalization again outside the range, return back to the intermediate level.for example;
Case 1: ideal case Pre-defined target temp =200 celsious. Temp Range = 5 celsius degree. Top Range temp =Pre-defined target temp +Temp Range x 0.5 = 202.5 Bottom Range temp =Pre-defined target temp -Temp Range x 0.5 = 197.5 Cut-in =198 Cut-off =199; New Peak = let's say 201 seems in the range. ---- Case 2: Outside range out of Top range Pre-defined target temp =200 celsius. Temp Range = 5 celsius degree. calculated Top Range temp =202.5 calculated Bottom Range temp =197.5 calculated Cut-in =180 calculated Cut-off =185; Peak temperature reached above 205. It seems out of Top range temperature. Adding value to cut-in temp = 200 -205= -5. The new Cut-in = 180+ (-5) =175; Testing again for verification. ---- Case 3: Outside range Below Bottom range Pre-defined target temp =200 celsius. Temp Range = 5 celsius degree. calculated Top Range temp =202.5 calculated Bottom Range temp =197.5 calculated Cut-in =180 calculated Cut-off =185; The peak temperature = 189; It seems the peak temperature stays below the bottom range temperature. Adding value to cut-in temp = 200 -189 =11. The new Cut-in = 180+11 =191; It seems above the cut-off. then new statement ; new Cut-off = New Cut-in + Half of the Adding value Cut-off = 191+ 11= 202; Testing again for verification.
Finally, this will end in the intermediate cycle, which will find the correct result. if in case different, we will go correction cycle the loop again until finding the value within the range.
Since we are offsetting the Peak between pre-defined targets, I assume the temperature could be a little bit lower than the targeted value. But it will be within the range.<<Using in Operation Function>>
We could have two option;-
Predefined in the config, keep using the same values. But if Outside the range, report an error. But suggest a solution as a parameter.
-
As a PID Engine, Dynamic test going on during the code interpretation as another thread; As intermediate level keep testing while the peak values going away from the target, keep adding cut-in values plus /minus.
The times we measure cut-in to Cut-off and cut-off the peak temperatures could be represent sampling as temperature and time. I believe the values in the 2 dimensions will show interesting graphs ( Temperature x Times).
-
@dc42 I have water-block cooling which is originally Dyze double heater Typhoon hot end. Which is continuously running. I need multiple heaters and sensors running simultaneously. Since they are on the same block, they are influencing. Incredibly fast heating, one of them cool fast and heat slow, other heat slow but cool fast. But they are defined in the config as a single hot end. Once a job starts, it enables both at the same time. ( Which is initially from the dyze design documentation) . However, It is all the time out of the temperature range and error.
Dyze-Design does not recommend using Duet on their advanced hot ends because of these time-based safety futures. That's why they don't provide support on that. I like Duet's advanced futures. So I believe I can contribute to development. Could you please comment on my proposal? I believe you do the best. But I like to add some spice like a dynamic PID engine. Believe me, it will be working in real-time and find its own tuning before starts.
I have done similar automation with Arduino based platform using 32-bit Teensy hardware. Which is quite fast. But your hardware has a beautiful interface. -
@jay_s_uk said in New heater tuning algorithm:
did you tune as H1 or T0?
finally I have some time to update and reply:
I usually tune using H0 and H1.
I'm working with Duet3 and RRF for the first time, so basically I am a noobI added the F0 back to the tool definition g-code line.
I just wonder why I suddenly see 2 fans defined after I switched to the new (beta) firmware branch. I didn't see any clue in the release notes though.Right now I try to tune my bed heater again, maybe the warning won't appear this time.
BTW: I still have the previous PID values stored, but I don't know if I can simply use them with the new firmware. -
wow, this time it finished fast (after 5 idle and 5 tuning cycles in 605 s) with no warning! Nice!
Thanks
Have a wonderful Christmas -
@sozkan said in New heater tuning algorithm:
@dc42 I have water-block cooling which is originally Dyze double heater Typhoon hot end. Which is continuously running. I need multiple heaters and sensors running simultaneously. Since they are on the same block, they are influencing. Incredibly fast heating, one of them cool fast and heat slow, other heat slow but cool fast. But they are defined in the config as a single hot end. Once a job starts, it enables both at the same time. ( Which is initially from the dyze design documentation) . However, It is all the time out of the temperature range and error.
Dyze-Design does not recommend using Duet on their advanced hot ends because of these time-based safety futures. That's why they don't provide support on that.
It's a shame that they haven't been in touch with us about that. I had no idea they were advising against using Duet, and I wasn't aware of the Typhoon hot end.
It's possible to extend the heater timeouts and allowed temperature ranges using the M570 command, in particular the P and T parameters.
Tuning those coupled heaters may work better using the following procedure;
-
Set the M570 limits for those heaters very high.
-
Find some parameters that allow you to heat both heaters at once to the target temperature.
-
With heater #1 at its normal operating temperature, tune heater #2 with the target temperature equal to its normal operating temperature.
-
Now set heater #2 to its normal operating temperature and tune heater #1.
If you continue to get "Temperature rising too slowly" errors, the fix is to reduce the gain or heating rate parameter. That's the M307 R parameter in 3.2RC1 and later.
HTH David
-
-
@dc42 said in New heater tuning algorithm:
@sozkan said in New heater tuning algorithm:
@dc42 I have water-block cooling which is originally Dyze double heater Typhoon hot end. Which is continuously running. I need multiple heaters and sensors running simultaneously. Since they are on the same block, they are influencing. Incredibly fast heating, one of them cool fast and heat slow, other heat slow but cool fast. But they are defined in the config as a single hot end. Once a job starts, it enables both at the same time. ( Which is initially from the dyze design documentation) . However, It is all the time out of the temperature range and error.
Dyze-Design does not recommend using Duet on their advanced hot ends because of these time-based safety futures. That's why they don't provide support on that.
It's a shame that they haven't been in touch with us about that. I had no idea they were advising against using Duet, and I wasn't aware of the Typhoon hot end.
It's possible to extend the heater timeouts and allowed temperature ranges using the M570 command, in particular the P and T parameters.
Tuning those coupled heaters may work better using the following procedure;
-
Set the M570 limits for those heaters very high.
-
Find some parameters that allow you to heat both heaters at once to the target temperature.
-
With heater #1 at its normal operating temperature, tune heater #2 with the target temperature equal to its normal operating temperature.
-
Now set heater #2 to its normal operating temperature and tune heater #1.
If you continue to get "Temperature rising too slowly" errors, the fix is to reduce the gain or heating rate parameter. That's the M307 R parameter in 3.2RC1 and later.
HTH David
Hi David,
Thank you for the support, I couldn`t realize this feature without your support.They actually don`t blame DUET, What they say;" They have some strong advantages, as much as some very frustrating weaknesses" advise me to get in touch with the DUET support team.
This what I wrote to them;"We are using RepRap based Duet 2 Wifi hardware. I have checked in your documentation, but PID parameters are not related to Typhoon.
Could you please specify what parameters needed? Because Heater 1 increases rapidly and Heater 2 slowdown. That cause error. Autotuning of PID is failing all the time. So I cant get the correct parameters."Their return; "Sadly, it is indeed very tricky to fine-tune the heaters with Duet. They have so many security and error checking features that it becomes a pain for the user.
We are using Duet with one of our Pulsar, and there is sadly nothing we can do to go around this firmware feature.
I would strongly suggest that you contact the guys from Duet and maybe they can implement a fix.Most of the time, we don't supply any parameters to our heaters, as it leads to more problems. It seems like the default values are good enough for what we are doing.
**"
However as of my thesis research subject; "Applicability of Large 3D Printers to the Production industry" stuck on these heater errors, which is frustrating. I needed to get into work and print some successful products. But almost 1.5 half months dealing with the heating errors. -
-
I have a 240v 500w AC heater controlled by an SSR heating a 250x250x4 aluminium bed.
With the old algorithm, the bed temp was flatline stable.
With the new algorithm I get 4-5 degrees oscillation after PID tuning at 100C
The extruder is as good as before, with almost no deviation.
Most of the deviation is over shooting (2.5-3 degrees)
I tried increasing dead time without a lot of change.I'm sure I'll be able to tweak it, but reporting as previous PID worked flawlessly.
; Heaters M308 S0 P"bedtemp" Y"thermistor" A"Bed" B4725 C7.06e-8 ; configure sensor 0 as thermistor on pin bedtemp M950 H0 C"bedheat" T0 Q10 ; create bed heater output on bedheat and map it to sensor 0 and set PWM frequency to 10hz M140 H0 ; Set bed themp to zero M143 H0 S130 A0 C0 ; set temperature limit for heater 0 to 130C - fault if too high M308 S1 P"e0temp" Y"thermistor" A"Nozzle-1" B4725 C7.06e-8 ; configure sensor 1 as thermistor on pin e0temp M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1 M143 H1 S280 A0 C0 ; set temperature limit for heater 1 to 280C - fault if too high ; Set PID autotune parameters M307 H0 R0.435 C745.2 D20.50 S1.00 ;set PID values for heater 0 (bed) no V parameter as powered by mains M307 H1 R2.354 C140.7:139.6 D7.38 S1.00 V24.3 ;set PID values for heater 1 (hotend)
-
@OwenD, do you have a record of the M307 bed heater parameters produced by the old tuning algorithm?
-
@dc42 The last time I posted my config it was
M307 H0 A421.6 C860.4 D14.2 S1.00 V24.0 B0
I doubt I would have changed it since them until the new algorithm was introduced. -
@dc42
Dear David,
Many thanks, I have finally Archived to print without problem for more than an hour. I will share the m307 values and printing the video later ( because it is saved on the device).The parameter set to M570 S180 and different
reduced PWM and delay rates for each heater.Since the Typhoon hot end carries two different power capacity rates on the same block and with two sensors individually sensing the temperature, and the auto tunning did not help, I had to play hundreds of times with parameters manually to get them synced on the same temperature.
However, reducing the PWM by more than half will reduce the print rate. Normally it is rated 1 kg/hour capacity hot-end.
-
@OwenD said in New heater tuning algorithm:
@dc42 The last time I posted my config it was
M307 H0 A421.6 C860.4 D14.2 S1.00 V24.0 B0
I doubt I would have changed it since them until the new algorithm was introduced.Penny may have just dropped.
It looks like the M307 returned by the auto-tune didn't include B0, so I presume it will default to bang bang thereafter.
Retrying now with B0 added. -
@OwenD said in New heater tuning algorithm:
@OwenD said in New heater tuning algorithm:
@dc42 The last time I posted my config it was
M307 H0 A421.6 C860.4 D14.2 S1.00 V24.0 B0
I doubt I would have changed it since them until the new algorithm was introduced.Penny may have just dropped.
It looks like the M307 returned by the auto-tune didn't include B0, so I presume it will default to bang bang thereafter.
Retrying now with B0 added.@dc42
Can confirm that the problem was the loss of the B0 parameter after running PID auto tune with the new algorithm.
The temp is now stable at 100C +/- 0.2-0.3Edit: Using M500 puts the B0 parameter into the new M307 settings, but the recommendation in the console at the end of tuning doesn't. I had copied and pasted the latter M307 recommendation.
-
Hi David,
with this algorithm i get always a massive overshoot at first. Which parameters should i tweak manually to try to fix it? R or C? -
@MikeS said in New heater tuning algorithm:
Hi David,
with this algorithm i get always a massive overshoot at first. Which parameters should i tweak manually to try to fix it? R or C?Try reducing R.
-
Hi,
fist thanks for all the work that is put into RRF!
my setup: i3mega with new external 300W-24V supply, converted to a duet-ethernet-1.4 now with firmware RRF3.2-RC2 running (+ PanelDue i5)
I successfully tuned the - in my opinion for higher temperature prints underpowered - "ultrabase mk3" heatplate of the i3mega of which has around 140-145W (glass plate swapped for a solid piece of flat alu with 240x240x5mm attached with heat-conductive-adhesive) for 110°C with M303 H0 P1.0 S110 (heater 0 is setup in config.g as PID via M307 H0 B0 S1.0 )
After successfull tuning with the following console printout
When manually heating afterwards, I am not able to reach any temperature above 100°C (after ca. 15-20minutes from ca. 35°C as start) before a heater0-fault is thrown
currently in config.g I tried
M143 H0 P0 S125 A2 ; switch off heater H_ temporarily if it exceeds S_°C
M143 H0 P1 S130 A0 ; raise a heater fault if it exceeds S_°C
M570 H0 P120 T30 S5to eventually have the error go away, but it seems I cannot get higher temperatures, because the higher the temperatures get, the slower the the heat-up-process is getting until it seems to saturate a little below 100°C. What I do not understand how it was able to reach 110°C while tuning?
Are there any software tweaks I could do to reach around 105-110°C for which I am aiming (I am reluctant to buy a higher W(wattage)-heatplate if I can avoid - which would otherwise be the most obvious thing of course)? The error the tuning threw up leads me to try maybe tuning for 105°C first?
EDIT:
Looks better with 105°C
At least does not throw a heater faultSadly when manually trying afterwards to heat, it also does not go to the 105°C but saturates at ca. 100°C after tuning and throws a fault because it cannot climb any more.
EDIT:
Looks even better with 100°C:
Since it does not throw a warning this is most likely the limit I guess?But even here, I cannot reach the 100°C consistent when heating afterwards manually, it still throws a fault...
But 95°C works fine -> no fault there, hm
-> 95°C
So it seems around 95°C is the inherent limit of this "i3 mega mk3" heatplate with its 140-145W on 220x220mm?
Or would there be any gain by trying hard swithing via setting heater-0 in config.g to M307 H0 B1 S1.0?Next is feeding the 24V through the 12V (It has 2 inputs 1 for 12V 1 for 24V) to see what temperature I can reach there
Stay tuned...
Thanks for working on the console-output for the user: In my perception a big step up!
Best regards
LucasEdit: After retryin 3.1.1, 3.2RC2 & final 3.2alpha it turns out I had in my filament-config.g another M143 with 100°C OUUUUUUUUUCH slap on the forhead at least the heatplate is now feeded with 10A instead of 5A because the waiting got me so nervous that we "tuned" the heating-time -> nice how you can change the behaviour of a resistance-heater by playing with parallel, series, or 1-of-2-circuits-only (no series, no parallel)
WUZA -
@dc42 so i tried playing around with values but i can get a stable temperature during printing, but can't mitigate the overshoot at the first heat up. Also when starting from a cold nozzle i usually get error on bad curve:
Warning: Auto tune of heater 1 failed due to bad curve fit (R=7.999, 1/C=0.0040:0.0097, D=10.3)
The temperature readings seems reasonable to me and i got no "noise" on that, at least from what i can see on duet ui.Any suggestion?
edit1: I managed to get the tune give me results by tuning the heater and not the tools, so i think the bad curve probelm is related to the layer fan but i'm not sure. Also with the given results i get a 8/10°C overshoot at first but at least it won't trigger the thermal runout safety. Still it has to be better than this.