Safety relay and e-stop in LCNC?

More
16 Jul 2024 21:26 #305419 by thomaseg
Safety relay and e-stop in LCNC? was created by thomaseg
Hi,

After advise from this forum I built my machines estop functions around a safety relay from Abb Sentry USR22. So i have dedicated hardware just for handling the latching, i have redundant safety contactors to take power to all moving parts and so on. Everything works all by itself and doesn't need LCNC to function. I can run the estop functions with LCNC completely turned off, just as i think it should work.

But I choose the USR22 since it have 2 groups of relays with a timed delay between them. In case of a estop, i'd like to first tell LCNC via the first relay that "shit has hit the fan, stop everything!" This happens via a simple IO-pin. Then after 400ms or so the safety relay will kill the power to servo-drives nomatter what via the 2nd relay...regardless of what LCNC do/did. The idea was that i would give the software a small window to command the servo-drives to do a estop via software(or do a "quickstop", whatever i can make work) and also the possibility to stop anything else that might need stopping, but isn't "deadly"(e.g. floodcoolant pump, liquid cooling system etc)...

But i'm unsure how to wire this in HAL for it to work properly inside LCNC. It seems like all examples are assuming that i just have the estop-button connected directly to a IO pin and then need LCNC to do the heavylifting in software. But this is not the case here. I want LCNC to do a "software estop" as fast as possible and likely also turn off other "non-critical stuff". I would also want LCNC to accept that the estop-condition is resolved whenever the IO-pin changes back again(no extra latching in software, i got all that in hardware). So the estop-latch examples doesn't quite fit as far as i can tell.

The signal from my safety relay is either high or low depending on the state of the estop. I tried to wire this to iocontrol.0.emc-enable-in, but this isn't quite right and i was curious if others have found a good way of doing this "properly"? Or has ideas how to do this?

/Thomas

Please Log in or Create an account to join the conversation.

More
16 Jul 2024 22:52 #305429 by Unlogic
Replied by Unlogic on topic Safety relay and e-stop in LCNC?
I'm using an ABB safety relay on my CNC converted mill (forum.linuxcnc.org/12-milling/50559-opti...mh50v-cnc-conversion) and I've set it up so that LinuxCNC feeds the e-stop circuit via an output on the Mesa board.

If LinuxCNC isn't up and running the e-stop cannot be reset. If the e-stop is triggered it can only be reset via my physical e-stop reset button, e-stop cannot be reset in software.

I'm using Delta B3 servos which have two different power connections on the servo drives, one connection for the logic section and one for the servo power section. The logic section remains powered all the time (per the Delta manual) but the servo power section is cut via contactors when an e-stop is triggered. The drives also have the e-stop signal connected to them so they can detect an e-stop and stop the servos using the built in brake resistor.

Here are two short videos I made about the setup:



Please Log in or Create an account to join the conversation.

More
17 Jul 2024 05:25 #305449 by pippin88
Replied by pippin88 on topic Safety relay and e-stop in LCNC?
Ha e you tried just setting it up in hal as an estop?

I have a simple estop button to LinuxCNC and when I reset the button LinuxCNC comes out of estop.
I still have to hit "power on" on LinuxCNC after reseting estop. This is generally recommended behaviour

Reseting estop should never result in immediate motion

Please Log in or Create an account to join the conversation.

More
17 Jul 2024 07:07 #305452 by rodw
Replied by rodw on topic Safety relay and e-stop in LCNC?
There are two ways to do this. You can either run an external latch (which is a momentary switch) that resets the safety relay. In this case, you should connect a signal to a Linuxcnc input which is connected in hal to iocontrol.0.emc-enable-in This is the approach I took.
 
There is no need to press anything in Linuxcnc

The other way is to  use iocontrol.0.user-request-enable instead of your external latch. Linuxcnc sends a pulse on this signal to act as the latch when the on screen estop is reset (S34 in the diagram).
When I researched this, this was compliant provided you isolated Linuxcnc (your controller) with redundant relays (K3 & K4). These needed to be force guided relays where a non conducting pin is forced between the contacts when they are triggered to ensure the contacts cannot become welded closed.

It's good that you used a safety relay with a timer in it can retain control until motion stops.

 
Attachments:

Please Log in or Create an account to join the conversation.

More
17 Jul 2024 09:10 #305463 by thomaseg
Replied by thomaseg on topic Safety relay and e-stop in LCNC?

I'm using an ABB safety relay on my CNC converted mill (forum.linuxcnc.org/12-milling/50559-opti...mh50v-cnc-conversion) and I've set it up so that LinuxCNC feeds the e-stop circuit via an output on the Mesa board.

If LinuxCNC isn't up and running the e-stop cannot be reset. If the e-stop is triggered it can only be reset via my physical e-stop reset button, e-stop cannot be reset in software.

I'm using Delta B3 servos which have two different power connections on the servo drives, one connection for the logic section and one for the servo power section. The logic section remains powered all the time (per the Delta manual) but the servo power section is cut via contactors when an e-stop is triggered. The drives also have the e-stop signal connected to them so they can detect an e-stop and stop the servos using the built in brake resistor.

I really like the way you setup reacts. I cannot figure out if your safety relay can actually trip without LinuxCNC being on? From what i can see on your schematic the estop is wired to the drives + IO pin, but not the safety relay?

Your drives are better than mine. The way logic and power is seperated is very handy! Mine doesn't have that. Neither does my drives support external e-stop input since they run via EtherCAT.

pippin88 post=305449 userid=16922
Ha e you tried just setting it up in hal as an estop?

I have a simple estop button to LinuxCNC and when I reset the button LinuxCNC comes out of estop.
I still have to hit "power on" on LinuxCNC after reseting estop. This is generally recommended behaviour

Reseting estop should never result in immediate motion

Yeah, hitting "Power on" in LinucCNC is just fine, it makes good sense. And i agree that estop reset shouldn't restart motion, that is crucial!
I tried just simply setting the e-stop pin to emc-enable:
net estop lcec.0.DI03.din-0-not => iocontrol.0.emc-enable-in
...but this doesn't work and i also suspect that this isn't actually what i want :-)

rodw post=305452 userid=20660
There are two ways to do this. You can either run an external latch (which is a momentary switch) that resets the safety relay. In this case, you should connect a signal to a Linuxcnc input which is connected in hal to iocontrol.0.emc-enable-in This is the approach I took.
 


There is no need to press anything in Linuxcnc

I tried this simple approach with the above HAL-code, but this isn't working(at all)... maybe the emc-enable-in should be pulsed? I'm unsure how the internals of LinuxCNC works with these pins...

rodw post=305452 userid=20660
The other way is to  use iocontrol.0.user-request-enable instead of your external latch. Linuxcnc sends a pulse on this signal to act as the latch when the on screen estop is reset (S34 in the diagram).
When I researched this, this was compliant provided you isolated Linuxcnc (your controller) with redundant relays (K3 & K4). These needed to be force guided relays where a non conducting pin is forced between the contacts when they are triggered to ensure the contacts cannot become welded closed.


I should have posted a diagram in my previous post, but better late than never. This is my safety circuit:
 
 
I'm starting to think that i have to change this. So instead of the resetbutton(S6) goes directly to the safety-relay it actually goes to LinuxCNC. Then LinuxCNC is the only on that can reset the safety relay, just like in Unlogics case mentioned above. The question is then if should have an additional latch inside LinuxCNC or how should i structure the HAL?

A whole other can of worms is that the drives are connected via EtherCAT and uses CIA402, so i need to manage their state when the estop is reset. I have to re-initialize them after a reset, i'm not even sure this is doable via HAL logic...
Attachments:

Please Log in or Create an account to join the conversation.

More
17 Jul 2024 09:16 #305464 by thomaseg
Replied by thomaseg on topic Safety relay and e-stop in LCNC?
Just to give a bit of "physical context", here is how it looks in "real life":
   
Attachments:

Please Log in or Create an account to join the conversation.

More
17 Jul 2024 12:19 #305479 by rodw
Replied by rodw on topic Safety relay and e-stop in LCNC?
Looks Good
This is mine on a Mesa setup but also have the same on an Ethercat machine
 
Red Safety Relay, two force guided relays in front of it.

The only thing I can see a bit different is your estop does not have dual circuits. I bought new ones for these safety relays that did. Back of switch shown here. (Brand is Idem, same as relay)
 

On my ethercat machine, I drop power to the steppers but also use the disable signal on the motors.
Attachments:

Please Log in or Create an account to join the conversation.

More
17 Jul 2024 12:20 #305480 by rodw
Replied by rodw on topic Safety relay and e-stop in LCNC?
I also should have mentioned the estop-latch component allows you to build an estop chain in hal.

Please Log in or Create an account to join the conversation.

More
17 Jul 2024 12:43 - 17 Jul 2024 12:43 #305483 by thomaseg
Replied by thomaseg on topic Safety relay and e-stop in LCNC?
Yeah i saw your description in another post and they look very similar. After seeing the discussion you had, i've already decided to do a minor change to the estop-button-circuit. The button itself have a NC and a NO connector, but i'm going to change the NO-contactor so i'm getting 2xNC instead and then put them in series and make that part redundant aswell... thanks for the inspiration ;-)

I also should have mentioned the estop-latch component allows you to build an estop chain in hal.

yes, i've studied that part, but i'm very unsure how to couple it with the hardware latch in the safety relay. My thoughts so far, see if it is clear and makes sense:
  • The physical estop triggers, this sends estop-signal to LinuxCNC and automatically kills servos after set amount of time.
  • The estop-signal sent to LinuxCNC triggers the estop-latch inside LinuxCNC and stops everything "on the software side" including estopping servers via EtherCAT.
  • The physical reset-button is connected to IO-pin instead of directly to safety relay. When pushed it sends signal to LinuxCNC estop latch to "open" disabling software estop.
  • When LinuxCNC estop goes into normal operation mode it sends a "oneshot" signal to the safety-relay to cause a reset of the physical latch

Does that make sense? As far as i can see i get "the best of both worlds", right? The only missing part is that i won't be able to trigger an estop from software, but i'm not sure i need that? It could be solved by a redundant relay in the physical estop chain, triggered by IO from LinuxCNC...but not sure if it is needed in any way...

/Thomas
Last edit: 17 Jul 2024 12:43 by thomaseg.

Please Log in or Create an account to join the conversation.

Time to create page: 0.174 seconds
Powered by Kunena Forum