+#define DEFAULT_MAX_ACCELERATION {1000, 1000, 200, 5000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+
+#define DEFAULT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for retracts
+
+#define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min)
+//#define MAX_SILENT_FEEDRATE 2700 //
+
+#define Z_AXIS_ALWAYS_ON 1
+
+// Automatic recovery after crash is detected
+#define AUTOMATIC_RECOVERY_AFTER_CRASH
+
+//DEBUG
+//#define _NO_ASM
+#define DEBUG_DCODES //D codes
+#if 1
+//#define DEBUG_FSENSOR_LOG //Reports fsensor status to serial
+//#define DEBUG_CRASHDET_COUNTERS //Display crash-detection counters on LCD
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
+//
+// 1047 is Pt1000 with 4k7 pullup
+// 1010 is Pt1000 with 1k pullup (non standard)
+// 147 is Pt100 with 4k7 pullup
+// 148 is E3D Pt100 with 4k7 pullup and no PT100 Amplifier on a MiniRambo 1.3a
+// 247 is Pt100 with 4k7 pullup and PT100 Amplifier
+// 110 is Pt100 with 1k pullup (non standard)
+
+#if defined(E3D_PT100_EXTRUDER_WITH_AMP)
+#define TEMP_SENSOR_0 247
+#elif defined(E3D_PT100_EXTRUDER_NO_AMP)
+#define TEMP_SENSOR_0 148
+#else
+#define TEMP_SENSOR_0 5
+#endif
+#define TEMP_SENSOR_1 0
+#define TEMP_SENSOR_2 0
+#if defined(E3D_PT100_BED_WITH_AMP)
+#define TEMP_SENSOR_BED 247
+#elif defined(E3D_PT100_BED_NO_AMP)
+#define TEMP_SENSOR_BED 148
+#else
+#define TEMP_SENSOR_BED 1
+#endif
+#define TEMP_SENSOR_PINDA 1
+#define TEMP_SENSOR_AMBIENT 2000
+
+#define STACK_GUARD_TEST_VALUE 0xA2A2
+
+#define MAX_BED_TEMP_CALIBRATION 50
+#define MAX_HOTEND_TEMP_CALIBRATION 50
+
+#define MAX_E_STEPS_PER_UNIT 250
+#define MIN_E_STEPS_PER_UNIT 100
+
+#define Z_BABYSTEP_MIN -3999
+#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_Y -3
+#define PINDA_PREHEAT_Z 1*/
+#define PINDA_HEAT_T 120 //time in s
+
+#define PINDA_MIN_T 50
+#define PINDA_STEP_T 10
+#define PINDA_MAX_T 100
+
+#define PING_TIME 60 //time in s
+#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
+#define PING_ALLERT_PERIOD 60 //time in s
+
+#define LONG_PRESS_TIME 1000 //time in ms for button long press
+#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
+
+#define DEFAULT_PID_TEMP 210
+
+#define MIN_PRINT_FAN_SPEED 75
+
+#ifdef SNMM
+#define DEFAULT_RETRACTION 4 //used for PINDA temp calibration and pause print
+#else
+#define DEFAULT_RETRACTION 1 //used for PINDA temp calibration and pause print
+#endif
+
+// How much shall the print head be lifted on power panic?
+// Ideally the Z axis will reach a zero phase of the stepper driver on power outage. To simplify this,
+// UVLO_Z_AXIS_SHIFT shall be an integer multiply of the stepper driver cycle, that is 4x full step.
+// For example, the Prusa i3 MK2 with 16 microsteps per full step has Z stepping of 400 microsteps per mm.
+// At 400 microsteps per mm, a full step lifts the Z axis by 0.04mm, and a stepper driver cycle is 0.16mm.
+// The following example, 12 * (4 * 16 / 400) = 12 * 0.16mm = 1.92mm.
+//#define UVLO_Z_AXIS_SHIFT 1.92
+#define UVLO_Z_AXIS_SHIFT 0.64
+// If power panic occured, and the current temperature is higher then target temperature before interrupt minus this offset, print will be recovered automatically.
// may need add path to avrdude config file: -C"c:\utils\arduino-0016\hardware\tools\avr\etc\avrdude.conf" if Arduino IDE installed in "c:\utils\arduino-0016\"
-extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders
-extern bool volumetric_enabled;
-extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
-extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
-extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
-extern float current_position[NUM_AXIS] ;
-extern float destination[NUM_AXIS] ;
-extern float add_homing[3];
-extern float min_pos[3];
-extern float max_pos[3];
-extern bool axis_known_position[3];
-extern float zprobe_zoffset;
-extern int fanSpeed;
-extern void homeaxis(int axis);
-
-
-#ifdef FAN_SOFT_PWM
-extern unsigned char fanSpeedSoftPwm;
-#endif
-
-#ifdef FILAMENT_SENSOR
- extern float filament_width_nominal; //holds the theoretical filament diameter ie., 3.00 or 1.75
- extern bool filament_sensor; //indicates that filament sensor readings should control extrusion
- extern float filament_width_meas; //holds the filament diameter as accurately measured
- extern signed char measurement_delay[]; //ring buffer to delay measurement
- extern int delay_index1, delay_index2; //index into ring buffer
+extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders
+extern bool volumetric_enabled;
+extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
+extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
+extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
+extern float current_position[NUM_AXIS] ;
+extern float destination[NUM_AXIS] ;
+extern float add_homing[3];
+extern float min_pos[3];
+extern float max_pos[3];
+extern bool axis_known_position[3];
+extern float zprobe_zoffset;
+extern int fanSpeed;
+extern void homeaxis(int axis);
+
+
+#ifdef FAN_SOFT_PWM
+extern unsigned char fanSpeedSoftPwm;
+#endif
+
+#if defined(LCD_PWM_PIN) && (LCD_PWM_PIN > -1)
+extern unsigned char lcdSoftPwm;
+extern unsigned char lcdBlinkDelay;
+#endif
+
+#ifdef FILAMENT_SENSOR
+ extern float filament_width_nominal; //holds the theoretical filament diameter ie., 3.00 or 1.75
+ extern bool filament_sensor; //indicates that filament sensor readings should control extrusion
+ extern float filament_width_meas; //holds the filament diameter as accurately measured
+ extern signed char measurement_delay[]; //ring buffer to delay measurement
+ extern int delay_index1, delay_index2; //index into ring buffer
+ if ((farm_mode == 0xFF && farm_no == 0) || (farm_no == 0xFFFF)) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode
+ if (farm_no == 0xFFFF) farm_no = 0;
+ if (farm_mode)
+ {
+ prusa_statistics(8);
+ selectedSerialPort = 1;
+ }
+ else
+ selectedSerialPort = 0;
+ MYSERIAL.begin(BAUDRATE);
+ fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream
+ stdout = uartout;
+ SERIAL_PROTOCOLLNPGM("start");
+ SERIAL_ECHO_START;
- if (usb_printing_counter > 0 && millis()-_usb_timer > 1000)
+
+#if 0
+ SERIAL_ECHOLN("Reading eeprom from 0 to 100: start");
+ for (int i = 0; i < 4096; ++i) {
+ int b = eeprom_read_byte((unsigned char*)i);
+ if (b != 255) {
+ SERIAL_ECHO(i);
+ SERIAL_ECHO(":");
+ SERIAL_ECHO(b);
+ SERIAL_ECHOLN("");
+ }
+ }
+ SERIAL_ECHOLN("Reading eeprom from 0 to 100: done");
+#endif
+
+ // Check startup - does nothing if bootloader sets MCUSR to 0
+ byte mcu = MCUSR;
+/* if (mcu & 1) SERIAL_ECHOLNRPGM(MSG_POWERUP);
+ if (mcu & 2) SERIAL_ECHOLNRPGM(MSG_EXTERNAL_RESET);
+ if (mcu & 4) SERIAL_ECHOLNRPGM(MSG_BROWNOUT_RESET);
+ if (mcu & 8) SERIAL_ECHOLNRPGM(MSG_WATCHDOG_RESET);
+ if (mcu & 32) SERIAL_ECHOLNRPGM(MSG_SOFTWARE_RESET);*/
+ if ((farm_mode == 0xFF && farm_no == 0) || (farm_no == 0xFFFF)) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode
+ eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
+ eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
+ int mesh_point = 0; //index number of calibration point
+
+ int ix = 0;
+ int iy = 0;
+
+ int XY_AXIS_FEEDRATE = homing_feedrate[X_AXIS] / 20;
+ int Z_PROBE_FEEDRATE = homing_feedrate[Z_AXIS] / 60;
+ int Z_LIFT_FEEDRATE = homing_feedrate[Z_AXIS] / 40;
+ bool has_z = is_bed_z_jitter_data_valid(); //checks if we have data from Z calibration (offsets of the Z heiths of the 8 calibration points from the first point)
+ #ifdef SUPPORT_VERBOSITY
+ if (verbosity_level >= 1) {
+ has_z ? SERIAL_PROTOCOLPGM("Z jitter data from Z cal. valid.\n") : SERIAL_PROTOCOLPGM("Z jitter data from Z cal. not valid.\n");
+ }
+ #endif // SUPPORT_VERBOSITY
+ setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100
+ const char *kill_message = NULL;
+ while (mesh_point != MESH_MEAS_NUM_X_POINTS * MESH_MEAS_NUM_Y_POINTS) {
+ // Get coords of a measuring point.
+ ix = mesh_point % MESH_MEAS_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1
+ iy = mesh_point / MESH_MEAS_NUM_X_POINTS;
+ if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag
+ if (!find_bed_induction_sensor_point_z((has_z && mesh_point > 0) ? z0 - Z_CALIBRATION_THRESHOLD : -10.f)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point
+ if (has_z && fabs(z0 - current_position[Z_AXIS]) > Z_CALIBRATION_THRESHOLD) { //if we have data from z calibration, max. allowed difference is 1mm for each point
+ mbl.upsample_3x3(); //bilinear interpolation from 3x3 to 7x7 points while using the same array z_values[iy][ix] for storing (just coppying measured data to new destination and interpolating between them)
+ SERIAL_ECHOLNPGM("Upsample finished");
+ mbl.active = 1; //activate mesh bed leveling
+ SERIAL_ECHOLNPGM("Mesh bed leveling activated");
+ if (!find_bed_induction_sensor_point_z(-10.f)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point
+ break;
+ card.closefile();
+ }
+
+
+ //memset(numb_wldsd, 0, sizeof(numb_wldsd));
+ //dtostrf(d_ReadData(), 8, 5, numb_wldsd);
+ //strcat(data_wldsd, numb_wldsd);
+
+
+
+ //MYSERIAL.println(data_wldsd);
+ //delay(1000);
+ //delay(3000);
+ //t1 = millis();
+
+ //while (digitalRead(D_DATACLOCK) == LOW) {}
+ //while (digitalRead(D_DATACLOCK) == HIGH) {}
+ memset(digit, 0, sizeof(digit));
+ //cli();
+ digitalWrite(D_REQUIRE, LOW);
+
+ for (int i = 0; i<13; i++)
+ {
+ //t1 = millis();
+ for (int j = 0; j < 4; j++)
+ {
+ while (digitalRead(D_DATACLOCK) == LOW) {}
+ while (digitalRead(D_DATACLOCK) == HIGH) {}
+ bitWrite(digit[i], j, digitalRead(D_DATA));
+ }
+ //t_delay = (millis() - t1);
+ //SERIAL_PROTOCOLPGM(" ");
+ //SERIAL_PROTOCOL_F(t_delay, 5);
+ //SERIAL_PROTOCOLPGM(" ");
+ }
+ //sei();
+ digitalWrite(D_REQUIRE, HIGH);
+ mergeOutput[0] = '\0';
+ output = 0;
+ for (int r = 5; r <= 10; r++) //Merge digits
+ {
+ sprintf(str, "%d", digit[r]);
+ strcat(mergeOutput, str);
+ }
+
+ output = atof(mergeOutput);
+
+ if (digit[4] == 8) //Handle sign
+ {
+ output *= -1;
+ }
+
+ for (int i = digit[11]; i > 0; i--) //Handle floating point
+ {
+ output *= 0.1;
+ }
+
+
+ //output = d_ReadData();
+
+ //row[ix] = current_position[Z_AXIS];
+
+ memset(data_wldsd, 0, sizeof(data_wldsd));
+
+ for (int i = 0; i <3; i++) {
+ memset(numb_wldsd, 0, sizeof(numb_wldsd));
+ dtostrf(current_position[i], 8, 5, numb_wldsd);
+ strcat(data_wldsd, numb_wldsd);
+ strcat(data_wldsd, ";");
+
+ }
+ memset(numb_wldsd, 0, sizeof(numb_wldsd));
+ dtostrf(output, 8, 5, numb_wldsd);
+ strcat(data_wldsd, numb_wldsd);
+ //strcat(data_wldsd, ";");
+ card.write_command(data_wldsd);
+
+
+ //row[ix] = d_ReadData();
+
+ row[ix] = output; // current_position[Z_AXIS];
+
+ if (iy % 2 == 1 ? ix == 0 : ix == x_points_num - 1) {
+ for (int i = 0; i < x_points_num; i++) {
+ SERIAL_PROTOCOLPGM(" ");
+ SERIAL_PROTOCOL_F(row[i], 5);
+
+
+ }
+ SERIAL_PROTOCOLPGM("\n");
+ }
+ custom_message_state--;
+ mesh_point++;
+ lcd_update(1);
+
+ }
+ card.closefile();
+
+}
+#endif
+
+void temp_compensation_start() {
+
+ custom_message = true;
+ custom_message_type = 5;
+ custom_message_state = PINDA_HEAT_T + 1;
+ lcd_update(2);
+ if (degHotend(active_extruder) > EXTRUDE_MINTEMP) {
//files auto[0-9].g on the sd card are performed in a row
//this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset
-const char MSG_BABYSTEP_Z_NOT_SET_EN[] PROGMEM = "Printer has not been calibrated yet. Run calibration G-code to adjust Z height.";
-const char MSG_BABYSTEP_Z_NOT_SET_CZ[] PROGMEM = "Tiskarna nebyla jeste zkalibrovana. Spustte kalibracni G-kod a doladte Z.";
-const char MSG_BABYSTEP_Z_NOT_SET_IT[] PROGMEM = "Printer has not been calibrated yet. Run calibration G-code to adjust Z height.";
-const char MSG_BABYSTEP_Z_NOT_SET_ES[] PROGMEM = "Printer has not been calibrated yet. Run calibration G-code to adjust Z height.";
-const char MSG_BABYSTEP_Z_NOT_SET_PL[] PROGMEM = "Printer has not been calibrated yet. Run calibration G-code to adjust Z height.";
+const char MSG_BABYSTEP_Z_NOT_SET_EN[] PROGMEM = "Distance between tip of the nozzle and the bed surface has not been set yet. Please follow the manual, chapter First steps, section First layer calibration.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR_EN[] PROGMEM = "X/Y calibration failed. Left front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR_CZ[] PROGMEM = "Kalibrace X/Y selhala. Levy predni bod moc vpredu. Srovnejte tiskarnu.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR_IT[] PROGMEM = "X/Y calibration failed. Left front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR_ES[] PROGMEM = "X/Y calibration failed. Left front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR_PL[] PROGMEM = "X/Y calibration failed. Left front calibration point not reachable.";
+const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR_EN[] PROGMEM = "XYZ calibration failed. Left front calibration point not reachable.";
+const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR_CZ[] PROGMEM = "Kalibrace XYZ selhala. Levy predni bod moc vpredu. Srovnejte tiskarnu.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR_EN[] PROGMEM = "X/Y calibration failed. Right front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR_CZ[] PROGMEM = "Kalibrace X/Y selhala. Pravy predni bod moc vpredu. Srovnejte tiskarnu.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR_IT[] PROGMEM = "X/Y calibration failed. Right front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR_ES[] PROGMEM = "X/Y calibration failed. Right front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR_PL[] PROGMEM = "X/Y calibration failed. Right front calibration point not reachable.";
+const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR_EN[] PROGMEM = "XYZ calibration failed. Right front calibration point not reachable.";
+const char MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR_CZ[] PROGMEM = "Kalibrace XYZ selhala. Pravy predni bod moc vpredu. Srovnejte tiskarnu.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR_EN[] PROGMEM = "X/Y calibration compromised. Left front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR_CZ[] PROGMEM = "Kalibrace X/Y nepresna. Levy predni bod moc vpredu.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR_IT[] PROGMEM = "X/Y calibration compromised. Left front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR_ES[] PROGMEM = "X/Y calibration compromised. Left front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR_PL[] PROGMEM = "X/Y calibration compromised. Left front calibration point not reachable.";
+const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR_EN[] PROGMEM = "XYZ calibration compromised. Left front calibration point not reachable.";
+const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR_CZ[] PROGMEM = "Kalibrace XYZ nepresna. Levy predni bod moc vpredu.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR_EN[] PROGMEM = "X/Y calibration compromised. Right front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR_CZ[] PROGMEM = "Kalibrace X/Y nepresna. Pravy predni bod moc vpredu.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR_IT[] PROGMEM = "X/Y calibration compromised. Right front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR_ES[] PROGMEM = "X/Y calibration compromised. Right front calibration point not reachable.";
-const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR_PL[] PROGMEM = "X/Y calibration compromised. Right front calibration point not reachable.";
+const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR_EN[] PROGMEM = "XYZ calibration compromised. Right front calibration point not reachable.";
+const char MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR_CZ[] PROGMEM = "Kalibrace XYZ nepresna. Pravy predni bod moc vpredu.";
+const char MSG_CONFIRM_NOZZLE_CLEAN_FIL_ADJ_EN[] PROGMEM = "Filaments are now adjusted. Please clean the nozzle for calibration. Click when done.";
+const char MSG_CONFIRM_NOZZLE_CLEAN_FIL_ADJ_CZ[] PROGMEM = "Filamenty jsou srovnany. Pro uspesnou kalibraci prosim ocistete trysku. Po te potvrdte tlacitkem.";
const char MSG_ERR_STOPPED_EN[] PROGMEM = "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)";
-const char MSG_ERR_STOPPED_CZ[] PROGMEM = "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)";
-const char MSG_ERR_STOPPED_IT[] PROGMEM = "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)";
-const char MSG_ERR_STOPPED_ES[] PROGMEM = "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)";
-const char MSG_ERR_STOPPED_PL[] PROGMEM = "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)";
+const char MSG_FOLLOW_CALIBRATION_FLOW_EN[] PROGMEM = "Printer has not been calibrated yet. Please follow the manual, chapter First steps, section Calibration flow.";
+const char MSG_FOLLOW_CALIBRATION_FLOW_CZ[] PROGMEM = "Tiskarna nebyla jeste zkalibrovana. Postupujte prosim podle manualu, kapitola Zaciname, odstavec Postup kalibrace.";
-const char MSG_MOVE_CARRIAGE_TO_THE_TOP_EN[] PROGMEM = "Calibrating X/Y. Move Z carriage up to the end stoppers. Click when done.";
-const char MSG_MOVE_CARRIAGE_TO_THE_TOP_CZ[] PROGMEM = "Kalibrace X/Y. Posunte prosim Z osu az k~hornimu dorazu. Potvrdte tlacitkem.";
-const char MSG_MOVE_CARRIAGE_TO_THE_TOP_IT[] PROGMEM = "Calibrating X/Y. Move Z carriage up to the end stoppers. Click when done.";
-const char MSG_MOVE_CARRIAGE_TO_THE_TOP_ES[] PROGMEM = "Calibrating X/Y. Move Z carriage up to the end stoppers. Click when done.";
-const char MSG_MOVE_CARRIAGE_TO_THE_TOP_PL[] PROGMEM = "Calibrating X/Y. Move Z carriage up to the end stoppers. Click when done.";
+const char MSG_MOVE_CARRIAGE_TO_THE_TOP_EN[] PROGMEM = "Calibrating XYZ. Rotate the knob to move the Z carriage up to the end stoppers. Click when done.";
+const char MSG_MOVE_CARRIAGE_TO_THE_TOP_CZ[] PROGMEM = "Kalibrace XYZ. Otacenim tlacitka posunte Z osu az k~hornimu dorazu. Potvrdte tlacitkem.";
+const char MSG_MOVE_CARRIAGE_TO_THE_TOP_Z_EN[] PROGMEM = "Calibrating Z. Rotate the knob to move the Z carriage up to the end stoppers. Click when done.";
+const char MSG_MOVE_CARRIAGE_TO_THE_TOP_Z_CZ[] PROGMEM = "Kalibrace Z. Otacenim tlacitka posunte Z osu az k~hornimu dorazu. Potvrdte tlacitkem.";
+const char MSG_PAPER_EN[] PROGMEM = "Place a sheet of paper under the nozzle during the calibration of first 4 points. If the nozzle catches the paper, power off the printer immediately.";
+const char MSG_PAPER_CZ[] PROGMEM = "Umistete list papiru na podlozku a udrzujte jej pod tryskou behem mereni prvnich 4 bodu. Pokud tryska zachyti papir, vypnete tiskarnu.";
+const char MSG_WIZARD_CALIBRATION_FAILED_EN[] PROGMEM = "Please check our handbook and fix the problem. Then resume the Wizard by rebooting the printer.";
+const char MSG_WIZARD_CALIBRATION_FAILED_CZ[] PROGMEM = "Prosim nahlednete do manualu a opravte problem. Po te obnovte Wizarda rebootovanim tiskarny.";
+const char MSG_WIZARD_V2_CAL_2_EN[] PROGMEM = "I will start to print line and you will gradually lower the nozzle by rotating the knob, until you reach optimal height. Check the pictures in our handbook in chapter Calibration.";
+const char MSG_WIZARD_V2_CAL_2_CZ[] PROGMEM = "Zacnu tisknout linku a Vy budete postupne snizovat trysku otacenim tlacitka dokud nedosahnete optimalni vysky. Prohlednete si obrazky v nasi prirucce v kapitole Kalibrace";
-#define MSG_BABYSTEP_Z_NOT_SET "Tiskarna nebyla jeste zkalibrovana. Spustte kalibracni G-kod a doladte Z."
+#define MSG_FOLLOW_CALIBRATION_FLOW "Tiskarna nebyla jeste zkalibrovana. Postupujte prosim podle manualu, kapitola Zaciname, odstavec Postup kalibrace."
+#define MSG_BABYSTEP_Z_NOT_SET "Neni zkalibrovana vzdalenost trysky od tiskove podlozky. Postupujte prosim podle manualu, kapitola Zaciname, odstavec Nastaveni prvni vrstvy."
+#define MSG_PAPER "Umistete list papiru na podlozku a udrzujte jej pod tryskou behem mereni prvnich 4 bodu. Pokud tryska zachyti papir, vypnete tiskarnu."
+#define MSG_WIZARD_Z_CAL "Nyni provedu z kalibraci."
+#define MSG_WIZARD_WILL_PREHEAT "Nyni predehreji trysku pro PLA."
+#define MSG_WIZARD_V2_CAL "Nyni zkalibruji vzdalenost mezi koncem trysky a povrchem heatbedu."
+#define MSG_WIZARD_V2_CAL_2 "Zacnu tisknout linku a Vy budete postupne snizovat trysku otacenim tlacitka dokud nedosahnete optimalni vysky. Prohlednete si obrazky v nasi prirucce v kapitole Kalibrace"
+#define MSG_V2_CALIBRATION "Kal. prvni vrstvy"
+#define MSG_WIZARD_DONE "Vse je hotovo."
+#define MSG_WIZARD_LOAD_FILAMENT "Prosim vlozte PLA filament do extruderu, po te stisknete tlacitko pro zavedeni filamentu."
+#define MSG_WIZARD_RERUN "Spusteni Wizarda vymaze ulozene vysledky vsech kalibraci a spusti kalibracni proces od zacatku. Pokracovat?"
+#define MSG_WIZARD_REPEAT_V2_CAL "Chcete opakovat posledni krok a pozmenit vzdalenost mezi tryskou a heatbed?"
+#define MSG_WIZARD_CLEAN_HEATBED "Prosim ocistete heatbed a stisknete tlacitko."
+#define MSG_WIZARD_PLA_FILAMENT "Je to PLA filament?"
+#define MSG_WIZARD_INSERT_CORRECT_FILAMENT "Prosim zavedte PLA filament a po te obnovte Wizarda stisknutim reset tlacitka."
+ + #define MSG_ERR_STOPPED "Drucker aufgrund von Fehlern gestoppt. Fehler beheben und mit M999 neu starten. (Temperatur wird zurueckgesetzt. Nach dem Neustart neu einstellen!)"
++#define(length = 20, lines = 8) MSG_MOVE_CARRIAGE_TO_THE_TOP "Kalibrieren von XYZ. Drehen Sie den Knopf bis der obere Anschlag erreicht wird. Klicken Sie den Knopf wenn es ganz oben wird."
++ #define(length = 20, lines = 8) MSG_MOVE_CARRIAGE_TO_THE_TOP_Z "Kalibrieren von Z. Drehen Sie den Knopf bis der obere Anschlag erreicht wird. Klicken Sie den Knopf wenn es ganz oben wird."
++
+
++#define(length = 20, lines = 8) MSG_CONFIRM_NOZZLE_CLEAN "Bitte entfernen Sie ueberstehendes Filament von der Duese. Klicken wenn sauber."
++ #define(length = 20, lines = 2) MSG_CONFIRM_CARRIAGE_AT_THE_TOP "Ist der Schlitten ganz oben?"
++ #define(length = 20, lines = 8) MSG_FOLLOW_CALIBRATION_FLOW "Der Drucker wurde noch nicht kalibriert. Bitte folgen Sie das Handbuch, Kapitel First steps, Abschnitt Calibration flow."
++ #define(length = 20, lines = 12) MSG_BABYSTEP_Z_NOT_SET "Der Abstand zwischen der Spitze der Duese und der Bett ist noch nicht eingestellt. Bitte folgen Sie dem Handbuch, First steps, section First layer calibration."
++
++
+
++ #define(length = 20, lines = 4) MSG_FILAMENT_LOADING_T0 "Filament in extruder 1 einlegen. Klicken wenn fertig."
++ #define(length = 20, lines = 4) MSG_FILAMENT_LOADING_T1 "Filament in extruder 2 einlegen. Klicken wenn fertig."
++ #define(length = 20, lines = 4) MSG_FILAMENT_LOADING_T2 "Filament in extruder 3 einlegen. Klicken wenn fertig."
++ #define(length = 20, lines = 4) MSG_FILAMENT_LOADING_T3 "Filament in extruder 4 einlegen. Klicken wenn fertig."
++ #define(length = 20, lines = 8) MSG_CONFIRM_NOZZLE_CLEAN_FIL_ADJ "Filamente sind jetzt eingestellt. Bitte reinigen Sie die Duese zur Kalibrierung. Klicken wenn fertig."
++ #define(length = 20, lines = 8) MSG_PAPER "Legen ein Blatt Papier unter die Duese waehrend der Kalibrierung der ersten 4 Punkte. Wenn die Duese das Papier einklemmt, Drucker sofort ausschalten"
+#define MSG_CHOOSE_EXTRUDER "Waehlen Sie Extruder"
+#define MSG_EXTRUDER "Extruder"
+#define MSG_EXTRUDER_1 "Extruder 1"
+#define MSG_EXTRUDER_2 "Extruder 2"
+#define MSG_EXTRUDER_3 "Extruder 3"
+#define MSG_EXTRUDER_4 "Extruder 4"
+
+#define MSG_WIZARD "Wizard"
+#define MSG_WIZARD_WELCOME "Hallo, ich bin dein Original Prusa i3 Drucker. Moechten Sie meine Hilfe durch den Setup-Prozess?"
+#define MSG_WIZARD_QUIT "Sie koennen immer den Asistenten im Menu neu aufrufen: Kalibrierung -> Assistant"
+#define MSG_WIZARD_SELFTEST "Zunaechst fuehre ich den Selbsttest durch um die haeufigsten Probleme bei der Aufbau zu ueberpruefen."
+#define MSG_WIZARD_CALIBRATION_FAILED "Bitte ueberpruefen Sie unser Handbuch und beheben Sie das Problem. Fahren Sie dann mit dem Assistenten fort, indem Sie den Drucker neu starten."
+#define MSG_WIZARD_XYZ_CAL "Ich werde jetzt die XYZ-Kalibrierung durchfuehren. Es wird ca. 12 Minuten dauern"
+#define MSG_WIZARD_FILAMENT_LOADED "Ist das Filament geladen?"
+#define MSG_WIZARD_Z_CAL "Ich werde jetzt die Z Kalibrierung durchfuehren."
+#define MSG_WIZARD_WILL_PREHEAT "Jetzt werde ich die Duese fuer PLA vorheizen. "
+#define MSG_WIZARD_V2_CAL "Jetzt werde ich den Abstand zwischen Duesenspitze und Druckbett kalibrieren."
+#define MSG_WIZARD_V2_CAL_2 "Ich werde jetzt erste Linie drucken. Waehrend des Druckes koennen Sie die Duese allmaehlich senken indem Sie den Knopf drehen, bis Sie die optimale Hoehe erreichen. Ueberpruefen Sie die Bilder in unserem Handbuch im Kapitel Kalibrierung"
+#define MSG_V2_CALIBRATION "Erste-Schicht Kal"
+#define MSG_WIZARD_DONE "Alles wurde getan. Viel Spass beim Drucken!"
+#define MSG_WIZARD_LOAD_FILAMENT "Fuehren Sie bitte PLA Filament in den Extruder und bestaetigen Sie den Knopf um es zu laden."
+#define MSG_WIZARD_RERUN "Der laufende Assistent loescht die aktuelle Kalibrierergebnisse und wird von Anfang an beginnen. Fortsetzen?"
+#define MSG_WIZARD_REPEAT_V2_CAL "Moechten Sie den letzten Schritt wiederholen um den Abstand zwischen Duese und Druckbett neu einzustellen?"
+#define MSG_WIZARD_CLEAN_HEATBED "Bitte reinigen Sie das Heizbett und druecken Sie dann den Knopf."
+#define MSG_WIZARD_PLA_FILAMENT "Ist es wirklich PLA Filament?"
+#define MSG_WIZARD_INSERT_CORRECT_FILAMENT "Bitte laden Sie PLA-Filament und fahren Sie mit dem Assistenten fort, indem Sie den Drucker neu starten."
+#define(length=20,lines=8) MSG_MOVE_CARRIAGE_TO_THE_TOP "Calibrating XYZ. Rotate the knob to move the Z carriage up to the end stoppers. Click when done."
+#define(length=20,lines=8) MSG_MOVE_CARRIAGE_TO_THE_TOP_Z "Calibrating Z. Rotate the knob to move the Z carriage up to the end stoppers. Click when done."
+
+#define(length=20,lines=8) MSG_CONFIRM_NOZZLE_CLEAN "Please clean the nozzle for calibration. Click when done."
+#define(length=20,lines=2) MSG_CONFIRM_CARRIAGE_AT_THE_TOP "Are left and right Z~carriages all up?"
+
+#define(length=60) MSG_FIND_BED_OFFSET_AND_SKEW_LINE1 "Searching bed calibration point"
+#define(length=14) MSG_FIND_BED_OFFSET_AND_SKEW_LINE2 " of 4"
+#define(length=60) MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1 "Improving bed calibration point"
+#define(length=14) MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE2 " of 4"
+#define(length=60) MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1 "Measuring reference height of calibration point"
+#define(length=14) MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2 " of 9"
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND "XYZ calibration failed. Bed calibration point was not found."
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED "XYZ calibration failed. Please consult the manual."
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_PERFECT "XYZ calibration ok. X/Y axes are perpendicular. Congratulations!"
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_SKEW_MILD "XYZ calibration all right. X/Y axes are slightly skewed. Good job!"
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME "XYZ calibration all right. Skew will be corrected automatically."
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR "XYZ calibration failed. Left front calibration point not reachable."
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR "XYZ calibration failed. Right front calibration point not reachable."
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_BOTH_FAR "XYZ calibration failed. Front calibration points not reachable."
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR "XYZ calibration compromised. Left front calibration point not reachable."
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR "XYZ calibration compromised. Right front calibration point not reachable."
+#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR "XYZ calibration compromised. Front calibration points not reachable."
+
+#define(length=20,lines=4) MSG_BED_LEVELING_FAILED_POINT_LOW "Bed leveling failed. Sensor didnt trigger. Debris on nozzle? Waiting for reset."
+#define(length=20,lines=4) MSG_BED_LEVELING_FAILED_POINT_HIGH "Bed leveling failed. Sensor triggered too high. Waiting for reset."
+#define(length=20,lines=4) MSG_BED_LEVELING_FAILED_PROBE_DISCONNECTED "Bed leveling failed. Sensor disconnected or cable broken. Waiting for reset."
+
+#define(length=20,lines=2) MSG_NEW_FIRMWARE_AVAILABLE "New firmware version available:"
+#define(length=20,lines=8) MSG_FOLLOW_CALIBRATION_FLOW "Printer has not been calibrated yet. Please follow the manual, chapter First steps, section Calibration flow."
+#define(length=20,lines=12) MSG_BABYSTEP_Z_NOT_SET "Distance between tip of the nozzle and the bed surface has not been set yet. Please follow the manual, chapter First steps, section First layer calibration."
+
+#define(length=20, lines=4) MSG_FILAMENT_LOADING_T0 "Insert filament into extruder 1. Click when done."
+#define(length=20, lines=4) MSG_FILAMENT_LOADING_T1 "Insert filament into extruder 2. Click when done."
+#define(length=20, lines=4) MSG_FILAMENT_LOADING_T2 "Insert filament into extruder 3. Click when done."
+#define(length=20, lines=4) MSG_FILAMENT_LOADING_T3 "Insert filament into extruder 4. Click when done."
+#define(length=20, lines=8) MSG_PAPER "Place a sheet of paper under the nozzle during the calibration of first 4 points. If the nozzle catches the paper, power off the printer immediately."
+#define(length=20, lines=7) MSG_WIZARD_WELCOME "Hi, I am your Original Prusa i3 printer. Would you like me to guide you through the setup process?"
+#define(length=20, lines=8) MSG_WIZARD_QUIT "You can always resume the Wizard from Calibration -> Wizard."
+#define(length=20, lines=8) MSG_WIZARD_SELFTEST "First, I will run the selftest to check most common assembly problems."
+#define(length=20, lines=8) MSG_WIZARD_CALIBRATION_FAILED "Please check our handbook and fix the problem. Then resume the Wizard by rebooting the printer."
+#define(length=20, lines=8) MSG_WIZARD_XYZ_CAL "I will run xyz calibration now. It will take approx. 12 mins."
+#define(lenght=20, lines=8) MSG_WIZARD_V2_CAL "Now I will calibrate distance between tip of the nozzle and heatbed surface."
+#define(lenght=20, lines=12) MSG_WIZARD_V2_CAL_2 "I will start to print line and you will gradually lower the nozzle by rotating the knob, until you reach optimal height. Check the pictures in our handbook in chapter Calibration."
+#define MSG_NEW_FIRMWARE_PLEASE_UPGRADE "Actualizar por favor"
+#define MSG_FOLLOW_CALIBRATION_FLOW "Impresora no esta calibrada todavia. Por favor usa el manual, capitulo First steps, Calibration flow."
+#define MSG_BABYSTEP_Z_NOT_SET "Distancia entre la punta del nozzle y la superficie de la heatbed aun no fijada. Por favor siga el manual, capitulo First steps, First layer calibration."
+#define MSG_BED_CORRECTION_MENU "Corr. de la cama"
+#define MSG_BED_CORRECTION_LEFT "Izquierda [um]"
+#define MSG_BED_CORRECTION_RIGHT "Derecha [um]"
+#define MSG_BED_CORRECTION_FRONT "Frontal [um]"
+#define MSG_BED_CORRECTION_REAR "Trasera [um]"
+#define MSG_BED_CORRECTION_RESET "Reset"
+
+#define MSG_MESH_BED_LEVELING "Mesh Bed Leveling"
+#define MSG_PAPER "Colocar una hoja de papel sobre la superficie de impresion durante la calibracion de los primeros 4 puntos. Si la boquilla mueve el papel, apagar impresora inmediatamente."
+#define MSG_WIZARD_WELCOME "Hola, soy tu impresora Original Prusa i3. Quieres que te guie a traves de la configuracion?"
+#define MSG_WIZARD_QUIT "Siempre puedes acceder al asistente desde Calibracion -> Wizard"
+#define MSG_WIZARD_SELFTEST "Primero, hare el Selftest para comprobar los problemas de montaje mas comunes."
+#define MSG_WIZARD_CALIBRATION_FAILED "Lee el manual y resuelve el problema. Despues, reinicia la impresora y continua con el Wizard"
+#define MSG_WIZARD_XYZ_CAL "Hare la calibracion XYZ. Tardara 12 min. aproximadamente."
+#define MSG_WIZARD_FILAMENT_LOADED "Esta el filamento cargado?"
+#define MSG_WIZARD_Z_CAL "Voy a hacer Calibracion Z ahora."
+#define MSG_WIZARD_WILL_PREHEAT "Voy a precalentar el nozzle para PLA ahora."
+#define MSG_WIZARD_V2_CAL "Voy a calibrar la distancia entre la punta del nozzle y la superficie de la heatbed."
+#define MSG_WIZARD_V2_CAL_2 "Voy a comenzar a imprimir la linea y tu bajaras el nozzle gradualmente al rotar el mando, hasta que llegues a la altura optima. Mira las imagenes del capitulo Calibracion en el manual."
+#define MSG_FOLLOW_CALIBRATION_FLOW "Stampante ancora non calibrata. Si prega di seguire il manuale, capitolo PRIMI PASSI, sezione della calibrazione."
+#define MSG_BABYSTEP_Z_NOT_SET "Distanza tra la punta dell'ugello e la superficie del letto non ancora imposta. Si prega di seguire il manuale, capitolo First steps, sezione First layer calibration."
+#define MSG_PAPER "Porre un foglio sotto l'ugello durante la calibrazione dei primi 4 punti. In caso l'ugello muova il foglio spegnere prontamente la stampante."
+
+#define MSG_FINISHING_MOVEMENTS "Arresto in corso"
+#define MSG_WIZARD_WELCOME "Ciao, sono la tua stampante Original Prusa i3. Gradiresti aiuto attraverso il processo di configurazione?"
+#define MSG_WIZARD_QUIT "E possibile proseguire la guide Wizard in qualsiasi momento attraverso Calibrazione -> Wizard."
+#define MSG_WIZARD_SELFTEST "Anzitutto avviero il Self Test per controllare gli errori di assemblaggio piu comuni."
+#define MSG_WIZARD_CALIBRATION_FAILED "Per favore consulta il nostro manuale per risolvere il problema. Poi riprendi il Wizard dopo aver riavviato la stampante."
+#define MSG_WIZARD_XYZ_CAL "Adesso avviero una Calibrazione XYZ. Puo durare circa 12 min."
+#define MSG_WIZARD_FILAMENT_LOADED "Il filamento e stato caricato?"
+#define MSG_WIZARD_Z_CAL "Adesso avviero una Calibrazione Z."
+#define MSG_WIZARD_WILL_PREHEAT "Adesso preriscaldero l'ugello per PLA."
+#define MSG_WIZARD_V2_CAL "Adesso tarero lo stacco fra ugello e superfice del piatto."
+#define MSG_WIZARD_V2_CAL_2 "Adesso iniziero a stampare una linea e tu dovrai abbassare l'ugello poco per volta ruotando la manopola sino a raggiungere una altezza ottimale. Per favore dai uno sguardo all'immagine del nostro manuale, cap.Calibrazione."
+#define MSG_FOLLOW_CALIBRATION_FLOW "Drukarka nie zostala jeszcze skalibrowana. Prosze kierowac sie instrukcja, rozdzial Zaczynamy, podrozdzial Selftest."
+#define MSG_BABYSTEP_Z_NOT_SET "Odleglosc dyszy od podkladki nie jest skalibrowana. Postepuj zgodnie z instrukcja rozdzial Zaczynamy, podrozdzial Kalibracja pierwszej warstwy."
+#define MSG_PAPER "Umiesc kartke papieru na podkladce i trzymaj pod dysza podczas pomiaru pierwszych 4 punktow. Jesli dysza zahaczy o papier, wylacz drukarke."
+ if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2) return result; //if fitting failed and front center point is out of reach, terminate calibration and inform user
- accelerate_steps = max(accelerate_steps,0); // Check limits due to numerical round-off
- accelerate_steps = min((uint32_t)accelerate_steps,block->step_event_count);//(We can cast here to unsigned, because the above line ensures that we are above zero)
- plateau_steps = 0;
+ if (accel_decel_steps < block->step_event_count) {
// Planner flag for nominal speed always reached. That means, the segment is long enough, that the nominal speed
// may be reached if accelerating from a safe speed (in the regard of jerking from zero speed).
BLOCK_FLAG_NOMINAL_LENGTH = 2,
- // If set, the machine will stop to a full halt at the end of this block,
- // respecting the maximum allowed jerk.
- BLOCK_FLAG_FULL_HALT_AT_END = 4,
// If set, the machine will start from a halt at the start of this block,
// respecting the maximum allowed jerk.
- BLOCK_FLAG_START_FROM_FULL_HALT = 8,
+ BLOCK_FLAG_START_FROM_FULL_HALT = 4,
};
// This struct is used when buffering the setup for each linear movement "nominal" values are as specified in
@@ -58,12 +55,6 @@ typedef struct {
// accelerate_until and decelerate_after are set by calculate_trapezoid_for_block() and they need to be synchronized with the stepper interrupt controller.
long accelerate_until; // The index of the step event on which to stop acceleration
long decelerate_after; // The index of the step event on which to start decelerating
- #ifdef ADVANCE
- long advance_rate;
- volatile long initial_advance;
- volatile long final_advance;
- float advance;
- #endif
// Fields used by the motion planner to manage acceleration
// float speed_x, speed_y, speed_z, speed_e; // Nominal mm/sec for each axis
@@ -85,14 +76,31 @@ typedef struct {
// Settings for the trapezoid generator (runs inside an interrupt handler).
// Changing the following values in the planner needs to be synchronized with the interrupt handler by disabling the interrupts.
+ //FIXME nominal_rate, initial_rate and final_rate are limited to uint16_t by MultiU24X24toH16 in the stepper interrupt anyway!
unsigned long nominal_rate; // The nominal step rate for this block in step_events/sec
unsigned long initial_rate; // The jerk-adjusted step rate at start of block
unsigned long final_rate; // The minimal rate at exit
unsigned long acceleration_st; // acceleration steps/sec^2
+ //FIXME does it have to be unsigned long? Probably uint8_t would be just fine.
unsigned long fan_speed;
volatile char busy;
+
+
+ // Pre-calculated division for the calculate_trapezoid_for_block() routine to run faster.
+ float speed_factor;
+
+#ifdef LIN_ADVANCE
+ bool use_advance_lead;
+ unsigned long abs_adv_steps_multiplier8; // Factorised by 2^8 to avoid float
+ if (temp_runaway_status[_heater_id] == TempRunaway_PREHEAT)
+ {
+ if (_current_temperature < ((_isbed) ? (0.8 * _target_temperature) : 150)) //check only in area where temperature is changing fastly for heater, check to 0.8 x target temperature for bed
+ {
+ __preheat_counter[_heater_id]++;
+ if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes
+ {
+ /*SERIAL_ECHOPGM("Heater:");
+ MYSERIAL.print(_heater_id);
+ SERIAL_ECHOPGM(" T:");
+ MYSERIAL.print(_current_temperature);
+ SERIAL_ECHOPGM(" Tstart:");
+ MYSERIAL.print(__preheat_start[_heater_id]);*/
+
+ if (_current_temperature - __preheat_start[_heater_id] < 2) {
+// These values have been calculated and tested over many days. See https://docs.google.com/spreadsheets/d/1MJXa6feEe0mGVCT2TrBwLxVOMoLDkJlvfQ4JXhAdV_E
+// Values that are missing from the 5C gap are missing due to resolution limits.
+{19.00000 * OVERSAMPLENR, 0},
+{19.25000 * OVERSAMPLENR, 5},
+{19.50000 * OVERSAMPLENR, 10},
+{19.87500 * OVERSAMPLENR, 15},
+{20.25000 * OVERSAMPLENR, 20},
+{21.00000 * OVERSAMPLENR, 25},
+{21.75000 * OVERSAMPLENR, 35},
+{22.00000 * OVERSAMPLENR, 40},
+{23.00000 * OVERSAMPLENR, 50}, // 55C is more commonly used.
static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue, menuFunc_t callbackFunc);
+*/
#define ENCODER_FEEDRATE_DEADZONE 10
@@ -228,37 +300,36 @@ volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad
volatile uint8_t slow_buttons;//Contains the bits of the currently pressed buttons.
#endif
uint8_t currentMenuViewOffset; /* scroll offset in the current menu */
-uint32_t blocking_enc;
uint8_t lastEncoderBits;
uint32_t encoderPosition;
+uint32_t savedEncoderPosition;
#if (SDCARDDETECT > 0)
bool lcd_oldcardstatus;
#endif
#endif //ULTIPANEL
menuFunc_t currentMenu = lcd_status_screen; /* function pointer to the currently active menu */
+menuFunc_t savedMenu;
uint32_t lcd_next_update_millis;
uint8_t lcd_status_update_delay;
bool ignore_click = false;
bool wait_for_unclick;
uint8_t lcdDrawUpdate = 2; /* Set to none-zero when the LCD needs to draw, decreased after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) */
-//prevMenu and prevEncoderPosition are used to store the previous menu location when editing settings.
+ enquecommand_P(PSTR("M107")); //turn off printer fan
+ enquecommand_P(PSTR("M104 S0")); // turn off temperature
+ enquecommand_P(PSTR("M140 S0")); // turn off heatbed
+ enquecommand_P(PSTR("G1 Z10 F1300.000"));
+ enquecommand_P(PSTR("G1 X10 Y180 F4000")); //home X axis
+ enquecommand_P(PSTR("M84"));// disable motors
+ lcd_timeoutToStatus = millis() - 1; //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
+ lcd_commands_step = 1;
+ }
+ if (lcd_commands_step == 1 && !blocks_queued() && cmd_buffer_empty())
+ {
+ lcd_setstatuspgm(WELCOME_MSG);
+ lcd_commands_step = 0;
+ lcd_commands_type = 0;
+ if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) {
+ lcd_wizard(10);
+ }
+ }
+
}
- if (lcd_commands_type == 2) /// stop print
+#endif // not SNMM
+
+ if (lcd_commands_type == LCD_COMMAND_STOP_PRINT) /// stop print
+ current_position[E_AXIS] = 0; //set initial position to zero
+ plan_set_e_position(current_position[E_AXIS]);
+
+ //long steps_start = st_get_position(E_AXIS);
+
+ long steps_final;
+ float e_steps_per_unit;
+ float feedrate = (180 / axis_steps_per_unit[E_AXIS]) * 1; //3 //initial automatic extrusion feedrate (depends on current value of axis_steps_per_unit to avoid too fast extrusion)
+#define DEFAULT_MAX_ACCELERATION {1000, 1000, 200, 5000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+
+#define DEFAULT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for retracts
+
+#define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min)
+//#define MAX_SILENT_FEEDRATE 2700 //
+
+#define Z_AXIS_ALWAYS_ON 1
+
+//DEBUG
+#if 0
+#define DEBUG_DCODES //D codes
+#define DEBUG_DISABLE_XMINLIMIT //x min limit ignored
+#define DEBUG_DISABLE_XMAXLIMIT //x max limit ignored
+#define DEBUG_DISABLE_YMINLIMIT //y min limit ignored
+#define DEBUG_DISABLE_YMAXLIMIT //y max limit ignored
+#define DEBUG_DISABLE_ZMINLIMIT //z min limit ignored
+#define DEBUG_DISABLE_ZMAXLIMIT //z max limit ignored
+#define DEFAULT_MAX_ACCELERATION {1000, 1000, 200, 5000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+
+#define DEFAULT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for retracts
+
+#define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min)
+//#define MAX_SILENT_FEEDRATE 2700 //
+
+#define Z_AXIS_ALWAYS_ON 1
+
+//DEBUG
+#define DEBUG_DCODES //D codes
+#if 0
+#define DEBUG_DISABLE_XMINLIMIT //x min limit ignored
+#define DEBUG_DISABLE_XMAXLIMIT //x max limit ignored
+#define DEBUG_DISABLE_YMINLIMIT //y min limit ignored
+#define DEBUG_DISABLE_YMAXLIMIT //y max limit ignored
+#define DEBUG_DISABLE_ZMINLIMIT //z min limit ignored
+#define DEBUG_DISABLE_ZMAXLIMIT //z max limit ignored
+#define DEFAULT_MAX_ACCELERATION {1000, 1000, 200, 5000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+
+#define DEFAULT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 1250 // X, Y, Z and E max acceleration in mm/s^2 for retracts
+
+#define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min)
+//#define MAX_SILENT_FEEDRATE 2700 //
+
+#define Z_AXIS_ALWAYS_ON 1
+
+// Automatic recovery after crash is detected
+#define AUTOMATIC_RECOVERY_AFTER_CRASH
+
+//DEBUG
+#define DEBUG_DCODES //D codes
+#if 1
+//#define DEBUG_FSENSOR_LOG //Reports fsensor status to serial
+//#define DEBUG_CRASHDET_COUNTERS //Display crash-detection counters on LCD
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
+//
+// 1047 is Pt1000 with 4k7 pullup
+// 1010 is Pt1000 with 1k pullup (non standard)
+// 147 is Pt100 with 4k7 pullup
+// 148 is E3D Pt100 with 4k7 pullup and no PT100 Amplifier on a MiniRambo 1.3a
+// 247 is Pt100 with 4k7 pullup and PT100 Amplifier
+// 110 is Pt100 with 1k pullup (non standard)
+
+#if defined(E3D_PT100_EXTRUDER_WITH_AMP)
+#define TEMP_SENSOR_0 247
+#elif defined(E3D_PT100_EXTRUDER_NO_AMP)
+#define TEMP_SENSOR_0 148
+#else
+#define TEMP_SENSOR_0 5
+#endif
+#define TEMP_SENSOR_1 0
+#define TEMP_SENSOR_2 0
+#if defined(E3D_PT100_BED_WITH_AMP)
+#define TEMP_SENSOR_BED 247
+#elif defined(E3D_PT100_BED_NO_AMP)
+#define TEMP_SENSOR_BED 148
+#else
+#define TEMP_SENSOR_BED 1
+#endif
+#define TEMP_SENSOR_PINDA 1
+#define TEMP_SENSOR_AMBIENT 2000
+
+#define STACK_GUARD_TEST_VALUE 0xA2A2
+
+#define MAX_BED_TEMP_CALIBRATION 50
+#define MAX_HOTEND_TEMP_CALIBRATION 50
+
+#define MAX_E_STEPS_PER_UNIT 250
+#define MIN_E_STEPS_PER_UNIT 100
+
+#define Z_BABYSTEP_MIN -3999
+#define Z_BABYSTEP_MAX 0
+
+#define PINDA_PREHEAT_X 70
+#define PINDA_PREHEAT_Y -3
+#define PINDA_PREHEAT_Z 1
+#define PINDA_HEAT_T 120 //time in s
+
+#define PINDA_MIN_T 50
+#define PINDA_STEP_T 10
+#define PINDA_MAX_T 100
+
+#define PING_TIME 60 //time in s
+#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
+#define PING_ALLERT_PERIOD 60 //time in s
+
+#define LONG_PRESS_TIME 1000 //time in ms for button long press
+#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
+
+#define DEFAULT_PID_TEMP 210
+
+#define MIN_PRINT_FAN_SPEED 75
+
+#ifdef SNMM
+#define DEFAULT_RETRACTION 4 //used for PINDA temp calibration and pause print
+#else
+#define DEFAULT_RETRACTION 1 //used for PINDA temp calibration and pause print
+#endif
+
+// How much shall the print head be lifted on power panic?
+// Ideally the Z axis will reach a zero phase of the stepper driver on power outage. To simplify this,
+// UVLO_Z_AXIS_SHIFT shall be an integer multiply of the stepper driver cycle, that is 4x full step.
+// For example, the Prusa i3 MK2 with 16 microsteps per full step has Z stepping of 400 microsteps per mm.
+// At 400 microsteps per mm, a full step lifts the Z axis by 0.04mm, and a stepper driver cycle is 0.16mm.
+// The following example, 12 * (4 * 16 / 400) = 12 * 0.16mm = 1.92mm.
+#define UVLO_Z_AXIS_SHIFT 1.92
+// If power panic occured, and the current temperature is higher then target temperature before interrupt minus this offset, print will be recovered automatically.