Bugfix of the "Move Z carriages up" step.

This commit is contained in:
bubnikv 2016-06-16 15:52:58 +02:00
parent 6cff4b92ff
commit d9da3c4c7f
6 changed files with 4077 additions and 4074 deletions

View file

@ -5,7 +5,7 @@
#include "Configuration_prusa.h"
// Firmware version
#define FW_version "3.0.2"
#define FW_version "3.0.2-bedcalib"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -274,19 +274,19 @@
#define MSG_CALIBRATE_BED "Calibrate bed"
#define MSG_CALIBRATE_BED_RESET "Reset bed calibration"
#define MSG_MOVE_CARRIAGE_TO_THE_TOP_LINE1 "Calibrating the machine."
#define MSG_MOVE_CARRIAGE_TO_THE_TOP_LINE2 "Please move the Z carriage up"
#define MSG_MOVE_CARRIAGE_TO_THE_TOP_LINE1 "Calibrating bed."
#define MSG_MOVE_CARRIAGE_TO_THE_TOP_LINE2 "Move Z carriage up"
#define MSG_MOVE_CARRIAGE_TO_THE_TOP_LINE3 "to the end stoppers."
#define MSG_MOVE_CARRIAGE_TO_THE_TOP_LINE4 "Click when done."
#define MSG_CONFIRM_CARRIAGE_AT_THE_TOP_LINE1 "Are both left and right Z carriages"
#define MSG_CONFIRM_CARRIAGE_AT_THE_TOP_LINE2 "touching the end stops?"
#define MSG_CONFIRM_CARRIAGE_AT_THE_TOP_LINE1 "Are left and right"
#define MSG_CONFIRM_CARRIAGE_AT_THE_TOP_LINE2 "Z carriages all up?"
#define MSG_FIND_BED_OFFSET_AND_SKEW_LINE1 "Searching calibration"
#define MSG_FIND_BED_OFFSET_AND_SKEW_LINE2 "point "
#define MSG_FIND_BED_OFFSET_AND_SKEW_LINE3 "of 4"
#define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1 "Improving calibration"
#define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE2 "point "
#define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE3 "of 9"
#define MSG_FIND_BED_OFFSET_AND_SKEW_LINE1 "Searching bed"
#define MSG_FIND_BED_OFFSET_AND_SKEW_LINE2 "calibration point"
#define MSG_FIND_BED_OFFSET_AND_SKEW_LINE3 " of 4"
#define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1 "Improving bed"
#define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE2 "calibration point"
#define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE3 " of 9"
#endif // LANGUAGE_EN_H

View file

@ -448,8 +448,8 @@ bool find_bed_offset_and_skew()
for (int k = 0; k < 4; ++ k) {
#ifdef MESH_BED_CALIBRATION_SHOW_LCD
lcd_print_at_PGM(0, 1, MSG_FIND_BED_OFFSET_AND_SKEW_LINE2);
lcd_implementation_print(k+1);
lcd_print_at_PGM(0, 2, MSG_FIND_BED_OFFSET_AND_SKEW_LINE3);
lcd_implementation_print_at(0, 2, k+1);
lcd_printPGM(MSG_FIND_BED_OFFSET_AND_SKEW_LINE3);
#endif /* MESH_BED_CALIBRATION_SHOW_LCD */
int i, j;
@ -568,8 +568,8 @@ bool improve_bed_offset_and_skew(int8_t method)
// Print the decrasing ID of the measurement point.
#ifdef MESH_BED_CALIBRATION_SHOW_LCD
lcd_print_at_PGM(0, 1, MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE2);
lcd_implementation_print_at(7, 1, mesh_point+1);
lcd_print_at_PGM(0, 2, MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE3);
lcd_implementation_print_at(0, 2, mesh_point+1);
lcd_printPGM(MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE3);
#endif /* MESH_BED_CALIBRATION_SHOW_LCD */
// Move up.
@ -674,6 +674,7 @@ void reset_bed_offset_and_skew()
eeprom_update_dword((uint32_t*)(EEPROM_BED_CALIBRATION_VEC_Y +4), 0x0FFFFFFFF);
}
#if 0
static const float[9][2] PROGMEM bed_points = {
};
@ -759,3 +760,4 @@ bool calculate_machine_skew_and_offset_LS(
// Invert the transformation matrix made of vec_x, vec_y and cntr.
}
#endif

View file

@ -1227,21 +1227,22 @@ bool lcd_calibrate_z_end_stop_manual()
lcd.setCursor(0, 3);
lcd_printPGM(MSG_MOVE_CARRIAGE_TO_THE_TOP_LINE4);
// Until the user finishes the z up movement.
enc_dif = encoderDiff;
encoderDiff = 0;
encoderPosition = 0;
for (;;) {
if (millis() - previous_millis_cmd > max_inactive_time)
goto canceled;
manage_heater();
manage_inactivity(true);
if (abs((enc_dif - encoderDiff)) > 4) {
if (abs(enc_dif - encoderDiff) > 1) {
previous_millis_cmd = millis();
// Only move up, whatever the user does.
current_position[Z_AXIS] += fabs(enc_dif - encoderDiff);
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[Z_AXIS] / 60, active_extruder);
// delay(10);
enc_dif = encoderDiff;
}
if (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP) {
delay(50);
previous_millis_cmd = millis();
encoderPosition += abs(encoderDiff / ENCODER_PULSES_PER_STEP);
encoderDiff = 0;
// Only move up, whatever the user does.
current_position[Z_AXIS] += fabs(encoderPosition);
encoderPosition = 0;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[Z_AXIS] / 60, active_extruder);
}
if (lcd_clicked()) {
// Wait until the Z up movement is finished.