Welcome! Log In Create A New Profile


Enabling power loss function in Tronxy X5SA Pro (Marlin)

Posted by Night6488 
Enabling power loss function in Tronxy X5SA Pro (Marlin)
August 02, 2022 01:33PM
So, I have Marlin 2.1.x bugfix (2.1 wouldn't run because of a problem with the SD enable pin) running in my Tronxy X5SA 400 Pro, and it works fine, no problems at all. But I want to improve 2 things: first enable power loss function and second enable LVGL mode. I think I know how to do the changes for LVGL mode, but I don't know how to do it for the power loss.
The board is the original Chitu v6 that has a power loss module, but I don't know what type and to which pin. I have included a schematic of the motherboard (x5sa-main_board-2.pdf) that I found on a corner of the Internet winking smiley. I have already tried a couple of combinations based on the diagram, but they didn't seem to work and I have no clue at all. Thanks in advance for all the help.
Re: Enabling power loss function in Tronxy X5SA Pro (Marlin)
August 02, 2022 07:08PM
Have you tried the following?
PG2 - tied to POWER_KEY_DETECT signal which gets renamed to EXT6 which comes out on pin 6 of JP4
PG4 - tied to ERROR_DETECT signal which gets renamed to EXT1 which comes out on pin 1 of JP4

Do you have any unused connectors on the board?
Re: Enabling power loss function in Tronxy X5SA Pro (Marlin)
August 03, 2022 07:05AM
Thanks for the quick reply!
Ok, after checking the pins_CHITU3D_common.h I saw that #define POWER_LOSS_PIN was disabled, so I enabled it with the value PG2 (note that there is a comment saying // PG4 PW_DET) and I have set the POWER_LOSS_RECOVERY configurations like this:
    #define PLR_ENABLED_DEFAULT    true // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
    //#define BACKUP_POWER_SUPPLY       // Backup power / UPS to move the steppers on power loss
    //#define POWER_LOSS_ZRAISE       2 // (mm) Z axis raise on resume (on power loss with UPS)
    //#define POWER_LOSS_PIN         44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
    #define POWER_LOSS_STATE     HIGH // State of pin indicating power loss
    #define POWER_LOSS_PULLUP         // Set pullup / pulldown as appropriate for your sensor
    //#define POWER_LOSS_PURGE_LEN   20 // (mm) Length of filament to purge on resume
    //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
But this doesn't seem to work (I tried by starting a print and while it was heating turning off the wall plug). Am I doing it correctly, or should I enable something else (the POWER_LOSS_PIN, for exampe)? Is there any clue on what type of sensor this is, or will I have to take guesses?
I can't guess what type of sensor is by the diagram, and I haven't found information about the module. There surely is an integrated module, because there is a laarge capacitor in the middle of the board.

I will edit this message as I try new combinations:
  • 3/08-Tried with PG4: no results
  • 3/08-Tried enabling #define POWER_LOSS_PIN PG2 and #define BACKUP_POWER_SUPPLY: no results. Note that I think if I have #define POWER_LOSS_PIN PG4 in pins_CHITU3D_common.h at the same time, the printer reboots constantly after powering it off mid-print and turning it on again, boots normally without SD card.
  • 3/08-Tried enabling #define POWER_LOSS_PIN PG4 (with PG4 and #define BACKUP_POWER_SUPPLY): Same problems with SD card, I think the printer edited something, but I can't see any changes or hidden files. I am using two SDs, one to print and one to update firmware

Edited 1 time(s). Last edit at 08/03/2022 08:27AM by Night6488.
Re: Enabling power loss function in Tronxy X5SA Pro (Marlin)
August 03, 2022 12:30PM
I also couldn't find any info on the Chitu v6 power loss module. From your description it sounds like a seperate board with a laarge capacitor on it. I saw a YouTube video with the BTT version and in that video they used just the POWER_LOSS_PIN and they enabled BACKUP_POWER_SUPPLY.

Yes, Marlin writes a file to the print SD card to keep track of how far the print has progressed before power failure. Move the SD card to your PC and see if anything unusual shows up. I think the file name is /PLR. Delete that file and try again.
Re: Enabling power loss function in Tronxy X5SA Pro (Marlin)
August 04, 2022 05:11PM
Yeah, I also saw that video. I am not sure it counts as a UPS because it is a single fat capacitor (integrated in the mainboard), it won't have the power to move a stepper. And I already took a look in my PC and I didn't find any files, neither in the SD or in the folder inside the SD (with see hidden files enabled). Okay, so I guess I will have to try every single combination sad smiley. Anyway, thanks for all the help, and I am open to more ideas!
Sorry, only registered users may post in this forum.

Click here to login