Merge branch 'master' into 12864-full

This commit is contained in:
David Ramiro 2019-03-27 16:12:07 +01:00
commit 17635865ca
No known key found for this signature in database
GPG Key ID: 5B042737EBEEB736
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.

View File

@ -1,27 +1,22 @@
# Anycubic i3 Mega Marlin 1.1.9 by davidramiro
# Anycubic i3 Mega / Mega-S Marlin 1.1.9 by davidramiro
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3MFT8QMP5ZRCE&source=url) [![Downloads](https://img.shields.io/github/downloads/davidramiro/Marlin-AI3M/total.svg?style=flat)](https://github.com/davidramiro/Marlin-AI3M/releases) [![Open Issues](https://img.shields.io/github/issues-raw/davidramiro/Marlin-AI3M.svg?style=flat)](https://github.com/davidramiro/Marlin-AI3M/issues?q=is%3Aopen+is%3Aissue) [![Closed Issues](https://img.shields.io/github/issues-closed-raw/davidramiro/Marlin-AI3M.svg?style=flat)](https://github.com/davidramiro/Marlin-AI3M/issues?q=is%3Aissue+is%3Aclosed) [![License](https://img.shields.io/github/license/davidramiro/Marlin-AI3M.svg?style=flat)](https://github.com/davidramiro/Marlin-AI3M/blob/master/LICENSE) [![Latest Release](https://img.shields.io/github/release/davidramiro/Marlin-AI3m.svg?style=flat)](https://github.com/davidramiro/Marlin-AI3M/releases/latest/) ![](https://img.shields.io/github/last-commit/davidramiro/Marlin-AI3m.svg?style=flat)
This is my slightly customized version of the [Marlin Firmware](https://github.com/MarlinFirmware/Marlin), gratefully based on [derhopp's repo](https://github.com/derhopp/Marlin-with-Anycubic-i3-Mega-TFT) with his remarkable efforts to get the Anycubic i3 Mega TFT screen to work.
This is a custom version of the [Marlin Firmware](https://github.com/MarlinFirmware/Marlin) for the i3 Mega/Mega-S, gratefully based on [derhopp's repo](https://github.com/derhopp/Marlin-with-Anycubic-i3-Mega-TFT) with his remarkable efforts to get the Anycubic TFT screen to work with the latest versions of Marlin.
## RepRapDiscount Full Graphic Smart Controller branch
**This branch is prepared to be used with a 12864 display like the [RepRapDiscount Full Graphic Smart Controller](https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller).**
This firmware works on every i3 Mega that has two Z-axis endstops. If you have an older model with only one Z endstop, a small [adjustment](https://github.com/davidramiro/Marlin-AI3M/wiki/Customization-&-Compiling#single-z-endstop) is required.
The new **Mega-S** should work too, but you will need to enter two additional commands after flashing the firmware, mentioned in the instructions below.
Looking for a **BLtouch firmware**? Head [this way](https://github.com/MNieddu91/Marlin-AI3M-BLTouch)! Mounting and configuration instructions are included.
Note: This is just a firmware, not magic. A big part of print quality still depends on your slicer settings and mechanical condition of your machine.
#### Make sure to take a look at the [Wiki](https://github.com/davidramiro/Marlin-AI3M/wiki/), especially the [FAQ](https://github.com/davidramiro/Marlin-AI3M/wiki/Frequently-Asked-Questions).
A German translation of the instructions can be found [here](https://kore.cc/i3mega/download/marlin-ai3m_german.pdf).
## Why use this?
While the i3 Mega is a great printer for its price and produces fantastic results in stock, there are some issues that are easily addressed:
While the i3 Mega is a great printer for its price and produces fantastic results in stock, there are some improvements and additional features that this firmware provides:
- Many people have issues getting the Ultrabase leveled perfectly, using Manual Mesh Bed Leveling the printer generates a mesh of the flatness of the bed and compensates for it on the Z-axis for perfect prints without having to level with the screws.
- Much more efficient bed heating by using PID control. This uses less power and holds the temperature at a steady level. Highly recommended for printing ABS.
@ -157,10 +152,11 @@ M420 S1
- No need to download or create a bed leveling test, simply send those commands to your printer:
```
G28
G26 C H200 P25 R25
G26 C H200 P5 R25 Q4.2 Z4
```
- To adjust your filament's needed temperature, change the number of the `H` parameter
- Default bed temperature is 60°C, if you need another temperature, add e.g. `B80`
- `Q` parameter sets retraction length in mm, `Z` sets unretraction.
- If your leveling is good, you will have a complete pattern of your mesh on your bed that you can peel off in one piece
- Don't worry if the test looks a bit messy, the important thing is just that the line width is the same all over the mesh
- Optional: Hang it up on a wall to display it as a trophy of how great your leveling skills are.