Welcome! Log In Create A New Profile

Advanced

Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees

Posted by srinidhi 
Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees
December 01, 2022 07:22AM
Hi,

I tried the Marlin 2.1.1 version with MPC for the extruders.
The tuning was successful, but there is a constant error for all set points, which is also periodic. The waveform is attached.

I have tried tuning multiple times with the same results.
I am using PT100 with 1k resistor as potential divider and a 60W cartridge heater.
Kindly suggest any possible solutions.
Thanks in advance!
Attachments:
open | download - mpc_waveform.PNG (442 KB)
Re: Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees
December 02, 2022 09:06PM
My MPC deviation was about 1/4 of what you're seeing. About the same a PID.
Re: Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees
December 02, 2022 11:48PM
Yes, I expected it to be better, but it's slightly worse than PID. However, one thing I notice is, in PID, the errors are random. In MPC, the error is periodic. I have a second extruder which behaves exactly the same.

Edited 1 time(s). Last edit at 12/03/2022 03:53AM by srinidhi.
Re: Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees
December 03, 2022 01:15AM
I suspect your 60W heater is not 60W

Unplug the heater, measure its resistance

then do some simple math



to calculate the real wattage (P)

Edited 3 time(s). Last edit at 12/03/2022 01:20AM by Dust.
Re: Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees
December 03, 2022 01:17AM
Will try this and update, thanks
Re: Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees
December 03, 2022 01:28AM
make sure to touch your probes together to measure the error Resistance of the meter and probe wires then subtract that value from the heater resistance measured

Edited 1 time(s). Last edit at 12/03/2022 01:29AM by Dust.
Re: Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees
December 05, 2022 05:55AM
Hi, I found the resistance of the heater to be around 11 ohms.
Power = 24*24/11 = 53 Watts
This value has slightly improved the performance, the errors are not periodic, and have a deviation of around -2 to up to +2 in some cases. Is it lesser than this usually?
I am thinking of iterating with different values of power, and finalize the one which gives better performance.
rq3
Re: Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees
December 05, 2022 12:08PM
The MPC M306 T routine places the nozzle at 1 mm from the bed by default, and then engages the part cooling fan to calculate the heat loss during actual printing. I found that 1 mm was NOT close enough, and set the distance to 0.1mm in configuration.h (my typical first layer height).

It made a huge difference, at least for my set-up.

#define MPC_TUNING_POS { X_CENTER, Y_CENTER, 0.1f } // (mm) M306 Autotuning position, ideally bed center at first layer height.

Instead of:
#define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center at first layer height.

Also be aware that many control boards have very bad ADC (analog to digital converter) designs, and they lie like a dog on a sun warmed rug. It is very unlikely for a heat block to swing many degrees over a few seconds.

In addition, a PT100 RTD is possibly the worst sensor for this application. A 12 bit ADC can resolve, at best, 4096 steps, or 0.122C over a 0C to 500C range (about 0.8mV with a 3.3 Vref), while the voltage from a PT100 with a 1K exciter is only 0.000669 volts PER DEGREE. The temperature readings will appear to bounce wildly, because the ADC hasn't the resolution to do anything else.

I use a PT1000 RTD (10 times more sensitive), with an amplifier to linearize and expand the RTD signal to cover the entire ADC input, and I do run exclusively with MPC. But you may just be expecting resolution and stability that your set-up just isn't capable of.

Edited 2 time(s). Last edit at 12/05/2022 12:38PM by rq3.
Re: Marlin 2.1.1 Model Predictive Control has deviation of -3 to +1 degrees
December 07, 2022 07:39AM
Hi, thanks for the inputs!
I'll try out changing the centre position. You may be right regarding the resolution, but will give it a shot and update.
Sorry, only registered users may post in this forum.

Click here to login