5 Commits

Author SHA1 Message Date
David Ramiro
1a5804f260 Implement nozzle reheating on timeout via display
- Raise nozzle timeout to 10 minutes
- Use continue button as reheat trigger
- Manage nozzle_timed_out variable via display
- Add PausedByNozzleTimeout flag to enter correct routine on display
- Bump version to 1.4.3
2019-03-08 16:30:56 +01:00
David Ramiro
cea54723e7 Use realtime on filament sensor
Instead of incrementing a variable on every iteration on the filament sensor trigger loop, we now use a real time macro that ensure better repeatability and is easier to customize.
2019-03-08 16:05:54 +01:00
David Ramiro
90e27ff21b Fix indentation
Improve readability and fix #ifdef and #endif indentations
2019-03-08 01:25:21 +01:00
David Ramiro
85c32a2bb6 Fix Z movement on abort
- Referencing #29
- Adding audio feedback to special menu M500 and M502
2019-03-06 22:59:46 +01:00
David Ramiro
2c53c33d52 Tweak M600 display resume
- Add startFileprint(); call to M108 display routine to fix progress and ensure "printing done" gets shown
- Add SD printing check in marlin_main.cpp M600 routine to skip TFTstate if not necessary (e.g. USB printing)
- Move routine to the top again to ensure immediate execution
2019-02-24 15:48:03 +01:00
8 changed files with 1215 additions and 1134 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -58,6 +58,7 @@ public:
char TFTstate=ANYCUBIC_TFT_STATE_IDLE;
bool PausedByRunout=false;
bool PausedByFilamentChange=false;
bool PausedByNozzleTimeout=false;
private:
char TFTcmdbuffer[TFTBUFSIZE][TFT_MAX_CMD_SIZE];
@@ -100,6 +101,7 @@ private:
void HandleSpecialMenu();
void FilamentChangePause();
void FilamentChangeResume();
void ReheatNozzle();
char SelectedDirectory[30];
uint8_t SpecialMenu=false;
@@ -107,7 +109,8 @@ private:
#if ENABLED(ANYCUBIC_FILAMENT_RUNOUT_SENSOR)
char FilamentTestStatus=false;
char FilamentTestLastStatus=false;
long FilamentRunoutCounter=0;
bool FilamentSetMillis=true;
#endif
};

View File

@@ -1009,7 +1009,7 @@
#define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract.
#define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged.
#define PAUSE_PARK_NOZZLE_TIMEOUT 300 // (seconds) Time limit before the nozzle is turned off for safety.
#define PAUSE_PARK_NOZZLE_TIMEOUT 600 // (seconds) Time limit before the nozzle is turned off for safety.
#define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed.
#define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change.

View File

@@ -271,6 +271,9 @@ FORCE_INLINE bool all_axes_known() { return (axis_known_position & xyz_bits) ==
extern volatile bool wait_for_heatup;
// Making sure this flag can be cleared by the Anycubic display
extern volatile bool nozzle_timed_out;
#if HAS_RESUME_CONTINUE
extern volatile bool wait_for_user;
#endif

View File

@@ -519,6 +519,9 @@ static bool relative_mode; // = false;
// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
volatile bool wait_for_heatup = true;
// Making sure this flag can be cleared by the Anycubic display
volatile bool nozzle_timed_out = false;
// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
#if HAS_RESUME_CONTINUE
volatile bool wait_for_user; // = false;
@@ -7213,7 +7216,11 @@ inline void gcode_M17() {
* Used by M125 and M600
*/
static void wait_for_filament_reload(const int8_t max_beep_count=0) {
bool nozzle_timed_out = false;
nozzle_timed_out = false;
nozzle_timed_out = false;
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.PausedByNozzleTimeout = false;
#endif
#if ENABLED(ULTIPANEL)
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
@@ -7246,6 +7253,14 @@ inline void gcode_M17() {
nozzle_timed_out |= thermalManager.is_heater_idle(e);
if (nozzle_timed_out) {
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.PausedByNozzleTimeout=true;
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("DEBUG: Nozzle timeout flag set");
#endif
#endif
#if ENABLED(ULTIPANEL)
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
#endif
@@ -7287,6 +7302,9 @@ inline void gcode_M17() {
wait_for_user = true; // Wait for user to load filament
nozzle_timed_out = false;
#ifdef ANYCUBIC_TFT_DEBUG
AnycubicTFT.PausedByNozzleTimeout = false;
#endif
#if HAS_BUZZER
filament_change_beep(max_beep_count, true);
@@ -7320,7 +7338,11 @@ inline void gcode_M17() {
if (!did_pause_print) return;
// Re-enable the heaters if they timed out
bool nozzle_timed_out = false;
nozzle_timed_out = false;
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.PausedByNozzleTimeout = false;
#endif
HOTEND_LOOP() {
nozzle_timed_out |= thermalManager.is_heater_idle(e);
thermalManager.reset_heater_idle_timer(e);
@@ -8508,7 +8530,7 @@ inline void gcode_M109() {
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.CommandScan();
#endif
#if TEMP_RESIDENCY_TIME > 0
const float temp_diff = ABS(target_temp - temp);
@@ -8547,11 +8569,11 @@ inline void gcode_M109() {
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.HeatingDone();
#endif
#if DISABLED(BUSY_WHILE_HEATING)
KEEPALIVE_STATE(IN_HANDLER);
#endif
// flush the serial buffer after heating to prevent lockup by m105
SERIAL_FLUSH();
@@ -8665,11 +8687,11 @@ inline void gcode_M109() {
}
}
#endif
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.CommandScan();
#endif
#if TEMP_BED_RESIDENCY_TIME > 0
const float temp_diff = ABS(target_temp - temp);
@@ -8697,16 +8719,16 @@ inline void gcode_M109() {
}
} while (wait_for_heatup && TEMP_BED_CONDITIONS);
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.BedHeatingDone();
#endif
if (wait_for_heatup) lcd_reset_status();
#if DISABLED(BUSY_WHILE_HEATING)
KEEPALIVE_STATE(IN_HANDLER);
#endif
// flush the serial buffer after heating to prevent lockup by m105
SERIAL_FLUSH();
}
@@ -8904,7 +8926,7 @@ inline void gcode_M111() {
#if ENABLED(ULTIPANEL)
lcd_reset_status();
#endif
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.CommandScan();
#endif
@@ -8940,7 +8962,7 @@ inline void gcode_M81() {
#if ENABLED(ULTIPANEL)
LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF ".");
#endif
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.CommandScan();
#endif
@@ -10992,6 +11014,23 @@ inline void gcode_M502() {
* Default values are used for omitted arguments.
*/
inline void gcode_M600() {
#ifdef SDSUPPORT
if (card.sdprinting) { // are we printing from sd?
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("DEBUG: Enter M600 TFTstate routine");
#endif
AnycubicTFT.TFTstate=ANYCUBIC_TFT_STATE_SDPAUSE_REQ; // enter correct display state to show resume button
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("DEBUG: Set TFTstate to SDPAUSE_REQ");
#endif
AnycubicTFT.PausedByFilamentChange=true; // set flag to ensure correct resume routine gets executed
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("DEBUG: Set filament change flag");
#endif
}
#endif
point_t park_point = NOZZLE_PARK_POINT;
if (get_target_extruder_from_command(600)) return;
@@ -11054,19 +11093,6 @@ inline void gcode_M502() {
const bool job_running = print_job_timer.isRunning();
if (pause_print(retract, park_point, unload_length, true)) {
#ifdef SDSUPPORT
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("DEBUG: Enter TFTstate routine");
#endif
AnycubicTFT.TFTstate=ANYCUBIC_TFT_STATE_SDPAUSE_REQ; // enter correct display state to show resume button
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("DEBUG: Set TFTState to SDPAUSE_REQ");
#endif
AnycubicTFT.PausedByFilamentChange=true; // set flag to ensure correct resume routine gets executed
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("DEBUG: Set filament change flag");
#endif
#endif
wait_for_filament_reload(beep_count);
resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count);
}
@@ -14753,7 +14779,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
runout.run();
#endif
#if ENABLED(ANYCUBIC_TFT_MODEL) && ENABLED(ANYCUBIC_FILAMENT_RUNOUT_SENSOR)
AnycubicTFT.FilamentRunout();
#endif
@@ -14961,7 +14987,7 @@ void idle(
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.CommandScan();
#endif
lcd_update();
host_keepalive();
@@ -15018,7 +15044,7 @@ void kill(const char* lcd_msg) {
#else
UNUSED(lcd_msg);
#endif
#ifdef ANYCUBIC_TFT_MODEL
// Kill AnycubicTFT
AnycubicTFT.KillTFT();
@@ -15113,7 +15139,7 @@ void setup() {
MYSERIAL0.begin(BAUDRATE);
SERIAL_PROTOCOLLNPGM("start");
SERIAL_ECHO_START();
#ifdef ANYCUBIC_TFT_MODEL
// Setup AnycubicTFT
AnycubicTFT.Setup();
@@ -15139,7 +15165,6 @@ void setup() {
SERIAL_ECHOPGM(MSG_MARLIN);
SERIAL_CHAR(' ');
SERIAL_ECHOLNPGM(SHORT_BUILD_VERSION);
SERIAL_CHAR(' ');
SERIAL_ECHOPGM(MSG_MARLIN_AI3M);
SERIAL_CHAR(' ');
SERIAL_ECHOLNPGM(CUSTOM_BUILD_VERSION);

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.1"
#define CUSTOM_BUILD_VERSION "v1.4.3"
/**
* 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-02-23"
#define STRING_DISTRIBUTION_DATE "2019-03-06"
/**
* Required minimum Configuration.h and Configuration_adv.h file versions.

View File

@@ -137,7 +137,7 @@
#define MSG_INVALID_EXTRUDER "Invalid extruder"
#define MSG_INVALID_SOLENOID "Invalid solenoid"
#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature"
#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID " MARLIN-AI3M_VERSION:" CUSTOM_BUILD_VERSION
#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " MARLIN-AI3M_VERSION:" CUSTOM_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID
#define MSG_MARLIN_AI3M "Marlin-AI3M"
#define MSG_COUNT_X " Count X:"
#define MSG_COUNT_A " Count A:"

View File

@@ -9,12 +9,7 @@ Feel free to discuss issues and work with me further optimizing this firmware!
I am running this version on an i3 Mega Ultrabase V3 (for distinction of the different versions, check [this Thingiverse thread](https://www.thingiverse.com/groups/anycubic-i3-mega/forums/general/topic:27064)).
Basically, this should work on every Ultrabase version that has two Z-axis endstops.
The new **Mega-S** should work too, but you will need to enter those two commands to make the new extruder work:
```
M92 E384
M500
```
Afterwards, calibration is highly recommended as per the instructions on the [Wiki](https://github.com/davidramiro/Marlin-AI3M/wiki/Calibration/).
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.
@@ -26,7 +21,7 @@ A German translation of the instructions can be found [here](https://kore.cc/i3m
## Known issues:
- **Cura users: Please turn off jerk and acceleration control in your print settings (not visible by default, select advanced visibility to unlock them). Cura's high default jerk and acceleration might cause shifted layers if you use TMC2208.**
- Power outage support is not included
- Estimated print times from your slicer might be slightly off.
- Special characters on any file or folders name on the SD card will cause the file menu to freeze. Simply replace or remove every special character (Chinese, Arabic, Russian, accents, German & Scandinavian umlauts, ...) from the name. Symbols like dashes or underscores are no problem.
**Important note: On the SD card that comes with the printer there is a folder with Chinese characters in it by default. Please rename or remove it.**
@@ -78,6 +73,11 @@ I provided three different precompiled hex files: One for no modifications on th
- `M502` - load hard coded default values
- `M500` - save them to EEPROM
**If you are using this on a Mega-S, those two additional commands are necessary:**
- `M92 E384` - set correct steps for the new extruder
- `M500` - save them
- I highly recommend calibrating the extruder.
#### Calibration and other instructions have been moved to the [Wiki](https://github.com/davidramiro/Marlin-AI3M/wiki/Calibration).
@@ -182,6 +182,9 @@ G26 C H200 P25 R25
- Place `M600` in your GCode at the desired layer or send it via terminal
- Alternatively: Use `FilamentChange Pause` in the Special Menu
- The nozzle will park and your printer will beep
- For safety reasons, the printer will turn off the hotend after 10 minutes. If you see the temperature being under the target:
- SD printing: Click `CONTINUE` **(only once!)** on the screen and wait for the hotend to heat up again.
- USB printing: Send `M108` and wait for the hotend to heat up again.
- Remove the filament from the bowden tube
- Insert the new filament right up to the nozzle, just until a bit of plastic oozes out
- Remove the excess filament from the nozzle with tweezers
@@ -199,6 +202,9 @@ G26 C H200 P25 R25
- Alternatively: Use `FilamentChange Pause` in the Special Menu
- The nozzle will park
- The printer will remove the filament right up to the extruder and beep when finished
- For safety reasons, the printer will turn off the hotend after 10 minutes. If you see the temperature being under the target:
- SD printing: Click `CONTINUE` **(only once!)** on the screen and wait for the hotend to heat up again.
- USB printing: Send `M108` and wait for the hotend to heat up again.
- Insert the new filament just up to the end of the bowden fitting, as shown here:
![Load Filament][m600 load]