BTT Relay V1.2 with SKR Mini E3 V3.0 - shuts down before Klipper loads

Basic Information:

Printer Model: Creality CR10S
MCU / Printerboard: Big Tree Tech SKR Mini E3 V3.0 + BTT CB 1 - PI 4B
klippy.log
klippy (1).log (250.7 KB)

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

I have just upgraded my 2017 Creality CR10S to run Klipper, it was a challenge but I got it working.
I have connected a BTT Relay V1.2 (auto shutdown relay) to the new SKR Mini E3 V3.0 motherboard, it shuts down 15 seconds after switching on the printer which doesn’t allow Klipper enough time to fully load.
I have fitted a jumper on the reset pins which allows Klipper to load but I suspect that this will prevent the auto shut down function from working.
I read on Reddit that modifying the mother board firmware can fix this problem but I have no idea how to do this. It makes sense that the mother board should send a signal to the relay to prevent shutdown before the Pi computer connects to the MCU and takes over.
Any suggestions on how to solve this issue?
Cheers!

You probably need to do something along the lines of:

Connect the relay to an appropriate pin

grafik

Configure the pin to be high during make menuconfig

Then flash the new firmware

Setup the needed macros

[output_pin power_detect]
# Pull the pin initially high after starting Klipper
pin: PC12
value: 1
shutdown_value: 0

[gcode_macro POWER_ON]
description: Turn on the printer via the relay
gcode: 
    SET_PIN PIN=power_detect VALUE=1

[gcode_macro POWER_OFF]
description: Turn off the printer via the relay
gcode:
    SET_PIN PIN=power_detect VALUE=0

Thanks, I’ll give that a go, you instructions are very clear.

Another solution that I found was to upload a modified program to the relay’s microcontroller, that will extend the shutdown to a minute, so long after Klipper loads.

I do not know this relay, so the above is only from a casual look at it.

If its hardware timer is too short before Klipper has a chance to initialize the needed pins, then a modified controller firmware might still be needed.

In any case you probably still need the above as it tells the relay to stay on until you actively pull this pin low.


The pins are connected to PS_ON_OFF (PC13) on the SKR Mini E3 V3.0 board, I was going to tweek
your gcode macros.
There is a Power Detect socket but It doesn’t seem to be used in the latest SKR Mini board.

Any free pin is suitable for this, e.g. endstop etc. If your board has a dedicated pin for it, of course it makes sense using it.

Thank you Sineos for taking the time to help me out, you’ve solved my problem, Klipper now loads like it should without the reset jumper in place. I have yet to test the auto shut down but I don’t see why that shouldn’t work now.
klippy.log (6.8 MB)

In case someone has the same problem, I followed Sineos’ advice, inputting PC13 as GPIO pin to set at microcontroller startup.
I then flashed the firmware into the printer, reconnected the Pi.

Then I placed the following gcode macros into printer.cfg

[output_pin PS_ON_OFF]
# Pull the pin initially high after starting Klipper
pin: PC13
value: 1
shutdown_value: 0

[gcode_macro POWER_ON]
    # description: Turn on the printer via the relay
gcode: 
    SET_PIN PIN=PS_ON_OFF VALUE=1

    # set shut down nozzle temperature
    TEMPERATURE_WAIT sensor=heater_extruder maximum=60

    # shut down the printer
    SET_PIN PIN=PS_ON_OFF VALUE=0  

It’s been a good day! :sunglasses:

In case you need want to connect the relay into the CR10S control box, I used this image as a guide.
The CR10 has a 2 pin switch with separate power socket, I Dremeled the switch hole bigger so that I could fit a 4 pin switch. The relay is positioned at the front below the control screen unit, just in front of the PSU.

Thanks for your feedback. Your macro seems strange, since under the heading of “POWER_ON” you are

  • Setting the pin high, which tells the relay to stay on
  • Use TEMPERATURE_WAIT, I guess with the intention to wait for the extruder to cool down. Note that this does nothing without setting the temperature with SET_HEATER_TEMPERATURE or M104 before
  • Turn off the board by pulling the pin low

Thanks again Sineos.
It is probably obvious that I am only just discovering Klipper and all its rules. I definitely need to spend time making things work like they should, I only managed to get the relay to shut down by manually pressing the END_PRINT macro in Mainsail. I don’t really know what I’m doing yet.

I can’t read your mind but from the looks of it, you might want to do something like:

[respond]

[output_pin power_detect]
# Pull the pin initially high after starting Klipper
pin: PC13
value: 1
shutdown_value: 0

[gcode_macro POWER_ON]
description: Turn on the printer via the relay
gcode: 
    SET_PIN PIN=power_detect VALUE=1

[gcode_macro POWER_OFF]
description: Turn off the printer via the relay
gcode:
    { action_respond_info('Shutting down now') }
    SET_PIN PIN=power_detect VALUE=0

[gcode_macro DO_SHUTDOWN]
description: Turn off all heaters and cut power once below 60C
gcode:
   TURN_OFF_HEATERS
   TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=60
   POWER_OFF

Then call DO_SHUTDOWN where you want. For example in the end-gcode of your slicer or an END_PRINT macro etc. This would then shut down the board after the print has finished.