Skip to content

Conversation

@vovodroid
Copy link
Contributor

Trigger power lost event basing on timeout, rather than on cycle counter. It provides more control and allow to skip false triggering.

Depending on UPS/PSU capacitors, DC/AC bed, it could be 0.1-0.5 second. I put default 10ms, I guess it more or less matches current 3 idle() calls.

To prolong this timeout heaters could be disabled during outage period until power is back.

@vovodroid
Copy link
Contributor Author

I see that build tests fails with Marlin/src/feature/powerloss.h:216:42: error: 'POWER_LOSS_TIMEOUT' was not declared in this scope

But there is Copying ConfigurationsRepo/config/examples/Prusa/MK3S-BigTreeTech-BTT002/Configuration_adv.h to Marlin/Configuration_adv.h. Obviously POWER_LOSS_TIMEOUT is not not defined there, because it's new define.

@thisiskeithb
Copy link
Member

I'll mention it again, but these types of changes should be optional in case the current method works better for someone or a user prefers it.

Disable POWER_LOSS_TIMEOUT in the default config (here) and then conditionally change how PLR is triggered if POWER_LOSS_TIMEOUT is enabled. Then add or modify a test so CI checks include it.

@vovodroid
Copy link
Contributor Author

Any advantages of current idle() fixed counter over configurable timeout?

@vovodroid vovodroid force-pushed the plr-power-timeout-pr branch from 1ec9759 to d198f1f Compare July 4, 2025 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants