Merge pull request #110 from XPila/MK3

Mk3
This commit is contained in:
XPila 2017-11-27 14:46:20 +01:00 committed by GitHub
commit 65bda580da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 45487 additions and 9 deletions

View file

@ -8,8 +8,8 @@
#define STR(x) STR_HELPER(x)
// Firmware version
#define FW_version "3.0.12-RC2"
#define FW_build 113
#define FW_version "3.1.1-RC1"
#define FW_build 115
//#define FW_build --BUILD-NUMBER--
#define FW_version_build FW_version " b" STR(FW_build)

View file

@ -511,7 +511,8 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
// For example, the Prusa i3 MK2 with 16 microsteps per full step has Z stepping of 400 microsteps per mm.
// At 400 microsteps per mm, a full step lifts the Z axis by 0.04mm, and a stepper driver cycle is 0.16mm.
// The following example, 12 * (4 * 16 / 400) = 12 * 0.16mm = 1.92mm.
#define UVLO_Z_AXIS_SHIFT 1.92
//#define UVLO_Z_AXIS_SHIFT 1.92
#define UVLO_Z_AXIS_SHIFT 0.64
// If power panic occured, and the current temperature is higher then target temperature before interrupt minus this offset, print will be recovered automatically.
#define AUTOMATIC_UVLO_BED_TEMP_OFFSET 5

View file

@ -53,4 +53,4 @@
#if defined(DIGIPOT_I2C)
#include <Wire.h>
#endif
#endif

View file

@ -826,6 +826,7 @@ void setup()
SERIAL_PROTOCOLLNPGM("start");
SERIAL_ECHO_START;
#if 0
SERIAL_ECHOLN("Reading eeprom from 0 to 100: start");
for (int i = 0; i < 4096; ++i) {
@ -842,11 +843,16 @@ void setup()
// Check startup - does nothing if bootloader sets MCUSR to 0
byte mcu = MCUSR;
if (mcu & 1) SERIAL_ECHOLNRPGM(MSG_POWERUP);
/* if (mcu & 1) SERIAL_ECHOLNRPGM(MSG_POWERUP);
if (mcu & 2) SERIAL_ECHOLNRPGM(MSG_EXTERNAL_RESET);
if (mcu & 4) SERIAL_ECHOLNRPGM(MSG_BROWNOUT_RESET);
if (mcu & 8) SERIAL_ECHOLNRPGM(MSG_WATCHDOG_RESET);
if (mcu & 32) SERIAL_ECHOLNRPGM(MSG_SOFTWARE_RESET);
if (mcu & 32) SERIAL_ECHOLNRPGM(MSG_SOFTWARE_RESET);*/
if (mcu & 1) puts_P(MSG_POWERUP);
if (mcu & 2) puts_P(MSG_EXTERNAL_RESET);
if (mcu & 4) puts_P(MSG_BROWNOUT_RESET);
if (mcu & 8) puts_P(MSG_WATCHDOG_RESET);
if (mcu & 32) puts_P(MSG_SOFTWARE_RESET);
MCUSR = 0;
//SERIAL_ECHORPGM(MSG_MARLIN);
@ -1083,6 +1089,9 @@ void setup()
eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 2, 48); //50C - 120um - 48usteps
eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 3, 80); //55C - 200um - 80usteps
eeprom_write_word(((uint16_t*)EEPROM_PROBE_TEMP_SHIFT) + 4, 120); //60C - 300um - 120usteps
eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 1);
temp_cal_active = true;
}
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == 255) {
eeprom_write_byte((uint8_t*)EEPROM_UVLO, 0);
@ -5293,6 +5302,8 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
{
MYSERIAL.println("!!!!M600!!!!");
bool old_fsensor_enabled = fsensor_enabled;
fsensor_enabled = false; //temporary solution for unexpected restarting
st_synchronize();
float target[4];
@ -5603,7 +5614,11 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
lcd_setstatuspgm(WELCOME_MSG);
custom_message = false;
custom_message_type = 0;
fsensor_enabled = old_fsensor_enabled; //temporary solution for unexpected restarting
#ifdef PAT9125
if (fsensor_M600)
{
cmdqueue_pop_front(); //hack because M600 repeated 2x when enqueued to front
@ -5616,6 +5631,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
fsensor_enable();
fsensor_restore_print_and_continue();
}
#endif //PAT9125
}
@ -6351,7 +6367,12 @@ void kill(const char *full_screen_message, unsigned char id)
}
cli(); // disable interrupts
suicide();
while(1) { /* Intentionally left empty */ } // Wait for reset
while(1)
{
wdt_reset();
/* Intentionally left empty */
} // Wait for reset
}
void Stop()

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1437,6 +1437,8 @@ static void lcd_menu_extruder_info()
{
int fan_speed_RPM[2];
pat9125_update();
fan_speed_RPM[0] = 60*fan_speed[0];
fan_speed_RPM[1] = 60*fan_speed[1];
@ -1474,11 +1476,25 @@ static void lcd_menu_extruder_info()
lcd.print(itostr3(pat9125_y));
// Display Light intensity from Filament sensor
/* Frame_Avg register represents the average brightness of all pixels within a frame (324 pixels). This
value ranges from 0(darkest) to 255(brightest). */
lcd.setCursor(0, 3);
lcd.print("Intensity: ");
lcd.setCursor(12, 3);
lcd.print("Int: ");
lcd.setCursor(5, 3);
lcd.print(itostr3(pat9125_b));
// Display LASER shutter time from Filament sensor
/* Shutter register is an index of LASER shutter time. It is automatically controlled by the chips internal
auto-exposure algorithm. When the chip is tracking on a good reflection surface, the Shutter is small.
When the chip is tracking on a poor reflection surface, the Shutter is large. Value ranges from 0 to
46. */
lcd.setCursor(10, 3);
lcd.print("Shut: ");
lcd.setCursor(15, 3);
lcd.print(itostr3(pat9125_s));
if (lcd_clicked())