Merge pull request #1334 from XPila/V3_5

PFW658 - disable extruder motor while changing filament with mmu2 (pr…
This commit is contained in:
PavelSindler 2018-11-13 16:10:24 +01:00 committed by GitHub
commit 51b4858a87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -6636,6 +6636,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
uint8_t val = tmc2130_cur2val(cur_mA);
tmc2130_set_current_h(i, val);
tmc2130_set_current_r(i, val);
//if (i == E_AXIS) printf_P(PSTR("E-axis current=%ldmA\n"), cur_mA);
}
#else //TMC2130

View File

@ -14,6 +14,10 @@
#include "printers.h"
#include <avr/pgmspace.h>
#ifdef TMC2130
#include "tmc2130.h"
#endif //TMC2130
#define CHECK_FINDA ((IS_SD_PRINTING || is_usb_printing) && (mcode_in_progress != 600) && !saved_printing && e_active())
#define MMU_TODELAY 100
@ -321,6 +325,15 @@ int8_t mmu_set_filament_type(uint8_t extruder, uint8_t filament)
void mmu_command(uint8_t cmd)
{
#ifdef TMC2130
if ((cmd >= MMU_CMD_T0) && (cmd <= MMU_CMD_T4))
{
//disable extruder motor
tmc2130_set_pwr(E_AXIS, 0);
//printf_P(PSTR("E-axis disabled\n"));
}
#endif //TMC2130
mmu_cmd = cmd;
mmu_ready = false;
}
@ -475,6 +488,11 @@ void manage_response(bool move_axes, bool turn_off_nozzle)
}
}
if (lcd_update_was_enabled) lcd_update_enable(true);
#ifdef TMC2130
//enable extruder motor (disabled in mmu_command, start of T-code processing)
tmc2130_set_pwr(E_AXIS, 1);
//printf_P(PSTR("E-axis enabled\n"));
#endif //TMC2130
}
//! @brief load filament to nozzle of multimaterial printer