PID Settings in ADVi3++ 4.0.6

Hi, folks,
I’m totally new to 3D printing. I started setting up my Wanhao Duplicator i3 Plus by following this tutorial:

Now I have a question. When I use commands like M301 and M500 in Octoprint the read out in the terminal states that the new values are stored.
But when I open the settings menu of my printer via LCD and look at PID I see different values.

I guess that’s because this menu isn’t showing the actual values but stored values which can be used to switch them fast. Is that correct?

Kind regards

Try unplugging the USB from the printer and plugging back in, it will restart the firmware. Then when you check on the LCD, you will probably see the setting update.

Thx, that didn’t do the trick.
At least marlin via octoprint tells me that the stored values are still there in the EEPROM after shutdown.

There’s something else that’s curious to me.
If I leave the settings menu for PID using the back arrow I see that’s there is a M501 triggered.
Is that intended?

I guess that would make sense if changing the temperature values in the dialog changes them directly via M301 and the check symbol stores them to the EEPROM via M500.
But I can’t see any M301 commands being triggered when pressing + or - for any of the p, i or d temps.

there is a M501 triggered. Is that intended?


But I can’t see any M301 commands being triggered when pressing + or - for any of the p, i or d temps.

This is done directly without simulating a gcode command.

Thanks for the confirmation.
After several test I see the following picture.
Settings done through octoprint/marlin are not reflected by the LCD. None of the possible profiles 1 to 3 correspond to the values store in the EEPROM through marlin.
Unplugin and replugin the USB cable doesn’t change that.

If I change the values through the LCD the values are stored in the EEPROM. But they are not stored one to one. P is stored as given. For I and D there are different multipliers applied (~0,164 and ~6,1).

The interesting part is, that if I switch the profiles 1 to 3 and without leaving the settings menu commit a M503 after switching, say from 2 to 3, the result will be that the values for P,I and D are exactly the ones shown for profile 2. So while switching, the values of the last shown profile, not the profile currently displayed, are correctly written one to one to the EEPROM, without multiplier.

I’m using the following:

Maybe I messed something up. Any ideas?

Which picture?

I don’t think so. I think that it can be considered as a bug in ADVi3++: PID handling is not implemented as it should be for M301 to work correctly.

But there is a reason behind: ADVi3++ is using PID profiles associated to a given temperature and the right profile is chosen when a print is started (based on the temperature). Something which is not possible with Marlin alone. That’s why my implementation diverges from the one in Marlin.

Sorry, the “picture” I referred to was a figure of speech. Maybe it’s only used in German. What I meant was “the situation as I understand it so far”.

So what I should do is use the PID Tuning implemented in ADVi3++ and don’t bother with merlin anymore, right?

Thanks for answering my questions and all the work you put into ADVi3++.


Could you please explain to me why the values I and D determined by the ADVI+3 autotune are stored in the EEPROM applying an multiplier of 0,1684?

I guess the relevant code is this one from temperature.h:

// Minimum number of Temperature::ISR loops between sensor readings.
// Multiplied by 16 (OVERSAMPLENR) to obtain the total time to
// get all oversampled sensor readings
#define MIN_ADC_ISR_LOOPS 10

#define ACTUAL_ADC_SAMPLES MAX(int(MIN_ADC_ISR_LOOPS), int(SensorsReady))

#define PID_K2 (1.0f-PID_K1)
#define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0f / 256.0f))

// Apply the scale factors to the PID values
#define scalePID_i(i) ( (i) * float(PID_dT) )
#define unscalePID_i(i) ( (i) / float(PID_dT) )
#define scalePID_d(d) ( (d) / float(PID_dT) )
#define unscalePID_d(d) ( (d) * float(PID_dT) )

First, the PID settings stored by ADVi3++ in EEPROM are not those displayed by M503. The ones displayed by M503 are not used (because there is only 1 value possible, and ADVi3++ have 3).

If your question is about the code in temperature.h, this is part of Marlin code, I have not touched it.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.