Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call function on idle? Power down PSU. #189

Closed
wizhippo opened this issue Feb 23, 2018 · 6 comments
Closed

How to call function on idle? Power down PSU. #189

wizhippo opened this issue Feb 23, 2018 · 6 comments

Comments

@wizhippo
Copy link
Contributor

I'm looking in the source and cannot pinpoint it. I would like to disable a pin I have connected to a psu when the printer is idle for x amount of time.

Can you point me to where I may add this?

@lenne0815
Copy link

Probably doing it from the raspi i/o is the way to go there, ruling out communication issues for safety: this is what a quick google brought up https://github.com/foosel/OctoPrint/wiki/Controlling-a-relay-board-from-your-RPi

@wizhippo
Copy link
Contributor Author

Either way, what I am looking for is in Klipper where is idle being detected to turn the motors off?

@lenne0815
Copy link

lenne0815 commented Feb 24, 2018

Just check where the ena pin from the stepsticks is called, it wont help much for switching a psu though as the motors are idle on boot. When you just use a psu exclusively for the stepsticks making it possible the second problem comes up; i doubt you can switch it on fast enough to not loose steps on the first movement when waking up.

Easiest way to do it is to add a G4 Sx + SET_PIN PIN=my_pin VALUE=0 ( [digital_output my_pin] ) to switch a pin after your printing gcode. Which can still leave the pin in an unknown state if the microcontroller crashes for whatever reason.

@KevinOConnor
Copy link
Collaborator

KevinOConnor commented Feb 24, 2018 via email

@cmock
Copy link
Contributor

cmock commented Feb 25, 2018

One solution that works: using the "PSU control" plugin in Octoprint, and a pin configured in klipper for the PS_ON signal on the RAMPS:

[digital_output power]
pin: !ar12
value: 0
shutdown_value: 0

Then, the plugin can use SET_PIN PIN=power VALUE=1 to turn on the PSU. Basically, I'm replicating the M80/M81 commands used in other firmwares to switch a PSU.

I have my PSU, electronics and hotend fans plus the LED lights wired up directly to the +12V rail, so the printer is really quiet until it actually does work. The plugin does the "idle" handling, including a threshold for the hotend temperature so the hotend fan is not turned off too soon.

The arduino/RAMPS/LCD is powered via USB from the Raspberry, so it is runnning all the time.

The plugin, BTW, could also use a Raspberry GPIO pin to switch the PSU.

@wizhippo
Copy link
Contributor Author

Psu control with its idle timeout looks like what I am looking for thank you.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants