Safety relay and e-stop in LCNC?
- thomaseg
- Offline
- Junior Member
- Posts: 31
- Thank you received: 4
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.
- Unlogic
- Offline
- Elite Member
- Posts: 202
- Thank you received: 102
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.
- pippin88
- Offline
- Elite Member
- Posts: 260
- Thank you received: 45
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.
- rodw
- Offline
- Platinum Member
- Posts: 10737
- Thank you received: 3540
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.
- thomaseg
- Offline
- Junior Member
- Posts: 31
- Thank you received: 4
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?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.
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.
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!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
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
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
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
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.
- thomaseg
- Offline
- Junior Member
- Posts: 31
- Thank you received: 4
Attachments:
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
- Posts: 10737
- Thank you received: 3540
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.
- rodw
- Offline
- Platinum Member
- Posts: 10737
- Thank you received: 3540
Please Log in or Create an account to join the conversation.
- thomaseg
- Offline
- Junior Member
- Posts: 31
- Thank you received: 4
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:I also should have mentioned the estop-latch component allows you to build an estop chain in hal.
- 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
Please Log in or Create an account to join the conversation.