Browse Source

Merge pull request #770 from josefpavlik/Marlin_v1

Marlin v1
nothinman 10 years ago
parent
commit
d4ba23bc28
5 changed files with 78 additions and 0 deletions
  1. 5
    0
      Marlin/Configuration.h
  2. 2
    0
      Marlin/Marlin.h
  3. 4
    0
      Marlin/Marlin_main.cpp
  4. 64
    0
      Marlin/thermistortables.h
  5. 3
    0
      Marlin/ultralcd.cpp

+ 5
- 0
Marlin/Configuration.h View File

@@ -123,6 +123,11 @@
123 123
 // 51 is 100k thermistor - EPCOS (1k pullup)
124 124
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
125 125
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
126
+//
127
+// 1047 is Pt1000 with 4k7 pullup
128
+// 1010 is Pt1000 with 1k pullup (non standard)
129
+// 147 is Pt100 with 4k7 pullup
130
+// 110 is Pt100 with 1k pullup (non standard)
126 131
 
127 132
 #define TEMP_SENSOR_0 -1
128 133
 #define TEMP_SENSOR_1 -1

+ 2
- 0
Marlin/Marlin.h View File

@@ -189,6 +189,8 @@ void enquecommand_P(const char *cmd); //put an ascii command at the end of the c
189 189
 void prepare_arc_move(char isclockwise);
190 190
 void clamp_to_software_endstops(float target[3]);
191 191
 
192
+void refresh_cmd_timeout(void);
193
+
192 194
 #ifdef FAST_PWM_FAN
193 195
 void setPwmFrequency(uint8_t pin, int val);
194 196
 #endif

+ 4
- 0
Marlin/Marlin_main.cpp View File

@@ -1080,6 +1080,10 @@ static void homeaxis(int axis) {
1080 1080
   }
1081 1081
 }
1082 1082
 #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
1083
++void refresh_cmd_timeout(void)
1084
+{
1085
+  previous_millis_cmd = millis();
1086
+}
1083 1087
 
1084 1088
 void process_commands()
1085 1089
 {

+ 64
- 0
Marlin/thermistortables.h View File

@@ -857,6 +857,70 @@ const short temptable_60[][2] PROGMEM = {
857 857
 };
858 858
 #endif
859 859
 
860
+// Pt1000 and Pt100 handling
861
+// 
862
+// Rt=R0*(1+a*T+b*T*T) [for T>0]
863
+// a=3.9083E-3, b=-5.775E-7
864
+
865
+#define PtA 3.9083E-3
866
+#define PtB -5.775E-7
867
+#define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T)))
868
+#define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1))
869
+#define PtLine(T,R0,Rup) { PtAdVal(T,R0,Rup)*OVERSAMPLENR, T },
870
+
871
+#if (THERMISTORHEATER_0 == 110) || (THERMISTORHEATER_1 == 110) || (THERMISTORHEATER_2 == 110) || (THERMISTORBED == 110) // Pt100 with 1k0 pullup
872
+const short temptable_110[][2] PROGMEM = {
873
+// only few values are needed as the curve is very flat  
874
+  PtLine(0,100,1000)
875
+  PtLine(50,100,1000)
876
+  PtLine(100,100,1000)
877
+  PtLine(150,100,1000)
878
+  PtLine(200,100,1000)
879
+  PtLine(250,100,1000)
880
+  PtLine(300,100,1000)
881
+};
882
+#endif
883
+#if (THERMISTORHEATER_0 == 147) || (THERMISTORHEATER_1 == 147) || (THERMISTORHEATER_2 == 147) || (THERMISTORBED == 147) // Pt100 with 4k7 pullup
884
+const short temptable_147[][2] PROGMEM = {
885
+// only few values are needed as the curve is very flat  
886
+  PtLine(0,100,4700)
887
+  PtLine(50,100,4700)
888
+  PtLine(100,100,4700)
889
+  PtLine(150,100,4700)
890
+  PtLine(200,100,4700)
891
+  PtLine(250,100,4700)
892
+  PtLine(300,100,4700)
893
+};
894
+#endif
895
+#if (THERMISTORHEATER_0 == 1010) || (THERMISTORHEATER_1 == 1010) || (THERMISTORHEATER_2 == 1010) || (THERMISTORBED == 1010) // Pt1000 with 1k0 pullup
896
+const short temptable_1010[][2] PROGMEM = {
897
+  PtLine(0,1000,1000)
898
+  PtLine(25,1000,1000)
899
+  PtLine(50,1000,1000)
900
+  PtLine(75,1000,1000)
901
+  PtLine(100,1000,1000)
902
+  PtLine(125,1000,1000)
903
+  PtLine(150,1000,1000)
904
+  PtLine(175,1000,1000)
905
+  PtLine(200,1000,1000)
906
+  PtLine(225,1000,1000)
907
+  PtLine(250,1000,1000)
908
+  PtLine(275,1000,1000)
909
+  PtLine(300,1000,1000)
910
+};
911
+#endif
912
+#if (THERMISTORHEATER_0 == 1047) || (THERMISTORHEATER_1 == 1047) || (THERMISTORHEATER_2 == 1047) || (THERMISTORBED == 1047) // Pt1000 with 4k7 pullup
913
+const short temptable_1047[][2] PROGMEM = {
914
+// only few values are needed as the curve is very flat  
915
+  PtLine(0,1000,4700)
916
+  PtLine(50,1000,4700)
917
+  PtLine(100,1000,4700)
918
+  PtLine(150,1000,4700)
919
+  PtLine(200,1000,4700)
920
+  PtLine(250,1000,4700)
921
+  PtLine(300,1000,4700)
922
+};
923
+#endif
860 924
 
861 925
 #define _TT_NAME(_N) temptable_ ## _N
862 926
 #define TT_NAME(_N) _TT_NAME(_N)

+ 3
- 0
Marlin/ultralcd.cpp View File

@@ -460,6 +460,7 @@ static void lcd_move_x()
460 460
 {
461 461
     if (encoderPosition != 0)
462 462
     {
463
+        refresh_cmd_timeout();
463 464
         current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
464 465
         if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS)
465 466
             current_position[X_AXIS] = X_MIN_POS;
@@ -489,6 +490,7 @@ static void lcd_move_y()
489 490
 {
490 491
     if (encoderPosition != 0)
491 492
     {
493
+        refresh_cmd_timeout();
492 494
         current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
493 495
         if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS)
494 496
             current_position[Y_AXIS] = Y_MIN_POS;
@@ -518,6 +520,7 @@ static void lcd_move_z()
518 520
 {
519 521
     if (encoderPosition != 0)
520 522
     {
523
+        refresh_cmd_timeout();
521 524
         current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
522 525
         if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS)
523 526
             current_position[Z_AXIS] = Z_MIN_POS;

Loading…
Cancel
Save