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,12 +156,13 @@ void manage_heater()
156 156
             pTerm+=Kc*current_block->speed_e; //additional heating if extrusion speed is high
157 157
           #endif
158 158
           pid_output = constrain(pTerm + iTerm - dTerm, 0, PID_MAX);
159
-          HeaterPower=pid_output;
159
+          
160 160
         }
161 161
     #endif //PID_OPENLOOP
162 162
     #ifdef PID_DEBUG
163 163
      //SERIAL_ECHOLN(" PIDDEBUG Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm<<" iTerm "<<iTerm<<" dTerm "<<dTerm);  
164 164
     #endif //PID_DEBUG
165
+    HeaterPower=pid_output;
165 166
     analogWrite(HEATER_0_PIN, pid_output);
166 167
   #endif //PIDTEMP
167 168
 
@@ -250,7 +251,7 @@ int temp2analogBed(int celsius) {
250 251
 
251 252
     return (1023 * OVERSAMPLENR) - raw;
252 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 255
   #endif
255 256
 }
256 257
 

Loading…
Cancel
Save