Oil, derivates and combinators?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Oil, derivates and combinators?

Post by XKnight »

I suppose the answer on the initial question is the control theory (https://en.wikipedia.org/wiki/Control_theory).
For those who are not familiar with it, this theory describes how to efficiently control different systems in time using regulatory signals (assuming this system has unknown influence from the outer world).
In our case unknown influence is the gas/lube/solid fuel consumption and regulatory signal is enabling cracking/production.

Also, you can try to use PI-controller for this task which can be built with several combinators.
My try

guitarmanmike
Burner Inserter
Burner Inserter
Posts: 14
Joined: Thu Mar 17, 2016 4:01 pm
Contact:

Re: Oil, derivates and combinators?

Post by guitarmanmike »

Hi XKnight,

Looks like a pretty cool setup. Can you explain how the combinators are setup to create that PI controller?

I hope I am understanding it correctly in that the green signal is in effect the duty cycle of your "consumer" pump which moves oil out of your monitored storage tank. That monitored storage then goes in as the sensor of your PI controller which somehow is using the difference of the storage level from the target level to create in effect a PWM signal which activates the power switch which would correspond to some control which would counteract the difference. In this case it pumps oil back to the monitored storage. This PWM signal is curved such that the larger the difference from the target level the closer the output PWM signal is to constant power.

In a practical case maybe you would be monitoring petrol would you able to hook it up such that it enables a light oil cracking pump during a petrol shortage and on the overshoot (or on a surplus) where the control signal would be inverted it powers an opposite PWM control to say enable petroleum to solid fuel?

How exactly are you configuring the combinators to achieve this affect I am still a bit of a newb in understanding how to achieve these types of affects with them. I think I understand that the constant combinator is the negative of your target level so that the fluid level becomes the difference between the tank and the target so a negative value means below target a positive value means above target. After that step I get a bit lost as to how to get an biased/curved signal from that and how to convert that into a PWM duty cycle.

User avatar
hansinator
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sat Sep 10, 2016 10:42 pm
Contact:

Re: Oil, derivates and combinators?

Post by hansinator »

I'd like to see how it works, too. Especially the component generating the pulses.

Acarin
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Thu Sep 01, 2016 3:58 pm
Contact:

Re: Oil, derivates and combinators?

Post by Acarin »

I will begin with a disclaimer: I'm not good with combinators. My brain, however, is normally ok with logic, and it seems to me that the solution on the last page pretty much covers the original question. Here's my outline on the setup:

1 tank each of PG, LO, HO, Lube
Pumps to control the input lines for each different process (which could be set on the tank outputs) as follows (conditions under which the pump is on)

PG - Fuel (PG>2400)
LO - Fuel (PG>500)
LO - PG (PG<501)
HO - Lube (Lube<2500)
HO - LO (Lube>2400)
Crude - Refinery (3 pumps in parallel to stage the throttling of the entire process) set to
Lube<2401
LO<2401
PG<2401

Thus, if Lube is in demand, the following occurs:
As soon as it drops below max, HO cracking to Lube is enabled
When it drops below 2401, HO-LO cracking is disabled, forcing all HO to convert to Lube, and 1 crude pump activates to push 30 crude/s at the refineries

If the demand is plastics and sulfur (ie PG)
When it drops below 2401, fuel production is stopped and a crude pump kicks in, followed by LO cracking changing to PG if the PG serves fall below 501

If the demand is fuel, LO and PG will be converted until PG drops below 2401, when PG-Fuel stops. LO-Fuel will continue unless PG drops below 501 (as outlined above). The third crude pump kicks in when LO falls below 2401.

I think I have considered all of the edge cases (given that I'm at work and can't really do a full-fledged work through), and it seems to me that these numbers should satisfy any requirement without any complex circuitry?

EDIT: actually, I don't see a need for a tank to store HO. It will always be used as it is produced...
EDIT 2: The pump on the Lube plant is redundant as well. Scrap that one :-)
EDIT 3: and I'm not entirely convinced that there is a need for any crude pumps on the refinery input. Not sure it really helps with any of the conditions, as the output is already throttling the process and the 'back pressure' will auto-regulate the input pipes.
EDIT 4: Revisited the OP's requirements. I would suggest hooking your tanks up to a power switch for the pumps and simply set a condition of "Anything<2400" (or set up a header tank of crude before the refineries and set switch condition to "Crude<2400"). However, you would also need a Solid Fuel buffer to ensure that production stops when not required. Easiest way would be a 1-stack chest on the output line. You could reduce the numbers I have provided, but you are somewhat limited by the fact that a tank holds 2500 units. It will always be more challenging to make rules based on part-full tanks, but it should be possible...

Post Reply

Return to “Gameplay Help”