Page 1 of 1

Switch off radar when accumulators are decreasing

Posted: Fri Mar 24, 2017 3:22 pm
by AndrewIRL
A power switch can easily be used to switch when accumulators hit a threshold, say 50% but I wanted to only switch the radars off at different thresholds depending on whether the accumulators are increasing/decreasing.

Power at 50 and decreasing - switch off
Power at 10 and increasing - switch on

Here's the circuit to detect increase/decrease hooked up
IncreasingCircuit.png
IncreasingCircuit.png (805.43 KiB) Viewed 3456 times
What happens on which tick is important, labelled t0 and t1 for the first and second ticks.

1) Starts with the accumulator charge A or more precisely A(t0)
2) Arithmetic combinator converts the A signal into a B signal and delays it by one tick => B(t0) = A(t0)
3) Two deciders, Green=A>B and Red=A<B, are performing A(t1) > B(t0) and A(t1) < B(t0) and by comparing values from two different ticks can figure out if the signal is increasing or decreasing.
4) SR latch (binary only) stores the green 1 signal with red as reset (Green=Green>Red)
5) A=Green*40, could be either 40 (meaning A increasing) or 0 (A decreasing)
6) Power switch takes A from (5), adds it to A from (1) and compares to 50 for power switching.

Non functional green/red lights at bottom left

Not labelled:
Radars at bottom of screen
SmartDisplay Mod

Re: Switch off radar when accumulators are decreasing

Posted: Fri Apr 14, 2017 1:30 pm
by Nich
Dont forget you also need to account for power > 10% and increasing otherwise they could turn off and not turn back on unless you drain enough power to get below 10%

Re: Switch off radar when accumulators are decreasing

Posted: Mon Apr 24, 2017 10:59 am
by AndrewIRL
Nich wrote:Dont forget you also need to account for power > 10% and increasing otherwise they could turn off and not turn back on unless you drain enough power to get below 10%
If the accumulated value dips to 20 and then starts rising the rise/fall detector in (5) will instantly detect that, it isn't dependent on a particular power level.
AndrewIRL wrote:5) A=Green*40, could be either 40 (meaning A increasing) or 0 (A decreasing)
6) Power switch takes A from (5), adds it to A from (1) and compares to 50 for power switching.
So that means the value from (1) is 20 and the value from (5) - (rise/fall detector) is 40. The power switch tests (40+20 > 50) and switches the power on. The problem mode comes when solar is generating some power but not enough to actually sustain the load behind the switch.

During dawn the accumulators might start rising from 20 to 21 causing radar power on - but there could be too many radars for the early dawn light to sustain so the accumulators start going down from 21 to 20 - causing a switch off. So you can get a type of flickering where the power gets switched on and off until the solar array generates enough power for the radars. If you are under-powered this flickering could be happening constantly throughout the day.

Re: Switch off radar when accumulators are decreasing

Posted: Fri May 26, 2017 5:56 am
by AndrewIRL
Gepwin achieves the same effect in his Youtube video Factorio short circuits: No Combinator Schmitt Trigger without using combinators.

https://www.youtube.com/watch?v=_ixfIR-CqwU