Merge pull request #664 from MRprusa3d/MK3

Mk3
This commit is contained in:
PavelSindler 2018-04-25 22:20:45 +02:00 committed by GitHub
commit 9a6cc8a035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 87 additions and 160 deletions

View File

@ -441,5 +441,4 @@ void gcode_M701();
#define UVLO !(PINE & (1<<4)) #define UVLO !(PINE & (1<<4))
void extr_unload2();
void proc_commands(); void proc_commands();

View File

@ -6051,7 +6051,7 @@ Sigma_Exit:
tmc2130_set_current_r(E_AXIS, tmc2130_current_r_bckp); tmc2130_set_current_r(E_AXIS, tmc2130_current_r_bckp);
#else #else
uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT);
if(silentMode) st_current_set(2, tmp_motor[2]); //set E back to normal operation currents if(silentMode != SILENT_MODE_NORMAL) st_current_set(2, tmp_motor[2]); //set E back to normal operation currents
else st_current_set(2, tmp_motor_loud[2]); else st_current_set(2, tmp_motor_loud[2]);
#endif //TMC2130 #endif //TMC2130
@ -6690,7 +6690,6 @@ Sigma_Exit:
pinMode(E_MUX0_PIN, OUTPUT); pinMode(E_MUX0_PIN, OUTPUT);
pinMode(E_MUX1_PIN, OUTPUT); pinMode(E_MUX1_PIN, OUTPUT);
pinMode(E_MUX2_PIN, OUTPUT);
delay(100); delay(100);
SERIAL_ECHO_START; SERIAL_ECHO_START;
@ -6700,25 +6699,21 @@ Sigma_Exit:
case 1: case 1:
WRITE(E_MUX0_PIN, HIGH); WRITE(E_MUX0_PIN, HIGH);
WRITE(E_MUX1_PIN, LOW); WRITE(E_MUX1_PIN, LOW);
WRITE(E_MUX2_PIN, LOW);
break; break;
case 2: case 2:
WRITE(E_MUX0_PIN, LOW); WRITE(E_MUX0_PIN, LOW);
WRITE(E_MUX1_PIN, HIGH); WRITE(E_MUX1_PIN, HIGH);
WRITE(E_MUX2_PIN, LOW);
break; break;
case 3: case 3:
WRITE(E_MUX0_PIN, HIGH); WRITE(E_MUX0_PIN, HIGH);
WRITE(E_MUX1_PIN, HIGH); WRITE(E_MUX1_PIN, HIGH);
WRITE(E_MUX2_PIN, LOW);
break; break;
default: default:
WRITE(E_MUX0_PIN, LOW); WRITE(E_MUX0_PIN, LOW);
WRITE(E_MUX1_PIN, LOW); WRITE(E_MUX1_PIN, LOW);
WRITE(E_MUX2_PIN, LOW);
break; break;
} }
@ -6846,7 +6841,7 @@ void ClearToSend()
SERIAL_PROTOCOLLNRPGM(MSG_OK); SERIAL_PROTOCOLLNRPGM(MSG_OK);
} }
#if MOTHERBOARD == 200 || MOTHERBOARD == 203 #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3
void update_currents() { void update_currents() {
float current_high[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; float current_high[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
float current_low[3] = DEFAULT_PWM_MOTOR_CURRENT; float current_low[3] = DEFAULT_PWM_MOTOR_CURRENT;
@ -6883,7 +6878,7 @@ void update_currents() {
} }
} }
} }
#endif //MOTHERBOARD == 200 || MOTHERBOARD == 203 #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3
void get_coordinates() void get_coordinates()
{ {
@ -6906,9 +6901,9 @@ void get_coordinates()
if (relative) if (relative)
destination[i] += current_position[i]; destination[i] += current_position[i];
seen[i]=true; seen[i]=true;
#if MOTHERBOARD == 200 || MOTHERBOARD == 203 #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3
if (i == Z_AXIS && SilentModeMenu == 2) update_currents(); if (i == Z_AXIS && SilentModeMenu == SILENT_MODE_AUTO) update_currents();
#endif //MOTHERBOARD == 200 || MOTHERBOARD == 203 #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3
} }
else destination[i] = current_position[i]; //Are these else lines really needed? else destination[i] = current_position[i]; //Are these else lines really needed?
} }
@ -8613,73 +8608,3 @@ void print_mesh_bed_leveling_table()
#define FIL_LOAD_LENGTH 60 #define FIL_LOAD_LENGTH 60
void extr_unload2() { //unloads filament
// float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT;
// float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
// int8_t SilentMode;
uint8_t snmm_extruder = 0;
if (degHotend0() > EXTRUDE_MINTEMP) {
lcd_implementation_clear();
lcd_display_message_fullscreen_P(PSTR(""));
max_feedrate[E_AXIS] = 50;
lcd.setCursor(0, 0); lcd_printPGM(MSG_UNLOADING_FILAMENT);
// lcd.print(" ");
// lcd.print(snmm_extruder + 1);
lcd.setCursor(0, 2); lcd_printPGM(MSG_PLEASE_WAIT);
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);
// st_current_set(2, E_MOTOR_HIGH_CURRENT);
if (current_temperature[0] < 230) { //PLA & all other filaments
current_position[E_AXIS] += 5.4;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2800 / 60, active_extruder);
current_position[E_AXIS] += 3.2;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 3000 / 60, active_extruder);
current_position[E_AXIS] += 3;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 3400 / 60, active_extruder);
}
else { //ABS
current_position[E_AXIS] += 3.1;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2000 / 60, active_extruder);
current_position[E_AXIS] += 3.1;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2500 / 60, active_extruder);
current_position[E_AXIS] += 4;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 3000 / 60, active_extruder);
/*current_position[X_AXIS] += 23; //delay
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600 / 60, active_extruder); //delay
current_position[X_AXIS] -= 23; //delay
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600 / 60, active_extruder); //delay*/
delay_keep_alive(4700);
}
max_feedrate[E_AXIS] = 80;
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[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();
//st_current_init();
// if (SilentMode == 1) st_current_set(2, tmp_motor[2]); //set back to normal operation currents
// else st_current_set(2, tmp_motor_loud[2]);
lcd_update_enable(true);
// lcd_return_to_status();
max_feedrate[E_AXIS] = 50;
}
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();
}

View File

@ -23,17 +23,17 @@
* Rambo Pin Assignments 1.3 * Rambo Pin Assignments 1.3
******************************************************************/ ******************************************************************/
#if MOTHERBOARD == 200 //200 - orig 102 #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 //200 - orig 102
#include "pins_Rambo_1_0.h" #include "pins_Rambo_1_0.h"
#endif //MOTHERBOARD == 200 #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0
#if MOTHERBOARD == 203 //203 - orig 302 #if MOTHERBOARD == BOARD_RAMBO_MINI_1_3 //203 - orig 302
#include "pins_Rambo_1_3.h" #include "pins_Rambo_1_3.h"
#endif //MOTHERBOARD == 203 #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_3
#if MOTHERBOARD == 310 //310 - new #if MOTHERBOARD == BOARD_EINSY_1_0a //310 - new
#include "pins_Einsy_1_0.h" #include "pins_Einsy_1_0.h"
#endif //MOTHERBOARD == 310 #endif //MOTHERBOARD == BOARD_EINSY_1_0a
#ifndef KNOWN_BOARD #ifndef KNOWN_BOARD
#error Unknown MOTHERBOARD value in configuration.h #error Unknown MOTHERBOARD value in configuration.h

View File

@ -69,6 +69,11 @@
#define E0_MS1_PIN 65 #define E0_MS1_PIN 65
#define E0_MS2_PIN 66 #define E0_MS2_PIN 66
#ifdef SNMM
#define E_MUX0_PIN 17
#define E_MUX1_PIN 16
#endif
#define MOTOR_CURRENT_PWM_XY_PIN 46 #define MOTOR_CURRENT_PWM_XY_PIN 46
#define MOTOR_CURRENT_PWM_Z_PIN 45 #define MOTOR_CURRENT_PWM_Z_PIN 45

View File

@ -48,12 +48,12 @@ uint8_t sm4_get_dir(uint8_t axis)
{ {
switch (axis) switch (axis)
{ {
#if ((MOTHERBOARD == 200) || (MOTHERBOARD == 203)) #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
case 0: return (PORTL & 2)?0:1; case 0: return (PORTL & 2)?0:1;
case 1: return (PORTL & 1)?0:1; case 1: return (PORTL & 1)?0:1;
case 2: return (PORTL & 4)?0:1; case 2: return (PORTL & 4)?0:1;
case 3: return (PORTL & 64)?1:0; case 3: return (PORTL & 64)?1:0;
#else if ((MOTHERBOARD == 310)) #else if ((MOTHERBOARD == BOARD_EINSY_1_0a))
case 0: return (PORTL & 1)?1:0; case 0: return (PORTL & 1)?1:0;
case 1: return (PORTL & 2)?0:1; case 1: return (PORTL & 2)?0:1;
case 2: return (PORTL & 4)?1:0; case 2: return (PORTL & 4)?1:0;
@ -67,12 +67,12 @@ void sm4_set_dir(uint8_t axis, uint8_t dir)
{ {
switch (axis) switch (axis)
{ {
#if ((MOTHERBOARD == 200) || (MOTHERBOARD == 203)) #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
case 0: if (!dir) PORTL |= 2; else PORTL &= ~2; break; case 0: if (!dir) PORTL |= 2; else PORTL &= ~2; break;
case 1: if (!dir) PORTL |= 1; else PORTL &= ~1; break; case 1: if (!dir) PORTL |= 1; else PORTL &= ~1; break;
case 2: if (!dir) PORTL |= 4; else PORTL &= ~4; break; case 2: if (!dir) PORTL |= 4; else PORTL &= ~4; break;
case 3: if (dir) PORTL |= 64; else PORTL &= ~64; break; case 3: if (dir) PORTL |= 64; else PORTL &= ~64; break;
#else if ((MOTHERBOARD == 310)) #else if ((MOTHERBOARD == BOARD_EINSY_1_0a))
case 0: if (dir) PORTL |= 1; else PORTL &= ~1; break; case 0: if (dir) PORTL |= 1; else PORTL &= ~1; break;
case 1: if (!dir) PORTL |= 2; else PORTL &= ~2; break; case 1: if (!dir) PORTL |= 2; else PORTL &= ~2; break;
case 2: if (dir) PORTL |= 4; else PORTL &= ~4; break; case 2: if (dir) PORTL |= 4; else PORTL &= ~4; break;
@ -87,13 +87,13 @@ uint8_t sm4_get_dir_bits(void)
uint8_t register dir_bits = 0; uint8_t register dir_bits = 0;
uint8_t register portL = PORTL; uint8_t register portL = PORTL;
//TODO -optimize in asm //TODO -optimize in asm
#if ((MOTHERBOARD == 200) || (MOTHERBOARD == 203)) #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
if (portL & 2) dir_bits |= 1; if (portL & 2) dir_bits |= 1;
if (portL & 1) dir_bits |= 2; if (portL & 1) dir_bits |= 2;
if (portL & 4) dir_bits |= 4; if (portL & 4) dir_bits |= 4;
if (portL & 64) dir_bits |= 8; if (portL & 64) dir_bits |= 8;
dir_bits ^= 0x07; //invert XYZ, do not invert E dir_bits ^= 0x07; //invert XYZ, do not invert E
#else if ((MOTHERBOARD == 310)) #else if ((MOTHERBOARD == BOARD_EINSY_1_0a))
if (portL & 1) dir_bits |= 1; if (portL & 1) dir_bits |= 1;
if (portL & 2) dir_bits |= 2; if (portL & 2) dir_bits |= 2;
if (portL & 4) dir_bits |= 4; if (portL & 4) dir_bits |= 4;
@ -108,13 +108,13 @@ void sm4_set_dir_bits(uint8_t dir_bits)
uint8_t register portL = PORTL; uint8_t register portL = PORTL;
portL &= 0xb8; //set direction bits to zero portL &= 0xb8; //set direction bits to zero
//TODO -optimize in asm //TODO -optimize in asm
#if ((MOTHERBOARD == 200) || (MOTHERBOARD == 203)) #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
dir_bits ^= 0x07; //invert XYZ, do not invert E dir_bits ^= 0x07; //invert XYZ, do not invert E
if (dir_bits & 1) portL |= 2; //set X direction bit if (dir_bits & 1) portL |= 2; //set X direction bit
if (dir_bits & 2) portL |= 1; //set Y direction bit if (dir_bits & 2) portL |= 1; //set Y direction bit
if (dir_bits & 4) portL |= 4; //set Z direction bit if (dir_bits & 4) portL |= 4; //set Z direction bit
if (dir_bits & 8) portL |= 64; //set E direction bit if (dir_bits & 8) portL |= 64; //set E direction bit
#else if ((MOTHERBOARD == 310)) #else if ((MOTHERBOARD == BOARD_EINSY_1_0a))
dir_bits ^= 0x0a; //invert YE, do not invert XZ dir_bits ^= 0x0a; //invert YE, do not invert XZ
if (dir_bits & 1) portL |= 1; //set X direction bit if (dir_bits & 1) portL |= 1; //set X direction bit
if (dir_bits & 2) portL |= 2; //set Y direction bit if (dir_bits & 2) portL |= 2; //set Y direction bit
@ -127,13 +127,13 @@ void sm4_set_dir_bits(uint8_t dir_bits)
void sm4_do_step(uint8_t axes_mask) void sm4_do_step(uint8_t axes_mask)
{ {
#if ((MOTHERBOARD == 200) || (MOTHERBOARD == 203) || (MOTHERBOARD == 310)) #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a))
uint8_t register portC = PORTC & 0xf0; uint8_t register portC = PORTC & 0xf0;
PORTC = portC | (axes_mask & 0x0f); //set step signals by mask PORTC = portC | (axes_mask & 0x0f); //set step signals by mask
asm("nop"); asm("nop");
PORTC = portC; //set step signals to zero PORTC = portC; //set step signals to zero
asm("nop"); asm("nop");
#endif //((MOTHERBOARD == 200) || (MOTHERBOARD == 203) || (MOTHERBOARD == 310)) #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a))
} }
uint16_t sm4_line_xyze_ui(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t de) uint16_t sm4_line_xyze_ui(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t de)

View File

@ -101,8 +101,6 @@ static bool check_endstops = true;
static bool check_z_endstop = false; static bool check_z_endstop = false;
static bool z_endstop_invert = false; static bool z_endstop_invert = false;
int8_t SilentMode = 0;
volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0}; volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0};
volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1}; volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1};
@ -1459,6 +1457,7 @@ void digitalPotWrite(int address, int value) // From Arduino DigitalPotControl e
#endif #endif
} }
//*** MaR::180416_03
void EEPROM_read_st(int pos, uint8_t* value, uint8_t size) void EEPROM_read_st(int pos, uint8_t* value, uint8_t size)
{ {
do do
@ -1472,13 +1471,13 @@ void EEPROM_read_st(int pos, uint8_t* value, uint8_t size)
void st_current_init() //Initialize Digipot Motor Current void st_current_init() //Initialize Digipot Motor Current
{ {
EEPROM_read_st(EEPROM_SILENT,(uint8_t*)&SilentMode,sizeof(SilentMode)); uint8_t SilentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT);
SilentModeMenu = SilentMode; SilentModeMenu = SilentMode;
#ifdef MOTOR_CURRENT_PWM_XY_PIN #ifdef MOTOR_CURRENT_PWM_XY_PIN
pinMode(MOTOR_CURRENT_PWM_XY_PIN, OUTPUT); pinMode(MOTOR_CURRENT_PWM_XY_PIN, OUTPUT);
pinMode(MOTOR_CURRENT_PWM_Z_PIN, OUTPUT); pinMode(MOTOR_CURRENT_PWM_Z_PIN, OUTPUT);
pinMode(MOTOR_CURRENT_PWM_E_PIN, OUTPUT); pinMode(MOTOR_CURRENT_PWM_E_PIN, OUTPUT);
if((SilentMode == 0) || (farm_mode) ){ if((SilentMode == SILENT_MODE_OFF) || (farm_mode) ){
motor_current_setting[0] = motor_current_setting_loud[0]; motor_current_setting[0] = motor_current_setting_loud[0];
motor_current_setting[1] = motor_current_setting_loud[1]; motor_current_setting[1] = motor_current_setting_loud[1];

View File

@ -129,7 +129,7 @@ int8_t ReInitLCD = 0;
int8_t SDscrool = 0; int8_t SDscrool = 0;
int8_t SilentModeMenu = 0; int8_t SilentModeMenu = SILENT_MODE_OFF;
int8_t FSensorStateMenu = 1; int8_t FSensorStateMenu = 1;
@ -3561,10 +3561,7 @@ static void lcd_crash_mode_info()
tim = millis(); tim = millis();
} }
if (lcd_clicked()) if (lcd_clicked())
{ menu_action_back();
if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) lcd_goto_menu(lcd_tune_menu, 18);
else lcd_goto_menu(lcd_settings_menu, 16, true, true);
}
} }
static void lcd_crash_mode_info2() static void lcd_crash_mode_info2()
@ -3577,13 +3574,7 @@ static void lcd_crash_mode_info2()
tim = millis(); tim = millis();
} }
if (lcd_clicked()) if (lcd_clicked())
{ menu_action_back();
//-// if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) lcd_goto_menu(lcd_tune_menu, 16);
if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) menu_action_back();
//-// else lcd_goto_menu(lcd_settings_menu, 14, true, true);
//-// else lcd_goto_menu(lcd_settings_menu, 7, true, true);
else menu_action_back();
}
} }
#endif //TMC2130 #endif //TMC2130
@ -3602,14 +3593,16 @@ static void lcd_fsensor_fail()
static void lcd_silent_mode_set() { static void lcd_silent_mode_set() {
switch (SilentModeMenu) { switch (SilentModeMenu) {
case 0: SilentModeMenu = 1; break;
#ifdef TMC2130 #ifdef TMC2130
case 1: SilentModeMenu = 0; break; case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break;
case SILENT_MODE_STEALTH: SilentModeMenu = SILENT_MODE_NORMAL; break;
default: SilentModeMenu = SILENT_MODE_NORMAL; break; // (probably) not needed
#else #else
case 1: SilentModeMenu = 2; break; case SILENT_MODE_POWER: SilentModeMenu = SILENT_MODE_SILENT; break;
case 2: SilentModeMenu = 0; break; case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break;
case SILENT_MODE_AUTO: SilentModeMenu = SILENT_MODE_POWER; break;
default: SilentModeMenu = SILENT_MODE_POWER; break; // (probably) not needed
#endif //TMC2130 #endif //TMC2130
default: SilentModeMenu = 0; break;
} }
eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu); eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
#ifdef TMC2130 #ifdef TMC2130
@ -3621,7 +3614,7 @@ static void lcd_silent_mode_set() {
// else // else
// MYSERIAL.print("standstill NG!"); // MYSERIAL.print("standstill NG!");
cli(); cli();
tmc2130_mode = SilentModeMenu?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL;
tmc2130_init(); tmc2130_init();
// We may have missed a stepper timer interrupt due to the time spent in tmc2130_init. // We may have missed a stepper timer interrupt due to the time spent in tmc2130_init.
// Be safe than sorry, reset the stepper timer before re-enabling interrupts. // Be safe than sorry, reset the stepper timer before re-enabling interrupts.
@ -3630,8 +3623,7 @@ static void lcd_silent_mode_set() {
#endif //TMC2130 #endif //TMC2130
st_current_init(); st_current_init();
#ifdef TMC2130 #ifdef TMC2130
if (CrashDetectMenu && SilentModeMenu) if (CrashDetectMenu && (SilentModeMenu != SILENT_MODE_NORMAL))
//-// lcd_goto_menu(lcd_crash_mode_info2);
menu_action_submenu(lcd_crash_mode_info2); menu_action_submenu(lcd_crash_mode_info2);
#endif //TMC2130 #endif //TMC2130
} }
@ -4095,10 +4087,10 @@ static void lcd_settings_menu()
#ifndef TMC2130 #ifndef TMC2130
if (!farm_mode) { //dont show in menu if we are in farm mode if (!farm_mode) { //dont show in menu if we are in farm mode
switch (SilentModeMenu) { switch (SilentModeMenu) {
case 0: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break; case SILENT_MODE_POWER: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break;
case 1: MENU_ITEM(function, MSG_SILENT_MODE_ON, lcd_silent_mode_set); break; case SILENT_MODE_SILENT: MENU_ITEM(function, MSG_SILENT_MODE_ON, lcd_silent_mode_set); break;
case 2: MENU_ITEM(function, MSG_AUTO_MODE_ON, lcd_silent_mode_set); break; case SILENT_MODE_AUTO: MENU_ITEM(function, MSG_AUTO_MODE_ON, lcd_silent_mode_set); break;
default: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break; default: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break; // (probably) not needed
} }
} }
#endif //TMC2130 #endif //TMC2130
@ -4139,9 +4131,10 @@ static void lcd_settings_menu()
} }
#ifdef TMC2130 #ifdef TMC2130
if (SilentModeMenu == 0) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set); //*** MaR::180416_01a
if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set);
else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set); else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set);
if (SilentModeMenu == 0) if (SilentModeMenu == SILENT_MODE_NORMAL)
{ {
if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set); if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set);
else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set); else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set);
@ -5042,37 +5035,30 @@ void change_extr(int extr) { //switches multiplexer for extruders
disable_e1(); disable_e1();
disable_e2(); disable_e2();
#ifdef SNMM
snmm_extruder = extr; snmm_extruder = extr;
#endif
pinMode(E_MUX0_PIN, OUTPUT); pinMode(E_MUX0_PIN, OUTPUT);
pinMode(E_MUX1_PIN, OUTPUT); pinMode(E_MUX1_PIN, OUTPUT);
pinMode(E_MUX2_PIN, OUTPUT);
switch (extr) { switch (extr) {
case 1: case 1:
WRITE(E_MUX0_PIN, HIGH); WRITE(E_MUX0_PIN, HIGH);
WRITE(E_MUX1_PIN, LOW); WRITE(E_MUX1_PIN, LOW);
WRITE(E_MUX2_PIN, LOW);
break; break;
case 2: case 2:
WRITE(E_MUX0_PIN, LOW); WRITE(E_MUX0_PIN, LOW);
WRITE(E_MUX1_PIN, HIGH); WRITE(E_MUX1_PIN, HIGH);
WRITE(E_MUX2_PIN, LOW);
break; break;
case 3: case 3:
WRITE(E_MUX0_PIN, HIGH); WRITE(E_MUX0_PIN, HIGH);
WRITE(E_MUX1_PIN, HIGH); WRITE(E_MUX1_PIN, HIGH);
WRITE(E_MUX2_PIN, LOW);
break; break;
default: default:
WRITE(E_MUX0_PIN, LOW); WRITE(E_MUX0_PIN, LOW);
WRITE(E_MUX1_PIN, LOW); WRITE(E_MUX1_PIN, LOW);
WRITE(E_MUX2_PIN, LOW);
break; break;
} }
@ -5080,7 +5066,7 @@ void change_extr(int extr) { //switches multiplexer for extruders
} }
static int get_ext_nr() { //reads multiplexer input pins and return current extruder number (counted from 0) static int get_ext_nr() { //reads multiplexer input pins and return current extruder number (counted from 0)
return(4 * READ(E_MUX2_PIN) + 2 * READ(E_MUX1_PIN) + READ(E_MUX0_PIN)); return(2 * READ(E_MUX1_PIN) + READ(E_MUX0_PIN));
} }
@ -5093,7 +5079,7 @@ void display_loading() {
} }
} }
static void extr_adj(int extruder) //loading filament for SNMM void extr_adj(int extruder) //loading filament for SNMM
{ {
bool correct; bool correct;
max_feedrate[E_AXIS] =80; max_feedrate[E_AXIS] =80;
@ -5137,7 +5123,7 @@ static void extr_adj(int extruder) //loading filament for SNMM
void extr_unload() { //unloads filament void extr_unload() { //unloads filament
float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT; float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT;
float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
int8_t SilentMode; uint8_t SilentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT);
if (degHotend0() > EXTRUDE_MINTEMP) { if (degHotend0() > EXTRUDE_MINTEMP) {
lcd_implementation_clear(); lcd_implementation_clear();
@ -5184,7 +5170,7 @@ void extr_unload() { //unloads filament
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 500, active_extruder);
st_synchronize(); st_synchronize();
//st_current_init(); //st_current_init();
if (SilentMode == 1) st_current_set(2, tmp_motor[2]); //set back to normal operation currents if (SilentMode != SILENT_MODE_OFF) st_current_set(2, tmp_motor[2]); //set back to normal operation currents
else st_current_set(2, tmp_motor_loud[2]); else st_current_set(2, tmp_motor_loud[2]);
lcd_update_enable(true); lcd_update_enable(true);
lcd_return_to_status(); lcd_return_to_status();
@ -5803,18 +5789,19 @@ static void lcd_autostart_sd()
static void lcd_silent_mode_set_tune() { static void lcd_silent_mode_set_tune() {
switch (SilentModeMenu) { switch (SilentModeMenu) {
case 0: SilentModeMenu = 1; break;
#ifdef TMC2130 #ifdef TMC2130
case 1: SilentModeMenu = 0; break; case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break;
case SILENT_MODE_STEALTH: SilentModeMenu = SILENT_MODE_NORMAL; break;
default: SilentModeMenu = SILENT_MODE_NORMAL; break; // (probably) not needed
#else #else
case 1: SilentModeMenu = 2; break; case SILENT_MODE_POWER: SilentModeMenu = SILENT_MODE_SILENT; break;
case 2: SilentModeMenu = 0; break; case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break;
case SILENT_MODE_AUTO: SilentModeMenu = SILENT_MODE_POWER; break;
default: SilentModeMenu = SILENT_MODE_POWER; break; // (probably) not needed
#endif //TMC2130 #endif //TMC2130
default: SilentModeMenu = 0; break;
} }
eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu); eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
st_current_init(); st_current_init();
//-// lcd_goto_menu(lcd_tune_menu, 9);
menu_action_back(); menu_action_back();
} }
@ -5870,10 +5857,11 @@ static void lcd_tune_menu()
#endif //DEBUG_DISABLE_FSENSORCHECK #endif //DEBUG_DISABLE_FSENSORCHECK
#ifdef TMC2130 #ifdef TMC2130
if (SilentModeMenu == 0) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set); //*** MaR::180416_01b
if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set);
else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set); else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set);
if (SilentModeMenu == 0) if (SilentModeMenu == SILENT_MODE_NORMAL)
{ {
if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set); if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set);
else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set); else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set);
@ -5882,10 +5870,10 @@ static void lcd_tune_menu()
#else //TMC2130 #else //TMC2130
if (!farm_mode) { //dont show in menu if we are in farm mode if (!farm_mode) { //dont show in menu if we are in farm mode
switch (SilentModeMenu) { switch (SilentModeMenu) {
case 0: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break; case SILENT_MODE_POWER: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break;
case 1: MENU_ITEM(function, MSG_SILENT_MODE_ON, lcd_silent_mode_set); break; case SILENT_MODE_SILENT: MENU_ITEM(function, MSG_SILENT_MODE_ON, lcd_silent_mode_set); break;
case 2: MENU_ITEM(function, MSG_AUTO_MODE_ON, lcd_silent_mode_set); break; case SILENT_MODE_AUTO: MENU_ITEM(function, MSG_AUTO_MODE_ON, lcd_silent_mode_set); break;
default: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break; default: MENU_ITEM(function, MSG_SILENT_MODE_OFF, lcd_silent_mode_set); break; // (probably) not needed
} }
} }
#endif //TMC2130 #endif //TMC2130
@ -6686,7 +6674,8 @@ static bool lcd_selfcheck_pulleys(int axis)
st_current_set(0, 850); //set motor current higher st_current_set(0, 850); //set motor current higher
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 200, active_extruder); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 200, active_extruder);
st_synchronize(); st_synchronize();
if (SilentModeMenu == 1) st_current_set(0, tmp_motor[0]); //set back to normal operation currents //*** MaR::180416_02
if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents
else st_current_set(0, tmp_motor_loud[0]); //set motor current back else st_current_set(0, tmp_motor_loud[0]); //set motor current back
current_position[axis] = current_position[axis] - move; current_position[axis] = current_position[axis] - move;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);

View File

@ -120,6 +120,16 @@ void lcd_mylang();
extern int farm_no; extern int farm_no;
extern int farm_timer; extern int farm_timer;
extern int farm_status; extern int farm_status;
#ifdef TMC2130
#define SILENT_MODE_NORMAL 0
#define SILENT_MODE_STEALTH 1
#define SILENT_MODE_OFF SILENT_MODE_NORMAL
#else
#define SILENT_MODE_POWER 0
#define SILENT_MODE_SILENT 1
#define SILENT_MODE_AUTO 2
#define SILENT_MODE_OFF SILENT_MODE_POWER
#endif
extern int8_t SilentModeMenu; extern int8_t SilentModeMenu;
#ifdef SNMM #ifdef SNMM
@ -229,7 +239,7 @@ extern void lcd_implementation_print_at(uint8_t x, uint8_t y, const char *str);
void change_extr(int extr); void change_extr(int extr);
static void lcd_colorprint_change(); static void lcd_colorprint_change();
static int get_ext_nr(); static int get_ext_nr();
static void extr_adj(int extruder); void extr_adj(int extruder);
static void extr_adj_0(); static void extr_adj_0();
static void extr_adj_1(); static void extr_adj_1();
static void extr_adj_2(); static void extr_adj_2();

View File

@ -203,7 +203,7 @@ MOTOR CURRENT SETTINGS
#define DIGIPOT_MOTOR_CURRENT_LOUD {135,135,135,135,135} #define DIGIPOT_MOTOR_CURRENT_LOUD {135,135,135,135,135}
// Motor Current settings for RAMBo mini PWM value = MotorCurrentSetting * 255 / range // Motor Current settings for RAMBo mini PWM value = MotorCurrentSetting * 255 / range
#if MOTHERBOARD == 203 || MOTHERBOARD == 200 #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3
#define MOTOR_CURRENT_PWM_RANGE 2000 #define MOTOR_CURRENT_PWM_RANGE 2000
#define DEFAULT_PWM_MOTOR_CURRENT {270, 830, 450} // {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 DEFAULT_PWM_MOTOR_CURRENT_LOUD {540, 830, 500} // {XY,Z,E}

View File

@ -247,7 +247,7 @@ 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} #define DIGIPOT_MOTOR_CURRENT_LOUD {135,135,135,135,135}
// Motor Current settings for RAMBo mini PWM value = MotorCurrentSetting * 255 / range // Motor Current settings for RAMBo mini PWM value = MotorCurrentSetting * 255 / range
#if MOTHERBOARD == 203 || MOTHERBOARD == 200 #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3
#define MOTOR_CURRENT_PWM_RANGE 2000 #define MOTOR_CURRENT_PWM_RANGE 2000
#define DEFAULT_PWM_MOTOR_CURRENT {270, 830, 450} // {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 DEFAULT_PWM_MOTOR_CURRENT_LOUD {540, 830, 500} // {XY,Z,E}

View File

@ -368,7 +368,7 @@ 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} #define DIGIPOT_MOTOR_CURRENT_LOUD {135,135,135,135,135}
// Motor Current settings for RAMBo mini PWM value = MotorCurrentSetting * 255 / range // Motor Current settings for RAMBo mini PWM value = MotorCurrentSetting * 255 / range
#if MOTHERBOARD == 200 || MOTHERBOARD == 203 #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3
#define MOTOR_CURRENT_PWM_RANGE 2000 #define MOTOR_CURRENT_PWM_RANGE 2000
#define DEFAULT_PWM_MOTOR_CURRENT {400, 750, 750} // {XY,Z,E} #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_LOUD {400, 750, 750} // {XY,Z,E}

View File

@ -682,16 +682,16 @@ uint8_t xyzcal_xycoords2point(int16_t x, int16_t y)
} }
//MK3 //MK3
#if ((MOTHERBOARD == 310)) #if ((MOTHERBOARD == BOARD_EINSY_1_0a))
const int16_t PROGMEM xyzcal_point_xcoords[4] = {1200, 22000, 22000, 1200}; const int16_t PROGMEM xyzcal_point_xcoords[4] = {1200, 22000, 22000, 1200};
const int16_t PROGMEM xyzcal_point_ycoords[4] = {600, 600, 19800, 19800}; const int16_t PROGMEM xyzcal_point_ycoords[4] = {600, 600, 19800, 19800};
#endif //((MOTHERBOARD == 310)) #endif //((MOTHERBOARD == BOARD_EINSY_1_0a))
//MK2.5 //MK2.5
#if ((MOTHERBOARD == 200) || (MOTHERBOARD == 203)) #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
const int16_t PROGMEM xyzcal_point_xcoords[4] = {1200, 22000, 22000, 1200}; const int16_t PROGMEM xyzcal_point_xcoords[4] = {1200, 22000, 22000, 1200};
const int16_t PROGMEM xyzcal_point_ycoords[4] = {700, 700, 19800, 19800}; const int16_t PROGMEM xyzcal_point_ycoords[4] = {700, 700, 19800, 19800};
#endif //((MOTHERBOARD == 200) || (MOTHERBOARD == 203)) #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
const uint16_t PROGMEM xyzcal_point_pattern[12] = {0x000, 0x0f0, 0x1f8, 0x3fc, 0x7fe, 0x7fe, 0x7fe, 0x7fe, 0x3fc, 0x1f8, 0x0f0, 0x000}; const uint16_t PROGMEM xyzcal_point_pattern[12] = {0x000, 0x0f0, 0x1f8, 0x3fc, 0x7fe, 0x7fe, 0x7fe, 0x7fe, 0x3fc, 0x1f8, 0x0f0, 0x000};