浏览代码

Z calibration dont set preheat values to zero,
improved alert meassages in selftest

PavelSindler 8 年之前
父节点
当前提交
d20adaa8fa
共有 2 个文件被更改,包括 22 次插入65 次删除
  1. 10 8
      Firmware/Marlin_main.cpp
  2. 12 57
      Firmware/ultralcd.cpp

+ 10 - 8
Firmware/Marlin_main.cpp

@@ -3304,11 +3304,15 @@ void process_commands()
 
     case 45: // M45: Prusa3D: bed skew and offset with manual Z up
     {
-		setTargetBed(0);
-		setTargetHotend(0, 0);
-		setTargetHotend(0, 1);
-		setTargetHotend(0, 2);
-				
+		// Only Z calibration?
+		bool onlyZ = code_seen('Z');
+
+		if (!only_z) {
+			setTargetBed(0);
+			setTargetHotend(0, 0);
+			setTargetHotend(0, 1);
+			setTargetHotend(0, 2);
+		}
 		adjust_bed_reset(); //reset bed level correction
         // Disable the default update procedure of the display. We will do a modal dialog.
         lcd_update_enable(false);
@@ -3322,9 +3326,7 @@ void process_commands()
         babystep_reset();
         // Mark all axes as in a need for homing.
         memset(axis_known_position, 0, sizeof(axis_known_position));
-        // Only Z calibration?
-        bool onlyZ = code_seen('Z');
-        
+                
         // Let the user move the Z axes up to the end stoppers.
         if (lcd_calibrate_z_end_stop_manual( onlyZ )) {
             refresh_cmd_timeout();

+ 12 - 57
Firmware/ultralcd.cpp

@@ -3649,44 +3649,21 @@ static void lcd_selftest()
 	{
 		_progress = lcd_selftest_screen(7, _progress, 3, true, 5000);
 	}
-
+	lcd_reset_alert_level();
+	enquecommand_P(PSTR("M84"));
 	lcd_implementation_clear();
 	lcd_next_update_millis = millis() + LCD_UPDATE_INTERVAL;
 
 	if (_result)
 	{
-		LCD_ALERTMESSAGERPGM(MSG_SELFTEST_OK);
+		LCD_ALERTMESSAGERPGM(MSG_SELFTEST_OK);				
 	}
 	else
 	{
 		LCD_ALERTMESSAGERPGM(MSG_SELFTEST_FAILED);
 	}
 }
-/*static bool lcd_selfcheck_endstops()
-{
-	bool _result = true;
 
-	if (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1 || READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1 || READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1)
-	{
-		current_position[0] = (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) ? current_position[0] = current_position[0] + 10 : current_position[0];
-		current_position[1] = (READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) ? current_position[1] = current_position[1] + 10 : current_position[1];
-		current_position[2] = (READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) ? current_position[2] = current_position[2] + 10 : current_position[2];
-	}
-	plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[0] / 60, active_extruder);
-	delay(500);
-
-	if (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1 || READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1 || READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1)
-	{
-		_result = false;
-		String  _error = String((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) ? "X" : "") +
-			String((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) ? "Y" : "") +
-			String((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) ? "Z" : "");
-		lcd_selftest_error(3, _error.c_str(), "");
-	}
-	manage_heater();
-	manage_inactivity();
-	return _result;
-}*/
 static bool lcd_selfcheck_axis(int _axis, int _travel)
 {
 	bool _stepdone = false;
@@ -3791,55 +3768,33 @@ static bool lcd_selfcheck_pulleys(int axis)
 	bool endstop_triggered = false;
 	bool result = true;
 	int i;
-	unsigned long timeout_counter;// = 20000 + millis();
+	unsigned long timeout_counter;
 	refresh_cmd_timeout();
 
 
-	if (axis == 0) move = 50; //230;
-		else move = 50; //190
+	if (axis == 0) move = 50; //X_AXIS 
+		else move = 50; //Y_AXIS
 
-
-		
-		/*while (!endstop_triggered) {
-			if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) || (READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1)) {
-				endstop_triggered = true;*/
-				current_position_init = current_position[axis];
-				timeout_counter = millis() + 2500; 
-			/*}
-			else {
-				current_position[axis] -= 1;
-				plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
-				st_synchronize();
-				if (millis() > timeout_counter) return(false);
-			}
-		}*/
+		current_position_init = current_position[axis];
+				
 		current_position[axis] += 2;
 		plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
 		for (i = 0; i < 5; i++) {
 			refresh_cmd_timeout();
 			current_position[axis] = current_position[axis] + move;
-			digipot_current(axis, 850); //set motor current higher
-			//max_jerk[X_AXIS] = 20;
+			digipot_current(0, 850); //set motor current higher
 			plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 200, active_extruder);
-			//max_jerk[X_AXIS] = DEFAULT_XJERK;
-			//digipot_current(axis, tmp_motor_loud[0]);
-			/*if (SilentMode == 1) digipot_current(2, tmp_motor[2]); //set back to normal operation currents
-			else */digipot_current(2, tmp_motor_loud[2]); //set motor current back			
+			if (SilentModeMenu == 1) digipot_current(0, tmp_motor[0]); //set back to normal operation currents
+			else digipot_current(0, tmp_motor_loud[0]); //set motor current back			
 			current_position[axis] = current_position[axis] - move;
 			plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
 			st_synchronize();
 			if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) || (READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1)) {
-				//current_position[axis] += 15;
-				//plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
 				lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
 				return(false);
 			}
-			if (millis() > timeout_counter) {
-				lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
-				return(false);
-			}else timeout_counter = millis() + 2500;
 		}
-		
+		timeout_counter = millis() + 2500;
 		endstop_triggered = false;
 		
 		while (!endstop_triggered) {