Monitoring that a relay has contacted

  • jayyhu
  • jayyhu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
23 Feb 2025 21:02 #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 or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
23 Feb 2025 22:01 #322411 by tommylight
Replied by tommylight on topic Monitoring that a relay has contacted
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 or Create an account to join the conversation.

  • jayyhu
  • jayyhu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
24 Feb 2025 05:28 - 24 Feb 2025 05:30 #322446 by jayyhu
Replied by jayyhu on topic Monitoring that a relay has contacted
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:
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
Last edit: 24 Feb 2025 05:30 by jayyhu.
The following user(s) said Thank You: tommylight

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
24 Feb 2025 05:35 #322449 by tommylight
Replied by tommylight on topic Monitoring that a relay has contacted
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.
The following user(s) said Thank You: jayyhu

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

  • jayyhu
  • jayyhu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
24 Feb 2025 06:27 #322458 by jayyhu
Replied by jayyhu on topic Monitoring that a relay has contacted
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 or Create an account to join the conversation.

More
24 Feb 2025 06:36 #322460 by rodw
Replied by rodw on topic Monitoring that a relay has contacted
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.

 
The following user(s) said Thank You: jayyhu

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

  • jayyhu
  • jayyhu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
28 Feb 2025 01:28 #322835 by jayyhu
Replied by jayyhu on topic Monitoring that a relay has contacted
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 or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum