Browse Source

heater power repair.

Bernhard Kubicek 13 years ago
parent
commit
ff592b056a
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      Marlin/temperature.cpp

+ 3
- 2
Marlin/temperature.cpp View File

156
             pTerm+=Kc*current_block->speed_e; //additional heating if extrusion speed is high
156
             pTerm+=Kc*current_block->speed_e; //additional heating if extrusion speed is high
157
           #endif
157
           #endif
158
           pid_output = constrain(pTerm + iTerm - dTerm, 0, PID_MAX);
158
           pid_output = constrain(pTerm + iTerm - dTerm, 0, PID_MAX);
159
-          HeaterPower=pid_output;
159
+          
160
         }
160
         }
161
     #endif //PID_OPENLOOP
161
     #endif //PID_OPENLOOP
162
     #ifdef PID_DEBUG
162
     #ifdef PID_DEBUG
163
      //SERIAL_ECHOLN(" PIDDEBUG Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm<<" iTerm "<<iTerm<<" dTerm "<<dTerm);  
163
      //SERIAL_ECHOLN(" PIDDEBUG Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm<<" iTerm "<<iTerm<<" dTerm "<<dTerm);  
164
     #endif //PID_DEBUG
164
     #endif //PID_DEBUG
165
+    HeaterPower=pid_output;
165
     analogWrite(HEATER_0_PIN, pid_output);
166
     analogWrite(HEATER_0_PIN, pid_output);
166
   #endif //PIDTEMP
167
   #endif //PIDTEMP
167
 
168
 
250
 
251
 
251
     return (1023 * OVERSAMPLENR) - raw;
252
     return (1023 * OVERSAMPLENR) - raw;
252
   #elif defined BED_USES_AD595
253
   #elif defined BED_USES_AD595
253
-    return celsius * (1024.0 / (5.0 * 100.0) ) * OVERSAMPLENR;
254
+    return lround(celsius * (1024.0 * OVERSAMPLENR/ (5.0 * 100.0) ) );
254
   #endif
255
   #endif
255
 }
256
 }
256
 
257
 

Loading…
Cancel
Save