浏览代码

Fix a bug where the PID controllers D action kicks in hard as soon as the PID controller starts.

daid 12 年前
父节点
当前提交
a504c88346
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      Marlin/temperature.cpp

+ 1
- 2
Marlin/temperature.cpp 查看文件

436
           //K1 defined in Configuration.h in the PID settings
436
           //K1 defined in Configuration.h in the PID settings
437
           #define K2 (1.0-K1)
437
           #define K2 (1.0-K1)
438
           dTerm[e] = (Kd * (pid_input - temp_dState[e]))*K2 + (K1 * dTerm[e]);
438
           dTerm[e] = (Kd * (pid_input - temp_dState[e]))*K2 + (K1 * dTerm[e]);
439
-          temp_dState[e] = pid_input;
440
-
441
           pid_output = constrain(pTerm[e] + iTerm[e] - dTerm[e], 0, PID_MAX);
439
           pid_output = constrain(pTerm[e] + iTerm[e] - dTerm[e], 0, PID_MAX);
442
         }
440
         }
441
+        temp_dState[e] = pid_input;
443
     #else 
442
     #else 
444
           pid_output = constrain(target_temperature[e], 0, PID_MAX);
443
           pid_output = constrain(target_temperature[e], 0, PID_MAX);
445
     #endif //PID_OPENLOOP
444
     #endif //PID_OPENLOOP

正在加载...
取消
保存