New heater tuning algorithm
-
@the_dragonlord said in New heater tuning algorithm:
Good morning. I've jut finished tuning the Heater 1 at 230°C with M303 H1 S230. This is my first print after using the new calibration algorithm....I'm experiencing a lot of oscillation around the set point as you can see:
You are the first person to report that with the new algorithm.
My suggestions are:
- Tune the heater again, but as a tool instead of as a heater. This will take account of the effect of the cooling fan.
- Make sure that the system ios using the M307 parameters that resulted form tuning.
- If you still get oscillations after doing that, increase the dead time (M307 D parameter). Try an increase of 30%, and increase further of needed to stop the oscillations.
-
I just want to give some feedback:
The new heater tuning works fine for me and the temperatures are very stable.
At the beginning I had one "heater fault" warning as soon the fan turned on. I noticed that it make a huge difference if you do the heater tuning "in the air" or do it near to the bed (or any other surface). If you do it near the bed the air from the part cooling fan gets reflected and cools also the hotend.After doing the heater tuning again the everything works great for my. The temperatures looks more stable than before.
-
Thanks @smoki3 , we will add that advice to the documentation.
-
@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
-
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