Преглед на файлове

Merge pull request #727 from drf5n/oversampling

temperature.cpp: Actually use OVERSAMPLENR in the oversampling calculation.
ErikZalm преди 11 години
родител
ревизия
0d81ae77bc
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1
    1
      Marlin/Configuration.h
  2. 1
    1
      Marlin/temperature.cpp

+ 1
- 1
Marlin/Configuration.h Целия файл

@@ -168,7 +168,7 @@
168 168
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
169 169
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
170 170
   #define K1 0.95 //smoothing factor within the PID
171
-  #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
171
+  #define PID_dT ((OVERSAMPLENR * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
172 172
 
173 173
 // If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
174 174
 // Ultimaker

+ 1
- 1
Marlin/temperature.cpp Целия файл

@@ -1190,7 +1190,7 @@ ISR(TIMER0_COMPB_vect)
1190 1190
 //      break;
1191 1191
   }
1192 1192
     
1193
-  if(temp_count >= 16) // 8 ms * 16 = 128ms.
1193
+  if(temp_count >= OVERSAMPLENR) // 8 * 16 * 1/(16000000/64/256)  = 131ms.
1194 1194
   {
1195 1195
     if (!temp_meas_ready) //Only update the raw values if they have been read. Else we could be updating them during reading.
1196 1196
     {

Loading…
Отказ
Запис