Jump to content

Logic feedback


Recommended Posts

What is feedback. Link logic gate/net output with one input (direct (positive) or via NOT (negative) gates). For prevent signal back tracking (from input direct to output) create link through set-to-null FILTER/BUFFER gates.

Some examples.

  1. Dormant pump. Shut up via right sensor, shut down via left sensor.
  2. Reservoir full/empty (scheme from dormant pump). Close input if reservoir is full and open if It is empty.
  3. Emergence generator. Prevent black-out. Auto on-off via smart battery.

Basic feedback principles:

  • OR gate became uncontrollable 'memory cell', any 'green' signal set output to green while exist feedback link.
  • AND gate became controllable 'memory cell', both green input set output to green, while input without feedback link also green.
  • XOR gate became pulse generator and almost unuseless.

Make fun with new toys.

Link to comment
https://forums.kleientertainment.com/forums/topic/109592-logic-feedback/
Share on other sites

This is a concept known as hysteresis. It's very common in the real world. Take for instance a water heater. It heats water at full power when it's on and to avoid lots of starts and stops, it turns on when temperature is below something and then it turns off when the temperature is over something else. Stoves work the same way and so does freezers and fridges. Compressors tend to do the same to maintain the pressure of an air tank within a certain threshold and the list goes on and on.

For ONI you can use the smart battery since it has hysteresis in the two sliders. If you want to build one yourself, then you can use a memory gate. Set it to two temperature sensors. Input is above 60 C. Reset is below 40 C. The output will turn on when it reach 60 C, then cooling kicks in (apparently for this example) and the signal turns off when reaching 40 C where the system will then shut down and heat up to 60 C to restart the cycle.

1 hour ago, fiziologus said:

XOR gate became pulse generator and almost unuseless

Actually I have used XOR as a pulse generator. While useless in itself, it's fast enough to start a buffer gate. The buffer gate then starts a cycle of events, which at the end will wait for a new pulse. Depending on what you are doing, being able to work with pulses can be quite useful.

You can for instance make a pulse generator with an AND gate. Connect the inputs to a NOT gate (input and output). When will the AND gate be on? If you say never, then you are wrong.

What happens is the not gate has a delay. this means when the input turns on, the output will turn on a moment later (next tick?). This means for one short pulse, both inputs to the AND gate will be on and the output will be on.

The result is a pulse when a wire changes from off to on. Not when it's off or when it's on, but the change from off to on. Yes you will need a buffer gate to catch it to make the pulse useful, but you can make something, which triggers on a rising edge in the wire signal.

2 hours ago, Nightinggale said:

This is a concept known as hysteresis. It's very common in the real world.

It is also critically necessary for stability in all situations were anything gets regulated digitally. If there is too little hysteresis, digital regulators start to oscillate as fast as possible and eventually destroy themselves, because there is always some loss (i.e. heating up of something) in every switching action. They also lose their regulating effect. In ONI, where logic is clocked ans switching valves or doors does not put stress on them, they only lose all regulating effect. 

For the analog world, this is replaced (simplified) by dampening as a similar idea. If an analog regulator is not dampened enough, it will overshoot to much when it regulates and then overshoot more in the other direction and so on, until it does nothing else but oscillate as maximum amplitude. That is, incidentally, also the reason there are no perfect analog regulators (same as there are no perfect digital ones): There is always some small error left. And the smaller you make this error, the more dampened and hence slower the regulator has to be to be stable.

The whole thing is a fascinating study of some limits to what is physically possible in this universe.

On 7/28/2019 at 7:33 PM, Nightinggale said:

This is a concept known as hysteresis. It's very common in the real world

Or feedback and very common in electronics (hysteresis more fundamental concept and include not only feedback).

On 7/28/2019 at 7:33 PM, Nightinggale said:

For ONI you can use the smart battery since it has hysteresis in the two sliders. If you want to build one yourself, then you can use a memory gate. Set it to two temperature sensors. Input is above 60 C. Reset is below 40 C. The output will turn on when it reach 60 C, then cooling kicks in (apparently for this example) and the signal turns off when reaching 40 C where the system will then shut down and heat up to 60 C to restart the cycle.

Smart battery almost not allow catch "generator not work" state. Of course may insert "smart" in power line and check fill-empty but this is not always applicable (emergence generator scheme may start manual (initial variant) or from main generator on-off system, "smart" as example only).

Memory gate not allow trigger-like (flip-flop) switching (even if 'set' always green, gate change output if 'reset' became green). It like RS-trigger in first look, but work little different.

Both good but still limited things.

On 7/28/2019 at 10:40 PM, Gurgel said:

If there is too little hysteresis, digital regulators start to oscillate as fast as possible and eventually destroy themselves, because there is always some loss

Feedback loops (any) may keep system stable, but may start oscillation itself also ("hunt").

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...