I've done something like that commercially for battery run systems.  Using a 
latching relay power is applied by a user switching a master switch ON which 
latches the relay and now there's power for the control system.  Once the 
control system is up the main contactor is switched on to supply full battery 
power to everything.

To unlatch the relay a user has to press the OFF switch or the same ON switch 
which is sensed by the system.  At that point the system shuts down leaving the 
power supply (which has its' own CANopen controller) to wait for the message 
from the rest of the system that says OK to shut down.   That OK is based on a 
PC sending a message OK to shut off along with other critical hardware devices.

Once everyone is off the power supply then opens the main contactors,  
unlatches the set/reset relay and power is gone.  Now a user has to 
mechanically switch the ON switch back on.

For the situation where the system is running on batteries and the batteries 
reach a specific state of charge (SOC=10% for example) the power supply 
duplicates the message sent as if a user had switched the POWER switch to the 
OFF position even though it's still mechanically ON.  Again after everyone has 
gracefully shut down, the power supply unlatches the set/reset relay and the 
system now is off with no current draw.  It now requires operator intervention 
to return to the site, mechanically switch the system off, put diesel into the 
genset, and then switch the system ON again.  If for some reason the battery is 
so low that it cannot start the system the genset needs to be running first in 
which case the batteries don't matter.  The genset has a 12V starting battery 
separate from the 24V control system.

John


> -----Original Message-----
> From: Chris Albertson [mailto:albertson.ch...@gmail.com]
> Sent: February-16-22 9:09 AM
> To: Enhanced Machine Controller (EMC)
> Subject: Re: [Emc-users] Graceful pi shutdown, power off
> 
> 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



_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to