#Circuit Network - Trains Liquids load/unload

1 messages · Page 1 of 1 (latest)

leaden maple
#

Hey peeps, I have a question.

I'm trying to figure out if I can make fluid trains load and unload at the same station using some circuit logic.
So far I've come up with the idea to:

  1. Check if the train arrives full or empty (U or L respectively in signals, U for unload a full train, and L for load an empty train)
  2. Store that so that it doesn't matter if the conditions vary later on.
  3. Enable/ Disable the pumps based on the signals.
    3a. When the U signal is present, enable the pumps pointing away from the train.
    3b. When the L signal is present, enable the pumps pointing into the train
  4. When the train reaches the "end" condition (0 for unloading, and 125k for loading) send a green signal to the train so it can leave again.

However, Either my system keeps reversing itself, never giving the train the signal. Or only the unload portion works.

It's a mess so far, but here's my setup from the image

  1. F AND R output U
  2. D AND L output GREEN
  3. (memory) U > 0 output 1 U
  4. (Memory) L > 0 output 1 L
  5. [Liquid Type] > 0 output 1 U
  6. [Liquid Type] = 0 output 1 L
  7. [Liquid Type] > 124.000 output 1 R
  8. U > L output 1 D
    9 L > R output 1 F
  • Pumps facing out: D > 0
  • Pumps facing in: F > 0

Train station (second image)

I might have built a frankenstein that doesn't work 😅
Help please?

Note: my letters were thought of as:
D - "Drain"
F - "Fill"
U - "Unload"
L - "Load"
R - "Reset"

raven sequoia
#

are you using the AND on purpose? If you're trying to make "if signal this and this are present" logic, they are probably not working as you're intending

uneven yewBOT
raven sequoia
#

I made a fluid swapper station for my offshore nuclear plant. It may or may not be useful, I'm not completely sure how the logic works anymore, it's been a while

#

high throughput was a must, also tank balancing, so most of the circuit handles those

leaden maple
#

I'll have a look. Thanks.
I wasn't trying to make a frankenstein on purpose no XD I figured at that point I needed to make sure that when the end condition was met, it didn't also start loading again

raven sequoia
#

to be fair, the only place where multi-fluid station makes any sense is the nuclear IMO

#

otherwise it's going to be a pain to try to manage different fluid consumption rates and flushing the pipes and stuff

#

but at least with nuclear it's 1:1 water and steam

leaden maple
#

I mean, in my megabase, I'm trying to store all possible liquids from Angel's and Bob's... The amount of train stations with a separate for loading/unloading is 144...

#

and that's just liquids.

#

Gasses come later

raven sequoia
#

modded will most likely change things up a bit jeszOops

leaden maple
#

haha yea

rough crown
#

I don’t think handling multiple liquids in the same pipe system is a good idea, you would have to construct it without pipes, only pumps and tanks to achieve reasonable performance. That being said, I have multi liquid stations in space exploration, which all have 4 liquids, I have 8 tanks on both sides, 4 per liquid connected with undergrounds, 1 tank and pump per wagon. I use cybersyn, which gives me signal of what should be loaded or unloaded. With vanilla trains I would probably just connect train station with pumps and set enable condition on pump to specific train id. Which would be pain to setup, which is why I use cybersyn. If you have multiple trains which need same pump enabled I would do it with decider combinator - if train id = something output resource to load or unload and then bring that signal to all pumps.

leaden maple
crisp lynx
#

With sushi pipes, if you're using them, you have to have a mechanism to flush out the floating point error

leaden maple
#

I'm not sure I understand

crisp lynx
#

When your ups drops below 60 or other disturbances happen, a floating point error can occur with pipes where they have 0.0 amount of fluid left in them, it would need to be flushed out

leaden maple
#

That is the case with multi-fluid yes, but in the case of a single fluid needing to be pumped in both directions that is not an error I'd be facing

crisp lynx
#

Yeah it's not an issue for you

leaden maple
#

am I that ambiguous in my question?
I require a single fluid to be both pumped in and out of the station

#

I mean you are right 😅

#

don't get me wrong, the error happens with multifluid 😅

crisp lynx
leaden maple
#

Ah! Missed that then hehe

#

sorry

crisp lynx
#

For your case, you might want to just draw out a logic map

#

Since its a bit complicated

#

And then build that in game with combinators

leaden maple
#

The problem is that I'm not sure what the logic map would look like though

#

I've considered using Draw.io to write up a logic map

crisp lynx
#

Start with what you want to do when something happens first

#

Just pen and paper works very well

leaden maple
#

yea fair enough

crisp lynx
#

Also, take note that combinators take 1 tick to process

#

Can seriously f up circuits

#

Simple solution to synchronise is to just make sure that everything runs through the same number of combinators

leaden maple
#

Yea that I've noticed. The train arriving and leaving before the circuits processed the first step lol

crisp lynx
#

Does cybersyn allow wait signals?

leaden maple
#

cybersyn?

But the trains I'm using allow "circuit" as a wait signal. With [signal] [comparison] [value]

crisp lynx
#

Oh wait you aren't using cybersyn my bad

leaden maple
#

hehehe, no problem. I'm using Angel's and Bob's mods

crisp lynx
#

Wait then how do you do multi purpose stations

#

Seperate train schedules for everything?

leaden maple
#

The trains themselves yes, but I'm trying to build a circuit that can make the station multipurpose

#

1 station
2 trains
station handles in and out pumping
1 train for in, 1 train for out

crisp lynx
#

Why would you have the issue with the trains just leaving then

#

Shouldn't there be a wait condition for full/empty cargo as well

leaden maple
#

Yes, but when the train arrives full, and I set it to "wait empty" then on the end, the circuit just pumps in, then out, then in, then out. And the train waits forever

crisp lynx
#

Why does it pump back in?

leaden maple
#

Because the logic circuit...

crisp lynx
#

You can store the state of the train in a memory cell

#

So initial detection if it's a loading or unloading

leaden maple
#

have you read the original question?

#

That's what I've been trying to figure out

crisp lynx
#

And then clear it when the train stop doesn't have a train at it, you can read train ID and set it to not zero or smth like that

#

You don't need to send a green signal to the train also

#

When the train comes, initialise values, do stuff, when it leaves, detect that and wipe the memory

leaden maple
#

Say I have a train that has liquid in it. Let's make it Oil.
It arrives, I store the "full" state in a memory cell.
When the train is empty, the new signal of "initially empty" overwrites the system, and it pumps liquid back in the train.
Then it is back overwritten with "initially full" and then starts pumping out.
Rinse and repeat

#

Hence this original question in the first place

#

I can't figure out the right circuit to do what you just said

crisp lynx
#

You need to turn the initial signal during the transition from no train to train into a pulse that is stored in a memory cell

#

I think you can brute force it by adding a good amount of delay and just letting the train leave as well

leaden maple
#

This is kind of what I want to do

#

But right now what happens is the train arrives, and the state is being set, but the contents update continuously, and the initial state doesn't stick. It keeps overwriting itself

crisp lynx
#

you can make the initial signal into a pulse by doing 2 seperate channels, one for the case where its full and one for the case where its empty, and not letting it through if it goes the way its supposed to go

crisp lynx
leaden maple
#

No, it overwrites with each tick. When the train liquid hits zero, it already has overwritten the initial state to empty.
Because the "read train" is continuous from the moment it arrives. And the train "empty" is a null signal (so no signals)

Really, I've looked up SR-latches, and pulse latches, and for some reason mine never work.
I can create a clock that can count 60 ticks per second (to be fair, it's a little buggy, so I set it to 59 ticks instead, but I digress)

#

At this point, I think I need a diagram to help me setup this circuit. Or a blueprint or whatever. Because I keep trying, and I suck at bit operations in factorio 😅

crisp lynx
crisp lynx
leaden maple
#

Hrm..

leaden maple
#

You're designing something?

crisp lynx
#

0eNrNWFuOmzAAvIt/S9rYQCBouyeo9mPVflUr5ICTWAKDjEkbRRygt+jZepLaQEggQICk2f5E8WtszwxjwwGsgpTEnDIBnAOgXsQS4Hw/gIRuGA5UndjHBDiAChICDTAcqhLHNACZBijzyU/gwOxNA4QJKigpxueFvcvScEW47FCNTIQcu9mKWQ6hgThK5KiIqakUkmkuNbAHjoGsLNMugFAF5BOP+oTPvChcUYZFxNvQFuZHs8Sz5Xrl/gSPAndFtnhH5RDZrwRyZZufD05U7ZryRLgXNKyDlPonHn5gIVdVACcCKxYhNFUxjDHPF+WAZ9k/SkWctuDtKBcpDk6IRY/ZlwI03stlpUy4ax6FLmUSAzhrHCQkKyZlxKuWDNUPJ/65AHKxjiF7Uu6lVORFlL1lbdTqEzRatgEZkzXS5w/SCC0aGj31aNSN1yqP4GmbOqhDHVRXB3aoY44l1Xg4qfMRnHb5/tsdfZ8vaIDxF+ONr8M2IKsCOrJyTSRYiST/yZ35lBcbK3zRItqaBpL5jpDuFiktbG+eR/ZwJpfDPGqP9Sg8OnTg5kc5tstiX+u2bbr28wTXvk5wLbqN6+VYrvWRRrsL16/Tub5P6nY52m5Gg1ZrttSFZsMJYVfkQfljhAYmEBwK26W6AiwJwZyKbUgE9a4eryOVPyHfdjQkRA13a/JHMZHi57ODD6PVzyZHVr9OZpP9uhvgwBsUnHDN1fVWJDQ1StF/FKV/fv2eEKYv97wCLPqfT33gY6dPTduHyvHSL8fzu6UtRP1xe00mY6BMxg3piN47HWdwPm8k5Kd/mZBN8487yjoz0JyQgWYr0uleroDYLBFR3Jt9ZseLTkIk0SJyc5gyRDS5SewXpi7rlanLajVVTPx6S16omsaE5HRRLo6ittdFaSZxtAxQV4z8Y41z9m1HAzv50lDY2oaGtUSWZeu2ri+y7C8EmyWa

uneven yewBOT
leaden maple
#

I'll give it a shot in a bit. (I also have to work lol)
I'll let you know!

crisp lynx
#

using a memory cell that keeps climbing in intervals of 125 and by syncing the signals, we can subtract the volume of the wagon (divided by 1000) from the cell output which starts at 125

#

the cell is reset when there is no train

#

the issue is that there is some overlap

#

fixable by just increasing the increment i think

#

just increase the value in the constant combinator to like 200 or smth and adjust the decider combinators accordingly, the output decider combinators will pulse L for loading and U for unloading when a train arrives, just capture that in a memory cell and it should all work

raven sequoia
#

rising edge detector would turn the "train contents upon arrival" into a pulse signal

leaden maple
#

That actually sounds great... but how...

raven sequoia
leaden maple
#

it says "unknown" to me 🤣

raven sequoia
#

hmmmmm

leaden maple
#

Ah, lemme read through that

#

found it lol

raven sequoia
#

oh you got it open?

leaden maple
#

Yea

#

but this is for two different fluids. but I'll read for the useful stuff

raven sequoia
#

yeah, but I recall that the "how to remember what the train had when it first came in the station" was relevant there too