From 9c4ce3623d1d097634d069f34fe2764df6db3042 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 8 Feb 2018 16:11:51 +0100 Subject: [PATCH 1/4] M600 unload current --- Firmware/Configuration_prusa.h | 8 +++++--- Firmware/Marlin_main.cpp | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Firmware/Configuration_prusa.h b/Firmware/Configuration_prusa.h index 6ab962cd..c3bb9ca8 100644 --- a/Firmware/Configuration_prusa.h +++ b/Firmware/Configuration_prusa.h @@ -231,10 +231,12 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define DIGIPOT_MOTOR_CURRENT_LOUD {135,135,135,135,135} // Motor Current settings for RAMBo mini PWM value = MotorCurrentSetting * 255 / range -#if MOTHERBOARD == 200 || MOTHERBOARD == 203 || MOTHERBOARD == 310 +#if MOTHERBOARD == 203 || MOTHERBOARD == 200 #define MOTOR_CURRENT_PWM_RANGE 2000 -#define DEFAULT_PWM_MOTOR_CURRENT {400, 750, 750} // {XY,Z,E} -#define DEFAULT_PWM_MOTOR_CURRENT_LOUD {400, 750, 750} // {XY,Z,E} +#define DEFAULT_PWM_MOTOR_CURRENT {270, 830, 450} // {XY,Z,E} +#define DEFAULT_PWM_MOTOR_CURRENT_LOUD {540, 830, 500} // {XY,Z,E} +#define Z_SILENT 0 +#define Z_HIGH_POWER 200 #endif /*------------------------------------ diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index cd601620..ab5a0469 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5775,8 +5775,15 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp #ifdef TMC2130 uint8_t tmc2130_current_r_bckp = tmc2130_current_r[E_AXIS]; tmc2130_set_current_r(E_AXIS, TMC2130_UNLOAD_CURRENT_R); +#else + + digipot_current(2, 450); //set motor current for unload + float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT; + float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; + #endif //TMC2130 - target[E_AXIS] -= 45; + + target[E_AXIS] -= 45; plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 5200 / 60, active_extruder); st_synchronize(); target[E_AXIS] -= 15; @@ -5784,10 +5791,16 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp st_synchronize(); target[E_AXIS] -= 20; plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 1000 / 60, active_extruder); - st_synchronize(); + st_synchronize(); + #ifdef TMC2130 tmc2130_set_current_r(E_AXIS, tmc2130_current_r_bckp); +#else + uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); + if(silentMode) digipot_current(2, tmp_motor[2]); //set E back to normal operation currents + else digipot_current(2, tmp_motor_loud[2]); #endif //TMC2130 + #endif // SNMM From ebe1c10423fa9504b1c1992bd7948020152839c3 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 8 Feb 2018 16:32:27 +0100 Subject: [PATCH 2/4] lower current for unload --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index ab5a0469..cffec399 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5777,7 +5777,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp tmc2130_set_current_r(E_AXIS, TMC2130_UNLOAD_CURRENT_R); #else - digipot_current(2, 450); //set motor current for unload + digipot_current(2, 200); //set lower E motor current for unload to protect filament sensor and ptfe tube float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT; float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; From a719ae1b018a9e853febff25efe58eccfc5117f2 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 8 Feb 2018 16:33:43 +0100 Subject: [PATCH 3/4] whitespace --- Firmware/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index cffec399..31216f8e 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5783,7 +5783,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp #endif //TMC2130 - target[E_AXIS] -= 45; + target[E_AXIS] -= 45; plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 5200 / 60, active_extruder); st_synchronize(); target[E_AXIS] -= 15; @@ -5791,7 +5791,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp st_synchronize(); target[E_AXIS] -= 20; plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 1000 / 60, active_extruder); - st_synchronize(); + st_synchronize(); #ifdef TMC2130 tmc2130_set_current_r(E_AXIS, tmc2130_current_r_bckp); From 80f353e8ff526132d6f8409658bbf93ba9bf432b Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 8 Feb 2018 16:52:05 +0100 Subject: [PATCH 4/4] Z_MAX_POS --- Firmware/Configuration_prusa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Configuration_prusa.h b/Firmware/Configuration_prusa.h index c3bb9ca8..5346f2a8 100644 --- a/Firmware/Configuration_prusa.h +++ b/Firmware/Configuration_prusa.h @@ -56,7 +56,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define X_MIN_POS 0 #define Y_MAX_POS 210 #define Y_MIN_POS -4 //orig -4 -#define Z_MAX_POS 210 +#define Z_MAX_POS 200 #define Z_MIN_POS 0.15 // Canceled home position