Monitoring that a relay has contacted

More
1 year 8 months ago #322398 by jayyhu
Hello,
I have an output signal to a relay, and an input signal from the other side of that relay (to confirm that the relay had contacted or not). Is there a way in HAL (besides writing my own comp) to monitor the input signal and make sure it matches the output signal within a timeframe, and otherwise signal an error if the signals don't match?
Thanks in advance!

Please Log in to join the conversation.

More
1 year 8 months ago #322411 by tommylight
What is exactly the aim of this?
You can do pretty much anything in hal that is also possible with a comp, so it is your choice.
Monitoring things on screen can be done easily by using VCP
linuxcnc.org/docs/html/gui/pyvcp.html
And use timedelay
linuxcnc.org/docs/2.9/html/man/man9/timedelay.9.html
Then connect that to feed hold or drive enable or e-stop in hal

Please Log in to join the conversation.

More
1 year 8 months ago #322446 by jayyhu
For a safety mechanism; the output signal controls 3 relays (which controls the spindle motor & misc circuits), and the input signal is basically all of those relays wired together, so if any of them stops working, I want everything to stop and error out. Thanks for the tip about timedelay--I ended up using a combination of xor2 and ton comps to get the effect I wanted:
Code:
setp ton.0.pt 1.0 net ref => xor2.0.in0 net mon => xor2.0.in1 net xor2.0.out => ton.0.in net err <= ton.0.q

Please Log in to join the conversation.

More
1 year 8 months ago #322449 by tommylight
Then you might want to use the joint.0.amp-fault input pin as that would disable everything when triggered, but does not e-stop.

Please Log in to join the conversation.

More
1 year 8 months ago #322458 by jayyhu
I already have those set to the individual drive error/fault output pins, so I ended up adding a names_misc_errors, which according to the docs, does the same thing.

Please Log in to join the conversation.

More
1 year 8 months ago #322460 by rodw
Using a safety relay with the estop external to Linuxcnc would be a better solutio.
If you used force guided relays as part of the estop circuit, you should not have an error. These relays have a pin that is forced into the contacts to force them apart. But you should have redundancy so two relays (probably in series) are used and both must be triggered.

 

Please Log in to join the conversation.

More
1 year 8 months ago #322835 by jayyhu
Thanks for the tip about safety relays--never knew they were a thing. I'm converting an existing mill (Emco concept mill 55) that uses a three-relay combo (K1/K2/K3). And the PLC file for the mill has a check to ensure that when the relays are commanded "on" that their outputs are "on" and vice-versa, so I'm just trying to add in that extra level of safety to LinuxCNC as well.

Please Log in to join the conversation.

Time to create page: 0.098 seconds
Powered by Kunena Forum