Welcome! Log In Create A New Profile

Advanced

M109 Hangs in Repetier-Host due to wild extruder temperature swings

Posted by Eric Mack 
M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 29, 2013 05:02PM
In Repetier Host, I set Extruder Temp for 230c but it will swing between 220c and 250c

As a result, when I run the gcode sliced by Slic3r the program will often hang because the temperature is too high above the desired temperature.

My work around is to manually preheat extruder and to comment out M109 in gcode like this:
;M109 S230 ; wait for temperature to be reached


I have run the PID calibration on the Extruder routine multiple times and verified that the PID settings are saved in EEPROM. No change. The Extruder temperature still swings.

When the machine is cold, both the extruder thermistor and the bed thermistor properly report the ambient temperature.

FYI: My heated Bed is set for Bang Bang temperature control and is rock solid, nevery varying more than a half a degree or less in any direction.


My Configuration:
Repetier Host V0.09B
Azteeg X3 with Repetier-Firmware-0.822


Any help would be appreciated.

Eric


Azteeg X3 Controller with Repetier Firmware, ViKi LCD, Repetier Host
RepStrap One:"http://www.ericmackonline.com/ICA/BLOGS/emonline.nsf/dx/erics-repstrap-3d-printer-trainer
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 05:53AM
Actually it does not hang in the host but in the firmware. The host is waiting for the command to get executed which never happens in your case.

With these strong swings I guess you have one of the following problems:
- high latency between heating and temperature change
- High heat power, e.g. because you are using 24v with a heater designed for 12v.

or something in the config is not as it should be. But thats hard to say without informations. Please post the extruder settings in eeprom and some data on your extruder and a picture of the temperature graph with output power included. I think you need to reduce max. output (pid max) to get working into normal regions.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 11:42AM
Thank you for your feedback.

I will collect this information for you. My heater cartridge is 12V. My power supply voltage is 14.9 VDC - I was told to increase it a bit. Do you think that could be the cause of the swings?
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 11:58AM
That already increases the power about 50%. So to get back to normal values you should set max_pid to 160. But I doubt it would swing that high, but never tried myself.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 12:16PM
Here is the information you requested.

I have not changed the "Extr 1 PID Max Value" EEPROM Setting. As you can see, it is at the default 255.

I have changed the PID Values according to the results of the M303 calibration run.



Thank you for your help!

P.S. For what it's worth, I just remembered that I have an LED/Resistor in parallel with the Heating Cartridge - I did this so that i could see when power was applied to the heat cartridge. I do not think this would affect anything as LEDs draw so little current and I have a 30 Amp supply. I mention this here in case, either the LED or the increase in PS Voltage to 14.9 has something to do with this problem. I'm not beyond operator error!

Edited 2 time(s). Last edit at 06/30/2013 01:03PM by Eric Mack.
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 01:02PM
That looks quite normal. What is obvious is, that your heater has very much power and has a steep start, which also results in the large overshoot. The pid values are for one overshoot that should swing out fast. There is one config value that you should change:

#define PID_CONTROL_RANGE 15

It defines when pid starts. 15 means target temp +/-15°C. You see this in the picture. Thats where pid disables the power completely to reduce overshoot. But for your power it is too late. So increase it to 40-50 for your case or reduce pid max, which should also reduce the heating speed making it swing in faster.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 01:10PM
Thank you, I will try that. Mean while, I post an additional screen shot for the benefit of anyone else that may learn from this thread and what you have shared.




As you can see after the extruder temperature stablizes it remains 5-10 degrees above the desired temp; whereas the Bed Temperature is rock solid. (Bed is using Bang Bang)
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 01:15PM
The problem is really that the heater is overpowered. That way little changes have large effects and make the control loop instable.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 04:17PM
Thank you for the explanation. Before I change the firmware, I decided to do an experiment and drop the power supply voltage to 12.1 volts and look at the temperature map to see the difference it makes.

I ran the test for a few minutes at 220c, then 230c, then 240c, and back to 200c.



As you can see from the screen shot, it made a significant improvement (as you indicated it would).

If I were going to stay at 12.1 volts I would run the M303 PID Calibration again but I really want to run the power supply at a higher voltage so that it is less impacted when I turn on the bed heater or add a second extruder.

I will now increase the power supply voltage back to 14.9 volts and make your recommended firmware change:
#define PID_CONTROL_RANGE 45

That will increase the range from the default of 15 to 45. I will repeat the tests and post the results.

Meanwhile, can you explain (or point me to information) on what the following EEPROM Setting does:

Extr 1. PID Max Value: 255

Does that refer to 255 degrees? or 255 as a percentage of power output? I am unclear. Thanks/.

Edited 1 time(s). Last edit at 06/30/2013 05:10PM by Eric Mack.
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 04:53PM
The pid nalgorithm computes the output in a range of 0-255, which is one. byte.. 255 is constant output. If you want to reduce maximum output you can reduce this value. That has the same effect as reducing the voltage.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
June 30, 2013 06:53PM
I am still running tests and will report results. It is unclear if I must run the M303 PID Calibration after each change of Power Supply Volts, PID Power, or PID Control Range
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
July 01, 2013 02:18AM
The PID values depend on the power output as it changes the speed, signals change. SO yes, you should M303 after changinf volt or pid max.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
July 01, 2013 04:34AM
I have been testing this all day with MAX power level as low as 60 in order to reduce swing. I even recalibrated my power supply down to 12.2 volts DC. What I still see are temperature swings of +- 5c (Better than the 20 c swing before).

As I continue to experiment with this, can you tell me what is a reasonable temperature swing that I should see with a well tuned PID?
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
July 01, 2013 06:25AM
If you have a stable reading thermistor you get within 1 degree. I have looked at your curves and see lots of little spikes inside the temperature readings. You can get them from electric noise, e.g. heater induces voltage on sensor. I hope you have drilled your wires to reduce this effect? It may also be a bad contact between thermistor and heater that lets values vary.

The problem with unsteady readings is especially the damping. It should damp the move not wrong/inaccurate readings. The firmware takes an average over several readings, so you see the spikes not as hard as they are in reality.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
July 07, 2013 10:19PM
I want to follow up for the benefit of anyone with similar experiences to mine.

I now have my temperature tracking within1.5 degrees of the desired set temperature.

Here's what I did:

1. Reduced the power as indicated above (Although, I am no longer convinced this is needed)

2. Drilled a hole in my heater block and inserted the thermistor into the heater block.

3. Double wrapped the heater block with ceramic insulation and many layers of Kapton tape


Thank you, Repetier, for your assistance. I hope this information helps someone else along the way.

Edited 1 time(s). Last edit at 07/07/2013 10:20PM by Eric Mack.
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
September 23, 2013 04:54PM
repetier Wrote:
-------------------------------------------------------
>
> swing out fast. There is one config value that you
> should change:
>
> #define PID_CONTROL_RANGE 15
>
> It defines when pid starts. 15 means target temp
> +/-15°C. You see this in the picture. Thats where
> pid disables the power completely to reduce
>

Is this value affecting ALL the extruders ?

Best Regards
Davide Ardizzoia


==============================
no toys here...sorry
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
September 23, 2013 05:47PM
yes, it is for all extruder. no sepearate setting for each extruder requred.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
September 28, 2013 10:00AM
While we are at it, I would like to dig a bit deeper about the "I" setting in PID.

You say (on your website)
===============================================================================================
The I-Term is the most important one. The I-Term tries to find the perfect output for your temperature. It does this by incrementing/decrementing the output slowly. The speed is defined by the I_GAIN parameter. You can help a lot, if you limit the range of possible values to a known range INTEGRAL_DRIVE_MIN .. INTEGRAL_DRIVE_MAX. The min value should be at least 0 and the max not exceed 255. If you don’t know what works for you, use these extreme values and watch the output with the command M203 S0. When you that the temperature stabilizes, take the mean value and add/sub 20. If you like to change temperatures, set the limits, so all possible ranges are enclosed with a safety factor.

If your I_GAIN is set to a good value, you will see that the oscillation gets smaller with time. Disturbances like different printing speed or blowing at the nozzle may increase the error again.
===============================================================================================

Please help me:

1) The I output of M303 is usually a smallish value (in my case, often less than 10). The value I got from autotuning can be directly set with LCD interface, using the same value the firmware prints at the end ?

2) Where I have to look to see those values M203 Sx gives me ?

3) If the mean value is the mean power output, should I map it to 0..255 (i.e.: if mean is 50, according to above instructions MIN should be 108 and MAX should be 148) ?

Bye
Davide




3) If those values are the


==============================
no toys here...sorry
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
September 28, 2013 10:44AM
3ntrlab Wrote:
-------------------------------------------------------
> While we are at it, I would like to dig a bit
> deeper about the "I" setting in PID.
>
> You say (on your website)
> ==================================================
> =============================================
> The I-Term is the most important one. The I-Term
> tries to find the perfect output for your
> temperature. It does this by
> incrementing/decrementing the output slowly. The
> speed is defined by the I_GAIN parameter. You can
> help a lot, if you limit the range of possible
> values to a known range INTEGRAL_DRIVE_MIN ..
> INTEGRAL_DRIVE_MAX. The min value should be at
> least 0 and the max not exceed 255. If you don’t
> know what works for you, use these extreme values
> and watch the output with the command M203 S0.
> When you that the temperature stabilizes, take the
> mean value and add/sub 20. If you like to change
> temperatures, set the limits, so all possible
> ranges are enclosed with a safety factor.
>
> If your I_GAIN is set to a good value, you will
> see that the oscillation gets smaller with time.
> Disturbances like different printing speed or
> blowing at the nozzle may increase the error
> again.
> ==================================================
> =============================================
>
> Please help me:
>
> 1) The I output of M303 is usually a smallish
> value (in my case, often less than 10). The value
> I got from autotuning can be directly set with LCD
> interface, using the same value the firmware
> prints at the end ?

Yes, thats the same value as in the LCD. It is normal, that it is small. The value is added/subtracted weighted 10 times per second, so it integrates over time.
>
> 2) Where I have to look to see those values M203
> Sx gives me ?

These are written to the output and captured by the host to allow a high frequency update for temperatures. WIth the new capabilities of M105 you normally do not need that one. Some time ago this was needed to get also the output power, but now M105 also tells the output power.

>
> 3) If the mean value is the mean power output,
> should I map it to 0..255 (i.e.: if mean is 50,
> according to above instructions MIN should be 108
> and MAX should be 148) ?

Think of I integrated over time. It can get very large (>255) and very small (<0). If that happens the result is rounted to 255 resp. 0 until I_INTEGRATED is in the valid range. That would mean a long time no or wrong corrections from I_GAIN. That is prevented by clipping it to a range that we know the solution is within.
So if the hottest neede dtemperature is 230° and you know a continuius PWM of 180 is enoug to reach that, even with fans enabled, you would set MAX to 180. The other side is the smallest temperature you like, lets say 180°C without fans. If 50 holds temperature below that, set MIn to 50.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: M109 Hangs in Repetier-Host due to wild extruder temperature swings
September 28, 2013 11:12AM
Ok, thanks.
Back to testing...

Bye
Davide


==============================
no toys here...sorry
Sorry, only registered users may post in this forum.

Click here to login