Observations on PID tuning



  • Hi,
    I just thought I'd post a few observations I've noticed for PID tuning the heated nozzel

    Overview

    From what I understand the duet boards use a different mechanism for PID tuning, controlling the heaters such as the nozzel that's supposed to be more accurate.
    I suspect / guess it's also true that the ADC on the Arm chip probably has a higher resolution than the one on a 16bit board for measuring the existing temperature.

    When running the PID for the hotend typically it's a case of

    M303 H1 P0.7 S205
    
    • H1 - Heater 1
    • P0.7 - PMW Power rating to use (0 - 1)
    • S205 - target temperature

    One critical thing appears to be the power rating.

    • If it's set too high such as 1, then you could end up with a thermal runaway which causes the hotend to shoot off to the moon
    • If it's set too low then then the hotend will take a long time to heat up and may not be able to keep up with the target temperature
    • I've also noticed that the higher the value more pronounced the oscillations

    Tried values

    Initially I started with a power rating of around 0.5
    This works while the printer isn't printing, but as soon as I started printing PETG (barely no fan) at around 230
    it couldn't keep up and stopped the printer after the temperature dropped too low, so I redid the PID tuning with 0.6

    Then I tried printing with PLA at 205, and a 3hole fan duct I'd just printed off
    This couldn't keep up while printing and would drop too low (probably due to the increased fan cooling the nozzel)
    so I redid the PID with a factor of 0.7

    It seems to be working okay, but it seems to oscillate different amounts based on the type of operation
    at around 20% infill half way through the print it seems to
    slowly climb to 205 then suddenly dip to around 202 / 203 before climbing again

    • Since the extrusion and the fan are drawing heat away from the nozzel, a static PID test might indicate everything is fine but might actually be underpowered.
    • Any oscillations you might see during heating the nozzel while not printing, might actually smooth out somewhat while printing due to the plastic taking heat away

    During printing I've noticed the following influences the amount of power needed

    • The speed of printing (faster extrusion means more heat being taken away from the nozzel)
    • If a fan is in use (increased cooling = more power)
    • If your using a 3 nozzel fan duct (increased cooling = more power)
    • The type of print operation such as solid infill, or partial infill (solid infill = more plastic extruded / more power needed)

    I should mention this isn't a criticism, but just something to watch out for when setting up a printer.
    Initially I was setting the power rating as low as possible to avoid oscillations
    but since those kinda smooth out a bit during printing, I've now realised it needs to be on the higher end to keep up with the printing and the fan.

    below are a couple of screengrabs of the temperature graph while printing pla at 205
    0_1534761664327_image1.png
    0_1534761672147_image2.png

    Many Thanks
    Richard


  • administrators

    Heater tuning should normally be done using P1 (the default), unless you are using very old firmware. The only time P1 is likely to be problematic is if your hot end heater is over-powered, for example if you make the mistake of using a 12V heater cartridge on a 24V system.

    The heater tuning doesn't always establish the value of the dead time (D parameter in the M307 command) very accurately. If D is set too low then the temperature will oscillate; so if you see the temperature oscillating regularly even when not printing, then try increasing D, initially by about 50%. If D is set too high then the PID will be slow to respond to external changes, for example the print cooling fan turning on.



  • I'm using the latest stable firmware 2.01
    The supply voltage is 12V, and in theory the heater is 12V
    although the heater is a cheap china clone

    I just tried the following with some PLA in

    M303 H1 P1 S190
    

    This led to

    0_1534800806877_cbc89318-c2a8-436b-9f47-85f4668c1e27-image.png

    this was starting from room temperature

    0_1534801246394_16a4a294-b136-4981-a14b-8af4b4a081c2-image.png



  • @dc42 said in Observations on PID tuning:

    The only time P1 is likely to be problematic is if your hot end heater is over-powered, for example if you make the mistake of using a 12V heater cartridge on a 24V system.

    Curious.

    I check all my heaters to verify that they have a resistance which suggests they are 12v - which is what I need.

    And yet on all of my four printers using P1.00 has always resulted in the tuning process reporting "over powered".

    I usually end up in the 50% to 70% range.

    Frederick



  • P0.9 seems to be the highest I can go without generating a warning
    I think I might try that with adjusting the dead time
    since I now know that printing smooths out some of the oscilations



  • @fcwilt Mine is a 40W 24V cartridge, and my last PID run triggered the big red warning that it was likely to hit 600C in a thermal runaway. I used the numbers as generated anyway. Judging by the resistance I'm pretty sure the new cartridge is a 24V. But I got the warning at P1 anyway.



  • @3dmntbighker said in Observations on PID tuning:

    @fcwilt Mine is a 40W 24V cartridge, and my last PID run triggered the big red warning that it was likely to hit 600C in a thermal runaway. I used the numbers as generated anyway. Judging by the resistance I'm pretty sure the new cartridge is a 24V. But I got the warning at P1 anyway.

    I tend to be cautious when it comes to setting things on fire.

    Until dc42 tells us there is a bug in the code and the warnings are bogus I'm going to play it safe.

    Frederick



  • Always measure you heat cartridge resistance to know your real power output.


  • administrators

    The "over powered" warning for hot ends is very common, especially since E3D started shipping silicone socks with their hot ends without reducing the heater cartridge power to compensate. Most users ignore it. However, if it predicts much more than 500C then I suggest a lower powered heater cartridge. 30W or even 25W is sufficient for an E3Dv6 hot end with a silicone sock.



  • @dc42 said in Observations on PID tuning:

    However, if it predicts much more than 500C then I suggest a lower powered heater cartridge. 30W or even 25W is sufficient for an E3Dv6 hot end with a silicone sock.

    Thanks for the info.

    So simply using a lower P setting is not sufficient to be safe?

    Frederick



  • @fcwilt said in Observations on PID tuning:

    So simply using a lower P setting is not sufficient to be safe?

    It will be OK as long as the MOSFET controlling the heater output does not fail short. In this case it would lead to full power heating at Vin voltage and no more control by the Duet. Given these fails are rare but they are a potential risk.

    I am currently looking into introducing something like described in this thread to be able to cut power in this case.



  • @wilriker said in Observations on PID tuning:

    I am currently looking into introducing something like described in this thread to be able to cut power in this case.

    There are network controlled outlets available.

    https://3gstore.com/product/7755_single_outlet_remote_power_switch_app_controlled.html

    I wonder if a Duet could send the needed command?

    Frederick



  • @fcwilt Technically they will work as well. I have a few concerns about them though.

    1. First they are much more pricy then the linked solution
    2. They are often proprietary systems where you have to use an app to switch them
    3. Some of them offer to switch them from anywhere in the world but that requires to punch a hole in my firewall to some Chinese server I don't like that

    Of course this is a ready built solution that is literally plug and play on the other hand.



  • @wilriker said in Observations on PID tuning:

    @fcwilt Technically they will work as well. I have a few concerns about them though.

    1. First they are much more pricy then the linked solution
    2. They are often proprietary systems where you have to use an app to switch them
    3. Some of them offer to switch them from anywhere in the world but that requires to punch a hole in my firewall to some Chinese server I don't like that

    Of course this is a ready built solution that is literally plug and play on the other hand.

    Yes it is more expensive but it is possibly "plug-and-play" with Duet.

    There is no app involved or outside server. It's a very simple HTTP command set needed by the web server running in the unit.

    The reason I mentioned it is that these devices have many applications. I have a few in my home controlling other things and if it could work with the Duet it would just be one more use.

    Frederick



  • @fcwilt I can definitely see how convenient they are - but I like to tinker my solutions including the trial-and-error spectrum of it. 😁



  • @dc42 said in Observations on PID tuning:

    The "over powered" warning for hot ends is very common, especially since E3D started shipping silicone socks with their hot ends without reducing the heater cartridge power to compensate. Most users ignore it. However, if it predicts much more than 500C then I suggest a lower powered heater cartridge. 30W or even 25W is sufficient for an E3Dv6 hot end with a silicone sock.

    Damn, I just ordered a bunch of 40W heaters after my wire failed. Mine predicted 600C. Is there any point in tuning with a lower P setting at this point? Assuming I want to keep the 40's should I remove the silicone boot and re-tune at P1? Or is the best course to ditch the 40's and order the 30's? <grumble>


Log in to reply