PID parameters and small MCU/thermistor temperature oscillations



  • Hi, I've been having some weird issues with PID tuning and temperature stability with my printer and I'm starting to think that either I have current leakage or ADC is failing. Namely PID values dont give me stable temperatures anymore (also the new algorithm). When doing nothing MCU temperature oscillates +/- 0.3 degrees. Same goes for thermistor temperatures both for hotend and the bed. They clearly all update at the same time. I've disconnected everything but the motors and main PSU (which is turned off by hardware switch) and powered the duet from the USB connection and the behaviour persists so I doubt that PSU is the issue (150W MeanWell from Amazon powering duet system that consumes at most 60W).

    Normally I wasn't bothered with this but it seems that the problem has gotten so bad that I can not get stable temperatures without manual PID tuning which wasnt the case before. And it seems to me that oscillations are getting worse over time (I have duet wifi 1.04c approx 1 year). Additionally old PID now reports that dangerous temperatures could be reached for my 30W e3d heater (and it is consuming 30W by measuring the power usage from the wall).

    On few occasions (with old algorithm) max temp reported by PID tuning algo would actually be lower than what I've seen on DWC e.g. it would report 274.6 and I would observe a quick jump to 274.8 afterwards so it seems that duet is getting confused by the thermistor readings (genuine e3d thermistor that came with v6).

    Duet also reports oscillations on my main PSU i.e. when print runs Vin oscillates and drops at least 0.1V however it does not seem to oscillate nor drop when measuring with multimeter (albeit I don't have a fancy multimeter but should be fine for one decimal point).

    I've also noticed a potential buildup between duet ground and mains earth when using PSU (but not when using USB) by shorting the bed ground output to earth which makes the bed LED next to MOSFET light up.

    PID values

    M307 H1 A559.2 C269.6 D5.0 S1.00 V23.9 B0 ;old
    M307 H1 R1.947 C262.0 D6.64 S1.00 V23.9 B0 ;new
    

    Ok perhaps this is too much info but I wanted to give as much background as possible. 🙂

    Are these oscillations normal? Perhaps its not the thing that is causing the PID issues.
    Can someone post their PID values for genuine e3d just as a reference?
    Is ADC really making issues?

    Best,
    Aleks



  • @akstrfn said in PID parameters and small MCU/thermistor temperature oscillations:

    I've also noticed a potential buildup between duet ground and mains earth when using PSU (but not when using USB) by shorting the bed ground output to earth which makes the bed LED next to MOSFET light up.

    This is normal because the bed power is switched on the negative side. By shorting negative to earth, you are bypassing the mosfet switch and leaving the bed in a permanent on state.


  • Moderator

    What does your temp graph look like?

    Post your config.g


  • administrators

    @akstrfn said in PID parameters and small MCU/thermistor temperature oscillations:

    PID values
    M307 H1 A559.2 C269.6 D5.0 S1.00 V23.9 B0 ;old M307 H1 R1.947 C262.0 D6.64 S1.00 V23.9 B0 ;new

    Thanks for the figures. They are remarkably consistent. As you have only one C value, I guess you didn't use the T parameter in the M303 command.

    Small temperature oscillations can usually be cured by increasing the M307 D (dead time) parameter.



  • @Zhang-Jianyu thanks for the remainder that duet switches negative side, I always forget that... There is a small potential difference between the earth and V- (V- is not grounded) so I thought to mention it albeit it should not matter.

    @Phaedrux the graph looks like this download.jpg at 20:20 there is a bump in temperature by 10 degrees and you can see the first oscillation. Note the graph is with very slow test print, with faster printing it gets much worse but anyhow its hard to see those small oscillations of this scale.

    I doubt that config is relevant but I know you like to check them so I'm attaching it. config.g

    @dc42 They are indeed consistent however they are wrong. Increasing dead time helps but it doesnt solve it. The new algorithm is much better at estimating the dead time as you said in the other thread. Nice thing is that dead time estimation works so much better that my bed PTC heaters are more stable (I raised previous dead time myself to 13):

    M307 H0 A150 C1076 D13 S1.00 V0 B0
    M307 H0 R0.187 C1024.9 D13.97 S1.00 V0 B0
    

    C * R ~= 190 but I lowered the A myself previosly and I dont remember what was the estimation of old algo but I think it was around 250. Bed temperature still oscillates around in delta of 0.5 degrees which is quite bad for 8mm thick alu bed.

    Speaking of T there is a typo in gcode wiki M303 T0 ; tune the primary heater of tool 0 (RRF 3.2beta3.2 and later) lacks S parameter.

    What about MCU temp fluctuations and slightly inaccurate voltage readings?
    I recently started to learn how to use the oscilloscope and now I wonder how to probe the system that switches ground?


  • administrators

    @akstrfn, are those small oscillations regular, or not? If they are irregular then they may be caused by variations in cooling.



  • @dc42 I'm not cooling the MCU and the fluctuations happen all the time. For example the printer was on the whole morning without doing anything so the temperature should stabilize but they dont. I've attached two video's just made:


  • administrators

    @akstrfn said in PID parameters and small MCU/thermistor temperature oscillations:

    Speaking of T there is a typo in gcode wiki M303 T0 ; tune the primary heater of tool 0 (RRF 3.2beta3.2 and later) lacks S parameter.

    Thanks, I have corrected that.

    Temperature reading fluctuations of +/-0.1C when using tjermictos or a little more when using PT1000 sensors are normal.



  • @dc42 it more like +/- 0.3C for all sensors including MCU but perhaps its not really relevant for PID tuning. When/if I get the time I'll try to check the code and see if I can figure it out atm I don't have time to babysit the printer.
    Best,
    Aleks


Log in to reply