New heater tuning algorithm
-
alright, I just registered to participate
I also have a "bigger" heatbed/plate with a 1400W heater.
Since I switched to the new firmware, the PID tuning result is different.
For the heatbed I always get the warning that others get, too: heater behaviour is not consistent during tuning.
Before I wrote this post, I updated to the new beta 4.1, since I read above that dc42 changed the algorithm again for bigger beds, but the results are nearly the same for me.Oh, the fan doesn't start while tuning. Since I switched to the new fw I have 2 fans listed: tool fan and the one I named "berdair", which actually is the air pump I have installed. The tool fan does not exist. I can't find the gcode in config.g that creates the "tool fan" though.
Under "Fans" I have 2 lines:
M950 F0 C"out7" Q18000
M106 C"BerdAir" P0 S0 L0.0 X0.7 H-1 B0.1Under "Tools" I removed the F0 from the M563 command without any effect.
So it's just
M563 P0 S"Volcano" D0 H1 ;F0 -
@NikA I had to go back to pre beta 3.2 to tune my heated bed as it would fail after 30 cycles and then fault in heating.
I suggest doing the same and making a note of the results you get so you can go back to them in case you decide to try the heater algorithm when RC1 gets released.For the fan coming on for the tool, did you tune as H1 or T0?
You should keep F0 in your tool definition as that ties that fan as the Tool fan.
The tool fan isn't created by your config but is the part fan tied to the current active tool. If tool 1 was activated, then the tool fan would become the part fan for that tool -
I run into more problems now:
Warning: Auto tune of heater 2 failed due to bad curve fit (R=2.038, C=0.004:0.004, D=7.9)
What does this mean?
-
@dc42 Would it be at all possible to monitor ambient temp and use it to adjust pid tune on automatically? I have 25C difference in ambient temp depending on the filament I am using.
-
@3dML said in New heater tuning algorithm:
@dc42 Would it be at all possible to monitor ambient temp and use it to adjust pid tune on automatically? I have 25C difference in ambient temp depending on the filament I am using.
I guess so, if you have a sensor to monitor chamber temperature.
-
@dc42 excited to see RC-1 out; do you still think toolboard auto tuning might make it into this final release?
-
@Nuramori said in New heater tuning algorithm:
@dc42 excited to see RC-1 out; do you still think toolboard auto tuning might make it into this final release?
Unfortunately not, because the 3.2 code is now frozen. However, we plan RRF 3.3 to have a very short development cycle and we hope to release the first RC in January.
-
@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:
-
@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?