Tuning Hot End PID

Post your advice, tips, suggestions, etc...
jsc
Posts: 1864
Joined: Thu Apr 10, 2014 4:00 am

Re: Tuning Hot End PID

Post by jsc » Mon May 26, 2014 10:45 pm

As indicated in the comments to the code I referenced way up in the thread, PID_MAX only kicks in when the heater is in PID mode. Up to a certain temperature below the target temperature, it will be in bang bang mode, and using the value of BANG_MAX. If BANG_MAX is too much for the PID_FUNCTIONAL_RANGE chosen, then the overshoot will occur no matter what PID_MAX is set to.

Some combination of lowering BANG_MAX/PID_MAX and increasing PID_FUNCTIONAL_RANGE might work.

DaveSL
Posts: 3
Joined: Sun Jun 08, 2014 3:21 am

Re: Tuning Hot End PID

Post by DaveSL » Sun Jun 08, 2014 3:29 am

I had the same problem with the PID autotune failing because of the initial overshoot. It was clearly not right because it would not maintain the extruder temperature during printing. My solution was to modify the autotune code where it stops after the temperature reached greater than 20 degrees over the target. I changed it to 30 and auto tune completed successfully with much different resultant PID numbers. I don't print with ABS so I wasn't worried about melting the PET. (I wouldn't do it for ABS level temperature) Extruder temp regulation works MUCH better now.

. Use at your own risk.

From line 219 in temperature.cpp

if(input > (temp + 20)) {
SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature to high");
return;

I CHANGED IT TO THIS:

if(input > (temp + 30)) {
SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature to high");
return;

User avatar
jimc
Posts: 2888
Joined: Wed Apr 09, 2014 11:30 pm
Location: mullica, nj
Contact:

Re: Tuning Hot End PID

Post by jimc » Sun Jun 08, 2014 4:33 am

yes i had the same issue when i put my e3d in. i had to run the autotune and the overshoot was way high. the info that jin posted above is great but i think he is running a different version of marlin. i did some digging and mine doesnt have the bang bang feature. its only PID. my pid max was set at 400 which i believe is stock. i dropped that down to a 150 and it kept it under control to do the autotune.

User avatar
Tim
Posts: 1205
Joined: Thu Apr 10, 2014 2:19 pm
Location: Poolesville, Maryland
Contact:

Re: Tuning Hot End PID

Post by Tim » Sun Jun 08, 2014 10:53 pm

Hello Ketil,

Pardon my ignorance of github (I run my own git server, and it works nothing like github), but I cloned the "Marlin.git", which appears to be the generic original. I don't see any branch for the M2 version. How do I clone it?

ketil
Posts: 45
Joined: Wed Apr 09, 2014 9:58 pm

Re: Tuning Hot End PID

Post by ketil » Sun Jun 08, 2014 11:33 pm

Hey Tim,

This should work:
  1. Check out my Marlin repo:

    Code: Select all

    git clone https://github.com/kefir-/Marlin.git
  2. List the branches, including remote ones:

    Code: Select all

    git branch -l -a
  3. You should see one listed as "remotes/origin/MakerGearM2-original-fw". Get that branch:

    Code: Select all

    git checkout MakerGearM2-original-fw
From there on you should have the code that I'm currently running on my original M2 (12v/19v, purchased late 2012). The branch name makes it sound like it's the original firmware, which it isn't... But it works fine for me!

jsc
Posts: 1864
Joined: Thu Apr 10, 2014 4:00 am

Re: Tuning Hot End PID

Post by jsc » Mon Jun 09, 2014 6:37 am

Tim, are you running a split voltage M2? If not, I would recommend you look at cmenard's fork instead, which is based off my 24V M2 fork.

User avatar
Tim
Posts: 1205
Joined: Thu Apr 10, 2014 2:19 pm
Location: Poolesville, Maryland
Contact:

Re: Tuning Hot End PID

Post by Tim » Mon Jun 09, 2014 2:11 pm

Jin,

Yes, I have the older split-voltage supply, which is why I'm interested in Ketil's firmware setup. He got his M2 about the same time that I got mine.

cafox
Posts: 1
Joined: Thu Apr 30, 2015 4:30 am

Re: Tuning Hot End PID

Post by cafox » Thu Apr 30, 2015 4:40 am

I have the older MakerGear M2 that came with the V3a hotend. I recently purchased a V3b hotend and had it converted to 19V. I experienced an issue where my extruded would not reach the set temp no matter where it was set.. it would remain about 10deg lower than the set temp.

I ran the autotuning (M303 E0 S220 C8), got the new PID and set it to the new values. Maybe my values will help others.. not sure.

Send the following Gcodes
M301 P37.20 I2.74 D126.16
M500

Those values worked for me... maybe they will work for others that are having trouble autotuneing the PID with the M303 command.

Thanks,
Chris
(I realize this is an older thread, but this is still a relevant topic.)

Post Reply