Relay Operation using Fluidsim

KamaruuV2

Member
Join Date
Apr 2024
Location
Manila
Posts
2
Hello, I need assistance in making a Relay operation that follows the given parameters:

-if S1 is switched and S2 is at off, the Lamp 1 will be on and will stay on even when S1 is unswitched.
-if S1 and S2 are pressed, then Lamp 1 will off.

I already managed to follow the 1st parameter

1712124968811.png
S1 is pressed and unpressed but lamp is still on

The only problem I have now is how do I incorporate the second parameter so that if S1 and S2 are switched, they will turn off


thank you in advance
 
[Update: improved spacing for clarity]

I don't think the image posted is anywhere near the logic necessary to even just turn the lamp on, but I am unsure what the ⇑ symbol means; is it an edge detector? You should try Rubber Duck Debugging on your logic, i.e. describe to yourself, or a rubber duck, or to the forum, how you thought that logic should work.

Or you should start over: to solve the problem we need but one rung to create the logic that satisfies the word problem, with one extra branch to turn on the light in addition to the first output branch that control the seal-in bit. And we don't need any edge detectors.

See De Morgan's Laws.

"If S1 and S2 are pressed, then Lamp will [i.e. is] off" ≡ "If BOTH (S1 is 1) AND (S2 is 1) then LAMP is off"

Apply De Morgan's law

"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if (NOT (EITHER (S1 is NOT 1) OR (S2 is NOT 1))) then (Lamp must be 0)"

Since S1 and S2 are boolean (bits), we can translate "is NOT 1" to "is 0" and get the following:

"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if (NOT (EITHER (S1 is 0) OR (S2 is 0))) then (Lamp must be 0)"

We can invert the NOT in the if-expression if we invert the then-expression:

"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if ((EITHER (S1 is 0) OR (S2 is 0))) then (NOT (Lamp must be 0))"

Finally, we remove the NOT from the then-expression:

"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if ((EITHER (S1 is 0) OR (S2 is 0))) then (Lamp may be 0 or 1)"

Since "Lamp may be 0 or 1" if "either S1 is 0 or S2 is 0", in that case (either S1 is 0 or S2 is 0), the original "if S1 is pressed and S2 is off, then turn on the lamp, and leave it on even if S1 is released" logic can control the lamp.

So the original word problem becomes


"if (EITHER ((S1 is pressed) AND (S2 is NOT pressed)) OR (Lamp is already on)) AND (EITHER (S1 is NOT pressed) OR (S2 is NOT pressed)) then (Lamp is on)"​

Note also that the first "(S2 is NOT pressed)" is made redundant by the second, and so the first can be removed.

All that remains is to code that word problem into ladder logic.

This is a long-winded reply, but this is how to do boolean logic. That said, once you are facile with boolean logic, this kind of thinking happens very quickly.
 
Last edited:
I don't think the image posted is anywhere near the logic necessary to even just turn the lamp on, but I am unsure what the ⇑ symbol means; is it an edge detector? You should try Rubber Duck Debugging on your logic, i.e. describe to yourself, or a rubber duck, or to the forum, how you thought that logic should work.

Or you should start over: to solve the problem we need but one rung to create the logic that satisfies the word problem, with one extra branch to turn on the light in addition to the first output branch that control the seal-in bit. And we don't need any edge detectors.

See De Morgan's Laws.

"If S1 and S2 are pressed, then Lamp will [i.e. is] off" ≡ "If BOTH (S1 is 1) AND (S2 is 1) then LAMP is off"

Apply De Morgan's law

"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if (NOT (EITHER (S1 is NOT 1) OR (S2 is NOT 1))) then (Lamp must be 0)"
Since S1 and S2 are boolean (bits), we can translate "is NOT 1" to "is 0" and get the following:
"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if (NOT (EITHER (S1 is 0) OR (S2 is 0))) then (Lamp must be 0)"
We can invert the NOT in the if-expression if we invert the then-expression:
"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if ((EITHER (S1 is 0) OR (S2 is 0))) then (NOT (Lamp must be 0))"
Finally, we remove the NOT from the then-expression:

"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if ((EITHER (S1 is 0) OR (S2 is 0))) then (Lamp may be 0 or 1)"
Since "Lamp may be 0 or 1" if "either S1 is 0 or S2 is 0", in that case (either S1 is 0 or S2 is 0), the original "if S1 is pressed and S2 is off, then turn on the lamp, and leave it on even if S1 is released" logic can control the lamp.
So the original word problem becomes
"if (
EITHER ((S1 is pressed) AND (S2 is NOT pressed)) OR (Lamp is already on)) AND (EITHER (S1 is NOT pressed) OR (S2
is NOT pressed)) then (Lamp is on)"

Note also that the first "(S2 is NOT pressed)" is made redundant by the second, and so the first can be removed.

All that remains is to code that word problem into ladder logic.

This is a long-winded reply, but this is how to do boolean logic. That said, once you are facile with boolean logic, this kind of thinking happens very quickly.
aight ill take note on that. If possible, Ill get back to this thread for updates. thanks!
 
Also, it sounds like this is a homework or class assignment, so this may not be relevant, but after you turn off the lamp by pressing both S1 and S2, the order in which S1 and S2 are released is important: if S2 is released before S1, then the light should turn on again.
 

Similar Topics

Hi, I am using AB 5069-L306ERS2 CPU. My system should achieve SIL-2. I have safety door switches connected to AB 5069-IB8S module, and I want to...
Replies
1
Views
114
Question to anyone with ideas about my thoughts on upgrading a very vintage timer, which is being used to switch between 2 5hp domestic water...
Replies
14
Views
442
I have an application where I want to use a safety relay in combination with a flame detector as the sensing element. The flame detector has relay...
Replies
23
Views
1,094
Hi guys, I am looking for a good replacement for an Omron smart relay. A customer of ours has a couple of these and they are beginning to fail. As...
Replies
14
Views
1,142
Back
Top Bottom