This is the problem with an instant acting switch. The pi gets one if the GPIO pins low and the replay opens, shutting down power but then the power is removed before the OS shuts down potentially corrupting storage.
I think the only solution is the solution that every modern electronic device uses. Turing on your using a remote control is the same problem. The TV has to issue a command to the relay that controls power, put how to do that if the TV is off? Solution, there is a second power control processor that controls the power. The "processor" can be a dumb delay timer but today microcontrollers are cheaper than timers and allow you to have functions like sequencing at no extra cost but software. Even cheaper are power management chips but those are designed for use inside the power supply. You will need to implement somekind of a delay device that is triggered by the Pi as it goes into Run Level 6 (I think 6 is "shutdown"?) The same controller can monitor the power button and when moved from off to on start the Pi, wait for it to boot then turn on the CNC motor power. The Pi wouldtalk to the controller with a GPIO pins or use some serial interface like I2C. I woulduse whatever serial interface is easy to program on the microcontroller. This power controller would tie into e-stop also. The e-stop that comes from the user interface would send a signal over that interface to drop power to the motors. Yes the "real" is best but now you can make the software one a little better. On Wed, Feb 16, 2022 at 6:17 AM Thaddeus Waldner <thadw...@gmail.com> wrote: > > Just use a simple 10A relay with 5V coil > > As a latch, you press a button to power up, ie power the coil, then the > > same line gets dropped by the Pi to power off.. > > How does the pi drop the 5v line after shutting down? > > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users > -- Chris Albertson Redondo Beach, California _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users