Browse Source

re-enabled heaterpower as storage for the current storage of the heater PWM duty cycle.

the M301 now returns the current PID settings of the machine.
M105 returns heating pwm duty cylce as "@:"
Bernhard Kubicek 13 years ago
parent
commit
e9adfa27b5
2 changed files with 30 additions and 23 deletions
  1. 29
    23
      Marlin/Marlin.pde
  2. 1
    0
      Marlin/temperature.cpp

+ 29
- 23
Marlin/Marlin.pde View File

647
       break;
647
       break;
648
     case 105: // M105
648
     case 105: // M105
649
       //SERIAL_ECHOLN(freeMemory());
649
       //SERIAL_ECHOLN(freeMemory());
650
-      #if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595)
651
-        tt = degHotend0();
652
-      #endif
653
-      #if TEMP_1_PIN > -1
654
-          bt = degBed();
655
-      #endif
650
+          
656
       #if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595)
651
       #if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595)
657
         SERIAL_PROTOCOLPGM("ok T:");
652
         SERIAL_PROTOCOLPGM("ok T:");
658
-        SERIAL_PROTOCOL(tt); 
653
+        SERIAL_PROTOCOL( degHotend0()); 
659
         #if TEMP_1_PIN > -1 
654
         #if TEMP_1_PIN > -1 
660
-          #ifdef PIDTEMP
661
-            SERIAL_PROTOCOL(" B:");
662
-            #if TEMP_1_PIN > -1
663
-              SERIAL_PROTOCOLLN(bt); 
664
-            #else
665
-              SERIAL_PROTOCOLLN(HeaterPower); 
666
-            #endif
667
-          #else //not PIDTEMP
668
-            SERIAL_PROTOCOLLN("");
669
-           #endif //PIDTEMP
670
-         #else
671
-            SERIAL_PROTOCOLLN("");
672
-          #endif //TEMP_1_PIN
673
-        #else
674
-          SERIAL_ERROR_START;
675
-          SERIAL_ERRORLNPGM("No thermistors - no temp");
655
+          SERIAL_PROTOCOLPGM(" B:");  
656
+          SERIAL_PROTOCOL(degBed());
657
+        #endif //TEMP_1_PIN
658
+      #else
659
+        SERIAL_ERROR_START;
660
+        SERIAL_ERRORLNPGM("No thermistors - no temp");
676
       #endif
661
       #endif
662
+      #ifdef PIDTEMP
663
+        SERIAL_PROTOCOLPGM(" @:");
664
+        SERIAL_PROTOCOL( HeaterPower); 
665
+       
666
+      #endif
667
+        SERIAL_PROTOCOLLN("");
677
       return;
668
       return;
678
       break;
669
       break;
679
     case 109: 
670
     case 109: 
901
       if(code_seen('P')) Kp = code_value();
892
       if(code_seen('P')) Kp = code_value();
902
       if(code_seen('I')) Ki = code_value()*PID_dT;
893
       if(code_seen('I')) Ki = code_value()*PID_dT;
903
       if(code_seen('D')) Kd = code_value()/PID_dT;
894
       if(code_seen('D')) Kd = code_value()/PID_dT;
895
+      #ifdef PID_ADD_EXTRUSION_RATE
896
+      if(code_seen('C')) Kc = code_value();
897
+      #endif
898
+      SERIAL_PROTOCOL("ok p:");
899
+      SERIAL_PROTOCOL(Kp);
900
+      SERIAL_PROTOCOL(" i:");
901
+      SERIAL_PROTOCOL(Ki/PID_dT);
902
+      SERIAL_PROTOCOL(" d:");
903
+      SERIAL_PROTOCOL(Kd*PID_dT);
904
+      #ifdef PID_ADD_EXTRUSION_RATE
905
+      SERIAL_PROTOCOL(" c:");
906
+      SERIAL_PROTOCOL(Kc*PID_dT);
907
+      #endif
908
+      SERIAL_PROTOCOLLN("");
909
+      
904
       break;
910
       break;
905
     #endif //PIDTEMP
911
     #endif //PIDTEMP
906
     case 500: // Store settings in EEPROM
912
     case 500: // Store settings in EEPROM

+ 1
- 0
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
     #endif //PID_OPENLOOP
161
     #endif //PID_OPENLOOP
161
     #ifdef PID_DEBUG
162
     #ifdef PID_DEBUG

Loading…
Cancel
Save