Skip to content

Commit

Permalink
Rebase update REVO and solve @wavexx comments
Browse files Browse the repository at this point in the history
  • Loading branch information
3d-gussner committed Jul 25, 2023
1 parent 8ae0e19 commit 6feab85
Show file tree
Hide file tree
Showing 14 changed files with 133 additions and 133 deletions.
2 changes: 1 addition & 1 deletion Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7332,7 +7332,7 @@ SERIAL_PROTOCOLPGM("\n\n");

#ifdef THERMAL_MODEL
/*!
### M310 - Thermal model settings <a href="https://reprap.org/wiki/G-code#M310:_Themal_model_settings">M310: Thermal model settings</a>
### M310 - Thermal model settings <a href="https://reprap.org/wiki/G-code#M310:_Thermal_model_settings">M310: Thermal model settings</a>
#### Usage
M310 ; report values
Expand Down
6 changes: 3 additions & 3 deletions Firmware/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ extern uint8_t menu_depth;
//! definition of reasons blocking the main menu
//! Use them as bit mask, so that the code may set various errors at the same time
enum ESeriousErrors {
MENU_BLOCK_NONE = 0,
MENU_BLOCK_THERMAL_ERROR = 0x01,
MENU_BLOCK_NONE = 0,
MENU_BLOCK_THERMAL_ERROR = 0x01,
#ifdef THERMAL_MODEL
MENU_BLOCK_THERMAL_MODEL_AUTOTUNE = 0x02,
#endif
MENU_BLOCK_STATUS_SCREEN_M0 = 0x04,
MENU_BLOCK_STATUS_SCREEN_M0 = 0x04,
}; // and possibly others in the future.

//! this is a flag for disabling entering the main menu and longpress. If this is set to anything !=
Expand Down
19 changes: 0 additions & 19 deletions Firmware/temp_model/e3d_REVO.h

This file was deleted.

19 changes: 0 additions & 19 deletions Firmware/temp_model/e3d_REVO_HF_60W.h

This file was deleted.

8 changes: 4 additions & 4 deletions Firmware/thermal_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ struct model_data
{
// temporary buffers
float dT_lag_buf[THERMAL_MODEL_MAX_LAG_SIZE]; // transport delay buffer
uint8_t dT_lag_size = 0; // transport delay buffer size
uint8_t dT_lag_idx = 0; // transport delay buffer index
float dT_err_prev = 0; // previous temperature delta error
float T_prev = 0; // last temperature extruder
uint8_t dT_lag_size = 0; // transport delay buffer size
uint8_t dT_lag_idx = 0; // transport delay buffer index
float dT_err_prev = 0; // previous temperature delta error
float T_prev = 0; // last temperature extruder

// configurable parameters
float P; // heater power (W)
Expand Down
19 changes: 19 additions & 0 deletions Firmware/thermal_model/e3d_REVO.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#define THERMAL_MODEL_E3D_REVO_VER 1 // model parameters version

#define THERMAL_MODEL_E3D_REVO_P 40. // heater power (W)
#define THERMAL_MODEL_E3D_REVO_U -0.0014 // linear temperature coefficient (W/K/power)
#define THERMAL_MODEL_E3D_REVO_V 1.05 // linear temperature intercept (W/power)

#define THERMAL_MODEL_E3D_REVO_C 8.77 // initial guess for heatblock capacitance (J/K)
#define THERMAL_MODEL_E3D_REVO_R 25.3 // initial guess for heatblock resistance (K/W)

#define THERMAL_MODEL_E3D_REVO_fS 0.15 // sim. 1st order IIR filter factor (f=100/27)
#define THERMAL_MODEL_E3D_REVO_LAG 270 // sim. response lag (ms, 0-2160)

#define THERMAL_MODEL_E3D_REVO_W 0.85 // Default warning threshold (K/s)
#define THERMAL_MODEL_E3D_REVO_E 1.23 // Default error threshold (K/s)

// fall-back resistance vector (R0-15)
#define THERMAL_MODEL_E3D_REVO_Rv {THERMAL_MODEL_E3D_REVO_R, 23.9, 22.5, 19.6, 19.0, 18.3, 17.7, 17.1, 16.8, 16.5, 16.3, 16.0, 15.9, 15.7, 15.6, 15.4}
19 changes: 19 additions & 0 deletions Firmware/thermal_model/e3d_REVO_HF_60W.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#define THERMAL_MODEL_E3D_REVO_HF_60W_VER 1 // model parameters version

#define THERMAL_MODEL_E3D_REVO_HF_60W_P 60. // heater power (W)
#define THERMAL_MODEL_E3D_REVO_HF_60W_U -0.0014 // linear temperature coefficient (W/K/power)
#define THERMAL_MODEL_E3D_REVO_HF_60W_V 1.05 // linear temperature intercept (W/power)

#define THERMAL_MODEL_E3D_REVO_HF_60W_C 9.10 // initial guess for heatblock capacitance (J/K)
#define THERMAL_MODEL_E3D_REVO_HF_60W_R 30.6 // initial guess for heatblock resistance (K/W)

#define THERMAL_MODEL_E3D_REVO_HF_60W_fS 0.15 // sim. 1st order IIR filter factor (f=100/27)
#define THERMAL_MODEL_E3D_REVO_HF_60W_LAG 270 // sim. response lag (ms, 0-2160)

#define THERMAL_MODEL_E3D_REVO_HF_60W_W 0.85 // Default warning threshold (K/s)
#define THERMAL_MODEL_E3D_REVO_HF_60W_E 1.23 // Default error threshold (K/s)

// fall-back resistance vector (R0-15)
#define THERMAL_MODEL_E3D_REVO_HF_60W_Rv {THERMAL_MODEL_E3D_REVO_HF_60W_R, 29.0, 27.5, 24.5, 23.4, 22.3, 21.2, 20.2, 19.8, 19.4, 19.0, 18.6, 18.3, 18.1, 17.9, 17.7}
2 changes: 1 addition & 1 deletion Firmware/ultralcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ enum class WizState : uint8_t
Xyz, //!< xyz calibration
Z, //!< z calibration
#ifdef THERMAL_MODEL
ThermalModel, //!< Thermal Model calibration
ThermalModel, //!< Thermal Model calibration
#endif //THERMAL_MODEL
IsFil, //!< Is filament loaded? First step of 1st layer calibration
Preheat, //!< Preheat for any material
Expand Down
12 changes: 6 additions & 6 deletions Firmware/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ extern void ip4_to_str(char* dest, uint8_t* IP);
// Calibration status of the machine
// (unsigned char*)EEPROM_CALIBRATION_STATUS_V2
typedef uint8_t CalibrationStatus;
const CalibrationStatus CALIBRATION_STATUS_SELFTEST = 0b00000001; // Selftest
const CalibrationStatus CALIBRATION_STATUS_XYZ = 0b00000010; // XYZ calibration
const CalibrationStatus CALIBRATION_STATUS_Z = 0b00000100; // Z calibration
const CalibrationStatus CALIBRATION_STATUS_SELFTEST = 0b00000001; // Selftest
const CalibrationStatus CALIBRATION_STATUS_XYZ = 0b00000010; // XYZ calibration
const CalibrationStatus CALIBRATION_STATUS_Z = 0b00000100; // Z calibration
#ifdef THERMAL_MODEL
const CalibrationStatus CALIBRATION_STATUS_THERMAL_MODEL = 0b00001000; // Thermal model calibration
const CalibrationStatus CALIBRATION_STATUS_THERMAL_MODEL = 0b00001000; // Thermal model calibration
#endif
const CalibrationStatus CALIBRATION_STATUS_LIVE_ADJUST = 0b00010000; // 1st layer calibration
const CalibrationStatus CALIBRATION_STATUS_UNKNOWN = 0b10000000; // Freshly assembled or unknown status
const CalibrationStatus CALIBRATION_STATUS_LIVE_ADJUST = 0b00010000; // 1st layer calibration
const CalibrationStatus CALIBRATION_STATUS_UNKNOWN = 0b10000000; // Freshly assembled or unknown status

// Calibration steps performed by the wizard
const CalibrationStatus CALIBRATION_WIZARD_STEPS =
Expand Down
30 changes: 15 additions & 15 deletions Firmware/variants/1_75mm_MK3-EINSy10a-E3DREVO.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,26 +381,26 @@
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45

// model-based temperature check
#define TEMP_MODEL 1 // enable model-based temperature checks
#define TEMP_MODEL_DEBUG 1 // extended runtime logging
#define THERMAL_MODEL 1 // enable model-based temperature checks
#define THERMAL_MODEL_DEBUG 1 // extended runtime logging

#define TEMP_MODEL_CAL_C_low 5 // C estimation lower limit
#define TEMP_MODEL_CAL_C_high 20 // C estimation upper limit
#define TEMP_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define TEMP_MODEL_CAL_C_itr 30 // C estimation iteration limit
#define THERMAL_MODEL_CAL_C_low 5 // C estimation lower limit
#define THERMAL_MODEL_CAL_C_high 20 // C estimation upper limit
#define THERMAL_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define THERMAL_MODEL_CAL_C_itr 30 // C estimation iteration limit

#define TEMP_MODEL_CAL_R_low 5 // R estimation lower limit
#define TEMP_MODEL_CAL_R_high 50 // R estimation upper limit
#define TEMP_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define TEMP_MODEL_CAL_R_itr 30 // R estimation iteration limit
#define THERMAL_MODEL_CAL_R_low 5 // R estimation lower limit
#define THERMAL_MODEL_CAL_R_high 50 // R estimation upper limit
#define THERMAL_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define THERMAL_MODEL_CAL_R_itr 30 // R estimation iteration limit

#define TEMP_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define TEMP_MODEL_CAL_T_high 230 // Default calibration working temperature (C)
#define THERMAL_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define THERMAL_MODEL_CAL_T_high 230 // Default calibration working temperature (C)

#define TEMP_MODEL_Ta_corr -7 // Default ambient temperature correction
#define THERMAL_MODEL_Ta_corr -7 // Default ambient temperature correction

#include "temp_model/e3d_REVO.h"
#define TEMP_MODEL_DEFAULT E3D_REVO // Default E3D REVO model parameters
#include "thermal_model/e3d_REVO.h"
#define THERMAL_MODEL_DEFAULT E3D_REVO // Default E3D REVO model parameters


/*------------------------------------
Expand Down
30 changes: 15 additions & 15 deletions Firmware/variants/1_75mm_MK3-EINSy10a-E3DREVO_HF_60W.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,26 +382,26 @@
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45

// model-based temperature check
#define TEMP_MODEL 1 // enable model-based temperature checks
#define TEMP_MODEL_DEBUG 1 // extended runtime logging
#define THERMAL_MODEL 1 // enable model-based temperature checks
#define THERMAL_MODEL_DEBUG 1 // extended runtime logging

#define TEMP_MODEL_CAL_C_low 5 // C estimation lower limit
#define TEMP_MODEL_CAL_C_high 20 // C estimation upper limit
#define TEMP_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define TEMP_MODEL_CAL_C_itr 30 // C estimation iteration limit
#define THERMAL_MODEL_CAL_C_low 5 // C estimation lower limit
#define THERMAL_MODEL_CAL_C_high 20 // C estimation upper limit
#define THERMAL_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define THERMAL_MODEL_CAL_C_itr 30 // C estimation iteration limit

#define TEMP_MODEL_CAL_R_low 5 // R estimation lower limit
#define TEMP_MODEL_CAL_R_high 50 // R estimation upper limit
#define TEMP_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define TEMP_MODEL_CAL_R_itr 30 // R estimation iteration limit
#define THERMAL_MODEL_CAL_R_low 5 // R estimation lower limit
#define THERMAL_MODEL_CAL_R_high 50 // R estimation upper limit
#define THERMAL_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define THERMAL_MODEL_CAL_R_itr 30 // R estimation iteration limit

#define TEMP_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define TEMP_MODEL_CAL_T_high 230 // Default calibration working temperature (C)
#define THERMAL_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define THERMAL_MODEL_CAL_T_high 230 // Default calibration working temperature (C)

#define TEMP_MODEL_Ta_corr -7 // Default ambient temperature correction
#define THERMAL_MODEL_Ta_corr -7 // Default ambient temperature correction

#include "temp_model/e3d_REVO_HF_60W.h"
#define TEMP_MODEL_DEFAULT E3D_REVO_HF_60W // Default E3D REVO HF 60W model parameters
#include "thermal_model/e3d_REVO_HF_60W.h"
#define THERMAL_MODEL_DEFAULT E3D_REVO_HF_60W // Default E3D REVO HF 60W model parameters


/*------------------------------------
Expand Down
30 changes: 15 additions & 15 deletions Firmware/variants/1_75mm_MK3S-EINSy10a-E3DREVO.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,26 +385,26 @@
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45

// model-based temperature check
#define TEMP_MODEL 1 // enable model-based temperature checks
#define TEMP_MODEL_DEBUG 1 // extended runtime logging
#define THERMAL_MODEL 1 // enable model-based temperature checks
#define THERMAL_MODEL_DEBUG 1 // extended runtime logging

#define TEMP_MODEL_CAL_C_low 5 // C estimation lower limit
#define TEMP_MODEL_CAL_C_high 20 // C estimation upper limit
#define TEMP_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define TEMP_MODEL_CAL_C_itr 30 // C estimation iteration limit
#define THERMAL_MODEL_CAL_C_low 5 // C estimation lower limit
#define THERMAL_MODEL_CAL_C_high 20 // C estimation upper limit
#define THERMAL_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define THERMAL_MODEL_CAL_C_itr 30 // C estimation iteration limit

#define TEMP_MODEL_CAL_R_low 5 // R estimation lower limit
#define TEMP_MODEL_CAL_R_high 50 // R estimation upper limit
#define TEMP_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define TEMP_MODEL_CAL_R_itr 30 // R estimation iteration limit
#define THERMAL_MODEL_CAL_R_low 5 // R estimation lower limit
#define THERMAL_MODEL_CAL_R_high 50 // R estimation upper limit
#define THERMAL_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define THERMAL_MODEL_CAL_R_itr 30 // R estimation iteration limit

#define TEMP_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define TEMP_MODEL_CAL_T_high 230 // Default calibration working temperature (C)
#define THERMAL_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define THERMAL_MODEL_CAL_T_high 230 // Default calibration working temperature (C)

#define TEMP_MODEL_Ta_corr -7 // Default ambient temperature correction
#define THERMAL_MODEL_Ta_corr -7 // Default ambient temperature correction

#include "temp_model/e3d_REVO.h"
#define TEMP_MODEL_DEFAULT E3D_REVO // Default E3D REVO model parameters
#include "thermal_model/e3d_REVO.h"
#define THERMAL_MODEL_DEFAULT E3D_REVO // Default E3D REVO model parameters


/*------------------------------------
Expand Down
30 changes: 15 additions & 15 deletions Firmware/variants/1_75mm_MK3S-EINSy10a-E3DREVO_HF_60W.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,26 +386,26 @@
#define TEMP_RUNAWAY_EXTRUDER_TIMEOUT 45

// model-based temperature check
#define TEMP_MODEL 1 // enable model-based temperature checks
#define TEMP_MODEL_DEBUG 1 // extended runtime logging
#define THERMAL_MODEL 1 // enable model-based temperature checks
#define THERMAL_MODEL_DEBUG 1 // extended runtime logging

#define TEMP_MODEL_CAL_C_low 5 // C estimation lower limit
#define TEMP_MODEL_CAL_C_high 20 // C estimation upper limit
#define TEMP_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define TEMP_MODEL_CAL_C_itr 30 // C estimation iteration limit
#define THERMAL_MODEL_CAL_C_low 5 // C estimation lower limit
#define THERMAL_MODEL_CAL_C_high 20 // C estimation upper limit
#define THERMAL_MODEL_CAL_C_thr 0.01 // C estimation iteration threshold
#define THERMAL_MODEL_CAL_C_itr 30 // C estimation iteration limit

#define TEMP_MODEL_CAL_R_low 5 // R estimation lower limit
#define TEMP_MODEL_CAL_R_high 50 // R estimation upper limit
#define TEMP_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define TEMP_MODEL_CAL_R_itr 30 // R estimation iteration limit
#define THERMAL_MODEL_CAL_R_low 5 // R estimation lower limit
#define THERMAL_MODEL_CAL_R_high 50 // R estimation upper limit
#define THERMAL_MODEL_CAL_R_thr 0.01 // R estimation iteration threshold
#define THERMAL_MODEL_CAL_R_itr 30 // R estimation iteration limit

#define TEMP_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define TEMP_MODEL_CAL_T_high 230 // Default calibration working temperature (C)
#define THERMAL_MODEL_CAL_T_low 50 // Default calibration cooling temperature (C)
#define THERMAL_MODEL_CAL_T_high 230 // Default calibration working temperature (C)

#define TEMP_MODEL_Ta_corr -7 // Default ambient temperature correction
#define THERMAL_MODEL_Ta_corr -7 // Default ambient temperature correction

#include "temp_model/e3d_REVO_HF_60W.h"
#define TEMP_MODEL_DEFAULT E3D_REVO_HF_60W // Default E3D REVO HF 60W model parameters
#include "thermal_model/e3d_REVO_HF_60W.h"
#define THERMAL_MODEL_DEFAULT E3D_REVO_HF_60W // Default E3D REVO HF 60W model parameters


/*------------------------------------
Expand Down
Loading

0 comments on commit 6feab85

Please sign in to comment.