Selaa lähdekoodia

Added PT100 support for Ultiboard2

daid 11 vuotta sitten
vanhempi
commit
df194f75e1
4 muutettua tiedostoa jossa 79 lisäystä ja 3 poistoa
  1. 1
    1
      Marlin/language.h
  2. 2
    1
      Marlin/pins.h
  3. 4
    1
      Marlin/temperature.cpp
  4. 72
    0
      Marlin/thermistortables.h

+ 1
- 1
Marlin/language.h Näytä tiedosto

23
 
23
 
24
 #define PROTOCOL_VERSION "1.0"
24
 #define PROTOCOL_VERSION "1.0"
25
 
25
 
26
-#if MOTHERBOARD == 7 || MOTHERBOARD == 71
26
+#if MOTHERBOARD == 7 || MOTHERBOARD == 71 || MOTHERBOARD == 72
27
 	#define MACHINE_NAME "Ultimaker"
27
 	#define MACHINE_NAME "Ultimaker"
28
 	#define FIRMWARE_URL "http://firmware.ultimaker.com"
28
 	#define FIRMWARE_URL "http://firmware.ultimaker.com"
29
 #elif MOTHERBOARD == 80
29
 #elif MOTHERBOARD == 80

+ 2
- 1
Marlin/pins.h Näytä tiedosto

1354
 #define MOTOR_CURRENT_PWM_Z_PIN 45
1354
 #define MOTOR_CURRENT_PWM_Z_PIN 45
1355
 #define MOTOR_CURRENT_PWM_E_PIN 46
1355
 #define MOTOR_CURRENT_PWM_E_PIN 46
1356
 //Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range
1356
 //Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range
1357
-#define MOTOR_CURRENT_PWM_RANGE 2000
1357
+#define MOTOR_CURRENT_PWM_RANGE 2000
1358
+#define DEFAULT_PWM_MOTOR_CURRENT  {1300, 1300, 1250}
1358
 
1359
 
1359
 //arduino pin witch triggers an piezzo beeper
1360
 //arduino pin witch triggers an piezzo beeper
1360
 #define BEEPER 18
1361
 #define BEEPER 18

+ 4
- 1
Marlin/temperature.cpp Näytä tiedosto

1039
   static unsigned long raw_temp_1_value = 0;
1039
   static unsigned long raw_temp_1_value = 0;
1040
   static unsigned long raw_temp_2_value = 0;
1040
   static unsigned long raw_temp_2_value = 0;
1041
   static unsigned long raw_temp_bed_value = 0;
1041
   static unsigned long raw_temp_bed_value = 0;
1042
-  static unsigned char temp_state = 0;
1042
+  static unsigned char temp_state = 8;
1043
   static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
1043
   static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
1044
   static unsigned char soft_pwm_0;
1044
   static unsigned char soft_pwm_0;
1045
   #if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL)
1045
   #if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL)
1181
       temp_state = 0;
1181
       temp_state = 0;
1182
       temp_count++;
1182
       temp_count++;
1183
       break;
1183
       break;
1184
+    case 8: //Startup, delay initial temp reading a tiny bit so the hardware can settle.
1185
+      temp_state = 0;
1186
+      break;
1184
 //    default:
1187
 //    default:
1185
 //      SERIAL_ERROR_START;
1188
 //      SERIAL_ERROR_START;
1186
 //      SERIAL_ERRORLNPGM("Temp measurement error!");
1189
 //      SERIAL_ERRORLNPGM("Temp measurement error!");

+ 72
- 0
Marlin/thermistortables.h Näytä tiedosto

563
    {1016*OVERSAMPLENR, 0}
563
    {1016*OVERSAMPLENR, 0}
564
 };
564
 };
565
 #endif
565
 #endif
566
+
567
+#if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
568
+/* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
569
+This does not match the normal thermistor behaviour so we need to set the following defines */
570
+#if (THERMISTORHEATER_0 == 20)
571
+# define HEATER_0_RAW_HI_TEMP 16383
572
+# define HEATER_0_RAW_LO_TEMP 0
573
+#endif
574
+#if (THERMISTORHEATER_1 == 20)
575
+# define HEATER_1_RAW_HI_TEMP 16383
576
+# define HEATER_1_RAW_LO_TEMP 0
577
+#endif
578
+#if (THERMISTORHEATER_2 == 20)
579
+# define HEATER_2_RAW_HI_TEMP 16383
580
+# define HEATER_2_RAW_LO_TEMP 0
581
+#endif
582
+#if (THERMISTORBED == 20)
583
+# define HEATER_BED_RAW_HI_TEMP 16383
584
+# define HEATER_BED_RAW_LO_TEMP 0
585
+#endif
586
+const short temptable_20[][2] PROGMEM = {
587
+{         0*OVERSAMPLENR ,       0     },
588
+{       227*OVERSAMPLENR ,       1     },
589
+{       236*OVERSAMPLENR ,       10     },
590
+{       245*OVERSAMPLENR ,       20     },
591
+{       253*OVERSAMPLENR ,       30     },
592
+{       262*OVERSAMPLENR ,       40     },
593
+{       270*OVERSAMPLENR ,       50     },
594
+{       279*OVERSAMPLENR ,       60     },
595
+{       287*OVERSAMPLENR ,       70     },
596
+{       295*OVERSAMPLENR ,       80     },
597
+{       304*OVERSAMPLENR ,       90     },
598
+{       312*OVERSAMPLENR ,       100     },
599
+{       320*OVERSAMPLENR ,       110     },
600
+{       329*OVERSAMPLENR ,       120     },
601
+{       337*OVERSAMPLENR ,       130     },
602
+{       345*OVERSAMPLENR ,       140     },
603
+{       353*OVERSAMPLENR ,       150     },
604
+{       361*OVERSAMPLENR ,       160     },
605
+{       369*OVERSAMPLENR ,       170     },
606
+{       377*OVERSAMPLENR ,       180     },
607
+{       385*OVERSAMPLENR ,       190     },
608
+{       393*OVERSAMPLENR ,       200     },
609
+{       401*OVERSAMPLENR ,       210     },
610
+{       409*OVERSAMPLENR ,       220     },
611
+{       417*OVERSAMPLENR ,       230     },
612
+{       424*OVERSAMPLENR ,       240     },
613
+{       432*OVERSAMPLENR ,       250     },
614
+{       440*OVERSAMPLENR ,       260     },
615
+{       447*OVERSAMPLENR ,       270     },
616
+{       455*OVERSAMPLENR ,       280     },
617
+{       463*OVERSAMPLENR ,       290     },
618
+{       470*OVERSAMPLENR ,       300     },
619
+{       478*OVERSAMPLENR ,       310     },
620
+{       485*OVERSAMPLENR ,       320     },
621
+{       493*OVERSAMPLENR ,       330     },
622
+{       500*OVERSAMPLENR ,       340     },
623
+{       507*OVERSAMPLENR ,       350     },
624
+{       515*OVERSAMPLENR ,       360     },
625
+{       522*OVERSAMPLENR ,       370     },
626
+{       529*OVERSAMPLENR ,       380     },
627
+{       537*OVERSAMPLENR ,       390     },
628
+{       544*OVERSAMPLENR ,       400     },
629
+{       614*OVERSAMPLENR ,       500     },
630
+{       681*OVERSAMPLENR ,       600     },
631
+{       744*OVERSAMPLENR ,       700     },
632
+{       805*OVERSAMPLENR ,       800     },
633
+{       862*OVERSAMPLENR ,       900     },
634
+{       917*OVERSAMPLENR ,       1000     },
635
+{       968*OVERSAMPLENR ,       1100     }
636
+};
637
+#endif
566
 
638
 
567
 #if (THERMISTORHEATER_0 == 51) || (THERMISTORHEATER_1 == 51) || (THERMISTORHEATER_2 == 51) || (THERMISTORBED == 51)
639
 #if (THERMISTORHEATER_0 == 51) || (THERMISTORHEATER_1 == 51) || (THERMISTORHEATER_2 == 51) || (THERMISTORBED == 51)
568
 // 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
640
 // 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)

Loading…
Peruuta
Tallenna