Factorio

Factorio

View Stats:
Z0MBE Jul 31, 2021 @ 1:52pm
how to make a pulse signal without inserters/belts
I often find myself needing this but i always use inserters to do it.
< >
Showing 1-4 of 4 comments
RiO Jul 31, 2021 @ 2:04pm 
Each combinator adds an additional delayed tick of processing.
You can abuse this to pulse on the rising or falling edge of a change in value.

So try this:
First create an arithmetic combinator that is a basic [each]*1 -> [each].
This is a diode. Basically; a no-op but it prevents signals accumulating on the output wires from messing with the input signals.

Now next to it create another combinator which does [each]*-1 -> [each].
Basically; flips the sign on all the signal values.

Connect the diode's output to the sign inverting combinator's input.
Connect the sign inverting combinator's output back to the diode's output as well.

The net effect is that a value passing through the diode will have a single tick during which it will have a value, before the inverted value comes in on the next tick to erase it.

Now; think about that effect for a bit and how you could combine it with other logic.

E.g. if you compute [each]/[each] you always get a value of 1 or no signal. So... if you combine that with the diode and sign inverter; you have a signal which is 1 for a signal tick and then nothing. And if you multiply it with the original source signal, you get a pulse of the changed source value.


[EDIT]
If what you're looking for a is a pulse on a regular interval, i.e. a heartbeat or a clock pulse, then look at Fel's post below this one.
Last edited by RiO; Jul 31, 2021 @ 2:10pm
Fel Jul 31, 2021 @ 2:04pm 
It depends on what you need that pulse for but it's possible with a timer into a modulo.
If that sounds like foreign language to you, a timer is a static combinator giving a signal with usually 1 in value)connected to both the input and output of an arythmetic combinator that does +1 on that signal (so the signal increases by 1 every tick).
You usually want a way to reset it to prevent issues when it reaches values too high.
A modulo is an arythmetic combinator where you do a modulo (%) on that signal to reduce the signal to a number between 0 and the number used for modulo minus 1 (for example, modulo 2 gives either 0 or 1).

If all you want is the pulse, you can alter this slightly so that the timer doesn't feed back into itself but instead the modulo feeding back into the timer (with a different coloured wire from the one connecting the static combinator).
knighttemplar1960 Jul 31, 2021 @ 8:01pm 
Go to 18:59
https://www.youtube.com/watch?v=AtN3ewXfZHM&t=2232s
You have to use something to generate your pulse be it checking the contents of a chest, an inserter, reading a belt, using combinators to set up clocks, etc.
Dunhill Aug 1, 2021 @ 1:46am 
Originally posted by mccafferty.max:
I often find myself needing this but i always use inserters to do it.
You can turn a continuous signal to a pulse using just a single arithmetic combinator. Basically, they have a one-tick delay, as opposed to just wire, which doesn't.

So, place down an arithmetic combinator, and set it to so it subtracts the signal in question from 0 (0-X) or multiples the signal in question by -1 (-1*X), with the output being the signal in question. Connect the continuous signal source to the input of the arithmetic combinator, and then, with a different colored wire, connect the source to what you want to receive the pulse. Then connect the arithmetic combinator output to what you want to receive the pulse, using the same colored cable you used to connect the source to what you want to receive the pulse.

https://imgur.com/vbjyTZR

Tick one: the signal from the source arrives to the arithmetic combinator and the output
Tick two: the arithmetic combinator converts it into a negative value of itself and outputs it, the wires then add the two values, the total being 0, which is the output




However, if you have your belts running in a loop, and want to receive a pulse in regular intervals, then you'll need to make a clock and a combinator which will output a signal once the clock reaches a certain value.

You make a clock by attaching a constant combinator to a decider combinator, which has its output and input connected to each other. The constant combinator should output any signal with a value of 1 (if the value is higher, then the clock will count faster, at a rate higher than one tick per tick, which needlessly complicates things). We can call the condition of the decider combinator its reset condition; when it's false, it will reset to 0. Let's say we want it to reset every 10 seconds; there's 60 ticks in one second, and 600 in 10 seconds, so the condition of the decider combinator would be: when X is less than 600, the output will be signal X, set to "input count". Now you have a clock which will count to 10 seconds and then reset itself to do it again. To create pulses from this, you'll need to hook up the output of the clock to the input of another decider combinator, which has a condition of let's say; if signal X is equal to 50, output signal Y with a value of 1. What number it'll be equal too is irrelevant, as long as it's not higher than the max tick count of the clock, in this case 600. Now you have a pulse generator which generates a pulse every 10 seconds.

https://imgur.com/UqK324x
Last edited by Dunhill; Aug 1, 2021 @ 1:59am
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Jul 31, 2021 @ 1:52pm
Posts: 4