From f89ba2c46aed55d0bfd7464a7057183526d7772b Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Mon, 10 Jul 2017 17:30:47 +0200 Subject: [PATCH] axis steps per unit excluded from M500, version changed --- Firmware/Configuration.h | 2 +- Firmware/ConfigurationStore.cpp | 6 +++--- Firmware/mesh_bed_calibration.cpp | 24 +++++++++++++++++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 387b10e15..4563c66bb 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -5,7 +5,7 @@ #include "Configuration_prusa.h" // Firmware version -#define FW_version "3.0.12-RC2" +#define FW_version "3.0.12" #define FW_PRUSA3D_MAGIC "PRUSA3DFW" #define FW_PRUSA3D_MAGIC_LEN 10 diff --git a/Firmware/ConfigurationStore.cpp b/Firmware/ConfigurationStore.cpp index f7f64094c..e914bf794 100644 --- a/Firmware/ConfigurationStore.cpp +++ b/Firmware/ConfigurationStore.cpp @@ -43,7 +43,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) // wrong data being written to the variables. // ALSO: always make sure the variables in the Store and retrieve sections are in the same order. -#define EEPROM_VERSION "V1" +#define EEPROM_VERSION "V2" #ifdef EEPROM_SETTINGS void Config_StoreSettings() @@ -51,7 +51,7 @@ void Config_StoreSettings() char ver[4]= "000"; int i=EEPROM_OFFSET; EEPROM_WRITE_VAR(i,ver); // invalidate data first - EEPROM_WRITE_VAR(i,axis_steps_per_unit); + //EEPROM_WRITE_VAR(i,axis_steps_per_unit); EEPROM_WRITE_VAR(i,max_feedrate); EEPROM_WRITE_VAR(i,max_acceleration_units_per_sq_second); EEPROM_WRITE_VAR(i,acceleration); @@ -274,7 +274,7 @@ void Config_RetrieveSettings() if (strncmp(ver,stored_ver,3) == 0) { // version number match - EEPROM_READ_VAR(i,axis_steps_per_unit); + //EEPROM_READ_VAR(i,axis_steps_per_unit); EEPROM_READ_VAR(i,max_feedrate); EEPROM_READ_VAR(i,max_acceleration_units_per_sq_second); diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 5220c1aff..6176d24db 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -2083,12 +2083,21 @@ BedSkewOffsetDetectionResultType improve_bed_offset_and_skew(int8_t method, int8 for (uint8_t mesh_point = 0; mesh_point < 3; ++ mesh_point) if (pts[mesh_point * 2 + 1] < Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH) too_far_mask |= 1 << mesh_point; - result = calculate_machine_skew_and_offset_LS(pts, 9, bed_ref_points, vec_x, vec_y, cntr, verbosity_level); + + if (verbosity_level >= 20) { + SERIAL_ECHOPGM("Distance from min before calculate_machine skew and offset LS:"); + MYSERIAL.print(int(too_far_mask)); + } + + result = calculate_machine_skew_and_offset_LS(pts, 9, bed_ref_points, vec_x, vec_y, cntr, verbosity_level); if (result < 0) { SERIAL_ECHOLNPGM("Calculation of the machine skew and offset failed."); goto canceled; } // In case of success, update the too_far_mask from the calculated points. + too_far_mask = 0; + if(verbosity_level >= 20) SERIAL_ECHOPGM("Reseting too far mask."); + for (uint8_t mesh_point = 0; mesh_point < 3; ++ mesh_point) { float y = vec_x[1] * pgm_read_float(bed_ref_points+mesh_point*2) + vec_y[1] * pgm_read_float(bed_ref_points+mesh_point*2+1) + cntr[1]; distance_from_min[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); @@ -2447,6 +2456,19 @@ void count_xyz_details() { eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y + 0)), eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y + 4)) }; + SERIAL_ECHOPGM("cntr[0]:"); + MYSERIAL.println(cntr[0]); + SERIAL_ECHOPGM("cntr[1]:"); + MYSERIAL.println(cntr[1]); + SERIAL_ECHOPGM("vec_x[0]:"); + MYSERIAL.println(vec_x[0]); + SERIAL_ECHOPGM("vec_x[1]:"); + MYSERIAL.println(vec_x[1]); + SERIAL_ECHOPGM("vec_y[0]:"); + MYSERIAL.println(vec_y[0]); + SERIAL_ECHOPGM("vec_y[1]:"); + MYSERIAL.println(vec_y[1]); + a2 = -1 * asin(vec_y[0] / MACHINE_AXIS_SCALE_Y); /* SERIAL_ECHOLNPGM("par:"); MYSERIAL.println(vec_y[0]);