Skip to content
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

A different heater check (V3) #2231

Closed
wants to merge 1 commit into from
Closed

A different heater check (V3) #2231

wants to merge 1 commit into from

Conversation

AnHardt
Copy link
Member

@AnHardt AnHardt commented Jun 2, 2015

Based on an idea by @nophead:

  • If a heater is full on the temperature shall not decrease;
  • If a heater is full off the temperature shall not rise;
    The test is made after a delay to give the heater time to react
    and only when above a settable ambient temperature.

A test(by @AnHardt)for sudden temperature jumps is integrated.
If thermal systems are inert.

  • If a temperature is jumping something is wrong.

All this is accomplished by noise on the thermometers

Some more explanations in Configuration_adv.h
A proposal for a setup-guide in the next comment.

Based on an idea by @nophead:
* If a heater is full on the temperature shall not decrease;
* If a heater is full off the temperature shall not rise;
The test is made after a delay to give the heater time to react
and only when above a settable ambient temperature.

A test(by @AnHardt)for sudden temperature jumps is integrated.
If thermal systems are inert.
*  If a temperature is jumping something is wrong.

All this is accomplished by noise on the thermometers

Some more explanations in `Configuration_adv.h`
A proposal for a setup-guide in the next comment.
@AnHardt
Copy link
Member Author

AnHardt commented Jun 2, 2015

Strategy to tune (set up) the new test.

1.) Turn off THERMAL_PROTECTION_HOTENDS and THERMAL_PROTECTION_BED in Configuration.h.
We don't want to see what they may detect - we want to see what the new function does.

2.) In Configuration_adv.h turn on the new functions by setting MAX_TEMP_OVERSTOOT_TIME to value different from 0.
The correct value you can find by setting a high target value to the heater but turning it off when MAX_AMBIENT_TEMPERATURE (50°C) is reached.
The time between turning off and changing direction of the measured temperature is MAX_TEMP_OVERSTOOT_TIME. A smaller value is saver but may give false positives.

3.) Turn on HEATER_STATE_DEBUG to see what's going on.

4.) Don't heat any heater but observe the output of HEATER_STATE_DEBUG on the serial console.

...
echo:SD card ok
Temperature: 0 count: 127 Temp.: 984 Temp.A.:0 Heater: 0 T_State: 0 Time:4294965691 H_State:1
Temperature: 1 count: 127 Temp.: 108 Temp.A.:0 Heater: 1 T_State: 0 Time:4294965687 H_State:1
Temperature: 0 count: 0 Temp.: 984 Temp.A.:984 Heater: 0 T_State: 0 Time:29916 H_State:2
Temperature: 1 count: 0 Temp.: 108 Temp.A.:108 Heater: 1 T_State: 0 Time:29917 H_State:2
...
Temperature: 1 count: 0 Temp.: 99 Temp.A.:107 Heater: 1 T_State: 0 Time:27630 H_State:2
Temperature: 0 count: 0 Temp.: 983 Temp.A.:983 Heater: 0 T_State: 0 Time:27433 H_State:2
Temperature: 1 count: -1 Temp.: 99 Temp.A.:107 Heater: 1 T_State: 0 Time:27434 H_State:2
Temperature: 0 count: 0 Temp.: 984 Temp.A.:983 Heater: 0 T_State: 0 Time:27236 H_State:2
Temperature: 1 count: -2 Temp.: 108 Temp.A.:106 Heater: 1 T_State: 0 Time:27237 H_State:2
Temperature: 0 count: 0 Temp.: 983 Temp.A.:984 Heater: 0 T_State: 0 Time:27039 H_State:2
Temperature: 1 count: 0 Temp.: 108 Temp.A.:106 Heater: 1 T_State: 0 Time:27040 H_State:2
...

Temperature: 0 -> bed
Temperature: 1 -> heater 0
count: 127 -> not initialized
count: 0 -> initialized
Temp.: 984 -> readout of a normal thermistor at room temperature
Temp.: 108 -> readout of a MAX 6675 at room temperature
Temp.A.:0 -> Average temperature not initialized
Temp.A.:984 -> Average temperature readout for the last 16 readouts - thermistor
Temp.A.:108 -> Average temperature readout for the last 16 readouts - MAX6675

Now some noise:

Temperature: 1 count: -1 Temp.: 99 Temp.A.:107 -> at this moment Temp. (99) was smaller than Temp.A.-TEMP_RAW_NOISE (106-6) so the counter is decreased.
Temperature: 1 count: -2 Temp.: 108 Temp.A.:106 -> the temperatures are close together again - the counter will be reset.
Temperature: 1 count: 0 Temp.: 108 Temp.A.:106 -> ok again

5.) Find a value for TEMP_RAW_NOISE where the count stays between -2 and 2, than add a bit.
Now try to produce noise by switching on/off lights, fans, play with the display, machines close by, maybe an other heater.
Count should not grow above +-2.
(For a 25° thermistor test above 25° - else you'll not see any noise at all.)

6.) Set TEMP_CONSEC_COUNT to a value the count NEVER can reach by noise. If set to low, you may get false positives.

7.) For MAX_AMBIENT_TEMPERATURE 50° is a good value to start with. A extruder heaters temperature may not fall below this, placed above a working heated bed.

8.) To adjust MAX_THERMO_JUMP_AMOUNT take a look on your Temp.: readings at room temperature. Take the difference to 1024 and to 0. The smaller difference is the maximum jump the value can make in this direction. To detect an error in worse conditions make MAX_THERMO_JUMP_AMOUNT the half of the smaller difference. The value must be higher than TEMP_RAW_NOISE. If the difference/2 is smaller than TEMP_RAW_NOISE take TEMP_RAW_NOISE+2. The fastest "normal" change is about full_range in one minute with about 5 readings per second (1024/60/5 = 3). Due to non-linearitys of the thermistor table the change my be a bit faster.

9.) Tests
Extruders and the bed are handled the same for this tests. So the results should be the same.
In various states,

  • Disconnect the sensor,
  • Short the sensor,
  • Disconnect the heater or the main power supply.

10.) Disable HEATER_STATE_DEBUG
11.) Reenable THERMAL_PROTECTION_HOTENDS and THERMAL_PROTECTION_BED in Configuration.h.

@clefranc
Copy link
Contributor

clefranc commented Jun 2, 2015

@AnHardt Will test it after my 5 h print....

@AnHardt AnHardt added Needs: Testing Testing is needed for this change Needs: More Data We need more data in order to proceed PR: New Feature labels Jun 2, 2015
@boelle
Copy link
Contributor

boelle commented Jun 27, 2015

Please rebase, the code cant be merged as is

@AnHardt AnHardt closed this Jun 29, 2015
@AnHardt AnHardt deleted the heatertest_again branch June 29, 2015 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: More Data We need more data in order to proceed Needs: Testing Testing is needed for this change PR: New Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants