Add external pin to control PSU state M80/M81 #20006
Closed
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.
Requirements
To enable Marlin to have an external way (physical pin) to change the Power Source Unit (PSU) state besides M80 and M81 G-code commands or the "Switch Power" option on LCD menu.
Description
I enabled the PSU_CONTROL to switch my PSU using the PS_ON_PIN to enable power on/off through M80/M81.
But I thought of adding a button on my printer to have an option to turn on the PSU physically and not only by G-code commands or navigating through the LCD menu and have to locate the "Switch Power" option.
Benefits
Add an option for the users of PSU_CONTROL to easy control the PSU state.
Configurations
Just uncomment line with PSU_CONTROL definition:
#define PSU_CONTROL
The default PSU_EXT_PIN is set to 58 that is exposed in AUX-1 header of RAMPS 1.4.
When the PSU_EXT_PIN is set to PSU_EXT_PIN_STATE it will verify the actual on/off state of PSU and change it accordingly.
Related Issues
There are no related problems, but it will correct the initial behavior that states that the printer was "Ready" when in reality it is still in "OFF" state.