Skip to content

Commit

Permalink
Merge branch 'prusa3d#2478-mmu-detect-grinding' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagepc committed Feb 21, 2020
2 parents 4d4fc99 + dae24b5 commit 4c1b5ac
Show file tree
Hide file tree
Showing 14 changed files with 312 additions and 171 deletions.
13 changes: 11 additions & 2 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@ void failstats_reset_print()
eeprom_update_byte((uint8_t *)EEPROM_POWER_COUNT, 0);
eeprom_update_byte((uint8_t *)EEPROM_MMU_FAIL, 0);
eeprom_update_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL, 0);
#if defined(FILAMENT_SENSOR) && defined(PAT9125)
fsensor_softfail = 0;
#endif
}


Expand Down Expand Up @@ -6700,7 +6703,7 @@ SERIAL_PROTOCOLPGM("\n\n");
{
if(code_seen(axis_codes[i]))
{
if(i == 3) { // E
if(i == E_AXIS) { // E
float value = code_value();
if(value < 20.0) {
float factor = cs.axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab.
Expand All @@ -6709,6 +6712,9 @@ SERIAL_PROTOCOLPGM("\n\n");
axis_steps_per_sqr_second[i] *= factor;
}
cs.axis_steps_per_unit[i] = value;
#if defined(FILAMENT_SENSOR) && defined(PAT9125)
fsensor_set_axis_steps_per_unit(value);
#endif
}
else {
cs.axis_steps_per_unit[i] = code_value();
Expand Down Expand Up @@ -8456,7 +8462,6 @@ SERIAL_PROTOCOLPGM("\n\n");
res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only
if (res_valid)
{

st_synchronize();
uint16_t res = tmc2130_get_res(i);
tmc2130_set_res(i, res_new);
Expand All @@ -8473,6 +8478,10 @@ SERIAL_PROTOCOLPGM("\n\n");
cs.axis_steps_per_unit[i] /= fac;
position[i] /= fac;
}
#if defined(FILAMENT_SENSOR) && defined(PAT9125)
if (i == E_AXIS)
fsensor_set_axis_steps_per_unit(cs.axis_steps_per_unit[i]);
#endif
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Firmware/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
//#define PAT9125_I2C_ADDR 0x79 //ID=HI
//#define PAT9125_I2C_ADDR 0x73 //ID=NC
#define PAT9125_XRES 0
#define PAT9125_YRES 240
#define PAT9125_YRES 240 // maximum resolution (5*X cpi)
#define PAT9124_YRES_MM (5*PAT9125_YRES/25.4) // counts per mm

//SM4 configuration
#define SM4_DEFDELAY 500 //default step delay [us]
Expand Down
Loading

0 comments on commit 4c1b5ac

Please sign in to comment.