Merge pull request #399 from XPila/MK3

build 146
This commit is contained in:
PavelSindler 2018-01-15 01:44:10 +01:00 committed by GitHub
commit 8ff38493f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 65 additions and 23 deletions

View File

@ -9,7 +9,7 @@
// Firmware version
#define FW_VERSION "3.1.1-RC4"
#define FW_COMMIT_NR 145
#define FW_COMMIT_NR 146
#define FW_DEV_VERSION FW_VERSION_RC
#define FW_VERSION_FULL FW_VERSION "-" STR(FW_COMMIT_NR)

View File

@ -311,6 +311,8 @@ void Config_RetrieveSettings(uint16_t offset, uint8_t level)
EEPROM_READ_VAR(i,max_jerk[Y_AXIS]);
EEPROM_READ_VAR(i,max_jerk[Z_AXIS]);
EEPROM_READ_VAR(i,max_jerk[E_AXIS]);
if (max_jerk[X_AXIS] > DEFAULT_XJERK) max_jerk[X_AXIS] = DEFAULT_XJERK;
if (max_jerk[Y_AXIS] > DEFAULT_YJERK) max_jerk[Y_AXIS] = DEFAULT_YJERK;
EEPROM_READ_VAR(i,add_homing);
#ifndef ULTIPANEL
int plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed;

View File

@ -75,12 +75,17 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#define MANUAL_FEEDRATE {2700, 2700, 1000, 100} // set the speeds for manual moves (mm/min)
//Silent mode limits
#define SILENT_MAX_ACCEL_X 960 // X-axis max acceleration in silent mode in mm/s^2
#define SILENT_MAX_ACCEL_Y 960 // Y-axis max axxeleration in silent mode in mm/s^2
#define SILENT_MAX_ACCEL_X_ST (100*SILENT_MAX_ACCEL_X) // X max accel in steps/s^2
#define SILENT_MAX_ACCEL_Y_ST (100*SILENT_MAX_ACCEL_Y) // Y max accel in steps/s^2
#define SILENT_MAX_ACCEL 960 // max axxeleration in silent mode in mm/s^2
#define SILENT_MAX_ACCEL_ST (100*SILENT_MAX_ACCEL) // max accel in steps/s^2
#define SILENT_MAX_FEEDRATE 172 //max feedrate in mm/s, because mode switched to normal for homming , this value limits also homing, it should be greater (172mm/s=9600mm/min>2700mm/min)
//Normal mode limits
#define NORMAL_MAX_ACCEL 2500 // Y-axis max axxeleration in normal mode in mm/s^2
#define NORMAL_MAX_ACCEL_ST (100*NORMAL_MAX_ACCEL) // max accel in steps/s^2
#define NORMAL_MAX_FEEDRATE 200 //max feedrate in mm/s, because mode switched to normal for homming , this value limits also homing, it should be greater (172mm/s=9600mm/min>2700mm/min)
//#define SIMPLE_ACCEL_LIMIT //new limitation method for normal/silent
//number of bytes from end of the file to start check
#define END_FILE_SECTION 10000
@ -96,8 +101,8 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
// this value is litlebit higher that real limit, because ambient termistor is on the board and is temperated from it,
// temperature inside the case is around 31C for ambient temperature 25C, when the printer is powered on long time and idle
// the real limit is 15C (same as MINTEMP limit), this is because 15C is end of scale for both used thermistors (bed, heater)
#define MINTEMP_MINAMBIENT 18
#define MINTEMP_MINAMBIENT_RAW 991
#define MINTEMP_MINAMBIENT 25
#define MINTEMP_MINAMBIENT_RAW 978
//DEBUG

View File

@ -4941,6 +4941,8 @@ Sigma_Exit:
if(code_seen('Y')) max_jerk[Y_AXIS] = code_value();
if(code_seen('Z')) max_jerk[Z_AXIS] = code_value();
if(code_seen('E')) max_jerk[E_AXIS] = code_value();
if (max_jerk[X_AXIS] > DEFAULT_XJERK) max_jerk[X_AXIS] = DEFAULT_XJERK;
if (max_jerk[Y_AXIS] > DEFAULT_YJERK) max_jerk[Y_AXIS] = DEFAULT_YJERK;
}
break;
case 206: // M206 additional homing offset

View File

@ -153,11 +153,12 @@ bool fsensor_check_autoload(void)
ISR(PCINT2_vect)
{
// return;
if (!((fsensor_int_pin_old ^ PINK) & FSENSOR_INT_PIN_MSK)) return;
static bool _lock = false;
if (_lock) return;
_lock = true;
// puts("PCINT2\n");
// return;
int st_cnt = fsensor_st_cnt;
fsensor_st_cnt = 0;
sei();
@ -218,6 +219,7 @@ ISR(PCINT2_vect)
}
}
pat9125_y = 0;
_lock = true;
return;
}

View File

@ -1003,8 +1003,19 @@ Having the real displacement of the head, we can calculate the total movement le
current_speed[i] = delta_mm[i] * inverse_second;
#ifdef TMC2130
float max_fr = max_feedrate[i];
if ((tmc2130_mode == TMC2130_MODE_SILENT) && (i < 2))
if (i < 2) // X, Y
{
if (tmc2130_mode == TMC2130_MODE_SILENT)
{
if (max_fr > SILENT_MAX_FEEDRATE)
max_fr = SILENT_MAX_FEEDRATE;
}
else
{
if (max_fr > NORMAL_MAX_FEEDRATE)
max_fr = NORMAL_MAX_FEEDRATE;
}
}
if(fabs(current_speed[i]) > max_fr)
speed_factor = min(speed_factor, max_fr / fabs(current_speed[i]));
#else //TMC2130
@ -1036,21 +1047,41 @@ Having the real displacement of the head, we can calculate the total movement le
{
block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
#ifdef TMC2130
#ifdef SIMPLE_ACCEL_LIMIT // in some cases can be acceleration limited inproperly
if (tmc2130_mode == TMC2130_MODE_SILENT)
{
if(((float)block->acceleration_st * (float)block->steps_x / (float)block->step_event_count) > SILENT_MAX_ACCEL_X_ST)
block->acceleration_st = SILENT_MAX_ACCEL_X_ST;
if(((float)block->acceleration_st * (float)block->steps_y / (float)block->step_event_count) > SILENT_MAX_ACCEL_Y_ST)
block->acceleration_st = SILENT_MAX_ACCEL_Y_ST;
if (block->steps_x || block->steps_y)
if (block->acceleration_st > SILENT_MAX_ACCEL_ST) block->acceleration_st = SILENT_MAX_ACCEL_ST;
}
else
{
if (block->steps_x || block->steps_y)
if (block->acceleration_st > NORMAL_MAX_ACCEL_ST) block->acceleration_st = NORMAL_MAX_ACCEL_ST;
}
if (block->steps_x && (block->acceleration_st > axis_steps_per_sqr_second[X_AXIS])) block->acceleration_st = axis_steps_per_sqr_second[X_AXIS];
if (block->steps_y && (block->acceleration_st > axis_steps_per_sqr_second[Y_AXIS])) block->acceleration_st = axis_steps_per_sqr_second[Y_AXIS];
if (block->steps_z && (block->acceleration_st > axis_steps_per_sqr_second[Z_AXIS])) block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS];
if (block->steps_e && (block->acceleration_st > axis_steps_per_sqr_second[E_AXIS])) block->acceleration_st = axis_steps_per_sqr_second[E_AXIS];
#else // SIMPLE_ACCEL_LIMIT
if (tmc2130_mode == TMC2130_MODE_SILENT)
{
if ((block->steps_x > block->step_event_count / 2) || (block->steps_y > block->step_event_count / 2))
if (block->acceleration_st > SILENT_MAX_ACCEL_ST) block->acceleration_st = SILENT_MAX_ACCEL_ST;
}
else
{
if ((block->steps_x > block->step_event_count / 2) || (block->steps_y > block->step_event_count / 2))
if (block->acceleration_st > NORMAL_MAX_ACCEL_ST) block->acceleration_st = NORMAL_MAX_ACCEL_ST;
}
if(((float)block->acceleration_st * (float)block->steps_x / (float)block->step_event_count) > axis_steps_per_sqr_second[X_AXIS])
block->acceleration_st = axis_steps_per_sqr_second[X_AXIS];
if(((float)block->acceleration_st * (float)block->steps_y / (float)block->step_event_count) > axis_steps_per_sqr_second[Y_AXIS])
block->acceleration_st = axis_steps_per_sqr_second[Y_AXIS];
if(((float)block->acceleration_st * (float)block->steps_e / (float)block->step_event_count) > axis_steps_per_sqr_second[E_AXIS])
block->acceleration_st = axis_steps_per_sqr_second[E_AXIS];
if(((float)block->acceleration_st * (float)block->steps_z / (float)block->step_event_count ) > axis_steps_per_sqr_second[Z_AXIS])
block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS];
if(((float)block->acceleration_st * (float)block->steps_e / (float)block->step_event_count) > axis_steps_per_sqr_second[E_AXIS])
block->acceleration_st = axis_steps_per_sqr_second[E_AXIS];
#endif // SIMPLE_ACCEL_LIMIT
#else //TMC2130
// Limit acceleration per axis
//FIXME Vojtech: One shall rather limit a projection of the acceleration vector instead of using the limit.