Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    PID Tuning help needed

    Scheduled Pinned Locked Moved Solved
    Tuning and tweaking
    5
    31
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Reefwarriorundefined
      Reefwarrior
      last edited by

      Hi

      I have started to PID tune my hotend heater, but it has been going for 20 minutes now, without finishing up - also I am at a P parameter of 0.1; am using an external mosfet driving my 24V heater (I want as little as possible current through my control board).

      I am using a Duet2 board, with firware V 3.2.2; and Duet wifi server verion 1.25. I have included the text from the configuration at the end of this post.

      Other strange thing is, there are quite a lot of oscillations with regards to the temperature being sensed. (Up to 3 to 4 degrees up and down)

      Any/all help appreciated!
      Tinus


      CONTENTS OF CONFIG.G

      ; Configuration file for Duet WiFi (firmware version 3)
      ; executed by the firmware on start-up
      ;
      ; generated by RepRapFirmware Configuration Tool v3.1.4 on Tue Nov 03 2020 07:37:18 GMT-0800 (Pacific Standard Time)

      ; General preferences
      G90 ; send absolute coordinates...
      M83 ; ...but relative extruder moves
      M550 P"Ender3" ; set printer name
      M918 P1 E4 F2000000 ; configure direct-connect display

      ; Network
      M552 S1 ; enable network
      M586 P0 S1 ; enable HTTP
      M586 P1 S0 ; disable FTP
      M586 P2 S0 ; disable Telnet

      ; Drives
      M569 P0 S0 ; X Stepper
      M569 P1 S0 ; Y Stepper
      M569 P2 S0 ; Z Stepper
      M569 P3 S1 ; E Stepper
      M569 P4 S0
      M584 X0 Y1 Z2:4 E3 ; set drive mapping
      M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation
      M92 X80.00 Y80.00 Z1200.00 E401 ; set steps per mm
      M566 X800.00 Y800.00 Z800.00 E300.00 ; set maximum instantaneous speed changes (mm/min)
      M203 X15000.00 Y15000.00 Z1500.00 E6000.00 ; set maximum speeds (mm/min)
      M201 X500.00 Y500.00 Z250.00 E5000.00 ; set accelerations (mm/s^2)
      M906 X800 Y1000 Z850 E1500 I50 ; set motor currents (mA) and motor idle factor in per cent
      M84 S30 ; Set idle timeout
      M671 X-24.2:250.8 Y0:0 S1.0

      ; Axis Limits
      M208 X-77.2 Y-13 Z0 S1 ; set axis minima
      M208 X270 Y258 Z360 S0 ; set axis maxima

      ; Endstops
      M574 X1 S1 P"!xstop" ; x-end stop with inverse operation
      M574 Y1 S1 P"!ystop" ; y-end stop with inverse operation
      M574 Z1 S2 ; z-end stop with inverse operation

      ; Z-Probe
      M950 S0 C"exp.heater3" ; define servo
      M558 C"zprobe.in" P9 H10 F120 T3000 S1 I1 ; set Z probe type to switch and the dive height + speeds
      G31 X40.0 Y-4.5 Z2.35 ; set Z probe trigger value, offset and trigger height // Z2.35
      M557 X15:215 Y15:195 S20 ; define mesh grid

      ; Heaters
      M308 S0 P"bedtemp" Y"thermistor" T100000 B4092 ; configure sensor 0 as thermistor on pin bedtemp
      M950 H0 C"bedheat" T0 ; create bed heater output on bedheat and map it to sensor 0
      M307 H0 B1 S0.6 ; enable bang-bang mode for the bed heater and set PWM limit
      M140 H0 ; map heated bed to heater 0
      M143 H0 S150 ; set temperature limit for heater 0 to 150C
      M308 S1 P"e0temp" Y"thermistor" T100000 B4092 ; 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
      M307 H1 B0 S0.6 ; disable bang-bang mode for heater and set PWM limit
      M302 S180 R180 ; Set retraction/extruding temperature limits. Extruding 180, Retraction 180.
      M143 H1 S320 ; Set maximum heater temperature to 320C

      ; Fans

      ;M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1
      M307 H1 B0 S0.85 ; disable bang-bang mode for heater and set PWM limit
      M302 S180 R180 ; Set retraction/extruding temperature limits. Extruding 180, Retraction 180.
      M143 H1 S320 ; Set maximum heater temperature to 320C

      ; Fans
      M950 F0 C"e1heat" ; create fan 0ler Fan" H-1 ; set fan 2 value. Thermostatic control is turned on @ 0.8Factor and 180C
      M106 P0 C"Part Cooler Fan" H-1
      M950 F1 C"fan0"
      M106 P1 C"Fan unknown 0" H-1
      M950 F2 C"fan1"
      M106 P2 C"Hot End Fan" H1 T40
      M950 F3 C"fan2"
      M106 P3 C"Extruder Stepper Fan" H1 T60

      ; Tools
      M563 P0 D0 H1 F0 ; define tool 0
      G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets
      G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C

      ; Custom settings are not defined

      ; Miscellaneous
      M501 ; load saved parameters from non-volatile memory
      T0 ; select first tool

      ; Signal to user that probe and loading is complete
      M501 ; Load EEPROM details
      M575 P1 S1 B115200

      1 Reply Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk
        last edited by

        the oscillations are normal and it can take up to an hour or more to PID tune something. just let it run its course

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        Reefwarriorundefined 1 Reply Last reply Reply Quote 0
        • Reefwarriorundefined
          Reefwarrior @jay_s_uk
          last edited by

          @jay_s_uk said in PID Tuning help needed:

          the oscillations are normal and it can take up to an hour or more to PID tune something. just let it run its course

          Thanx, but is it normal to shoot 30+ degrees Pas target, and the oscillations do not get smaller!?

          jay_s_ukundefined 1 Reply Last reply Reply Quote 0
          • jay_s_ukundefined
            jay_s_uk @Reefwarrior
            last edited by

            @Reefwarrior yes. its measuring cooling and heating times

            Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

            1 Reply Last reply Reply Quote 0
            • Reefwarriorundefined
              Reefwarrior
              last edited by

              @jay_s_uk Thank you - I will try again and let you know. Weird is that I started the PID process with a temperature of 240C, but on initial heating now it went past 320C. I suspect that the glass thingy (I forgot the name now!) that measures the temperature may not be calibrated/defined correctly.

              I know in Marlin you can choose the different options, but I haven't come across it in the duet firmware yet. Or am I missing something?

              Tinus 🙂

              jay_s_ukundefined deckingmanundefined 2 Replies Last reply Reply Quote 0
              • jay_s_ukundefined
                jay_s_uk @Reefwarrior
                last edited by

                @Reefwarrior yea, it shouldn't go as high as 320 on a 240 degree tune.
                The M308 line in config sets the thermistor. best finding out what you had in marlin so you can replicate it here

                Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                1 Reply Last reply Reply Quote 0
                • deckingmanundefined
                  deckingman @Reefwarrior
                  last edited by

                  @Reefwarrior It sounds to me like you have a very over powered heater. Might it be 12V heater running in a 24V system? Are you able to measure the resistance of the heater cartridge? If so, post the value here and one of us will work out the wattage.

                  Ian
                  https://somei3deas.wordpress.com/
                  https://www.youtube.com/@deckingman

                  Reefwarriorundefined 1 Reply Last reply Reply Quote 1
                  • Reefwarriorundefined
                    Reefwarrior @deckingman
                    last edited by

                    @deckingman Hi, I get 4.1ohm. I don't know if this can be correct, as it 'feels' too little?

                    jay_s_ukundefined deckingmanundefined 2 Replies Last reply Reply Quote 0
                    • jay_s_ukundefined
                      jay_s_uk @Reefwarrior
                      last edited by

                      @Reefwarrior typical resistances

                      P\V --------------------- 12V---- 24V
                      40w (Red Leads) 3.6Ω 14.4Ω
                      25w (Blue Leads) 5.76Ω 23.04Ω

                      Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                      1 Reply Last reply Reply Quote 1
                      • deckingmanundefined
                        deckingman @Reefwarrior
                        last edited by deckingman

                        @Reefwarrior said in PID Tuning help needed:

                        @deckingman Hi, I get 4.1ohm. I don't know if this can be correct, as it 'feels' too little?

                        So, if my maths serves me correctly, V=IR, so I=V/R = 24/4.1 = 5.8536Amps. Wattage = VI = 24 x 5.853 = 140.48 Watts !!

                        If the voltage was 12, then the current becomes 2.9 Amps so the wattage would then be 12 x 2.9 = 35 Watts.

                        So it looks you have a nominal 40 watt \ 12V cartridge so when you put 24V through it, you get roughly 4 x the heating power.

                        Note. A 40 Watt/24V cartridge would have a resistance of about 14.5 Ohms.

                        Edit. A 40W/ 24v heater cartridge would draw about 1.65 Amps which is perfectly safe to use with the onboard MOSFETs - no need to use an external one.

                        Ian
                        https://somei3deas.wordpress.com/
                        https://www.youtube.com/@deckingman

                        1 Reply Last reply Reply Quote 1
                        • Reefwarriorundefined
                          Reefwarrior
                          last edited by Reefwarrior

                          Thank you all for the feedback. Yes seems I am running a 12V then at 24V. I take it I can't just put in a power factor of P0.25 to fix this? Or will it be better to rather just swap it out for a 24V cartridge?

                          deckingmanundefined jay_s_ukundefined 2 Replies Last reply Reply Quote 0
                          • deckingmanundefined
                            deckingman @Reefwarrior
                            last edited by deckingman

                            @Reefwarrior said in PID Tuning help needed:

                            Thank you all for the feedback. Yes seems I am running a 12V then at 24V. I take it I can't just put in a power factor of P0.25 to fix this? Or will it be better to rather just swap it out for a 24V cartridge?

                            Running 25% PWM is bad idea IMO. The problem is that, if a MOSFET fails, then you could end up with the full ("permanent" as in non PWM switched) 24V which could be a fire risk.

                            Ian
                            https://somei3deas.wordpress.com/
                            https://www.youtube.com/@deckingman

                            1 Reply Last reply Reply Quote 0
                            • jay_s_ukundefined
                              jay_s_uk @Reefwarrior
                              last edited by

                              @Reefwarrior swap it. it will be unsafe until you do so

                              Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                              1 Reply Last reply Reply Quote 0
                              • Reefwarriorundefined
                                Reefwarrior
                                last edited by

                                Cool thank you. I will swap it out this afternoon then, and see if it is better.

                                With regards to the temperature measurement. Is it normal for it to jump up and down a few degrees? The graphs show spikes, instead of a normal flat line....

                                deckingmanundefined droftartsundefined 2 Replies Last reply Reply Quote 0
                                • deckingmanundefined
                                  deckingman @Reefwarrior
                                  last edited by

                                  @Reefwarrior said in PID Tuning help needed:

                                  Cool thank you. I will swap it out this afternoon then, and see if it is better.

                                  With regards to the temperature measurement. Is it normal for it to jump up and down a few degrees? The graphs show spikes, instead of a normal flat line....

                                  I think you'll find it's a lot more stable with a cartridge that is a better match to the hot end. The PID control can only do so much and when you have a heater that is over powered by a factor of 4 then you are likely to get overshoots when it turns on.

                                  Ian
                                  https://somei3deas.wordpress.com/
                                  https://www.youtube.com/@deckingman

                                  1 Reply Last reply Reply Quote 0
                                  • droftartsundefined
                                    droftarts administrators @Reefwarrior
                                    last edited by

                                    @Reefwarrior said in PID Tuning help needed:

                                    Is it normal for it to jump up and down a few degrees?

                                    No, check your wiring. Either it's picking up interference (usually from stepper motor or endstop wiring), or there's a poor joint. It will also cause the PID tuning to fail, as it can't get a consistent reading, and it's probably why it's taking so long to tune.

                                    Are you using a thermistor PT1000, PT100 or thermocouple? There are ways to make the last two more reliable, by using four wires rather than just two.

                                    Ian

                                    Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                                    Reefwarriorundefined 1 Reply Last reply Reply Quote 0
                                    • Reefwarriorundefined
                                      Reefwarrior @droftarts
                                      last edited by

                                      @droftarts Hi Ian,

                                      It looks like one of those little glass bead thingies that measures the temperature....

                                      droftartsundefined 1 Reply Last reply Reply Quote 0
                                      • droftartsundefined
                                        droftarts administrators @Reefwarrior
                                        last edited by

                                        @Reefwarrior Sounds like a thermistor. Check your wiring, and make sure the leads of the thermistor aren't grounding on the heater block, and that the thermistor bead is making good contact with the heater block (ie not flapping about in a big hole!). Cartridge thermistors, or PT1000, are generally easier to use and get good contact with. What kind of hot end is this?

                                        Ian

                                        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                                        Reefwarriorundefined deckingmanundefined 2 Replies Last reply Reply Quote 0
                                        • Reefwarriorundefined
                                          Reefwarrior @droftarts
                                          last edited by

                                          @droftarts E3d v6 clone. I will take a look at the hotend too....

                                          1 Reply Last reply Reply Quote 0
                                          • deckingmanundefined
                                            deckingman @droftarts
                                            last edited by

                                            @droftarts Did you check the earlier posts? It transpires the OP has a 12V cartridge and a 24V system. So around 140 Watt instead of 35. Methinks, that's more likely to cause the oscillations.

                                            Ian
                                            https://somei3deas.wordpress.com/
                                            https://www.youtube.com/@deckingman

                                            droftartsundefined 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA