Page 1 of 1

1-Combinator RS-latch

Posted: Wed Oct 30, 2024 8:38 pm
by Achating
Hey,
Idea popped in my head, that it should be possible to make single-input single-combinator RS-latch with new decider combinator. So I made one:
10-30-2024, 22-33-05.png
10-30-2024, 22-33-05.png (672.44 KiB) Viewed 14465 times
On the screenshot I recreated example of the backup steam generators from wiki using new latch design.

I have created parametrized blueprint for general use:


Notes:
- Output is "green" signal by default
- Red wire used as a memory cell

Have fun :)

Re: 1-Combinator RS-latch

Posted: Sun Nov 03, 2024 8:09 pm
by daemuth
Hey dude! This is awesome! I randomly bumped into this while making my own "smart assembler" and have used it to make my setup nice and compact:


Thanks for posting!

Re: 1-Combinator RS-latch

Posted: Wed Nov 13, 2024 5:34 pm
by CircuitBreaker
Cool! I've now used this in my fuel processing setup (when to crack heavy oil into light oil etc.). Very useful, thank you!

Re: 1-Combinator RS-latch

Posted: Thu Nov 14, 2024 2:37 pm
by TomyTheBest
This is epic.
you should ask for a 1$ license fee every time when someone using it.
I already owe a full tank gas ...

Re: 1-Combinator RS-latch

Posted: Sat Nov 16, 2024 2:15 am
by coffee-factorio
I was looking at this because I didn't get to 1 combinator RS latch but I had the idea it could be done.
Because I made a 1 combinator resetting clock.

You have two input conditions: t < value and r == 0. Two output conditions: 1 qty t and output total quantity of ts. This is done on a standard back fed logic single combinator clock. I have a videya of it and wanted to see if it was a novel idea or if it was already covered in a Friday Fast Facts or similar. I know I have my idea of how an RS Latch works and might try and come up with another video but if I do I wanna give people credit for being coming up with cool stuff :)

It isn't the timer that pauses from the tutorial. It definitely cycles. You'd have to use an rs latch as a guard for the demo purpose I think it has, which is switching a mall resource line on and off (because malls can halt while you build up small logistics; versus dedicated construction products that need to work till they end or research - which doesn't really end in theory).

I'll put a still frame from the video on this post when I get round to editting it.

Re: 1-Combinator RS-latch

Posted: Sun Nov 24, 2024 9:22 am
by phant0m
Hi,

Thanks for the idea! I've updated the latch for more general usage. Red wire is used as a memory cell.

A > 0 is the set signal.
B > 0 is the reset signal.

The logic I thought of is as follows:
We want to output S if A > 0 or S > 0, but not B > 0, so
[(A > 0) OR (S > 0)] AND [NOT (B > 0)]
[(A > 0) OR (S > 0)] AND (B = 0)
[(A > 0) AND (B = 0)] OR [(S > 0) AND (B = 0)]

I have not actually tested this thoroughly, please correct me if there's any issues with this setup.
Capture.PNG
Capture.PNG (77.29 KiB) Viewed 12881 times

Re: 1-Combinator RS-latch

Posted: Fri Nov 29, 2024 8:50 am
by Hudy01
and....I just use a box: :?
and set ON time by transport belt length :))
11-29-2024, 10-48-50.png
11-29-2024, 10-48-50.png (1.57 MiB) Viewed 12528 times
11-29-2024, 10-49-12.png
11-29-2024, 10-49-12.png (1.17 MiB) Viewed 12528 times

Re: 1-Combinator RS-latch

Posted: Thu Jan 02, 2025 10:20 pm
by SuicideJunkie
phant0m wrote: Sun Nov 24, 2024 9:22 am Hi,

Thanks for the idea! I've updated the latch for more general usage. Red wire is used as a memory cell.
...
I have not actually tested this thoroughly, please correct me if there's any issues with this setup.
I'm not clear on how that differs significantly from the classic; {S} > {R} ? Output 1x {S} (+Wire output to input)

2.0 could add some sidecar values to the classic latch using the additional output options; they would a running tally or a clock depending on your use case of 1 and input count options.

Re: 1-Combinator RS-latch

Posted: Fri Jan 10, 2025 6:41 am
by gGeorg
Slightly improved original idea,
input is restricted, (to green_only AND red_only) so it doesn’t mix with others. In case you use it in some far intriguing scenario.
01-10-2025, 07-40-37.png
01-10-2025, 07-40-37.png (359.1 KiB) Viewed 10689 times

Re: 1-Combinator RS-latch

Posted: Sat Jan 11, 2025 11:33 pm
by leograyc
This is such a great step up. I've browsed for 2 nights of normal RS-latch stuff till I see this.

I made a account just to give you a thumbs up.


________$$$$
_______$$__$
_______$___$$
_______$___$$
_______$$___$$
________$____$$
________$$____$$$
_________$$_____$$
_________$$______$$
__________$_______$$
____$$$$$$$________$$
__$$$_______________$$$$$$
_$$____$$$$____________$$$
_$___$$$__$$$____________$$
_$$________$$$____________$
__$$____$$$$$$____________$
__$$$$$$$____$$___________$
__$$_______$$$$___________$
___$$$$$$$$$__$$_________$$
____$________$$$$_____$$$$
____$$____$$$$$$____$$$$$$
_____$$$$$$____$$__$$
_______$_____$$$_$$$
________$$$$$$$$$$

Re: 1-Combinator RS-latch

Posted: Mon Nov 24, 2025 9:27 pm
by gargamel9
gGeorg wrote: Fri Jan 10, 2025 6:41 am Slightly improved original idea,
input is restricted, (to green_only AND red_only) so it doesn’t mix with others. In case you use it in some far intriguing scenario.
01-10-2025, 07-40-37.png
Hi there. I've been trying to use this to regulate the output of light oil. The idea is for the pump to work when the oil reaches a certain level and then continue to pump until it reaches another one, say from 190.000 to 180.000 (so the pump not just starts at 190.000 and then stops when it reaches 189.000 almost instantly)
Its there a way to do that?
thx

Re: 1-Combinator RS-latch

Posted: Tue Nov 25, 2025 10:34 am
by gGeorg
gargamel9 wrote: Mon Nov 24, 2025 9:27 pm
gGeorg wrote: Fri Jan 10, 2025 6:41 am Slightly improved original idea,
input is restricted, (to green_only AND red_only) so it doesn’t mix with others. In case you use it in some far intriguing scenario.
01-10-2025, 07-40-37.png
Hi there. I've been trying to use this to regulate the output of light oil. The idea is for the pump to work when the oil reaches a certain level and then continue to pump until it reaches another one, say from 190.000 to 180.000 (so the pump not just starts at 190.000 and then stops when it reaches 189.000 almost instantly)
Its there a way to do that?
thx
Sure, you want classic hysteresis.
https://en.wikipedia.org/wiki/Hysteresis
SetUp First line value at 190.000
SetuUp last line value at 180.000
Change both "<" signs into ">"

Basically, you are turning the direction of hysteresis other way around.

Re: 1-Combinator RS-latch

Posted: Wed Nov 26, 2025 3:29 pm
by gargamel9
Doesnt seem to work.
Im thinking on a clock or something so it keeps pumping like for 1 minute or something. So far it gets stuck at a value and keeps turning on and off

Re: 1-Combinator RS-latch

Posted: Fri Nov 28, 2025 1:43 pm
by gGeorg
gargamel9 wrote: Wed Nov 26, 2025 3:29 pm Doesnt seem to work. // yes it does
Im thinking on a clock or something so it keeps pumping like for 1 minute or something. // clock is different device than Shmitt trigger. Look for One-time-clock instead. So far it gets stuck at a value and keeps turning on and off // you probably set something wrong, without screen it is hard to tell