Input rocket switches + safety

Hi all!

First of all, I’m quite new here.
So forgive me when my questions are stupid haha.

My question is :

Ik have 2 rocker switches, rocker switch 1 must act like a “safety button”
And rocker switch 2 must act like a " start / go command"
So, when switch 1 is true, you can’t press switch 2. When 1 is false, then only you can press 1.

Both of the switches going to 1 relay output.
( already made that. And it works)

But the thing is… When switch 2 is already active, and I press switch 1. It doesn’t " over rule". So, switch 1 is not fully working as a safety switch.

So what can I do, to makes this working.

I hope that my story is clear, and that you guys can help me!

Thanks!

I assume what you are saying is, if command switch is on and safety switch gets turned on, then relay should not be activated until command switch is turned off and back on again.

Usually to disable an input, we would use the gate node, but turning on the safety would immediately pass the state of command switch, so it would immediately enable the relay if command switch is on. You want to enable the command switch only if safety is on AND command is off. That would look like this (the tweak-boolean on the right is the safety – true means we are live; left is the command switch; watch node at the bottom represents relay):

image

There are two problems with this.

  1. Turning on the command switch disables the gate, which can happen before the new switch state has passed through it. We could fix this by adding a defer node between the command button and the “and” node to guarantee that the new switch state reaches gate before the gate is disabled.
  2. There is no good way to turn the relay back off.

I’m thinking we probably need a flip-flop to remember current relay state instead of just using logic to calculate it. We could use the gate code above (with delay node added), but I think we can do it more directly:

image

The “and” node says that we only have true when both switches are true and the command switch was off (“defer” of “not” of command switch). This will obviously not stay true for long since it goes back to false as soon as defer “expires”, but all we need is a quick pulse to set the flip-flop.

The puls… nodes are both pulse-on-false. If either switch is turned off, we immediately force the flip-flop (and hence the relay) to off.

There is one bug/feature with this code…it turns the relay on if both switches are on at power-up. Adding a delay that starts on boot seems to resolve this:

Now the delay timer needs to NOT be active before relay can be activated…in this case, at least 1 second after boot. If both switches are on when delay expires, we don’t have condition that command switch was off, so relay is not activated until command switch is turned off and back on.

Bonus, if you remove the wire from command switch to the “and” node and reduce the “and” to only 3 inputs, the “and” node can now light a warning light that the system is armed. Add a new 2-input “and” that takes input from command switch and the 3-input “and” node. Use 2-input “and” to SET the flip-flop instead of wiring directly from the 3-input “and”.

3 Likes

Gweimer,

My apologies for the late response! ( got a family thing)
You answer really helped me a lot, I’m quite new with XOD. But I’m learning fast, due the tutorials and the support from the forum. And it’s so much fun!

Anyhow, thank you again for you’re time, and clear/extensive answer. Keep up the good work!

( Sorry for my English it’s not my first language haha)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.