-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dyze High Temp Thermistor Support #4244
Dyze High Temp Thermistor Support #4244
Conversation
d1e86ca
to
318fe93
Compare
An entry will need adding to thermistornames.h, for support in the Thermistor info menu. |
318fe93
to
ffa7540
Compare
Hi, I think I found some problem with activated SINGLENOZZLE feature. I turn on the printer. Then I set the temperature by M104 S190 T0 to 190°C. When the temperature gets steady I extrude 10mm. After that, I change the tool by T1. After these steps, the temperature starts rising and floats at 200-205°C. Switching the tool back by T0, the temperature again gets steady at the setpoint 190°C. Switching the tool by T1 temperature again rises to 200-205°C. Setting the temperature setpoint for T1 separately to 190°C does not help. I found that this problem with temperature does not appear until the first extrusion and the tool switching to T1. I haven't changed anything except some configuration for my Prusa i3. Here you find my branch https://github.com/Edie47/Marlin/tree/rc_dyze_thermistor_diff_test. |
@Edie47 That's very strange. I would not expect an issue like that to be specific to temperature sensor number 66. If such a bug exists, it is related to something else. Are you using |
ffa7540
to
c66655d
Compare
@thinkyhead I gave a try to another hotend that has 100k thermistor (temperature sensor number 1).The same thing happened so I can confirm that this issue is not connected with the temperature sensor number 66. I did not know it previously. I am using my extruder with temperature sensor number 66 as my default, therefore I posted it here. EDIT: I also tried the RCBugFix branch from MarlinFirmware and the same problem occurs also there. |
c66655d
to
182c8d7
Compare
@Edie47 So, when you switch extruders, the target temperature on the display actually changes (immediately) too? I recently merged some additional changes into |
@thinkyhead Yes, when I switch the extruders, the temperature on the display changes. Hope it helps. I have found a compilation error when #define MILLISECONDS_PREHEAT_TIME is uncommented in Configuration_adv.h. The problem was in temperature.h I corrected it. Take a look at my last commit of RCBugFix branch that I used for the test. |
Replace hotend with HOTEND_INDEX instead of e. static void setTargetHotend(const float& celsius, uint8_t e) {
#if HOTENDS == 1
UNUSED(e);
#endif
#ifdef MILLISECONDS_PREHEAT_TIME
if (celsius == 0.0f)
- reset_preheat_time(hotend);
- else if (target_temperature[hotend] == 0.0f)
- start_preheat_time(hotend);
+ reset_preheat_time(HOTEND_INDEX);
+ else if (target_temperature[HOTEND_INDEX] == 0.0f)
+ start_preheat_time(HOTEND_INDEX);
#endif
target_temperature[HOTEND_INDEX] = celsius;
#if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0
start_watching_heater(HOTEND_INDEX);
#endif
} |
I did. Unfortunately, it did not help. |
Hmm, i thought so. There is more of this kind - somewhere. I'm still searching. |
I tried now this. I turned on the printer. Then I sent the command M104 S190 T1. Waited for the temperature to get steady at 190°C. Then I extruded 10mm. After that, the temperature immediately increased and started floating between 198 and 205. |
UPDATE: Commenting PID_ADD_EXTRUSION_RATE problem is gone and temperature is OK. |
temperature.cpp
! @thinkyhead #if ENABLED(PID_ADD_EXTRUSION_RATE)
cTerm[HOTEND_INDEX] = 0;
if (_HOTEND_TEST) {
long e_position = stepper.position(E_AXIS);
if (e_position > last_position[_HOTEND_EXTRUDER]) {
lpq[lpq_ptr++] = e_position - last_position[_HOTEND_EXTRUDER];
last_position[_HOTEND_EXTRUDER] = e_position;
}
else {
lpq[lpq_ptr++] = 0;
}
if (lpq_ptr >= lpq_len) lpq_ptr = 0;
cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX);
pid_output += cTerm[HOTEND_INDEX];
}
#endif //PID_ADD_EXTRUSION_RATE |
If we want an average over the last few seconds her, a construct like:
would make more sense. But temperature systems are slow. It makes much more sense to push all the energy needed as fast as possible. The slowness of the energy transfer will do the averaging anyway. Only if
or something like that. |
I suggest to disable |
Good catches. I rechecked, and I think that's the last place where I'll see about disabling And yes, that is strange to have a ring buffer that only ever reads or writes the last value written. My assumption would be that it was intended to read from "some time in the recent past" and calculate based on that, to introduce a delay. But if it's not doing anything like that, well it's odd! |
The reason that |
So, I peeked at the lpq[lpq_ptr++] = 0;
}
// After incrementing above, lpq_ptr now points at the "next" value (the oldest one)
if (lpq_ptr >= lpq_len) lpq_ptr = 0;
cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] / planner.axis_steps_per_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX); |
Ah. Ok. Now the code seems to be correct. If it makes sense to use a delay is still questionable. Also if a experimental feature should be enabled by default. |
I tested #4278 and the temperature regulation works fine. The problem is gone. 👍 Good job. |
Thanks for the feedback. |
Is it possible to create a material Kc auto-tune function? So turn on and off the extruder while monitoring the temperature change rate. That way variances in material can be compensated for as at the time you are changing a spool of filament (heat up hot end, feed filament a few mm, then run filament auto-tune. Some wasted filament, but if it works, much better heat control. |
@mjmeans |
The idea "heat more when we have to melt more material" is simple. To find out, when exactly to heat more and how much exactly, to not make things worse, is a relative complex problem. |
So… Do we agree it is best to disable by default? If so, renaming the option can help to ensure configurations are updated. #if defined(PID_ADD_EXTRUSION_RATE)
#error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration."
#endif |
Perhaps it's as simple as running M303 again while extruding at a near max rate to arrive at new PID values, then interpolating based on amount about to be extruded. |
@mjmeans The PID tuning function could get as detailed as we want. In the long run, it may be possible to introduce logic that adapts to fluctuations in temperature using a "dynamic hedging" algorithm. Either way, this constitutes a Feature Request and we should add it to our list of things to do for Marlin 1.2. |
@thinkyhead |
Rebase, squash, cleanup, and improvement of #4098.
This is a follow up of : #2915 and #2941 (since changes that were made in MarlinDev are brought back in Marlin)
These modifications allow the use of high temperature thermistors in order to handle hot ends temperature up to 500 degrees Celsius.
Because thermistors able to read higher temperature tend to have a hard time reading lower values, two "defines" were added to allow a "preheating time" as well as handle some measure of noise reading (sudden drops for a few frames).
These defines have been added to the default configuration. Using another configuration or commenting these additions produce the same execution than before these changes.
A high temperature compatible thermistor has been added (no 66) to the thermistor table
The tests were taken from #2066
The hardware was : Board: Arduino MEGA2560 with RAMPS 1.4
Dyze Design sensor 500°C
HEATER_0_MINTEMP 21
MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED = 5;
MILLISECONDS_PREHEAT_TIME = 20000;
TEST 7 - Hotend's thermistor disconnected before startup
No error is shown. Temperature shown is 20°C, 1°C below the mintemp error.
Since the conditions «is preheating» and «target temperature > 0» is not met, the min_temp error is not shown as it would normally be.
TEST 9 - Hotend's thermistor disconnected after heating begins AND before (preheating time) seconds elapsed
Heater remains ON for the duration of "preheating time". Turns OFF once the duration is elapsed.
TEST 11 - Hotend's thermistor disconnected after heating begins AND after (preheating time) seconds elapsed
Min_temp error, heater is disabled.
TEST 13 - Hotend's thermistor disconnected after target temperature reached.
Min_temp error, heater is disabled.