-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anycubic I3 Mega (AI3M) extensible ui implementation #18655
Anycubic I3 Mega (AI3M) extensible ui implementation #18655
Conversation
…d working, except pause with heater timeout (not verified)
…n't test as m25 is auto resuming
…prove filament outage detection
…en when not printing
…c_i3_mega_lcd_18655
So... meanwhile, I wrote an extui module for the Anycubic Chiron TFT. And today I noticed this PR was merged with code for the Anycubic i3 Mega. AFAIK, the 2 screens are very similar but not quite the same. For instance, the Chiron has a menu entry to perform auto-levelling. My implementation has a few main differences:
All of that said, I reckon it's not worth trying to merge the 2 implementations. There are other models already and there will be more. Trying to unify everything would be more elegant, but it would be a problem to test since a change for a printer LCD could break support for another one and the person changing the code very likely won't have access to all Anycubic printers to test. So, my suggestion would be to just tweak the configuration #defines to enable the module for the correct LCD.
which could become:
The only other thing I would consider is to drop the module anycubic_serial and use the existing MarlinSerial class. Please let me know your thoughts. |
I like the idea of not needing to re-implement the Serial class, I wanted to do that, but just ran out of time. I agree with you that any attempt to merge the two implementations will probably need the person doing the merge to at least have both printers handy to test on. The test/debug cycle was what killed me the most timewise on this. I didn't technically implement the code myself though for this, I ported David Ramiro's code (which was based on Derhopp's code) and then cleaned up a few things to make sure the memory use was as low as possible. Thinkyhead made some major changes to the config file to make it one set of configs for both bl touch and non bl touch systems. It would be a small effort to add the Chiron configs to that as well. How different is your implementation to mine otherwise? |
I've seen other Marlin forks and decided to write my implementation from scratch. So, the code is similar in what it does but it's syntactically different. Other than a few changes to instantiate a new MarlinSerial class, it's basically just 1 file. I noticed some pins have now been #defined in pins_TRIGORILLA_14.h which is something to revisit as well: while the mainboard has some connectors for specific endstops and other hardware, both the Chiron and i3 Mega have a "hub" PCB mounted on top of the Trigorilla that reroutes some signals. Also, some endstops on the Chiron are wired to AUX connectors. It's a mess, not sure what the best solution is here, but I'd probably allow to override the PIN #defines from Configuration.h. I was hoping to get some indication from @thinkyhead before doing any more work. |
I recommend jumping on discord and trying to get a convo going there. I made sure to lurk on discord before commencing my port so that my effort wasn't wasted either. It would be easier to coordinate in real time then. Incidentally, have you by chance found a way to send a user specified dialog box to the tft in your code? It's the single most important feature we need to make pause/resume work properly with the aggressive heater time out in Marlin 2.0 |
How would I start the conversation on Discord? There doesn't seem to be a #dev channel. That's why I decided to post here. Regarding the dialog box, if you mean a way to display an arbitrary string then no, I have not seen that. I used the Anycubic source code as reference. I'm not sure what you're referring to with "aggressive heater time out"? |
Yeah that sucks, was hoping you found a magical option. I even tried sending all the J commands from 21 to 51 to no avail. Then I ran out and gave up. RE: Aggressive heater timeouts, the standard hotend timeout in Marlin 2 is 45 seconds, on bowden printer with a bowden as long as the AI3m that's just not enough time for a filament runout to unload. So you invariably will get a hotend time out, heat up, and then resume process instead of a standard pause, park and resume process with Marlin 2.0 |
So... I merged my work. It's not been easy. The main problem was that you added pin definitions to pins_TRIGORILLA_14.h for the i3 mega, but they don't apply to all Anycubic printers with a Trigorilla mainboard. In fact, the Trigorilla has pins for X-/X+/Y-/Y+/Z-/Z+ endstops, but on both the i3 mega and Chiron the limit switches are NOT all wired to the expected pins on the mainboard. Some endstops are wired to an AUX connector. Also, there's a "hub" PCB mounted on top of the mainboard which routes some signals to other I/O pins. After a brief discussion on Discord, I was suggested to add pin definitions to pins_TRIGORILLA_14.h using conditional compilation. So, by defining ANYCUBIC_I3MEGA in Configuration.h you'll get the definitions for the i3 mega and by defining ANYCUBIC_CHIRON it will build using the Chiron pin definitions. Then, I removed anycubic_serial and used the MarlinSerial class. It was a bit time consuming. Can you please test my branch with your i3 mega?
If I didn't mess anything up, it should work. |
Hello, the management of the Trigorilla Ver 1.1 card is not used although it is present in Configuration.h, line 2222
changing feedrate via screen does not work because feedrate_percentage is forced to 100 in anycubic_tft.cpp
there is old display bug when there are 3 files on the SD card. I corrected in anycubic_tft.cpp line 378 void AnycubicTFTClass::RenderCurrentFileList() {
I picked up the real starting melody, still in anycubic_tft.cpp
and I add a #define STARTUP_CHIME in the AI3M section of Configuration.h I added the management of the AI3M model S in Configuration.h
and in //============================== Movement Settings ============================
I am attaching the modified files that I am using. |
* Fix material preset type * Fix material preset editing * NO_LCD_REINIT for FSMC (or, no SD_DETECT_PIN) * Clean up preheat edit items * [cron] Bump distribution date (2020-06-26) * Minor LCD cleanup, improvement * Fix typo in DWIN, preheat array * Update Italian language (MarlinFirmware#18414) * [samd51] Manifest assigned timers priority (MarlinFirmware#18402) * Update MKS Robin Nano auto-build env (MarlinFirmware#18417) * SAMD51 cleanup (MarlinFirmware#18419) * BTT SKR Pro runout pins (MarlinFirmware#18416) * Update Brazilian Portuguese language (MarlinFirmware#18411) * Fix Fan Speed menu items (MarlinFirmware#18400) * Patch some DGUS warnings * Allow larger ADC debounce Reference MarlinFirmware#17205 * [cron] Bump distribution date (2020-06-27) * [cron] Bump distribution date (2020-06-28) * Update language fonts * Tool Change Migration fixes and debugging (MarlinFirmware#18448) * ExtUI additions (MarlinFirmware#18447) Co-authored-by: Scott Lahteine <[email protected]> * Add Romanian language (MarlinFirmware#18455) Co-authored-by: cristyanul <[email protected]> * Fix "probing failed" false positives (MarlinFirmware#18435) * Adjustable delta_diagonal_rod_trim (MarlinFirmware#18423) * Russian, Ukranian for wide LCD (MarlinFirmware#18433) * Tweak pins formatting * Suppress unused var warning * ClosedLoop as singleton * [cron] Bump distribution date (2020-06-29) * MKS Robin Nano flash-based EEPROM (MarlinFirmware#18466) * Use "reset reason" defines (MarlinFirmware#18462) * [cron] Bump distribution date (2020-06-30) * [cron] Bump distribution date (2020-07-01) * Fix missing parenthesis (MarlinFirmware#18473) * Fix FYSETC CHEETAH V1.2 SD re-insert (MarlinFirmware#18474) Include this board with other Cheetah stepper reset. * Hide menu item with no fan (MarlinFirmware#18470) * Permit independent X2,Y2,Z2,Z3,Z4 endstop inverting (MarlinFirmware#18481) * Add TFT_LVGL_UI support (MarlinFirmware#18438) * Per-Hotend Default PIDs (MarlinFirmware#18483) * Enforce sensor range for temperature target (MarlinFirmware#18465) * Mitigate stepper timeout * Add CHAMBER PWM code * Structured thermistor tables * Fix reversed sensor ranges * Prevent temps outside sensor range * [cron] Bump distribution date (2020-07-02) * Tweak stepper shutdown test * Extend thermistor 1047 to 500°C * Updated lock / unlock actions * [cron] Bump distribution date (2020-07-03) * Keep filament runout pin for Creality Melzi (MarlinFirmware#18504) * Add FYSETC 2.42 inch OLED support (MarlinFirmware#18485) * Option to set manual Babystepping distance in mm (MarlinFirmware#18503) Co-authored-by: Scott Lahteine <[email protected]> * Clean up LCD Manual Move / UBL Mesh Edit (MarlinFirmware#18373) * FYSETC OLED followup (MarlinFirmware#18519) * Ensure Git applies Unix line-endings in tests (MarlinFirmware#18495) * Fix axis name in serial output (MarlinFirmware#18522) * Fix env:mks_robin_nano35 (MarlinFirmware#18516) * FIx Sanguino/1284p board_upload.maximum_size (MarlinFirmware#18502) * M150 I to set Neopixel by index (MarlinFirmware#18490) * [cron] Bump distribution date (2020-07-04) * PID Accelerated Edit (MarlinFirmware#18532) * Patch Bad PR action * Two lock-closed per day * [cron] Bump distribution date (2020-07-05) * Fix "'ubl' not declared" error (MarlinFirmware#18541) * Fix thermistors exist-for-reading tests (MarlinFirmware#18533) Co-authored-by: Scott Lahteine <[email protected]> * Fix "Probing mesh point" message Closes MarlinFirmware#17770 Co-Authored-By: Jan-Gerard van der Toorn <[email protected]> * Limit actions to main * Probing points followup (MarlinFirmware#18552) * Update actions on bugfix branch * Add CI for pushed commits Co-Authored-By: thisiskeithb <[email protected]> * Add CI for pushed commits (MarlinFirmware#18549) * Fix Neopixel set_color (MarlinFirmware#18544) * Fix stall sensitivity adjustment for FTDI screens (MarlinFirmware#18554) * Minor pins cleanup * Add comment to M412 * Reduce string duplication * STM32: No compile-time check for PWM_PIN (MarlinFirmware#18539) Co-authored-by: Scott Lahteine <[email protected]> * Filament Runout Inverting => State (MarlinFirmware#18537) Co-authored-by: Scott Lahteine <[email protected]> * Simplify home_z_safely, respect HOME_AFTER_DEACTIVATE * [cron] Bump distribution date (2020-07-06) * Temporarily use patched lock-threads * Filament state followup * Get SAMD51 CXX flags from script * Use Material Preset 1 for PID autotune (MarlinFirmware#18446) Co-authored-by: Scott Lahteine <[email protected]> * Fix broken POWER_LOSS_RECOVERY prompt (MarlinFirmware#18557) Co-authored-by: Scott Lahteine <[email protected]> * Add Lerdge S,X,K (MarlinFirmware#18302) * Fix TMC homing phase coils alignment (MarlinFirmware#18528) Co-authored-by: Fabio Santos <[email protected]> * Scale runout distance setting for editable range (MarlinFirmware#18567) * 0.7.1 <= TMCStepper <= 0.7.9 (MarlinFirmware#18564) * Reduce 'first loop' temperature residency time (MarlinFirmware#18421) Co-authored-by: Scott Lahteine <[email protected]> * Update and fix POWER_MONITOR (MarlinFirmware#18561) * [cron] Bump distribution date (2020-07-07) * Temp Residency followup * Whitespace cleanup * Combine command macros * Fix typo in Configuration_adv.h (MarlinFirmware#18570) * [cron] Bump distribution date (2020-07-08) * Tweak PLR debug * Fix warning with PIO * SKR 1.4 alert for unsupported LCD * Update Chinese (zh_CN) language (MarlinFirmware#18580) * Lock threads updated * Show fixed V in Power Display with no V sensor (MarlinFirmware#18579) * Fix User Temp Sensor (1000), reversed Pt100 / Pt1000 (MarlinFirmware#18590) * Fix some comments * Add `Cap:RUNOUT` Co-Authored-By: Julius ter Pelkwijk <[email protected]> * [cron] Bump distribution date (2020-07-09) * Fix missing controller fan include * 2.0.5.4 : Use ststm32 < 6.2 * Consolidate probe clearance, add section debug (MarlinFirmware#18576) * Better section / function log * Add do_z_clearance motion function * Remove outdated comment (MarlinFirmware#18597) * Clean up some MMU comments * MarlinUI support for up to 5 Material Presets (MarlinFirmware#18488) - Add `I` preset parameter to `G26`, `M106`, `M140`, and `M190`. - Extend menu items to permit a string interpolation. - Keep material names in a list and interpolate in menu items. - Extend material presets to support up to 5 predefined materials. Co-authored-by: Scott Lahteine <[email protected]> * "M122 I" to reinitialize TMC (MarlinFirmware#18571) * [cron] Bump distribution date (2020-07-10) * Add current offset for POWER_MONITOR sensor (MarlinFirmware#18600) * Fix CMSIS / USB-FD regression (MarlinFirmware#18602) * Fix Chitu V6 with LVGL UI (MarlinFirmware#18608) * Fix CHITU_F103 pio.board name (MarlinFirmware#18486) * Capitalize "G-code" * [cron] Bump distribution date (2020-07-11) * Option to assist thermocouple debug (MarlinFirmware#18621) * Fix pid_debug_flag * Specify supported library versions * [cron] Bump distribution date (2020-07-12) * Clarify MICROSTEP_MODES * Option for extra endstop check (MarlinFirmware#18424) * Fix G35 output formatting (MarlinFirmware#18631) * [cron] Bump distribution date (2020-07-13) * [email protected] for LPC * Creality V4 cleanup * [cron] Bump distribution date (2020-07-14) * Fix / improve menu items (MarlinFirmware#18644) * LPC fix NeoPixel fork * Fix leveling "Point n of 3" message (MarlinFirmware#18639) * Increase STM32F1 Servo Timer Interrupt Priority (MarlinFirmware#18637) * [cron] Bump distribution date (2020-07-15) * Specify ststm32 @ 6.1.x * Tool-change debug option * Add REPORT_FAN_CHANGE as an option * Clean up DWIN code * General cleanup * Fix some Power Loss Recovery behaviors (MarlinFirmware#18558) * PLR followup * Fix Hotend Idle Timeout trigger (MarlinFirmware#18657) * [cron] Bump distribution date (2020-07-16) * Fix SKR 1.4 LCD / ADC Keypad sanity-check (MarlinFirmware#18670) * Broadcast host actions Fixes MarlinFirmware#18565 * Sanity-check BABYSTEP_MULTIPLICATOR_* * [cron] Bump distribution date (2020-07-17) * Fix material_preset reference issue * Chopper Timing Preset for 24V 0.9° (MarlinFirmware#18662) * Fix passive Chamber Temp reading (MarlinFirmware#18674) * Fix check_hotends with > 1 hotend * Tweak and use SD_ORDER * ExtUI for Anycubic I3 Mega (MarlinFirmware#18655) * Support FT81050 with FYSETC F6 (MarlinFirmware#18678) Co-authored-by: Scott Lahteine <[email protected]> * Smaller SD EEPROM file on Ender 3 V2 * Use safe_delay for PSU_POWERUP_DELAY (MarlinFirmware#18680) Co-authored-by: Scott Lahteine <[email protected]> * Fix E3V2 M0/M1 and wait_for_user * [cron] Bump distribution date (2020-07-18) * Chitu V6 - Stepper Z2 pins (MarlinFirmware#18683) * Fix DGUS write variable endianness (MarlinFirmware#18689) * Trigorilla Pro board (MarlinFirmware#18692) * Prettier BLTouch menu items (MarlinFirmware#18682) * Return to Status on PID Autotune (MarlinFirmware#18695) * Misc formatting, cleanup * [cron] Bump distribution date (2020-07-19) * More customizable DGUSDisplay (MarlinFirmware#18700) * Fix encoder reverse, partial steps handling (MarlinFirmware#18694) * Update Chinese (cn) language (MarlinFirmware#18705) * Fix endian DGUS WriteVariable (MarlinFirmware#18703) * Fix BLTouch PWM reliability in HAL/STM32 (MarlinFirmware#18702) * [cron] Bump distribution date (2020-07-20) * SAMD51: More reliable Servo/BLTouch PWM (MarlinFirmware#18710) * Only download & compile required libraries (MarlinFirmware#18699) * Reduce Step Smoothing ceiling to 50% CPU usage (MarlinFirmware#18719) * Fix some LVGL warnings * Patch auto-deps for Windows CXX (MarlinFirmware#18721) * [cron] Bump distribution date (2020-07-21) * Matching mat.bed_temp condition * Ignore unused (but downloaded) libraries (MarlinFirmware#18728) * Use development version of PlatformIO (MarlinFirmware#18724) * Fix build for Windows path edge case * Filter some unused Marlin/src subfolders (MarlinFirmware#18729) * New DGUS UI var / definition syntax (MarlinFirmware#18718) * Optimize LCD, Wifi, etc. libraries (MarlinFirmware#18730) * Fix inline AnycubicSerial method * Anycubic followup * [cron] Bump distribution date (2020-07-22) * Fix Spanish preheat strings (MarlinFirmware#18743) * Explicit SdFat * Custom Nozzle Wipe (MarlinFirmware#18736) * [cron] Bump distribution date (2020-07-23) * Linear Advance: Only change E DIR when needed (MarlinFirmware#18744) * Fix links to secure sites (MarlinFirmware#18745) * Fast Filament Change temperature check (MarlinFirmware#18738) * General cleanup * [cron] Bump distribution date (2020-07-24) * Update FYSETC AIO II TMC UART pins (MarlinFirmware#18749) * Update links, README, contributing, etc. * Update links, README, contributing, etc. * ibid. * Add CONTROLLER_FAN_IGNORE_Z (MarlinFirmware#18735) * Simplify encoder handling (MarlinFirmware#18754) * Fix ESP3D_WIFISUPPORT ini typo * Apply lib_ignore from [features] (MarlinFirmware#18762) * Ender 3 V2 BL24C16 EEPROM support (MarlinFirmware#18758) * Filament Runout pin for Creality v4.2.2 board (MarlinFirmware#18763) * [cron] Bump distribution date (2020-07-25) * Ender 3 V2: Inject 'G28 O' before G29 (MarlinFirmware#18767) * Fix Lerdge variant script (MarlinFirmware#18771) * G425/G35 menu items; G425 pre- and post- scripts (MarlinFirmware#18737) * Robin nano V2, TFT LVGL UI parameters, and more (MarlinFirmware#18500) * Clean up after changes * Update (c) * Fix ui.external_control compile error (MarlinFirmware#18778) * [cron] Bump distribution date (2020-07-26) * Fix search for best compiler (MarlinFirmware#18779) * Close host's Filament Change dialog (MarlinFirmware#18785) * More folders only compiled when their feature is Enabled (MarlinFirmware#18780) Co-authored-by: Scott Lahteine <[email protected]> * Randomize firmware.bin, fix unflag * Fix MKS Robin Nano V2 build / upload (MarlinFirmware#18784) * Fix compile-time PWM_PIN (MarlinFirmware#18793) Co-authored-by: Scott Lahteine <[email protected]> * Prevent ESP3D_WIFISUPPORT with non-ESP32 board (MarlinFirmware#18792) * Add 0 to EXTRUDERS :[json] (MarlinFirmware#18786) * [cron] Bump distribution date (2020-07-27) * Config for Anycubic Mega TFT * Marlin Release 2.0.6 * [cron] Bump distribution date (2020-07-28) * Fix WiFi / ESP32 sanity check (MarlinFirmware#18808) * Fix garbled print_xyz output (MarlinFirmware#18810) * Fix DELTA + TMC sensorless homing + SPI endstops (MarlinFirmware#18811) * DISABLE_DEBUG required to free Robin nano Z_DIR_PIN (MarlinFirmware#18832) * Fix NEOPIXEL_LED compile w/out PRINTER_EVENT_LEDS (MarlinFirmware#18824) * Add TEMP_PROBE_PIN for Einsy Rambo (MarlinFirmware#18823) * Fix Cancel Objects index display (zero-based) (MarlinFirmware#18841) * Fix UNKNOWN_Z_NO_RAISE in G28 Bug introduced in 73fc077 * In G28 Z is sort-of known * Update include_tree * Add monitor_flags * Fix Duplicator i3 Plus pin diagram (MarlinFirmware#18862) * Fix FLYF407ZG pins (MarlinFirmware#18865) * Fix Spindle/Laser PWM DC (MarlinFirmware#18871) * No mks_robin extra_scripts in Trigorilla build (MarlinFirmware#18872) * Fix Z height after tool change (MarlinFirmware#18951) * Move Cancel Object menu, fix canceled item index (MarlinFirmware#18930) * Update Italian language (MarlinFirmware#18886) * Update Slovak language (MarlinFirmware#18884) * HW PWM sanity checks for SPINDLE_LASER_FREQUENCY (MarlinFirmware#18947) * Fix IS_PROBE_PIN macro (MarlinFirmware#19024) Co-authored-by: Scott Lahteine <[email protected]> Co-authored-by: thinkyhead <[email protected]> Co-authored-by: Giuliano Zaro <[email protected]> Co-authored-by: Keith Bennett <[email protected]> Co-authored-by: Johnny Eshak <[email protected]> Co-authored-by: Lucas Seiki Oshiro <[email protected]> Co-authored-by: Jason Smith <[email protected]> Co-authored-by: InsanityAutomation <[email protected]> Co-authored-by: cristyanul <[email protected]> Co-authored-by: JP Flouret <[email protected]> Co-authored-by: Fabio Santos <[email protected]> Co-authored-by: Serhiy-K <[email protected]> Co-authored-by: ellensp <[email protected]> Co-authored-by: George Fu <[email protected]> Co-authored-by: Robby Candra <[email protected]> Co-authored-by: Victor Oliveira <[email protected]> Co-authored-by: cbteeple <[email protected]> Co-authored-by: notabucketofspam <[email protected]> Co-authored-by: Jan-Gerard van der Toorn <[email protected]> Co-authored-by: Oliver Jean Eifler <[email protected]> Co-authored-by: ManuelMcLure <[email protected]> Co-authored-by: GhostlyCrowd <[email protected]> Co-authored-by: Luc Hoang Long <[email protected]> Co-authored-by: J.C. Nelson <[email protected]> Co-authored-by: shuttercat <[email protected]> Co-authored-by: espr14 <[email protected]> Co-authored-by: cccc <[email protected]> Co-authored-by: Julius ter Pelkwijk <[email protected]> Co-authored-by: Axel <[email protected]> Co-authored-by: Speaka <[email protected]> Co-authored-by: Chris Pepper <[email protected]> Co-authored-by: Leo <[email protected]> Co-authored-by: Evgeny Z <[email protected]> Co-authored-by: Sergey1560 <[email protected]> Co-authored-by: JBA <[email protected]> Co-authored-by: Markus Towara <[email protected]> Co-authored-by: yufanyufan <[email protected]> Co-authored-by: Claus Näveke <[email protected]> Co-authored-by: cr20-123 <[email protected]> Co-authored-by: Pascal de Bruijn <[email protected]> Co-authored-by: Mark Langezaal <[email protected]> Co-authored-by: Ivan Kravets <[email protected]> Co-authored-by: Diego von Deschwanden <[email protected]> Co-authored-by: fleek <[email protected]> Co-authored-by: MKS-Sean <[email protected]> Co-authored-by: giryan <[email protected]> Co-authored-by: Victor Tseng <[email protected]> Co-authored-by: MoellerDi <[email protected]> Co-authored-by: natemason <[email protected]> Co-authored-by: swissnorp <[email protected]> Co-authored-by: Sebastien Andrivet <[email protected]> Co-authored-by: FLYmaker <[email protected]> Co-authored-by: Claus Näveke <[email protected]> Co-authored-by: cbaugher <[email protected]> Co-authored-by: Roman Moravčík <[email protected]> Co-authored-by: Julius Mumme <[email protected]>
Requirements
Description
This is an implementation of the Anycubic I3 Mega (AI3M) custom TFT code in the Extensible UI (ai_api) approach. It is a port of the code from Derhopp and David Ramiro into Marlin 2.0 extensible UI primitives with an attempt to cut down on any core functionality duplication effectively using the extensible UI API calls and core Marlin features.
Benefits
Brings proper Marlin 2.0 support to the Anycubic I3 Mega (AI3M)
Related Issues
N/A