Fix probe temp calibration (#16718)
This commit is contained in:
		@@ -48,10 +48,10 @@ class ProbeTempComp {
 | 
				
			|||||||
  public:
 | 
					  public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    static constexpr temp_calib_t cali_info_init[TSI_COUNT] = {
 | 
					    static constexpr temp_calib_t cali_info_init[TSI_COUNT] = {
 | 
				
			||||||
        {  30, 10,  5,  30 + 10 *  5 },       // Probe
 | 
					        {  10,  5,  30,  30 + 10 *  5 },       // Probe
 | 
				
			||||||
        {  60, 10,  5,  60 + 10 *  5 },       // Bed
 | 
					        {  10,  5,  60,  60 + 10 *  5 },       // Bed
 | 
				
			||||||
      #if ENABLED(USE_TEMP_EXT_COMPENSATION)
 | 
					      #if ENABLED(USE_TEMP_EXT_COMPENSATION)
 | 
				
			||||||
        { 180,  5, 20, 180 +  5 * 20 }        // Extruder
 | 
					        {  20,  5, 180, 180 +  5 * 20 }        // Extruder
 | 
				
			||||||
      #endif
 | 
					      #endif
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    static const temp_calib_t cali_info[TSI_COUNT];
 | 
					    static const temp_calib_t cali_info[TSI_COUNT];
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -256,7 +256,7 @@ void GcodeSuite::G76() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // Initialize temperatures
 | 
					    // Initialize temperatures
 | 
				
			||||||
    uint16_t target_bed = temp_comp.probe_calib_bed_temp,
 | 
					    uint16_t target_bed = temp_comp.probe_calib_bed_temp,
 | 
				
			||||||
             target_probe = temp_comp.cali_info_init[TSI_BED].start_temp;
 | 
					             target_probe = temp_comp.cali_info_init[TSI_PROBE].start_temp;
 | 
				
			||||||
    thermalManager.setTargetBed(target_bed);
 | 
					    thermalManager.setTargetBed(target_bed);
 | 
				
			||||||
    SERIAL_ECHOLNPGM("Waiting for bed and probe temperature.");
 | 
					    SERIAL_ECHOLNPGM("Waiting for bed and probe temperature.");
 | 
				
			||||||
    while (fabs(thermalManager.degBed() - float(target_bed)) > 0.1f
 | 
					    while (fabs(thermalManager.degBed() - float(target_bed)) > 0.1f
 | 
				
			||||||
@@ -332,13 +332,13 @@ void GcodeSuite::G76() {
 | 
				
			|||||||
      else
 | 
					      else
 | 
				
			||||||
        SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
 | 
					        SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (target_probe == temp_comp.cali_info_init[TSI_BED].start_temp)
 | 
					      if (target_probe == temp_comp.cali_info_init[TSI_PROBE].start_temp)
 | 
				
			||||||
        temp_comp.prepare_new_calibration(measured_z);
 | 
					        temp_comp.prepare_new_calibration(measured_z);
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        temp_comp.push_back_new_measurement(TSI_PROBE, measured_z);
 | 
					        temp_comp.push_back_new_measurement(TSI_PROBE, measured_z);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      target_probe += temp_comp.cali_info_init[TSI_BED].temp_res;
 | 
					      target_probe += temp_comp.cali_info_init[TSI_PROBE].temp_res;
 | 
				
			||||||
      if (target_probe > temp_comp.cali_info_init[TSI_BED].end_temp) break;
 | 
					      if (target_probe > temp_comp.cali_info_init[TSI_PROBE].end_temp) break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());
 | 
					    SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user