Welcome! Log In Create A New Profile

Advanced

Strange behavior during PID Autotune

Posted by benkitesurfs 
Strange behavior during PID Autotune
December 24, 2020 02:01PM
I have autotuned my hotend and bed many times before - I usually use the temps that I run for PETG, since that's the filament that I used the most, and I do 8 passes. For the hotend that is M303 E0 S250 C8

Last night I changed out my heatbreak and nozzle due to continued clogging that was not resolved after multiple cold pulls. After, I decided to run PID autotune on the hotend. When I do, the temperature will oscillate, as expected, but after a few oscillations, it will just start running away (usually down, but sometimes up), slowly, with tiny oscillations (about 1-2˚) until the Autotune times out.

I have tried swapping out the thermistor, just in case, but it hasn't made a difference. Has anyone experienced this?

I am running Marlin 2.0.7.2
Attachments:
open | download - Screen Shot 2020-12-24 at 10.33.45 AM.png (202 KB)
Re: Strange behavior during PID Autotune
December 24, 2020 03:44PM
It's either got to be the heater cartridge or the electrical bits sending power to it. Which includes the connectors, they can work loose.

If your controller supports 2 extruders, you could try wiring up to the 2nd extruder power and thermal sensor outputs and the extruder motor controller, set your Marlin to use the 2nd extruder temporarily, and try again to see if it makes a difference, if not, it's definitely the cartridge at fault.

Edited 1 time(s). Last edit at 12/24/2020 03:46PM by DragonFire.
Re: Strange behavior during PID Autotune
December 24, 2020 05:07PM
Thanks for replying!

I checked the resistance in the heater cartridge, and it seemed reasonable at 5.2 ohms (its a 12v 30w E3D cartridge - supposed to be 4.8 ohms)

I disassembled the system again, and made sure everything was tight. I ran PID again, this time starting with 0 values for all 3 parameters, running a short autotune at 180˚ (4 cycles), inputing those values, then repeating the autotune at 200˚, then 250˚, now I did another at 250˚ for 12 cycles, and after about 4 cycles it has run away again, just like before. I'm going to get a new heater cartridge just in case, but that means I probably can't print until next week angry smiley
Attachments:
open | download - Screen Shot 2020-12-24 at 2.05.56 PM.png (221.8 KB)
Re: Strange behavior during PID Autotune
December 24, 2020 05:38PM
What makes me suspect the mosFET in the controller that controls nozzle 1 heating - it's definitely staying on when it should be cooling down. Judging fro the second sceenshot you posted.

And yes, I have had one fail and go runaway on me.

EDIT:: One other thing to check - is the nozzle grounded somewhere to the 0V line? Check electrical resistance. It could be a short is bypassing the electronics when the nozzle is hot. Unlikely but possible.

EDI|T EDIT: If the mosFET on the board is only misbehaving at high temperatures, fitting an external mosFET or relay might cure the problem. Keep the heat away from it.

Edited 2 time(s). Last edit at 12/24/2020 05:56PM by DragonFire.
Re: Strange behavior during PID Autotune
December 24, 2020 06:02PM
Ok will do.

I am trying to do the experiment you originally suggested (using the E1 mosfet in order to see if the e0 mosfet is the problem). I have never used dual extruders before, but I went into my firmware and set:

#define EXTRUDERS 2
#define TEMP_SENSOR_1 5 // same thermistor number as TEMP_SENSOR_0

I changed my octoprint settings to dual extruder, moved my thermistor over, as well as my heater cartridge leads. The temperature of E1 is being accurately displayed in octoprint, but when I give the printer a temperature command on E1, I get no heat, of course followed by a thermal runaway error.

I have checked with a meter, I'm getting no voltage to the E1 terminals. I'm thinking I must be missing something in the firmware.

The board is SKR 1.4 Turbo

I guess I could also keep it set up as a single extruder and just change the pin assignments? I can't find the pins in the pins_BTT_SKR_V1_4.h file though...
Re: Strange behavior during PID Autotune
December 24, 2020 07:47PM
Marlin_2.0.7\src\pins\lpc1768


#define E0_STEP_PIN                        P2_13
#define E0_DIR_PIN                         P0_11
#define E0_ENABLE_PIN                      P2_12
#ifndef E0_CS_PIN
  #define E0_CS_PIN                        P1_04
#endif

#define E1_STEP_PIN                        P1_15
#define E1_DIR_PIN                         P1_14
#define E1_ENABLE_PIN                      P1_16
#ifndef E1_CS_PIN
  #define E1_CS_PIN                        P1_01
#endif


Computer Programmer / Electronics Technician
Re: Strange behavior during PID Autotune
December 26, 2020 01:29PM
Thanks for your response!

I did figure out how to reassign the pins - they were in the SKR commons file, I was looking in the lpc1768.

After switching things over to the E1 mosfet, not much has changed. I can get through a PID autotune now, but the after changing the numbers (and verifying that they're saved), my temperatures are not stable. I get continuous oscillation of about +-5 degrees, and eventually it will get more severe, and I'll get a thermal runaway shutdown.

I watched this video: [www.youtube.com] by Teaching Tech

I installed a 470 microfarad cap (because I don't have a 1000 right now), it doesn't seem to have made a difference. I'm getting a 1000 microfarad cap on monday, as well as a new heater cartridge, so we'll see if that helps

Edited 2 time(s). Last edit at 12/26/2020 01:30PM by benkitesurfs.
Re: Strange behavior during PID Autotune
December 26, 2020 01:57PM
This was my latest attempt thumbs down
Attachments:
open | download - Screen Shot 2020-12-26 at 10.56.09 AM.png (202.6 KB)
Re: Strange behavior during PID Autotune
December 26, 2020 04:40PM
Well, you've checked the board... only other thing I can think of checking would be the connection from the thermistor to the board. Check the wires are crimped to the pins solidly. If there was only a few strands doing the connection, that might affect connection at high temperature.

A silicone sock on the heater block should help. That's the only other things I can think of. It does look like the heater cartridge doesn't like working at that temperature.

I would have thought if a power fluctuation was the issue with your printer, the heated bed wouldn't stabilize either, because it draws a lot more current than the hotend heater cartridge does?

Edited 1 time(s). Last edit at 12/26/2020 04:41PM by DragonFire.
Re: Strange behavior during PID Autotune
December 28, 2020 10:38PM
I am using a silicone sock. I took the wire loom apart and replaced the extension cable to the thermistor (its the E3d one with the plugs on the thermistor), but that hasn't made a difference.

My bed heater goes through an external Mosfet, so its actually low load on the control board itself.

My new heater cartridge will arrive tomorrow, so hopefully that will solve it
Re: Strange behavior during PID Autotune
December 31, 2020 02:49PM
I'm completely out of ideas.

New heater cartridge.

New thermistor.

Switched to the other (E1) mosfet on the board.

Installed a 1000uF cap (according to Michael at Teaching Tech: [www.youtube.com])

Looked at voltage from the PSU with a multi-meter (not a scope, so variation could be occurring faster than I can read on my meter) during heating.

about 20 PID autotune attempts, with different combinations of variables (temperature, cycles). The resulting PID constants vary quite a bit, but none of them result in the hot end holding a consistent temperature

I have recently made changes to the K1 smoothing constant in the firmware, but that hasn't made any difference either.
Attachments:
open | download - Screen Shot 2020-12-31 at 11.42.05 AM.png (204.4 KB)
Re: Strange behavior during PID Autotune
December 31, 2020 07:52PM
As an experiment, you could also try using the mosFET on the hotend, rather than the heated bed, to see if that makes a difference.

One thing I'd try would be to reduce maximum current (BANG_MAX) delivered... it looks to me like your hot end always gets maximum power applied when it's too cool. Try a value of 191 instead of 255. (configuration.h file)

Quote

// Comment the following line to disable PID and enable bang-bang.
#define PIDTEMP
#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current <<<<< HERE
#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
#define PID_K1 0.95 // Smoothing factor within any PID loop

Also in configuration.h, you can give the hot end more leeway by increasing the TEMP_WINDOW and TEMP_HYSTERESIS values. Not ideal.

Quote

#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109
#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer <<HERE
#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target <<HERE

It's not ideal because your hotend control gets less accurate. Decreasing the value of TEMP_HYSTERESIS might be what you're looking for.

Edited 1 time(s). Last edit at 12/31/2020 07:53PM by DragonFire.
Re: Strange behavior during PID Autotune
December 31, 2020 08:01PM
Do you have any fans pointing at the nozzle or heater block? That could also be a factor, as PID tries to warm the nozzle, the fan cools it down too much.
Re: Strange behavior during PID Autotune
January 01, 2021 01:23PM
Good suggestions, I'll give it a try.

I have a layer cooling fan, and it does seem to cause the temp to drop when it comes on. But I can't keep a steady temp even when the fan is not on, so I think that's a separate issue. When I run the fan I always run it at 25%, since its a radial fan, and its pretty powerful.
Re: Strange behavior during PID Autotune
January 01, 2021 04:43PM
The BANG_MAX seemed to make it better, but its far from perfect. I think I'll try to adjust K1 again?

PID_FUNCTIONAL_RANGE didn't seem to have any significant effect.

I did have one PID autotune that failed - oddly enough, the temperature curve during the failed autotune is the flattest line I've seen in a while...
Attachments:
open | download - Screen Shot 2021-01-01 at 11.09.47 AM.png (82.9 KB)
open | download - Screen Shot 2021-01-01 at 11.52.50 AM.png (82.6 KB)
open | download - Screen Shot 2021-01-01 at 1.25.17 PM.png (79.5 KB)
open | download - Screen Shot 2021-01-01 at 12.44.30 PM.png (77.7 KB)
Re: Strange behavior during PID Autotune
January 01, 2021 08:40PM
OK, if you lower TEMP_HYSTERESIS from 3 to 2, then Marlin will react to a temperature difference of 2 degrees rather than 3 degrees. It will try harder and react quicker.

What you really want for part cooling is a double ended shroud that points at both sides of the printed part... not a fan that blows hard everywhere.

[www.thingiverse.com]

You ever tried printing without part cooling? You get stronger parts, but more blobby bridges.

A different approach is to insulate the heatblock with an heat insulating material. Not ideal, most of them are irritants (kiln lining) if not downright toxic (asbestos).
Re: Strange behavior during PID Autotune
January 03, 2021 03:28PM
I have a solution! This is 100% a Marlin problem. I decided to try RepRap firmware this morning, and the results are astounding. One PID autotune (about 5 minutes), and the hotend is hold temp with less than 0.5˚ deviations! Check out this flat line!!!
Attachments:
open | download - Screen Shot 2021-01-03 at 12.27.43 PM.png (210.9 KB)
Re: Strange behavior during PID Autotune
January 03, 2021 03:53PM
I'm glad you got it working with RRF. BTW, the latest RRF 3.2RC tunes with the print cooling fan both off and on, so that it can apply feedforward corrections to the heater power when the fan speed is changed.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Strange behavior during PID Autotune
January 03, 2021 03:59PM
@dc42 I'll check that out! I need to finish configuring RRF - I just did the bare minimum and loaded it up to test it.

@DragonFire Thanks for sticking with me on this, and giving me a lot of great ideas
Re: Strange behavior during PID Autotune
January 03, 2021 06:49PM
Quote
dc42
I'm glad you got it working..

+1
Sorry, only registered users may post in this forum.

Click here to login