diff options
author | PavelSindler <pavel@prusa3d.cz> | 2017-05-05 02:37:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-05 02:37:08 +0300 |
commit | 6fdaa2c3413ce6d9109f646725e87de81eed1cb8 (patch) | |
tree | ef86616b266ed5ff738b505d2684d98688027cf8 | |
parent | 361e472c509cf8b21c38d8dcfc3672cfee3e4ab7 (diff) | |
parent | 134a50f5b32be29bcc2df1d97ad3dab6fc279348 (diff) |
Merge pull request #88 from PavelSindler/MK2
updated messages; snmm: updated stop print, unload and load filaments, added setting bowden lengths from service menu
-rw-r--r-- | Firmware/Configuration.h | 3 | ||||
-rw-r--r-- | Firmware/Marlin.h | 1 | ||||
-rw-r--r-- | Firmware/Marlin_main.cpp | 486 | ||||
-rw-r--r-- | Firmware/language_all.cpp | 118 | ||||
-rw-r--r-- | Firmware/language_all.h | 20 | ||||
-rw-r--r-- | Firmware/language_cz.h | 10 | ||||
-rw-r--r-- | Firmware/language_en.h | 11 | ||||
-rw-r--r-- | Firmware/language_es.h | 2 | ||||
-rw-r--r-- | Firmware/language_it.h | 1 | ||||
-rw-r--r-- | Firmware/language_pl.h | 1 | ||||
-rw-r--r-- | Firmware/planner.h | 4 | ||||
-rw-r--r-- | Firmware/stepper.cpp | 41 | ||||
-rw-r--r-- | Firmware/ultralcd.cpp | 275 | ||||
-rw-r--r-- | Firmware/ultralcd.h | 9 | ||||
-rw-r--r-- | Firmware/ultralcd_implementation_hitachi_HD44780.h | 12 |
15 files changed, 636 insertions, 358 deletions
diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index c3459ebf1..483273a0f 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -5,7 +5,7 @@ #include "Configuration_prusa.h" // Firmware version -#define FW_version "3.0.10-11" +#define FW_version "3.0.11-RC1" #define FW_PRUSA3D_MAGIC "PRUSA3DFW" #define FW_PRUSA3D_MAGIC_LEN 10 @@ -46,6 +46,7 @@ #define EEPROM_PRINT_FLAG (EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY-1) #define EEPROM_PROBE_TEMP_SHIFT (EEPROM_PRINT_FLAG - 2*5) //5 x int for storing pinda probe temp shift relative to 50 C; unit: motor steps #define EEPROM_TEMP_CAL_ACTIVE (EEPROM_PROBE_TEMP_SHIFT - 1) +#define EEPROM_BOWDEN_LENGTH (EEPROM_TEMP_CAL_ACTIVE - 2*4) //4 x int for bowden lengths for multimaterial // Currently running firmware, each digit stored as uint16_t. // The flavor differentiates a dev, alpha, beta, release candidate or a release version. diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index c33ccb392..a8dd4eab6 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -282,6 +282,7 @@ extern float retract_recover_length, retract_recover_length_swap, retract_recove extern unsigned long starttime;
extern unsigned long stoptime;
+extern int bowden_length[4];
extern bool is_usb_printing;
extern bool homing_flag;
extern bool temp_cal_active;
diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2c1a6bf09..ab50a3192 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -247,6 +247,8 @@ int extruder_multiply[EXTRUDERS] = {100 #endif }; +int bowden_length[4]; + bool is_usb_printing = false; bool homing_flag = false; @@ -265,6 +267,8 @@ float pause_lastpos[4]; unsigned long pause_time = 0; unsigned long start_pause_print = millis(); +unsigned long load_filament_time; + bool mesh_bed_leveling_flag = false; unsigned char lang_selected = 0; @@ -897,7 +901,7 @@ int er_progress = 0; void factory_reset(char level, bool quiet) { lcd_implementation_clear(); - + int cursor_pos = 0; switch (level) { // Level 0: Language reset @@ -969,6 +973,9 @@ void factory_reset(char level, bool quiet) break; + case 4: + bowden_menu(); + break; default: break; @@ -983,178 +990,183 @@ void factory_reset(char level, bool quiet) // are initialized by the main() routine provided by the Arduino framework. void setup() { - setup_killpin(); - setup_powerhold(); - MYSERIAL.begin(BAUDRATE); - SERIAL_PROTOCOLLNPGM("start"); - SERIAL_ECHO_START; + setup_killpin(); + setup_powerhold(); + MYSERIAL.begin(BAUDRATE); + SERIAL_PROTOCOLLNPGM("start"); + SERIAL_ECHO_START; #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 + 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); - MCUSR=0; - - //SERIAL_ECHORPGM(MSG_MARLIN); - //SERIAL_ECHOLNRPGM(VERSION_STRING); - - #ifdef STRING_VERSION_CONFIG_H - #ifdef STRING_CONFIG_H_AUTHOR - SERIAL_ECHO_START; - SERIAL_ECHORPGM(MSG_CONFIGURATION_VER); - SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); - SERIAL_ECHORPGM(MSG_AUTHOR); - SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); - SERIAL_ECHOPGM("Compiled: "); - SERIAL_ECHOLNPGM(__DATE__); - #endif - #endif - - SERIAL_ECHO_START; - SERIAL_ECHORPGM(MSG_FREE_MEMORY); - SERIAL_ECHO(freeMemory()); - SERIAL_ECHORPGM(MSG_PLANNER_BUFFER_BYTES); - SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); - lcd_update_enable(false); - // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) - Config_RetrieveSettings(); - SdFatUtil::set_stack_guard(); //writes magic number at the end of static variables to protect against overwriting static memory by stack - tp_init(); // Initialize temperature loop - plan_init(); // Initialize planner; - watchdog_init(); - st_init(); // Initialize stepper, this enables interrupts! - setup_photpin(); - servo_init(); - // Reset the machine correction matrix. - // It does not make sense to load the correction matrix until the machine is homed. - world2machine_reset(); - - lcd_init(); - if (!READ(BTN_ENC)) - { - _delay_ms(1000); - if (!READ(BTN_ENC)) - { - lcd_implementation_clear(); - - - lcd_printPGM(PSTR("Factory RESET")); - - - SET_OUTPUT(BEEPER); - WRITE(BEEPER, HIGH); - - while (!READ(BTN_ENC)); - - WRITE(BEEPER, LOW); - - + // 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); + MCUSR = 0; + + //SERIAL_ECHORPGM(MSG_MARLIN); + //SERIAL_ECHOLNRPGM(VERSION_STRING); + +#ifdef STRING_VERSION_CONFIG_H +#ifdef STRING_CONFIG_H_AUTHOR + SERIAL_ECHO_START; + SERIAL_ECHORPGM(MSG_CONFIGURATION_VER); + SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); + SERIAL_ECHORPGM(MSG_AUTHOR); + SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); + SERIAL_ECHOPGM("Compiled: "); + SERIAL_ECHOLNPGM(__DATE__); +#endif +#endif - _delay_ms(2000); - - char level = reset_menu(); - factory_reset(level, false); - - switch (level) { - case 0: _delay_ms(0); break; - case 1: _delay_ms(0); break; - case 2: _delay_ms(0); break; - case 3: _delay_ms(0); break; - } - // _delay_ms(100); -/* -#ifdef MESH_BED_LEVELING - _delay_ms(2000); - - if (!READ(BTN_ENC)) - { - WRITE(BEEPER, HIGH); - _delay_ms(100); - WRITE(BEEPER, LOW); - _delay_ms(200); - WRITE(BEEPER, HIGH); - _delay_ms(100); - WRITE(BEEPER, LOW); - - int _z = 0; - calibration_status_store(CALIBRATION_STATUS_CALIBRATED); - EEPROM_save_B(EEPROM_BABYSTEP_X, &_z); - EEPROM_save_B(EEPROM_BABYSTEP_Y, &_z); - EEPROM_save_B(EEPROM_BABYSTEP_Z, &_z); - } - else - { + SERIAL_ECHO_START; + SERIAL_ECHORPGM(MSG_FREE_MEMORY); + SERIAL_ECHO(freeMemory()); + SERIAL_ECHORPGM(MSG_PLANNER_BUFFER_BYTES); + SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); + lcd_update_enable(false); + // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) + Config_RetrieveSettings(); + SdFatUtil::set_stack_guard(); //writes magic number at the end of static variables to protect against overwriting static memory by stack + tp_init(); // Initialize temperature loop + plan_init(); // Initialize planner; + watchdog_init(); + st_init(); // Initialize stepper, this enables interrupts! + setup_photpin(); + servo_init(); + // Reset the machine correction matrix. + // It does not make sense to load the correction matrix until the machine is homed. + world2machine_reset(); + + lcd_init(); + if (!READ(BTN_ENC)) + { + _delay_ms(1000); + if (!READ(BTN_ENC)) + { + lcd_implementation_clear(); - WRITE(BEEPER, HIGH); - _delay_ms(100); - WRITE(BEEPER, LOW); - } -#endif // mesh */ - - } - } - else - { - _delay_ms(1000); // wait 1sec to display the splash screen - } - + lcd_printPGM(PSTR("Factory RESET")); - #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1 - SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan - #endif - #ifdef DIGIPOT_I2C - digipot_i2c_init(); - #endif - setup_homepin(); + SET_OUTPUT(BEEPER); + WRITE(BEEPER, HIGH); -#if defined(Z_AXIS_ALWAYS_ON) - enable_z(); + while (!READ(BTN_ENC)); + + WRITE(BEEPER, LOW); + + + + _delay_ms(2000); + + char level = reset_menu(); + factory_reset(level, false); + + switch (level) { + case 0: _delay_ms(0); break; + case 1: _delay_ms(0); break; + case 2: _delay_ms(0); break; + case 3: _delay_ms(0); break; + } + // _delay_ms(100); + /* + #ifdef MESH_BED_LEVELING + _delay_ms(2000); + + if (!READ(BTN_ENC)) + { + WRITE(BEEPER, HIGH); + _delay_ms(100); + WRITE(BEEPER, LOW); + _delay_ms(200); + WRITE(BEEPER, HIGH); + _delay_ms(100); + WRITE(BEEPER, LOW); + + int _z = 0; + calibration_status_store(CALIBRATION_STATUS_CALIBRATED); + EEPROM_save_B(EEPROM_BABYSTEP_X, &_z); + EEPROM_save_B(EEPROM_BABYSTEP_Y, &_z); + EEPROM_save_B(EEPROM_BABYSTEP_Z, &_z); + } + else + { + + WRITE(BEEPER, HIGH); + _delay_ms(100); + WRITE(BEEPER, LOW); + } + #endif // mesh */ + + } + } + else + { + _delay_ms(1000); // wait 1sec to display the splash screen + } + + + +#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1 + SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan #endif - farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE); - EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no); - 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); - } - // Enable Toshiba FlashAir SD card / WiFi enahanced card. - card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); - // Force SD card update. Otherwise the SD card update is done from loop() on card.checkautostart(false), - // but this times out if a blocking dialog is shown in setup(). - card.initsd(); - - if (eeprom_read_dword((uint32_t*)(EEPROM_TOP-4)) == 0x0ffffffff && - eeprom_read_dword((uint32_t*)(EEPROM_TOP-8)) == 0x0ffffffff && - eeprom_read_dword((uint32_t*)(EEPROM_TOP-12)) == 0x0ffffffff) { - // Maiden startup. The firmware has been loaded and first started on a virgin RAMBo board, - // where all the EEPROM entries are set to 0x0ff. - // Once a firmware boots up, it forces at least a language selection, which changes - // EEPROM_LANG to number lower than 0x0ff. - // 1) Set a high power mode. - eeprom_write_byte((uint8_t*)EEPROM_SILENT, 0); - } +#ifdef DIGIPOT_I2C + digipot_i2c_init(); +#endif + setup_homepin(); +#if defined(Z_AXIS_ALWAYS_ON) + enable_z(); +#endif + farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE); + EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no); + 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); + } + + // Enable Toshiba FlashAir SD card / WiFi enahanced card. + card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); + // Force SD card update. Otherwise the SD card update is done from loop() on card.checkautostart(false), + // but this times out if a blocking dialog is shown in setup(). + card.initsd(); + + if (eeprom_read_dword((uint32_t*)(EEPROM_TOP - 4)) == 0x0ffffffff && + eeprom_read_dword((uint32_t*)(EEPROM_TOP - 8)) == 0x0ffffffff && + eeprom_read_dword((uint32_t*)(EEPROM_TOP - 12)) == 0x0ffffffff) { + // Maiden startup. The firmware has been loaded and first started on a virgin RAMBo board, + // where all the EEPROM entries are set to 0x0ff. + // Once a firmware boots up, it forces at least a language selection, which changes + // EEPROM_LANG to number lower than 0x0ff. + // 1) Set a high power mode. + eeprom_write_byte((uint8_t*)EEPROM_SILENT, 0); + } +#ifdef SNMM + if (eeprom_read_dword((uint32_t*)EEPROM_BOWDEN_LENGTH) == 0x0ffffffff) { //bowden length used for SNMM + int _z = BOWDEN_LENGTH; + for(int i = 0; i<4; i++) EEPROM_save_B(EEPROM_BOWDEN_LENGTH + i * 2, &_z); + } +#endif // In the future, somewhere here would one compare the current firmware version against the firmware version stored in the EEPROM. // If they differ, an update procedure may need to be performed. At the end of this block, the current firmware version @@ -1188,6 +1200,7 @@ void setup() // Show the message. lcd_show_fullscreen_message_and_wait_P(MSG_FOLLOW_CALIBRATION_FLOW); } + for (int i = 0; i<4; i++) EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]); lcd_update_enable(true); // Store the currently running firmware into an eeprom, @@ -2050,68 +2063,8 @@ void process_commands() } else if(code_seen("FR")) { // Factory full reset - factory_reset(0,true); - - }else if(code_seen("Y")) { //filaments adjustment at the beginning of print (for SNMM) - #ifdef SNMM - int extr; - SilentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); //is silent mode or loud mode set - lcd_implementation_clear(); - lcd_display_message_fullscreen_P(MSG_FIL_ADJUSTING); - current_position[Z_AXIS] = 100; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder); - digipot_current(2, E_MOTOR_HIGH_CURRENT); - for (extr = 1; extr < 4; extr++) { //we dont know which filament is in nozzle, but we want to load filament0, so all other filaments must unloaded - change_extr(extr); - ramming(); - } - change_extr(0); - current_position[E_AXIS] += FIL_LOAD_LENGTH; //loading filament0 into the nozzle - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder); - st_synchronize(); - - for (extr = 1; extr < 4; extr++) { - digipot_current(2, E_MOTOR_LOW_CURRENT); //set lower current for extruder motors - change_extr(extr); - current_position[E_AXIS] += (FIL_LOAD_LENGTH + 3 * FIL_RETURN_LENGTH); //adjusting filaments - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 5000, active_extruder); - st_synchronize(); - digipot_current(2, tmp_motor_loud[2]); //set back to normal operation currents - current_position[E_AXIS] -= FIL_RETURN_LENGTH; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder); - st_synchronize(); - } - - change_extr(0); - current_position[E_AXIS] += 25; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 10, active_extruder); - digipot_current(2, E_MOTOR_HIGH_CURRENT); - ramming(); - if (SilentMode == 1) digipot_current(2, tmp_motor[2]); //set back to normal operation currents - else digipot_current(2, tmp_motor_loud[2]); - st_synchronize(); - lcd_show_fullscreen_message_and_wait_P(MSG_CONFIRM_NOZZLE_CLEAN_FIL_ADJ); - lcd_implementation_clear(); - lcd_printPGM(MSG_PLEASE_WAIT); - current_position[Z_AXIS] = 0; - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder); - st_synchronize(); - lcd_update_enable(true); - - #endif - } - else if (code_seen("SetF")) { -#ifdef SNMM - bool not_finished = (eeprom_read_byte((unsigned char*)EEPROM_PRINT_FLAG) != PRINT_FINISHED); - eeprom_update_byte((unsigned char*)EEPROM_PRINT_FLAG, PRINT_STARTED); - if (not_finished) enquecommand_front_P(PSTR("PRUSA Y")); -#endif - } - else if (code_seen("ResF")) { -#ifdef SNMM - eeprom_update_byte((unsigned char*)EEPROM_PRINT_FLAG, PRINT_FINISHED); -#endif - } + factory_reset(0,true); + } //else if (code_seen('Cal')) { // lcd_calibration(); // } @@ -5109,11 +5062,35 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp } else { - #ifdef FILAMENTCHANGE_FINALRETRACT - target[E_AXIS]+= FILAMENTCHANGE_FINALRETRACT ; - #endif + #ifdef SNMM + + #else + #ifdef FILAMENTCHANGE_FINALRETRACT + target[E_AXIS] += FILAMENTCHANGE_FINALRETRACT; + #endif + #endif // SNMM } - plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], FILAMENTCHANGE_RFEED, active_extruder); + +#ifdef SNMM + target[E_AXIS] += 12; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 3500, active_extruder); + target[E_AXIS] += 6; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 5000, active_extruder); + target[E_AXIS] += (FIL_LOAD_LENGTH * -1); + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 5000, active_extruder); + st_synchronize(); + target[E_AXIS] += (FIL_COOLING); + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 50, active_extruder); + target[E_AXIS] += (FIL_COOLING*-1); + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 50, active_extruder); + target[E_AXIS] += (bowden_length[snmm_extruder] *-1); + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 3000, active_extruder); + st_synchronize(); + +#else + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], FILAMENTCHANGE_RFEED, active_extruder); +#endif // SNMM + //finish moves st_synchronize(); @@ -5127,10 +5104,19 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp uint8_t cnt=0; int counterBeep = 0; lcd_wait_interact(); + load_filament_time = millis(); while(!lcd_clicked()){ - cnt++; + + cnt++; manage_heater(); manage_inactivity(true); + +/*#ifdef SNMM + target[E_AXIS] += 0.002; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 500, active_extruder); + +#endif // SNMM*/ + if(cnt==0) { #if BEEPER > 0 @@ -5140,7 +5126,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp SET_OUTPUT(BEEPER); if (counterBeep== 0){ WRITE(BEEPER,HIGH); - } + } if (counterBeep== 20){ WRITE(BEEPER,LOW); } @@ -5153,14 +5139,41 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp #endif #endif } + } +#ifdef SNMM + display_loading(); + do { + target[E_AXIS] += 0.002; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 500, active_extruder); + delay_keep_alive(2); + } while (!lcd_clicked()); + /*if (millis() - load_filament_time > 2) { + load_filament_time = millis(); + target[E_AXIS] += 0.001; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 1000, active_extruder); + }*/ +#endif //Filament inserted WRITE(BEEPER,LOW); - - //Feed the filament to the end of nozzle quickly - target[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED ; - plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], FILAMENTCHANGE_EFEED, active_extruder); + + //Feed the filament to the end of nozzle quickly +#ifdef SNMM + + st_synchronize(); + target[E_AXIS] += bowden_length[snmm_extruder]; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 3000, active_extruder); + target[E_AXIS] += FIL_LOAD_LENGTH - 60; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 1400, active_extruder); + target[E_AXIS] += 40; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 400, active_extruder); + target[E_AXIS] += 10; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 50, active_extruder); +#else + target[E_AXIS] += FILAMENTCHANGE_FIRSTFEED; + plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], FILAMENTCHANGE_EFEED, active_extruder); +#endif // SNMM //Extrude some filament target[E_AXIS]+= FILAMENTCHANGE_FINALFEED ; @@ -5198,6 +5211,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp // Everything good default: lcd_change_success(); + lcd_update_enable(true); break; } @@ -5352,6 +5366,9 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp break; case 702: { +#ifdef SNMM + extr_unload_all(); +#else custom_message = true; custom_message_type = 2; lcd_setstatuspgm(MSG_UNLOADING_FILAMENT); @@ -5363,7 +5380,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp lcd_setstatuspgm(WELCOME_MSG); custom_message = false; custom_message_type = 0; - +#endif } break; @@ -5389,6 +5406,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp else { tmp_extruder = code_value(); #ifdef SNMM + snmm_extruder = tmp_extruder; st_synchronize(); delay(100); diff --git a/Firmware/language_all.cpp b/Firmware/language_all.cpp index 9fc3afbfe..7c2cf4941 100644 --- a/Firmware/language_all.cpp +++ b/Firmware/language_all.cpp @@ -968,13 +968,15 @@ const char * const MSG_FIL_ADJUSTING_LANG_TABLE[LANG_NUM] PROGMEM = { const char MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_EN[] PROGMEM = "Iteration "; const char MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_CZ[] PROGMEM = "Iterace "; -const char MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_ES[] PROGMEM = "Iteracion "; +const char MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_IT[] PROGMEM = "Reiterazione "; +const char MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_ES[] PROGMEM = "Reiteracion "; +const char MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_PL[] PROGMEM = "Iteracja "; const char * const MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_LANG_TABLE[LANG_NUM] PROGMEM = { MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_EN, MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_CZ, - MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_EN, + MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_IT, MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_ES, - MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_EN, + MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_PL, MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_EN }; @@ -1280,6 +1282,17 @@ const char * const MSG_LOADING_FILAMENT_LANG_TABLE[LANG_NUM] PROGMEM = { MSG_LOADING_FILAMENT_DE }; +const char MSG_LOAD_ALL_EN[] PROGMEM = "Load all"; +const char MSG_LOAD_ALL_CZ[] PROGMEM = "Zavest vse"; +const char * const MSG_LOAD_ALL_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_LOAD_ALL_EN, + MSG_LOAD_ALL_CZ, + MSG_LOAD_ALL_EN, + MSG_LOAD_ALL_EN, + MSG_LOAD_ALL_EN, + MSG_LOAD_ALL_EN +}; + const char MSG_LOAD_EPROM_EN[] PROGMEM = "Load memory"; const char * const MSG_LOAD_EPROM_LANG_TABLE[1] PROGMEM = { MSG_LOAD_EPROM_EN @@ -1300,6 +1313,50 @@ const char * const MSG_LOAD_FILAMENT_LANG_TABLE[LANG_NUM] PROGMEM = { MSG_LOAD_FILAMENT_DE }; +const char MSG_LOAD_FILAMENT_1_EN[] PROGMEM = "Load filament 1"; +const char MSG_LOAD_FILAMENT_1_CZ[] PROGMEM = "Zavest filament 1"; +const char * const MSG_LOAD_FILAMENT_1_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_LOAD_FILAMENT_1_EN, + MSG_LOAD_FILAMENT_1_CZ, + MSG_LOAD_FILAMENT_1_EN, + MSG_LOAD_FILAMENT_1_EN, + MSG_LOAD_FILAMENT_1_EN, + MSG_LOAD_FILAMENT_1_EN +}; + +const char MSG_LOAD_FILAMENT_2_EN[] PROGMEM = "Load filament 2"; +const char MSG_LOAD_FILAMENT_2_CZ[] PROGMEM = "Zavest filament 2"; +const char * const MSG_LOAD_FILAMENT_2_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_LOAD_FILAMENT_2_EN, + MSG_LOAD_FILAMENT_2_CZ, + MSG_LOAD_FILAMENT_2_EN, + MSG_LOAD_FILAMENT_2_EN, + MSG_LOAD_FILAMENT_2_EN, + MSG_LOAD_FILAMENT_2_EN +}; + +const char MSG_LOAD_FILAMENT_3_EN[] PROGMEM = "Load filament 3"; +const char MSG_LOAD_FILAMENT_3_CZ[] PROGMEM = "Zavest filament 3"; +const char * const MSG_LOAD_FILAMENT_3_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_LOAD_FILAMENT_3_EN, + MSG_LOAD_FILAMENT_3_CZ, + MSG_LOAD_FILAMENT_3_EN, + MSG_LOAD_FILAMENT_3_EN, + MSG_LOAD_FILAMENT_3_EN, + MSG_LOAD_FILAMENT_3_EN +}; + +const char MSG_LOAD_FILAMENT_4_EN[] PROGMEM = "Load filament 4"; +const char MSG_LOAD_FILAMENT_4_CZ[] PROGMEM = "Zavest filament 4"; +const char * const MSG_LOAD_FILAMENT_4_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_LOAD_FILAMENT_4_EN, + MSG_LOAD_FILAMENT_4_CZ, + MSG_LOAD_FILAMENT_4_EN, + MSG_LOAD_FILAMENT_4_EN, + MSG_LOAD_FILAMENT_4_EN, + MSG_LOAD_FILAMENT_4_EN +}; + const char MSG_LOOSE_PULLEY_EN[] PROGMEM = "Loose pulley"; const char MSG_LOOSE_PULLEY_CZ[] PROGMEM = "Uvolnena remenicka"; const char MSG_LOOSE_PULLEY_IT[] PROGMEM = "Puleggia lenta"; @@ -2947,6 +3004,17 @@ const char * const MSG_UNLOADING_FILAMENT_LANG_TABLE[LANG_NUM] PROGMEM = { MSG_UNLOADING_FILAMENT_DE }; +const char MSG_UNLOAD_ALL_EN[] PROGMEM = "Unload all"; +const char MSG_UNLOAD_ALL_CZ[] PROGMEM = "Vyjmout vse"; +const char * const MSG_UNLOAD_ALL_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_UNLOAD_ALL_EN, + MSG_UNLOAD_ALL_CZ, + MSG_UNLOAD_ALL_EN, + MSG_UNLOAD_ALL_EN, + MSG_UNLOAD_ALL_EN, + MSG_UNLOAD_ALL_EN +}; + const char MSG_UNLOAD_FILAMENT_EN[] PROGMEM = "Unload filament"; const char MSG_UNLOAD_FILAMENT_CZ[] PROGMEM = "Vyjmout filament"; const char MSG_UNLOAD_FILAMENT_IT[] PROGMEM = "Scarica filamento"; @@ -2962,6 +3030,50 @@ const char * const MSG_UNLOAD_FILAMENT_LANG_TABLE[LANG_NUM] PROGMEM = { MSG_UNLOAD_FILAMENT_DE }; +const char MSG_UNLOAD_FILAMENT_1_EN[] PROGMEM = "Unload filament 1"; +const char MSG_UNLOAD_FILAMENT_1_CZ[] PROGMEM = "Vyjmout filament 1"; +const char * const MSG_UNLOAD_FILAMENT_1_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_UNLOAD_FILAMENT_1_EN, + MSG_UNLOAD_FILAMENT_1_CZ, + MSG_UNLOAD_FILAMENT_1_EN, + MSG_UNLOAD_FILAMENT_1_EN, + MSG_UNLOAD_FILAMENT_1_EN, + MSG_UNLOAD_FILAMENT_1_EN +}; + +const char MSG_UNLOAD_FILAMENT_2_EN[] PROGMEM = "Unload filament 2"; +const char MSG_UNLOAD_FILAMENT_2_CZ[] PROGMEM = "Vyjmout filament 2"; +const char * const MSG_UNLOAD_FILAMENT_2_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_UNLOAD_FILAMENT_2_EN, + MSG_UNLOAD_FILAMENT_2_CZ, + MSG_UNLOAD_FILAMENT_2_EN, + MSG_UNLOAD_FILAMENT_2_EN, + MSG_UNLOAD_FILAMENT_2_EN, + MSG_UNLOAD_FILAMENT_2_EN +}; + +const char MSG_UNLOAD_FILAMENT_3_EN[] PROGMEM = "Unload filament 3"; +const char MSG_UNLOAD_FILAMENT_3_CZ[] PROGMEM = "Vyjmout filament 3"; +const char * const MSG_UNLOAD_FILAMENT_3_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_UNLOAD_FILAMENT_3_EN, + MSG_UNLOAD_FILAMENT_3_CZ, + MSG_UNLOAD_FILAMENT_3_EN, + MSG_UNLOAD_FILAMENT_3_EN, + MSG_UNLOAD_FILAMENT_3_EN, + MSG_UNLOAD_FILAMENT_3_EN +}; + +const char MSG_UNLOAD_FILAMENT_4_EN[] PROGMEM = "Unload filament 4"; +const char MSG_UNLOAD_FILAMENT_4_CZ[] PROGMEM = "Vyjmout filament 4"; +const char * const MSG_UNLOAD_FILAMENT_4_LANG_TABLE[LANG_NUM] PROGMEM = { + MSG_UNLOAD_FILAMENT_4_EN, + MSG_UNLOAD_FILAMENT_4_CZ, + MSG_UNLOAD_FILAMENT_4_EN, + MSG_UNLOAD_FILAMENT_4_EN, + MSG_UNLOAD_FILAMENT_4_EN, + MSG_UNLOAD_FILAMENT_4_EN +}; + const char MSG_USB_PRINTING_EN[] PROGMEM = "USB printing "; const char MSG_USB_PRINTING_CZ[] PROGMEM = "Tisk z USB "; const char MSG_USB_PRINTING_IT[] PROGMEM = "Stampa da USB"; diff --git a/Firmware/language_all.h b/Firmware/language_all.h index 968a074f3..f04a07278 100644 --- a/Firmware/language_all.h +++ b/Firmware/language_all.h @@ -255,10 +255,20 @@ extern const char* const MSG_LOADING_COLOR_LANG_TABLE[LANG_NUM]; #define MSG_LOADING_COLOR LANG_TABLE_SELECT(MSG_LOADING_COLOR_LANG_TABLE) extern const char* const MSG_LOADING_FILAMENT_LANG_TABLE[LANG_NUM]; #define MSG_LOADING_FILAMENT LANG_TABLE_SELECT(MSG_LOADING_FILAMENT_LANG_TABLE) +extern const char* const MSG_LOAD_ALL_LANG_TABLE[LANG_NUM]; +#define MSG_LOAD_ALL LANG_TABLE_SELECT(MSG_LOAD_ALL_LANG_TABLE) extern const char* const MSG_LOAD_EPROM_LANG_TABLE[1]; #define MSG_LOAD_EPROM LANG_TABLE_SELECT_EXPLICIT(MSG_LOAD_EPROM_LANG_TABLE, 0) extern const char* const MSG_LOAD_FILAMENT_LANG_TABLE[LANG_NUM]; #define MSG_LOAD_FILAMENT LANG_TABLE_SELECT(MSG_LOAD_FILAMENT_LANG_TABLE) +extern const char* const MSG_LOAD_FILAMENT_1_LANG_TABLE[LANG_NUM]; +#define MSG_LOAD_FILAMENT_1 LANG_TABLE_SELECT(MSG_LOAD_FILAMENT_1_LANG_TABLE) +extern const char* const MSG_LOAD_FILAMENT_2_LANG_TABLE[LANG_NUM]; +#define MSG_LOAD_FILAMENT_2 LANG_TABLE_SELECT(MSG_LOAD_FILAMENT_2_LANG_TABLE) +extern const char* const MSG_LOAD_FILAMENT_3_LANG_TABLE[LANG_NUM]; +#define MSG_LOAD_FILAMENT_3 LANG_TABLE_SELECT(MSG_LOAD_FILAMENT_3_LANG_TABLE) +extern const char* const MSG_LOAD_FILAMENT_4_LANG_TABLE[LANG_NUM]; +#define MSG_LOAD_FILAMENT_4 LANG_TABLE_SELECT(MSG_LOAD_FILAMENT_4_LANG_TABLE) extern const char* const MSG_LOOSE_PULLEY_LANG_TABLE[LANG_NUM]; #define MSG_LOOSE_PULLEY LANG_TABLE_SELECT(MSG_LOOSE_PULLEY_LANG_TABLE) extern const char* const MSG_M104_INVALID_EXTRUDER_LANG_TABLE[1]; @@ -555,8 +565,18 @@ extern const char* const MSG_UNKNOWN_COMMAND_LANG_TABLE[1]; #define MSG_UNKNOWN_COMMAND LANG_TABLE_SELECT_EXPLICIT(MSG_UNKNOWN_COMMAND_LANG_TABLE, 0) extern const char* const MSG_UNLOADING_FILAMENT_LANG_TABLE[LANG_NUM]; #define MSG_UNLOADING_FILAMENT LANG_TABLE_SELECT(MSG_UNLOADING_FILAMENT_LANG_TABLE) +extern const char* const MSG_UNLOAD_ALL_LANG_TABLE[LANG_NUM]; +#define MSG_UNLOAD_ALL LANG_TABLE_SELECT(MSG_UNLOAD_ALL_LANG_TABLE) extern const char* const MSG_UNLOAD_FILAMENT_LANG_TABLE[LANG_NUM]; #define MSG_UNLOAD_FILAMENT LANG_TABLE_SELECT(MSG_UNLOAD_FILAMENT_LANG_TABLE) +extern const char* const MSG_UNLOAD_FILAMENT_1_LANG_TABLE[LANG_NUM]; +#define MSG_UNLOAD_FILAMENT_1 LANG_TABLE_SELECT(MSG_UNLOAD_FILAMENT_1_LANG_TABLE) +extern const char* const MSG_UNLOAD_FILAMENT_2_LANG_TABLE[LANG_NUM]; +#define MSG_UNLOAD_FILAMENT_2 LANG_TABLE_SELECT(MSG_UNLOAD_FILAMENT_2_LANG_TABLE) +extern const char* const MSG_UNLOAD_FILAMENT_3_LANG_TABLE[LANG_NUM]; +#define MSG_UNLOAD_FILAMENT_3 LANG_TABLE_SELECT(MSG_UNLOAD_FILAMENT_3_LANG_TABLE) +extern const char* const MSG_UNLOAD_FILAMENT_4_LANG_TABLE[LANG_NUM]; +#define MSG_UNLOAD_FILAMENT_4 LANG_TABLE_SELECT(MSG_UNLOAD_FILAMENT_4_LANG_TABLE) extern const char* const MSG_USB_PRINTING_LANG_TABLE[LANG_NUM]; #define MSG_USB_PRINTING LANG_TABLE_SELECT(MSG_USB_PRINTING_LANG_TABLE) extern const char* const MSG_USERWAIT_LANG_TABLE[LANG_NUM]; diff --git a/Firmware/language_cz.h b/Firmware/language_cz.h index f92e6d6eb..9712ab371 100644 --- a/Firmware/language_cz.h +++ b/Firmware/language_cz.h @@ -74,6 +74,16 @@ #define MSG_PREHEAT "Predehrev" #define MSG_UNLOAD_FILAMENT "Vyjmout filament" #define MSG_LOAD_FILAMENT "Zavest filament" +#define MSG_LOAD_FILAMENT_1 "Zavest filament 1" +#define MSG_LOAD_FILAMENT_2 "Zavest filament 2" +#define MSG_LOAD_FILAMENT_3 "Zavest filament 3" +#define MSG_LOAD_FILAMENT_4 "Zavest filament 4" +#define MSG_UNLOAD_FILAMENT_1 "Vyjmout filament 1" +#define MSG_UNLOAD_FILAMENT_2 "Vyjmout filament 2" +#define MSG_UNLOAD_FILAMENT_3 "Vyjmout filament 3" +#define MSG_UNLOAD_FILAMENT_4 "Vyjmout filament 4" +#define MSG_UNLOAD_ALL "Vyjmout vse" +#define MSG_LOAD_ALL "Zavest vse" #define MSG_RECTRACT "Rectract" #define MSG_ERROR "CHYBA:" diff --git a/Firmware/language_en.h b/Firmware/language_en.h index 204cc70ca..ec3ea2110 100644 --- a/Firmware/language_en.h +++ b/Firmware/language_en.h @@ -71,6 +71,17 @@ #define MSG_PREHEAT "Preheat" #define MSG_UNLOAD_FILAMENT "Unload filament" #define MSG_LOAD_FILAMENT "Load filament" +#define MSG_LOAD_FILAMENT_1 "Load filament 1" +#define MSG_LOAD_FILAMENT_2 "Load filament 2" +#define MSG_LOAD_FILAMENT_3 "Load filament 3" +#define MSG_LOAD_FILAMENT_4 "Load filament 4" +#define MSG_UNLOAD_FILAMENT_1 "Unload filament 1" +#define MSG_UNLOAD_FILAMENT_2 "Unload filament 2" +#define MSG_UNLOAD_FILAMENT_3 "Unload filament 3" +#define MSG_UNLOAD_FILAMENT_4 "Unload filament 4" +#define MSG_UNLOAD_ALL "Unload all" +#define MSG_LOAD_ALL "Load all" + #define MSG_RECTRACT "Rectract" #define MSG_ERROR "ERROR:" diff --git a/Firmware/language_es.h b/Firmware/language_es.h index 7a43092f4..066412cf8 100644 --- a/Firmware/language_es.h +++ b/Firmware/language_es.h @@ -206,7 +206,7 @@ #define MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1 "Medir la altura del punto de la calibracion" #define MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2 " de 9" -#define MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION "Iteracion " +#define MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION "Reiteracion " #define MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND "Calibracion XYZ fallada. Puntos de calibracion en la cama no encontrados." #define MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED "Calibracion XYZ fallada. Consultar el manual por favor." #define MSG_BED_SKEW_OFFSET_DETECTION_PERFECT "Calibracion XYZ ok. Ejes X/Y perpendiculares. Felicitaciones!" diff --git a/Firmware/language_it.h b/Firmware/language_it.h index 26f5ae484..1075d9a7d 100644 --- a/Firmware/language_it.h +++ b/Firmware/language_it.h @@ -196,6 +196,7 @@ #define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE2 " su 9"
#define MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1 "Misurare l'altezza di riferimento del punto di calibrazione"
#define MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2 " su 9"
+#define MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION "Reiterazione "
#define MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND "Calibrazione XYZ fallita. Il punto di calibrazione sul letto non e' stato trovato."
#define MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED "Calibrazione XYZ fallita. Si prega di consultare il manuale."
diff --git a/Firmware/language_pl.h b/Firmware/language_pl.h index 83fbfa8b9..d8cae5c1e 100644 --- a/Firmware/language_pl.h +++ b/Firmware/language_pl.h @@ -211,6 +211,7 @@ #define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE2 " z 9" #define MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1 "Okreslam wysokosc odniesienia punktu kalibracyjnego" #define MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2 " z 9" +#define MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION "Iteracja " #define MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND "Kalibr. XYZ nieudana. Kalibracyjny punkt podkladki nieznaleziony." #define MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED "Kalibracja XYZ niepowiedziona. Sprawdzic w instrukcji." diff --git a/Firmware/planner.h b/Firmware/planner.h index a13aa1bd2..30194952d 100644 --- a/Firmware/planner.h +++ b/Firmware/planner.h @@ -171,7 +171,9 @@ FORCE_INLINE block_t *plan_get_current_block() } // Returns true if the buffer has a queued block, false otherwise -FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); } +FORCE_INLINE bool blocks_queued() { + return (block_buffer_head != block_buffer_tail); +} //return the nr of buffered moves FORCE_INLINE uint8_t moves_planned() { diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index 919c55918..b92f54ee1 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -515,14 +515,39 @@ ISR(TIMER1_COMPA_vect) } #endif - if ((out_bits & (1<<E_AXIS)) != 0) { // -direction - REV_E_DIR(); - count_direction[E_AXIS]=-1; - } - else { // +direction - NORM_E_DIR(); - count_direction[E_AXIS]=1; - } + if ((out_bits & (1 << E_AXIS)) != 0) + { // -direction + //AKU +#ifdef SNMM + if (snmm_extruder == 0 || snmm_extruder == 2) + { + NORM_E_DIR(); + } + else + { + REV_E_DIR(); + } +#else + REV_E_DIR(); +#endif // SNMM + count_direction[E_AXIS] = -1; + } + else + { // +direction +#ifdef SNMM + if (snmm_extruder == 0 || snmm_extruder == 2) + { + REV_E_DIR(); + } + else + { + NORM_E_DIR(); + } +#else + NORM_E_DIR(); +#endif // SNMM + count_direction[E_AXIS] = 1; + } for(uint8_t i=0; i < step_loops; i++) { // Take multiple steps per interrupt (For high speed moves) #ifndef AT90USB diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 94c3ad761..a933d4bc1 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -96,6 +96,10 @@ int8_t SDscrool = 0; int8_t SilentModeMenu = 0; +#ifdef SNMM +uint8_t snmm_extruder = 0; +#endif + int lcd_commands_type=LCD_COMMAND_IDLE; int lcd_commands_step=0; bool isPrintPaused = false; @@ -589,6 +593,7 @@ void lcd_commands() if (lcd_commands_type == LCD_COMMAND_STOP_PRINT) /// stop print { + uint8_t stopped_extruder; if (lcd_commands_step == 0) { @@ -608,9 +613,8 @@ void lcd_commands() if (lcd_commands_step == 2 && !blocks_queued()) { setTargetBed(0); - setTargetHotend(0, 0); - setTargetHotend(0, 1); - setTargetHotend(0, 2); + enquecommand_P(PSTR("M104 S0")); //set hotend temp to 0 + manage_heater(); lcd_setstatuspgm(WELCOME_MSG); cancel_heatup = false; @@ -620,9 +624,6 @@ void lcd_commands() { // M84: Disable steppers. enquecommand_P(PSTR("M84")); -#ifdef SNMM - enquecommand_P(PSTR("PRUSA ResF")); //resets flag at the end of the print (used for SNMM) -#endif autotempShutdown(); lcd_commands_step = 2; } @@ -671,62 +672,7 @@ void lcd_commands() lcd_commands_step = 5; } if (lcd_commands_step == 7 && !blocks_queued()) { - /*ramming(); - st_synchronize(); - change_extr(0);*/ - st_synchronize(); - enquecommand_P(PSTR("M907 E700")); //set extruder current higher - enquecommand_P(PSTR("M203 E50")); - st_synchronize(); - if (current_temperature[0] < 230) { - // PLA - - //enquecommand_P(PSTR("G1 E-8 F2100.000000")); - //enquecommand_P(PSTR("G1 E8 F2100.000000")); - enquecommand_P(PSTR("G1 E5.4 F2800.000000")); - enquecommand_P(PSTR("G1 E3.2 F3000.000000")); - enquecommand_P(PSTR("G1 E3 F3400.000000")); - enquecommand_P(PSTR("M203 E80")); - st_synchronize(); - enquecommand_P(PSTR("G1 E-82 F9500.000000")); - enquecommand_P(PSTR("M203 E50")); - enquecommand_P(PSTR("G1 E-20 F1200.000000")); - enquecommand_P(PSTR("G1 E5 F400.000000")); - enquecommand_P(PSTR("G1 E5 F600.000000")); - st_synchronize(); - enquecommand_P(PSTR("G1 E-10 F600.000000")); - enquecommand_P(PSTR("G1 E+10 F600.000000")); - enquecommand_P(PSTR("G1 E-10 F800.000000")); - enquecommand_P(PSTR("G1 E+10 F800.000000")); - enquecommand_P(PSTR("G1 E-10 F800.000000")); - st_synchronize(); - }else { - // ABS - - //enquecommand_P(PSTR("G1 E-8 F2100.000000")); - //enquecommand_P(PSTR("G1 E8 F2100.000000")); - enquecommand_P(PSTR("G1 E3.1 F2000.000000")); - enquecommand_P(PSTR("G1 E3.1 F2500.000000")); - enquecommand_P(PSTR("G1 E4 F3000.000000")); - st_synchronize(); - enquecommand_P(PSTR("G4 P4700")); - enquecommand_P(PSTR("M203 E80")); - enquecommand_P(PSTR("G1 E-92 F9900.000000")); - enquecommand_P(PSTR("M203 E50")); - enquecommand_P(PSTR("G1 E-5 F800.000000")); - enquecommand_P(PSTR("G1 E5 F400.000000")); - st_synchronize(); - enquecommand_P(PSTR("G1 E-5 F600.000000")); - enquecommand_P(PSTR("G1 E5 F600.000000")); - enquecommand_P(PSTR("G1 E-5 F600.000000")); - enquecommand_P(PSTR("G1 E5 F600.000000")); - enquecommand_P(PSTR("G1 E5 F600.000000")); - st_synchronize(); - } - enquecommand_P(PSTR("T0")); - enquecommand_P(PSTR("M907 E550")); //set extruder current to 500 - //digipot_init(); - + enquecommand_P(PSTR("M702")); lcd_commands_step = 3; } } @@ -2821,38 +2767,112 @@ void lcd_mylang() { } -char reset_menu() { - int enc_dif = 0; - char cursor_pos = 0; - +void bowden_menu() { + int enc_dif = encoderDiff; + int cursor_pos = 0; lcd_implementation_clear(); + lcd.setCursor(0, 0); + lcd.print(">"); + for (int i = 0; i < 4; i++) { + lcd.setCursor(1, i); + lcd.print("Extruder "); + lcd.print(i); + lcd.print(": "); + EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]); + lcd.print(bowden_length[i] - 48); - lcd.setCursor(1, 0); + } + enc_dif = encoderDiff; + /*while (1) { + if (lcd_clicked()) { + while (lcd_clicked()); + delay(10); + while (lcd_clicked()); + break; + } + }*/ - lcd_printPGM(PSTR("Language")); + while (1) { + manage_heater(); + manage_inactivity(true); - lcd.setCursor(1, 1); - - lcd_printPGM(PSTR("Statistics")); - - - lcd.setCursor(1, 2); - - lcd_printPGM(PSTR("Shiping prep")); + lcd.setCursor(0, 0); + lcd.print(" "); + lcd.setCursor(0, 1); + lcd.print(" "); + lcd.setCursor(0, 2); + lcd.print(" "); + lcd.setCursor(0, 3); + lcd.print(" "); + lcd.setCursor(0, cursor_pos); + lcd.print(">"); + + + if (abs((enc_dif - encoderDiff)) > 4) { + + if ((abs(enc_dif - encoderDiff)) > 1) { + if (enc_dif > encoderDiff) { + bowden_length[cursor_pos]--; + lcd.setCursor(13, cursor_pos); + lcd.print(bowden_length[cursor_pos] -48); + enc_dif = encoderDiff; + } + + if (enc_dif < encoderDiff) { + bowden_length[cursor_pos]++; + lcd.setCursor(13, cursor_pos); + lcd.print(bowden_length[cursor_pos] -48); + enc_dif = encoderDiff; + } + } + } + delay(100); + if (lcd_clicked()) { + while (lcd_clicked()); + delay(10); + while (lcd_clicked()); + EEPROM_save_B(EEPROM_BOWDEN_LENGTH + cursor_pos * 2, &bowden_length[cursor_pos]); + if (cursor_pos == 3) return; + else { + cursor_pos++; + } + } + + + } +} - lcd.setCursor(1, 3); +char reset_menu() { +#ifdef SNMM + int items_no = 5; +#else + int items_no = 4; +#endif + static int first = 0; + int enc_dif = 0; + char cursor_pos = 0; + const char *item [items_no]; - lcd_printPGM(PSTR("All data")); + item[0] = "Language"; + item[1] = "Statistics"; + item[2] = "Shipping prep"; + item[3] = "All Data"; +#ifdef SNMM + item[4] = "Bowden length"; +#endif // SNMM + enc_dif = encoderDiff; + lcd_implementation_clear(); lcd.setCursor(0, 0); - lcd.print(">"); + while (1) { - enc_dif = encoderDiff; - - while (1) { + for (int i = 0; i < 4; i++) { + lcd.setCursor(1, i); + lcd.print(item[first + i]); + } manage_heater(); manage_inactivity(true); @@ -2870,10 +2890,18 @@ char reset_menu() { if (cursor_pos > 3) { cursor_pos = 3; + if (first < items_no - 4) { + first++; + lcd_implementation_clear(); + } } if (cursor_pos < 0) { cursor_pos = 0; + if (first > 0) { + first--; + lcd_implementation_clear(); + } } lcd.setCursor(0, 0); lcd.print(" "); @@ -2895,7 +2923,7 @@ char reset_menu() { while (lcd_clicked()); delay(10); while (lcd_clicked()); - return(cursor_pos); + return(cursor_pos + first); } } @@ -2949,9 +2977,14 @@ void change_extr(int extr) { //switches multiplexer for extruders disable_e1(); disable_e2(); +#ifdef SNMM + snmm_extruder = extr; +#endif + pinMode(E_MUX0_PIN, OUTPUT); pinMode(E_MUX1_PIN, OUTPUT); pinMode(E_MUX2_PIN, OUTPUT); + switch (extr) { case 1: WRITE(E_MUX0_PIN, HIGH); @@ -2986,6 +3019,15 @@ static int get_ext_nr() { //reads multiplexer input pins and return current extr } +void display_loading() { + switch (snmm_extruder) { + case 1: (MSG_FILAMENT_LOADING_T1); break; + case 2: lcd_display_message_fullscreen_P(MSG_FILAMENT_LOADING_T2); break; + case 3: lcd_display_message_fullscreen_P(MSG_FILAMENT_LOADING_T3); break; + default: lcd_display_message_fullscreen_P(MSG_FILAMENT_LOADING_T0); break; + } +} + static void extr_adj(int extruder) //loading filament for SNMM { bool correct; @@ -3012,7 +3054,7 @@ static void extr_adj(int extruder) //loading filament for SNMM //if (!correct) goto START; //extr_mov(BOWDEN_LENGTH/2.f, 500); //dividing by 2 is there because of max. extrusion length limitation (x_max + y_max) //extr_mov(BOWDEN_LENGTH/2.f, 500); - extr_mov(BOWDEN_LENGTH, 500); + extr_mov(bowden_length[extruder], 500); lcd_implementation_clear(); lcd.setCursor(0, 1); lcd_printPGM(MSG_PLEASE_WAIT); st_synchronize(); @@ -3033,9 +3075,10 @@ static void extr_unload() { //unloads filament lcd_display_message_fullscreen_P(PSTR("")); max_feedrate[E_AXIS] = 50; lcd.setCursor(0, 1); lcd_printPGM(MSG_PLEASE_WAIT); - current_position[Z_AXIS] += 15; //lifting in Z direction to make space for extrusion - plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 25, active_extruder); - + if (current_position[Z_AXIS] < 15) { + current_position[Z_AXIS] += 15; //lifting in Z direction to make space for extrusion + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 25, active_extruder); + } current_position[E_AXIS] += 10; //extrusion plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 10, active_extruder); @@ -3063,9 +3106,9 @@ static void extr_unload() { //unloads filament } max_feedrate[E_AXIS] = 80; - current_position[E_AXIS] -= (BOWDEN_LENGTH + 60 + FIL_LOAD_LENGTH) / 2; + current_position[E_AXIS] -= (bowden_length[snmm_extruder] + 60 + FIL_LOAD_LENGTH) / 2; plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder); - current_position[E_AXIS] -= (BOWDEN_LENGTH + 60 + FIL_LOAD_LENGTH) / 2; + current_position[E_AXIS] -= (bowden_length[snmm_extruder] + 60 + FIL_LOAD_LENGTH) / 2; plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder); st_synchronize(); //digipot_init(); @@ -3112,6 +3155,13 @@ static void extr_adj_3() { extr_adj(3); } +static void load_all() { + for (int i = 0; i < 4; i++) { + change_extr(i); + extr_adj(i); + } +} + //wrapper functions for changing extruders static void extr_change_0() { change_extr(0); @@ -3131,13 +3181,27 @@ static void extr_change_3() { } //wrapper functions for unloading filament -static void extr_unload_all() { - for (int i = 0; i < 4; i++) { - change_extr(i); - extr_unload(); +void extr_unload_all() { + if (degHotend0() > EXTRUDE_MINTEMP) { + for (int i = 0; i < 4; i++) { + change_extr(i); + extr_unload(); + } + } + else { + lcd_implementation_clear(); + lcd.setCursor(0, 0); + lcd_printPGM(MSG_ERROR); + lcd.setCursor(0, 2); + lcd_printPGM(MSG_PREHEAT_NOZZLE); + delay(2000); + lcd_implementation_clear(); + lcd_return_to_status(); } } + + static void extr_unload_0() { change_extr(0); extr_unload(); @@ -3160,10 +3224,11 @@ static void fil_load_menu() { START_MENU(); MENU_ITEM(back, MSG_MAIN, lcd_main_menu); - MENU_ITEM(function, PSTR("Load filament 1"), extr_adj_0); - MENU_ITEM(function, PSTR("Load filament 2 "), extr_adj_1); - MENU_ITEM(function, PSTR("Load filament 3"), extr_adj_2); - MENU_ITEM(function, PSTR("Load filament 4"), extr_adj_3); + MENU_ITEM(function, MSG_LOAD_ALL, load_all); + MENU_ITEM(function, MSG_LOAD_FILAMENT_1, extr_adj_0); + MENU_ITEM(function, MSG_LOAD_FILAMENT_2, extr_adj_1); + MENU_ITEM(function, MSG_LOAD_FILAMENT_3, extr_adj_2); + MENU_ITEM(function, MSG_LOAD_FILAMENT_4, extr_adj_3); END_MENU(); } @@ -3173,16 +3238,16 @@ static void fil_unload_menu() { START_MENU(); MENU_ITEM(back, MSG_MAIN, lcd_main_menu); - MENU_ITEM(function, PSTR("Unload all"), extr_unload_all); - MENU_ITEM(function, PSTR("Unload filament 1"), extr_unload_0); - MENU_ITEM(function, PSTR("Unload filament 2"), extr_unload_1); - MENU_ITEM(function, PSTR("Unload filament 3"), extr_unload_2); - MENU_ITEM(function, PSTR("Unload filament 4"), extr_unload_3); + MENU_ITEM(function, MSG_UNLOAD_ALL, extr_unload_all); + MENU_ITEM(function, MSG_UNLOAD_FILAMENT_1, extr_unload_0); + MENU_ITEM(function, MSG_UNLOAD_FILAMENT_2, extr_unload_1); + MENU_ITEM(function, MSG_UNLOAD_FILAMENT_3, extr_unload_2); + MENU_ITEM(function, MSG_UNLOAD_FILAMENT_4, extr_unload_3); END_MENU(); } -static void change_extr_menu(){ +/*static void change_extr_menu(){ START_MENU(); MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM(function, PSTR("Extruder 1"), extr_change_0); @@ -3191,7 +3256,7 @@ static void change_extr_menu(){ MENU_ITEM(function, PSTR("Extruder 4"), extr_change_3); END_MENU(); -} +}*/ #endif @@ -3459,7 +3524,7 @@ static void lcd_main_menu() #ifdef SNMM MENU_ITEM(submenu, MSG_LOAD_FILAMENT, fil_load_menu); MENU_ITEM(submenu, MSG_UNLOAD_FILAMENT, fil_unload_menu); - MENU_ITEM(submenu, MSG_CHANGE_EXTR, change_extr_menu); + //MENU_ITEM(submenu, MSG_CHANGE_EXTR, change_extr_menu); #endif MENU_ITEM(submenu, MSG_SETTINGS, lcd_settings_menu); if(!isPrintPaused) MENU_ITEM(submenu, MSG_MENU_CALIBRATION, lcd_calibration_menu); diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index cd7e18421..8da778296 100644 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -103,6 +103,10 @@ void lcd_mylang(); extern int farm_timer; extern int farm_status; +#ifdef SNMM + extern uint8_t snmm_extruder; +#endif // SNMM + extern bool cancel_heatup; extern bool isPrintPaused; @@ -217,6 +221,8 @@ static void extr_unload_1(); static void extr_unload_2(); static void extr_unload_3(); static void lcd_disable_farm_mode(); +void extr_unload_all(); +static void extr_unload(); void stack_error(); static void lcd_ping_allert(); @@ -237,10 +243,13 @@ void lcd_extr_cal_reset(); union MenuData; +void bowden_menu(); char reset_menu(); void lcd_pinda_calibration_menu(); void lcd_calibrate_pinda(); void lcd_temp_calibration_set(); +void display_loading(); + #endif //ULTRALCD_H
\ No newline at end of file diff --git a/Firmware/ultralcd_implementation_hitachi_HD44780.h b/Firmware/ultralcd_implementation_hitachi_HD44780.h index d82d023d1..8b1ed3de6 100644 --- a/Firmware/ultralcd_implementation_hitachi_HD44780.h +++ b/Firmware/ultralcd_implementation_hitachi_HD44780.h @@ -776,15 +776,17 @@ static void lcd_implementation_status_screen() } else { +#ifdef SNMM + lcd_printPGM(PSTR(" E")); + lcd.print(get_ext_nr() + 1); + +#else lcd.setCursor(LCD_WIDTH - 8 - 2, 2); lcd_printPGM(PSTR(" ")); +#endif } -#ifdef SNMM - lcd_printPGM(PSTR(" E")); - lcd.print(get_ext_nr()+1); - -#endif + //Print time elapsed lcd.setCursor(LCD_WIDTH - 8 -1, 2); |