M600 unload current

This commit is contained in:
PavelSindler 2018-02-08 16:11:51 +01:00
parent 37f138ed3a
commit 9c4ce3623d
2 changed files with 20 additions and 5 deletions

View File

@ -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
/*------------------------------------

View File

@ -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