Merge branch 'master' into 12864-full

This commit is contained in:
David Ramiro
2019-03-27 16:12:07 +01:00
6 changed files with 108 additions and 33 deletions

View File

@@ -115,6 +115,13 @@ void AnycubicTFTClass::Setup() {
SelectedDirectory[0]=0;
SpecialMenu=false;
#ifdef STARTUP_CHIME
buzzer.tone(250, 554); // C#5
buzzer.tone(250, 740); // F#5
buzzer.tone(250, 554); // C#5
buzzer.tone(500, 831); // G#5
#endif
}
void AnycubicTFTClass::WriteOutageEEPromData() {

View File

@@ -381,10 +381,10 @@
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
// i3 Mega
#define DEFAULT_Kp 15.94
#define DEFAULT_Ki 1.17
#define DEFAULT_Kd 54.19
// i3 Mega stock v5 hotend, 40W heater cartridge (3.6Ω @ 22°C)
#define DEFAULT_Kp 18.58
#define DEFAULT_Ki 1.38
#define DEFAULT_Kd 62.40
// Ultimaker
//#define DEFAULT_Kp 22.2
@@ -438,10 +438,10 @@
//#define PID_BED_DEBUG // Sends debug data to the serial port.
//Anycubic i3 Mega 160W Ultrabase
#define DEFAULT_bedKp 251.78
#define DEFAULT_bedKi 49.57
#define DEFAULT_bedKd 319.73
//Anycubic i3 Mega Ultrabase (0.9Ω @ 22°C)
#define DEFAULT_bedKp 187.45
#define DEFAULT_bedKi 35.75
#define DEFAULT_bedKd 245.71
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from pidautotune
@@ -1520,6 +1520,21 @@
//
#define SPEAKER
//
// STARTUP CHIME
//
// Play a (non-earpiercing) startup chime on startup/serial connection
// of the Trigorilla board
//
//#define STARTUP_CHIME
//
// ENDSTOP BEEP
//
// Short 2KHz beep when endstops are hit
//
//#define ENDSTOP_BEEP
//
// The duration and frequency for the UI feedback sound.
// Set these to 0 to disable audio feedback in the LCD menus.
@@ -1821,13 +1836,13 @@
// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
// which is not as annoying as with the hardware PWM. On the other hand, if this frequency
// is too low, you should also increment SOFT_PWM_SCALE.
//#define FAN_SOFT_PWM
#define FAN_SOFT_PWM
// Incrementing this by 1 will double the software PWM frequency,
// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
// However, control resolution will be halved for each increment;
// at zero value, there are 128 effective control positions.
#define SOFT_PWM_SCALE 0
#define SOFT_PWM_SCALE 2
// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can
// be used to mitigate the associated resolution loss. If enabled,

View File

@@ -44,8 +44,9 @@
#endif
#define EXTRUSION_MULTIPLIER 1.0
#define RETRACTION_MULTIPLIER 6
#define PRIME_LENGTH 25.0
#define RETRACTION_LENGTH 1
#define UNRETRACTION_LENGTH 1.2
#define PRIME_LENGTH 5
#define OOZE_AMOUNT 2.25
#define INTERSECTION_CIRCLE_RADIUS 5
@@ -107,8 +108,9 @@
* pliers while holding the LCD Click wheel in a depressed state. If you do not have
* an LCD, you must specify a value if you use P.
*
* Q # Multiplier Retraction Multiplier. Normally not needed. Retraction defaults to 1.0mm and
* un-retraction is at 1.2mm These numbers will be scaled by the specified amount
* Q # Retract Retraction length. Defaults to 1mm if not specified.
* Z # Unretract Unretraction length. Defaults to 1.2mm if not specified.
* Note: If Q is specified but Z isn't, Z defaults to Q * 1.2.
*
* R # Repeat Prints the number of patterns given as a parameter, starting at the current location.
* If a parameter isn't given, every point will be printed unless G26 is interrupted.
@@ -145,7 +147,8 @@
// retracts/recovers won't result in a bad state.
static float g26_extrusion_multiplier,
g26_retraction_multiplier,
g26_retraction_length,
g26_unretraction_length,
g26_layer_height,
g26_prime_length,
g26_x_pos, g26_y_pos;
@@ -223,13 +226,13 @@
void retract_filament(const float where[XYZE]) {
if (!g26_retracted) { // Only retract if we are not already retracted!
g26_retracted = true;
move_to(where, -1.0 * g26_retraction_multiplier);
move_to(where, -1.0 * g26_retraction_length);
}
}
void recover_filament(const float where[XYZE]) {
if (g26_retracted) { // Only un-retract if we are retracted.
move_to(where, 1.2 * g26_retraction_multiplier);
move_to(where, g26_unretraction_length);
g26_retracted = false;
}
}
@@ -564,7 +567,8 @@
if (axis_unhomed_error()) return;
g26_extrusion_multiplier = EXTRUSION_MULTIPLIER;
g26_retraction_multiplier = RETRACTION_MULTIPLIER;
g26_retraction_length = RETRACTION_LENGTH;
g26_unretraction_length = UNRETRACTION_LENGTH;
g26_layer_height = MESH_TEST_LAYER_HEIGHT;
g26_prime_length = PRIME_LENGTH;
g26_bed_temp = MESH_TEST_BED_TEMP;
@@ -596,14 +600,44 @@
if (parser.seen('Q')) {
if (parser.has_value()) {
g26_retraction_multiplier = parser.value_float();
if (!WITHIN(g26_retraction_multiplier, 0.05, 15.0)) {
SERIAL_PROTOCOLLNPGM("?Specified Retraction Multiplier not plausible.");
g26_retraction_length = parser.value_float();
if (!WITHIN(g26_retraction_length, 0.05, 15.0)) {
SERIAL_PROTOCOLLNPGM("?Specified Retraction length not plausible.");
return;
}
}
else {
SERIAL_PROTOCOLLNPGM("?Retraction Multiplier must be specified.");
SERIAL_PROTOCOLLNPGM("?Retraction length must be specified.");
return;
}
}
if (parser.seen('Z')) {
if (parser.has_value()) {
g26_unretraction_length = parser.value_float();
if (!WITHIN(g26_unretraction_length, 0.05, 15.0)) {
SERIAL_PROTOCOLLNPGM("?Specified Unretraction length not plausible.");
return;
}
}
else {
SERIAL_PROTOCOLLNPGM("?Unretraction length must be specified.");
return;
}
}
if (!parser.seen('Z') && parser.seen('Q')) {
// retraction without unretraction specified, use 1.2 multiplier (preserve Gcode spec)
g26_unretraction_length = g26_retraction_length * 1.2;
SERIAL_ECHOPAIR(" Unretraction amount automatically set to ", g26_unretraction_length);
SERIAL_EOL();
}
if (parser.seen('Z') && parser.seen('Q')) {
// consider typos or unreasonable retract/unretract ratios
float g26_retract_unretract_delta = g26_unretraction_length - g26_retraction_length;
if (!WITHIN(g26_retract_unretract_delta, -5, 5)) {
SERIAL_PROTOCOLLNPGM("?Invalid Retraction/Unretraction ratio. Must be within 5mm.");
return;
}
}

View File

@@ -14815,6 +14815,25 @@ void disable_all_steppers() {
disable_e_steppers();
}
#ifdef ENDSTOP_BEEP
void EndstopBeep() {
static char last_status=((READ(X_MIN_PIN)<<2)|(READ(Y_MIN_PIN)<<1)|READ(X_MAX_PIN));
static unsigned char now_status;
now_status=((READ(X_MIN_PIN)<<2)|(READ(Y_MIN_PIN)<<1)|READ(X_MAX_PIN))&0xff;
if(now_status<last_status) {
static millis_t endstop_ms = millis() + 300UL;
if (ELAPSED(millis(), endstop_ms)) {
buzzer.tone(60, 2000);
}
last_status=now_status;
} else if(now_status!=last_status) {
last_status=now_status;
}
}
#endif
/**
* Manage several activities:
* - Check for Filament Runout
@@ -15041,6 +15060,10 @@ void idle(
AnycubicTFT.CommandScan();
#endif
#ifdef ENDSTOP_BEEP
EndstopBeep();
#endif
lcd_update();
host_keepalive();

View File

@@ -41,7 +41,7 @@
* Defines the version of the Marlin-AI3M build. Not to be confused with
* Marlin's own build number, e.g. 1.1.9.
*/
#define CUSTOM_BUILD_VERSION "v1.4.4"
#define CUSTOM_BUILD_VERSION "v1.4.5"
/**
* Verbose version identifier which should contain a reference to the location
@@ -54,7 +54,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
#define STRING_DISTRIBUTION_DATE "2019-03-13"
#define STRING_DISTRIBUTION_DATE "2019-03-24"
/**
* Required minimum Configuration.h and Configuration_adv.h file versions.