Cumulative drop_target reset delays for multi-coil banks #1621
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR continues to refine the DropTarget behavior for target banks with individual reset coils.
The Setup
The existing MPF behavior is smart enough to wait after resetting a drop target before checking the switch value and updating the target state, using the
ignore_switch_ms
property. MPF is also smart enough to stagger a series of drop target resets in order to smooth out PSU usage, using thereset_coil_max_wait_ms
property.The Problem
When using staggered drop target resets for power optimization, MPF does not factor into account the additional time it takes to reset all of the drop targets. As a result, the
ignore_window_ms
may expire while the coils are still resetting, leading to unexpected events and behavior. Additionally, the firing of a reset coil may momentarily disturb the opto sensor on a neighboring target, causing false switch detections.The Solution
This PR tracks how much additional time is being requested by the PSU to sequentially pulse all of the drop target coils, and adds that time to the
ignore_switch_ms
property. This ensures that all of the coils have fired and switches have settled before MPF reads the state for updating the bank (or attempting a retry).Why add and not max?
If the total delayed time is still less than the
ignore_switch_ms
, or vice versa, why not just use the larger value? My assumption is that theignore_switch_ms
time is provided by the designer based on the settling time of the switches after all coils are done firing. Adding the values ensures that the coils are done and the settling is complete.This PR also adds
reconcile=True
to theinit_phase_4
reset callback to prevent the playfield from being marked active during startup.