Closed TheRaf974 closed 3 months ago
I also have an interrogation about the suicide feature, what is it exactly ? I can't find any documentation or discussion about it. It seems to be a legacy of Marlin 1. Should it be mapped to a pin connected to the reset pin of a the microcontroller to force reset in case of a critical failure ?
Some boards (ZM3) and add-ons (MKS_PWC
) provide a "suicide pin" feature, similar to a "dead-man's switch." The pin must remain in a particular state, or else the machine does a rapid shutdown. The "CR2020 Industrial series" must have this also. These pins definitions came directly from Creality, and often vendor code changes are not tailored to consider use in our more generic codebase. I am adding a wrapper so that configs will need to specify that they are actually a "CR2020" and only then will these power / suicide pins be applied.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Did you test the latest
bugfix-2.1.x
code?Yes, and the problem still exists.
Bug Description
I have a CR-10 S5 with a Creality mainboard v2.2. It runs on Marlin 2.1.2.3 with
BOARD_RAMPS_CREALITY
I was setting up
PSU_CONTROL
to turn off my printer onM81
using a static relay located before my power supply unit.To use
PSU_CONTROL
, aPS_ON_PIN
is required. The default pin 40, inpins_RAMPS CREALITY.h
isn't accessible in my board. The CR2020 must have a specific board with pin 40 exposed, which is not my case.So, I added
#define PS_ON_PIN EXP4_PIN
in myConfiguration.h
, based onpins_RAMPS CREALITY.h
. Comments suggest thatPS_ON_PIN
could be use on pin 12, which seems much more logical than pin 40.At this time,
PSU_CONTROL
comportement was inversed (M80 turned off and M81 turned on) no matter what was the value ofPSU_ACTIVE_STATE
. After digging a bit, I found that inM80_M81.cpp
forM81()
(turn off), the usage ofsuicide()
is prioritary topowerManager.power_off_soon()
:For
M80()
(turn on), this time afterpowerManager.power_on()
, it turn low theSUICIDE_PIN
:PSU_CONTROL
comportement was inversed because :SUICIDE_PIN
is unconditionnally defined to pin 12 (the one I use)suicide
is the opposite of the one I was searching forsuicide
was prioritary toPSU_CONTROL
This unconfitionnal definition sounds problematic to me, as it seems to be specific to one printer among the tens of creality's printer.
I solved my problem by replacing this part with this
and
#define SUICIDE_PIN -1
in myConfiguration.h
(I'll make a PR for this, looks like a good fix to me)Nevertheless, I'm not convinced that one specific printer using a modified version of a more standard board should drive the default definition of the standard one.
At least, I think that
PS_ON_PIN
andSUICIDE_PIN
should be modified. Pin 40 (PS_ON_PIN
) isn't exposed on the standard creality mainboard, so this is irrelevant. Pin 12 (SUICIDE_PIN
) is a part of a group of 4 pins planned as extensions pins.If a default
PS_ON_PIN
is really required, then its sounds more logic to me to use pin 12, as comments suggested.PS: After some research, the board used in the CR2020 seems to be the Creality mainboard v3.1, which seems to be discontinued. Maybe, this board should have its own
pins.h
file.Bug Timeline
No response
Expected behavior
No response
Actual behavior
No response
Steps to Reproduce
No response
Version of Marlin Firmware
2.1.2.3
Printer model
Creality CR-10 S5
Electronics
Power Supply Control with a static relay
LCD/Controller
No response
Other add-ons
No response
Bed Leveling
None
Your Slicer
None
Host Software
None
Don't forget to include
Configuration.h
andConfiguration_adv.h
.Additional information & file uploads
Configuration.zip