Browse Source

PINDA calibration and precalibrated characteristics.

Robert Pelnar 7 years ago
parent
commit
1113124bde
3 changed files with 24 additions and 20 deletions
  1. 5 1
      Firmware/Configuration_prusa.h
  2. 11 17
      Firmware/Dcodes.cpp
  3. 8 2
      Firmware/Marlin_main.cpp

+ 5 - 1
Firmware/Configuration_prusa.h

@@ -475,9 +475,13 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
 #define Z_BABYSTEP_MIN -3999
 #define Z_BABYSTEP_MAX 0
 
+#define PINDA_PREHEAT_X 20
+#define PINDA_PREHEAT_Y 60
+#define PINDA_PREHEAT_Z 0.15
+/*
 #define PINDA_PREHEAT_X 70
 #define PINDA_PREHEAT_Y -3
-#define PINDA_PREHEAT_Z 1
+#define PINDA_PREHEAT_Z 1*/
 #define PINDA_HEAT_T 120 //time in s
 
 #define PINDA_MIN_T 50

+ 11 - 17
Firmware/Dcodes.cpp

@@ -338,34 +338,31 @@ void dcode_7()
 
 void dcode_8()
 {
-	LOG("D8 - Read/Write PINDA\n");
+	printf_P(PSTR("D8 - Read/Write PINDA\n"));
 	uint8_t cal_status = calibration_status_pinda();
 	float temp_pinda = current_temperature_pinda;
 	float offset_z = temp_compensation_pinda_thermistor_offset(temp_pinda);
 	if ((strchr_pointer[1+1] == '?') || (strchr_pointer[1+1] == 0))
 	{
-		LOG("cal_status=");
-		LOG(cal_status?"1\n":"0\n");
+		printf_P(PSTR("cal_status=%d\n"), cal_status?1:0);
 		for (uint8_t i = 0; i < 6; i++)
 		{
-			LOG("temp_pinda=");
-			LOG(35 + i * 5, DEC);
-			LOG("C, temp_shift=");
 			uint16_t offs = 0;
 			if (i > 0) offs = eeprom_read_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + (i - 1));
-			LOG(((float)offs) / axis_steps_per_unit[Z_AXIS], 3);
-			LOG("mm\n");
+			float foffs = ((float)offs) / axis_steps_per_unit[Z_AXIS];
+			offs = 1000 * foffs;
+			printf_P(PSTR("temp_pinda=%dC temp_shift=%dum\n"), 35 + i * 5, offs);
 		}
 	}
 	else if (strchr_pointer[1+1] == '!')
 	{
 		cal_status = 1;
 		eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, cal_status);
-		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 0, 50); //40C - 
-		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 1, 100); //45C - 
-		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 2, 150); //50C - 
-		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 3, 200); //55C - 
-		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 4, 250); //60C - 
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 0,   8); //40C -  20um -   8usteps
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 1,  24); //45C -  60um -  24usteps
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 2,  48); //50C - 120um -  48usteps
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 3,  80); //55C - 200um -  80usteps
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 4, 120); //60C - 300um - 120usteps
 	}
 	else
 	{
@@ -377,10 +374,7 @@ void dcode_8()
 			offset_z = code_value();
 		}
 	}
-	LOG("temp_pinda=");
-	LOG(temp_pinda);
-	LOG("offset_z=");
-	LOG(offset_z, 3);
+	printf_P(PSTR("temp_pinda=%d offset_z=%d.%03d\n"), (int)temp_pinda, (int)offset_z, ((int)(1000 * offset_z) % 1000));
 }
 
 void dcode_10()

+ 8 - 2
Firmware/Marlin_main.cpp

@@ -1075,7 +1075,13 @@ void setup()
 	} else temp_cal_active = eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE);
 
 	if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) {
-		eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0);
+		//eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0);
+		eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 0,   8); //40C -  20um -   8usteps
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 1,  24); //45C -  60um -  24usteps
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 2,  48); //50C - 120um -  48usteps
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 3,  80); //55C - 200um -  80usteps
+		eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 4, 120); //60C - 300um - 120usteps
 	}
 	if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == 255) {
 		eeprom_write_byte((uint8_t*)EEPROM_UVLO, 0);
@@ -2936,7 +2942,7 @@ void process_commands()
 			MYSERIAL.println(start_temp);
 
 //			setTargetHotend(200, 0);
-			setTargetBed(50 + 10 * (start_temp - 30) / 5);
+			setTargetBed(70 + (start_temp - 30));
 
 			custom_message = true;
 			custom_message_type = 4;