Przeglądaj źródła

preliminiary implementation for the early heating finish.

Might be replaced by something more clever, e.g. by erik, and does not yet support the second extruder or the bed.
its kind of not so cool, because you need 6 more ints.
Maybe isheating() should use the degrees directly, as it is not used in time-critical anyways.
Then it would be much easier. to have the offsets without additional variables.
Bernhard 13 lat temu
rodzic
commit
59205ac5fc
3 zmienionych plików z 8 dodań i 2 usunięć
  1. 2
    0
      Marlin/Configuration.h
  2. 2
    0
      Marlin/temperature.cpp
  3. 4
    2
      Marlin/temperature.h

+ 2
- 0
Marlin/Configuration.h Wyświetl plik

91
 // if CooldownNoWait is defined M109 will not wait for the cooldown to finish
91
 // if CooldownNoWait is defined M109 will not wait for the cooldown to finish
92
 #define CooldownNoWait true
92
 #define CooldownNoWait true
93
 
93
 
94
+// Heating is finished if a temperature close to this degree shift is reached
95
+#define HEATING_EARLY_FINISH_DEG_OFFSET 1 //Degree
94
 // PID settings:
96
 // PID settings:
95
 // Uncomment the following line to enable PID support.
97
 // Uncomment the following line to enable PID support.
96
   
98
   

+ 2
- 0
Marlin/temperature.cpp Wyświetl plik

43
 //===========================================================================
43
 //===========================================================================
44
 int target_raw[3] = {0, 0, 0};
44
 int target_raw[3] = {0, 0, 0};
45
 int current_raw[3] = {0, 0, 0};
45
 int current_raw[3] = {0, 0, 0};
46
+int heatingtarget_raw[3]= {0, 0, 0};
47
+
46
 
48
 
47
 #ifdef PIDTEMP
49
 #ifdef PIDTEMP
48
   
50
   

+ 4
- 2
Marlin/temperature.h Wyświetl plik

41
 float analog2temp(int raw);
41
 float analog2temp(int raw);
42
 float analog2tempBed(int raw);
42
 float analog2tempBed(int raw);
43
 extern int target_raw[3];  
43
 extern int target_raw[3];  
44
+extern int heatingtarget_raw[3];
44
 extern int current_raw[3];
45
 extern int current_raw[3];
45
 extern float Kp,Ki,Kd,Kc;
46
 extern float Kp,Ki,Kd,Kc;
46
 
47
 
79
 FORCE_INLINE void setTargetHotend0(const float &celsius) 
80
 FORCE_INLINE void setTargetHotend0(const float &celsius) 
80
 {  
81
 {  
81
   target_raw[TEMPSENSOR_HOTEND_0]=temp2analog(celsius);
82
   target_raw[TEMPSENSOR_HOTEND_0]=temp2analog(celsius);
83
+  heatingtarget_raw[TEMPSENSOR_HOTEND_0]=temp2analog(celsius-HEATING_EARLY_FINISH_DEG_OFFSET);
82
   #ifdef PIDTEMP
84
   #ifdef PIDTEMP
83
     pid_setpoint = celsius;
85
     pid_setpoint = celsius;
84
   #endif //PIDTEMP
86
   #endif //PIDTEMP
90
 };
92
 };
91
 FORCE_INLINE void setTargetBed(const float &celsius)     {  target_raw[TEMPSENSOR_BED     ]=temp2analogBed(celsius);};
93
 FORCE_INLINE void setTargetBed(const float &celsius)     {  target_raw[TEMPSENSOR_BED     ]=temp2analogBed(celsius);};
92
 
94
 
93
-FORCE_INLINE bool isHeatingHotend0() {return target_raw[TEMPSENSOR_HOTEND_0] > current_raw[TEMPSENSOR_HOTEND_0];};
95
+FORCE_INLINE bool isHeatingHotend0() {return heatingtarget_raw[TEMPSENSOR_HOTEND_0] > current_raw[TEMPSENSOR_HOTEND_0];};
94
 FORCE_INLINE bool isHeatingHotend1() {return target_raw[TEMPSENSOR_HOTEND_1] > current_raw[TEMPSENSOR_HOTEND_1];};
96
 FORCE_INLINE bool isHeatingHotend1() {return target_raw[TEMPSENSOR_HOTEND_1] > current_raw[TEMPSENSOR_HOTEND_1];};
95
 FORCE_INLINE float isHeatingHotend(uint8_t extruder){  
97
 FORCE_INLINE float isHeatingHotend(uint8_t extruder){  
96
-  if(extruder == 0) return target_raw[TEMPSENSOR_HOTEND_0] > current_raw[TEMPSENSOR_HOTEND_0];
98
+  if(extruder == 0) return heatingtarget_raw[TEMPSENSOR_HOTEND_0] > current_raw[TEMPSENSOR_HOTEND_0];
97
   if(extruder == 1) return target_raw[TEMPSENSOR_HOTEND_1] > current_raw[TEMPSENSOR_HOTEND_1];
99
   if(extruder == 1) return target_raw[TEMPSENSOR_HOTEND_1] > current_raw[TEMPSENSOR_HOTEND_1];
98
 };
100
 };
99
 FORCE_INLINE bool isHeatingBed() {return target_raw[TEMPSENSOR_BED] > current_raw[TEMPSENSOR_BED];};
101
 FORCE_INLINE bool isHeatingBed() {return target_raw[TEMPSENSOR_BED] > current_raw[TEMPSENSOR_BED];};

Ładowanie…
Anuluj
Zapisz