Skip to content
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

[FR] MKS PWC + UPS working together + possible solution #22534

Open
javicarrera opened this issue Aug 8, 2021 · 1 comment
Open

[FR] MKS PWC + UPS working together + possible solution #22534

javicarrera opened this issue Aug 8, 2021 · 1 comment
Labels
C: Peripherals T: Feature Request Features requested by users.

Comments

@javicarrera
Copy link

javicarrera commented Aug 8, 2021

Is your feature request related to a problem? Please describe.

Currently it is not possible using MKS PWC power module and UPS module together.
For me this combo goes always together because otherwise you can't raise Z axis in case of
power failure and your print would be in any case ruined.
So without UPS you can only control switching on and off the printer.

Are you looking for hardware support?

In my case I have succesfully tried with this set up:

  • Robin Nano v1.2
  • MKS PWC v3.0
  • MKS UPS

Describe the feature you want

This is an improvement to this PR #22528 which is currently working with my setup (Robin Nano 1.2 + PWC 3.0 + UPS).

UPS is controlled by the definition BACKUP_POWER_SUPPLY. The signal cable from UPS remains not connected, because the PWC is already controlling this pin. PWC is connected as shown in the manual.
So now it is possible to raise Z axis in case of power failure.

I have tried it only on LVGL_UI and all features are working:

  • Push button switches on and off
  • Power failure saves in SD card and raises Z axis.
  • Print continues after power failure
  • Switch on/off works also with the UI.

Just change in pins_MKS_ROBIN_NANO.h (I suppose it would be similar for any MKS board):

#if ENABLED(PSU_CONTROL) // MKSPWC
  #if HAS_TFT_LVGL_UI
    #error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
  #endif
  #ifndef PS_ON_PIN
    #define PS_ON_PIN PB2 // PW_OFF
  #endif
  #ifndef KILL_PIN
    #define KILL_PIN PA2 // PW_DET
    #define KILL_PIN_STATE HIGH
  #endif
  #if ENABLED(BACKUP_POWER_SUPPLY)
    #define POWER_LOSS_PIN KILL_PIN // PW_DET allows use of MKS PWC & UPS together - DO NOT plug UPS signal cable to main board
  #endif
#else
  #ifndef SUICIDE_PIN
    #define SUICIDE_PIN PB2 // LVGL UI MKSPWC SUICIDE PIN PB2 - PW_OFF
    #define SUICIDE_PIN_INVERTING false // LVGL UI MKSPWC pin state
  #endif
  #ifndef KILL_PIN
    #define KILL_PIN PA2 // LVGL UI MKSPWC PW_DET pin
    #define KILL_PIN_STATE HIGH // LVGL UI MKSPWC pin state
  #endif
  #if ENABLED(BACKUP_POWER_SUPPLY)
    #ifndef POWER_LOSS_PIN
      #define POWER_LOSS_PIN KILL_PIN // Allows use of MKS PWC & UPS together - DO NOT plug UPS signal cable to main board
    #endif
  #endif
#endif

I would delete from misc. functions, as are already controlled in previous code.

//#define POWER_LOSS_PIN PA2 // PW_DET
//#define PS_ON_PIN      PB2 // PW_OFF
@javicarrera javicarrera added the T: Feature Request Features requested by users. label Aug 8, 2021
@javicarrera javicarrera changed the title [FR] MKS PWC + UPS working together [FR] MKS PWC + UPS working together + possible solution Aug 8, 2021
@javicarrera
Copy link
Author

Connection layout:
MKS PWC: https://prnt.sc/1l7cko5
MKS UPS: https://prnt.sc/1l7d1nx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Peripherals T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests

2 participants