Merge pull request #109 from XPila/MK3

PINDA calibration and precalibrated characteristics.
This commit is contained in:
XPila 2017-11-27 07:12:08 +01:00 committed by GitHub
commit 5781b8e523
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 20 deletions

View file

@ -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_MIN -3999
#define Z_BABYSTEP_MAX 0 #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_X 70
#define PINDA_PREHEAT_Y -3 #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_HEAT_T 120 //time in s
#define PINDA_MIN_T 50 #define PINDA_MIN_T 50

View file

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

View file

@ -1075,7 +1075,13 @@ void setup()
} else temp_cal_active = eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE); } else temp_cal_active = eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE);
if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 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) { if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == 255) {
eeprom_write_byte((uint8_t*)EEPROM_UVLO, 0); eeprom_write_byte((uint8_t*)EEPROM_UVLO, 0);
@ -2936,7 +2942,7 @@ void process_commands()
MYSERIAL.println(start_temp); MYSERIAL.println(start_temp);
// setTargetHotend(200, 0); // setTargetHotend(200, 0);
setTargetBed(50 + 10 * (start_temp - 30) / 5); setTargetBed(70 + (start_temp - 30));
custom_message = true; custom_message = true;
custom_message_type = 4; custom_message_type = 4;